Changeset 32 for trunk/wp-content/plugins/xpressme/xpressme_class.php
- Timestamp:
- Dec 17, 2008, 12:18:56 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/xpressme/xpressme_class.php
r28 r32 8 8 var $is_theme_sidebar_disp; 9 9 var $is_save_post_revision; 10 var $is_postnavi_title_disp; 11 var $is_left_postnavi_old; 12 var $old_post_link_text; 13 var $newer_post_link_text; 14 10 15 //constructor 11 16 function XPressME_Class() … … 33 38 $this->is_theme_sidebar_disp = true; 34 39 $this->is_save_post_revision = true; 40 $this->is_postnavi_title_disp = true; 41 $this->is_left_postnavi_old = true; 42 $this->old_post_link_text = __('to Old Post'); 43 $this->newer_post_link_text = __('to Newer Post'); 35 44 } 36 45 … … 53 62 $write_options = array ( 54 63 'is_use_xoops_upload_path' => $this->is_use_xoops_upload_path , 55 'is_theme_sidebar_disp' => $this->is_theme_sidebar_disp 64 'is_theme_sidebar_disp' => $this->is_theme_sidebar_disp , 65 'is_save_post_revision' => $this->is_save_post_revision , 66 'is_postnavi_title_disp' => $this->is_postnavi_title_disp , 67 'is_left_postnavi_old' => $this->is_left_postnavi_old , 68 'old_post_link_text' => $this->old_post_link_text , 69 'newer_post_link_text' => $this->newer_post_link_text 56 70 ); 57 71 if ($mode == 'add_new') { … … 67 81 $this->is_theme_sidebar_disp = stripslashes(trim($_POST['ch_is_theme_sidebar_disp'])); 68 82 $this->is_save_post_revision = stripslashes(trim($_POST['ch_is_save_post_revision'])); 83 $this->is_postnavi_title_disp = stripslashes(trim($_POST['ch_is_postnavi_title_disp'])); 84 $this->is_left_postnavi_old = stripslashes(trim($_POST['ch_is_left_postnavi_old'])); 85 $this->old_post_link_text = stripslashes($_POST['ch_old_post_link_text']); 86 if(empty($this->old_post_link_text)) $this->old_post_link_text = __('to Old Post'); 87 $this->newer_post_link_text = stripslashes($_POST['ch_newer_post_link_text']); 88 if(empty($this->newer_post_link_text)) $this->newer_post_link_text = __('to Newer Post'); 89 69 90 } 70 91 71 92 function yes_no_radio_option($option_name,$option_desc,$yes = '',$no= ''){ 72 if (empty( $yes )) $yes = __('YES','xpressme') ; 73 if (empty( $no )) $no = __('NO','xpressme') ; 74 $value = $this->{$option_name}; 75 $ans_name = 'ch_' . $option_name; 76 77 $form = "<tr>\n"; 78 $form .= '<th><label for="images_to_link">' . $option_desc . "</label></th>\n"; 79 $form .= "<td>\n"; 80 if ($value){ 81 $form .= "<label><input type='radio' name='". $ans_name . "' value='1' checked='checked' />" . $yes ."</label><br />\n"; 82 $form .= "<label><input type='radio' name='". $ans_name . "' value='0' />". $no . "</label>\n"; 83 }else{ 84 $form .= "<label><input type='radio' name='". $ans_name . "' value='1' />" . $yes . "</label><br />\n"; 85 $form .= "<label><input type='radio' name='". $ans_name . "' value='0' checked='checked' />". $no ."</label>\n"; 86 } 87 $form .= "</td>\n"; 88 $form .= "</tr><tr>\n"; 89 90 return $form; 91 92 } 93 if (empty( $yes )) $yes = __('YES','xpressme') ; 94 if (empty( $no )) $no = __('NO','xpressme') ; 95 $value = $this->{$option_name}; 96 $ans_name = 'ch_' . $option_name; 97 98 $form = "<tr>\n"; 99 $form .= '<th><label for="images_to_link">' . $option_desc . "</label></th>\n"; 100 $form .= "<td>\n"; 101 if ($value){ 102 $form .= "<label><input type='radio' name='". $ans_name . "' value='1' checked='checked' />" . $yes ."</label><br />\n"; 103 $form .= "<label><input type='radio' name='". $ans_name . "' value='0' />". $no . "</label>\n"; 104 }else{ 105 $form .= "<label><input type='radio' name='". $ans_name . "' value='1' />" . $yes . "</label><br />\n"; 106 $form .= "<label><input type='radio' name='". $ans_name . "' value='0' checked='checked' />". $no ."</label>\n"; 107 } 108 $form .= "</td>\n"; 109 $form .= "</tr><tr>\n"; 110 111 return $form; 112 113 } 114 115 function text_option($option_name,$option_desc){ 116 $value = $this->{$option_name}; 117 $ans_name = 'ch_' . $option_name; 118 119 $form = "<tr>\n"; 120 $form .= '<th><label for="images_to_link">' . $option_desc . "</label></th>\n"; 121 $form .= "<td>\n"; 122 $form .= '<label> <input name="'. $ans_name . '" type="text" size="25" maxlength="50" value="' . $value . '" /></label>'."\n"; 123 $form .= "</td>\n"; 124 $form .= "</tr><tr>\n"; 125 126 return $form; 127 128 } 93 129 94 130 function option_page() … … 123 159 __('NO','xpressme') 124 160 ); 161 echo $this->yes_no_radio_option('is_postnavi_title_disp', 162 __('Select Display name of PostNavi Link','xpressme'), 163 __('Title of post','xpressme'), 164 __('Next and Previous','xpressme') 165 ); 166 echo $this->yes_no_radio_option('is_left_postnavi_old', 167 __('Adjustment of Navi link display position','xpressme'), 168 __("'Old Post Link' is displayed in the left, and 'Newer Post Link' is displayed in the right",'xpressme'), 169 __("'Newer Post Link' is displayed in the left, and 'Old Post Link' is displayed in the right",'xpressme') 170 ); 171 echo $this->text_option('old_post_link_text', 172 __('Display Title of Old Post Link','xpressme') 173 ); 174 echo $this->text_option('newer_post_link_text', 175 __('Display Title of Newer Post Link','xpressme') 176 ); 177 125 178 126 179 // $this->is_use_xoops_upload_path_html();
Note: See TracChangeset
for help on using the changeset viewer.