- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/xpressme/xpressme_class.php
r20 r28 6 6 var $pluginName = 'xpressme'; 7 7 var $is_use_xoops_upload_path; 8 8 var $is_theme_sidebar_disp; 9 var $is_save_post_revision; 9 10 //constructor 10 11 function XPressME_Class() … … 30 31 { 31 32 $this->is_use_xoops_upload_path = true; 33 $this->is_theme_sidebar_disp = true; 34 $this->is_save_post_revision = true; 32 35 } 33 36 … … 49 52 { 50 53 $write_options = array ( 51 'is_use_xoops_upload_path' => $this->is_use_xoops_upload_path 54 'is_use_xoops_upload_path' => $this->is_use_xoops_upload_path , 55 'is_theme_sidebar_disp' => $this->is_theme_sidebar_disp 52 56 ); 53 57 if ($mode == 'add_new') { … … 61 65 { 62 66 $this->is_use_xoops_upload_path = stripslashes(trim($_POST['ch_is_use_xoops_upload_path'])); 67 $this->is_theme_sidebar_disp = stripslashes(trim($_POST['ch_is_theme_sidebar_disp'])); 68 $this->is_save_post_revision = stripslashes(trim($_POST['ch_is_save_post_revision'])); 63 69 } 70 71 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 } 64 93 65 94 function option_page() … … 74 103 75 104 76 echo '<div class="wrap">'; 77 echo '<div id="icon-options-general" class="icon32"><br /></div>'; 78 echo '<h2>' . __('XPressME Configuration Page', 'xpressme') . '</h2> '; 105 echo '<div class="wrap">'."\n"; 106 echo '<div id="icon-options-general" class="icon32"><br /></div>'."\n"; 107 echo '<h2>' . __('XPressME Configuration Page', 'xpressme') . "</h2>\n"; 108 echo '<form method="post" action="' . $_SERVER["REQUEST_URI"] . '">'."\n" ; 109 echo '<table class="form-table">'."\n"; 110 echo $this->yes_no_radio_option('is_use_xoops_upload_path', 111 __('Media Upload Base Path','xpressme'), 112 __('Use XOOPS UPLOAD PATH','xpressme'), 113 __('USE WordPress BASE_PATH','xpressme') 114 ); 115 echo $this->yes_no_radio_option('is_theme_sidebar_disp', 116 __('Thema Sidebar Display','xpressme'), 117 __('YES','xpressme'), 118 __('NO','xpressme') 119 ); 120 echo $this->yes_no_radio_option('is_save_post_revision', 121 __('The change tracking of the post is preserved','xpressme'), 122 __('YES','xpressme'), 123 __('NO','xpressme') 124 ); 125 126 // $this->is_use_xoops_upload_path_html(); 127 echo "</table>\n"; 128 129 echo '<p class="submit">'."\n"; 130 echo '<input type="submit" value= "' . __('Update Config', 'xpressme') . '" name="submit_update" />' ."\n"; 131 echo '<input type="submit" value= "' . __('Preset Config', 'xpressme') . '" name="submit_reset" />' ."\n"; 132 echo "</p>\n"; 79 133 80 echo '<form method="post" action="' . $_SERVER["REQUEST_URI"] . '">' ; 81 echo '<table class="form-table">'; 82 $this->is_use_xoops_upload_path_html(); 83 echo '</table>'; 84 85 echo '<p class="submit">'; 86 echo '<input type="submit" value= "' . __('Update Config', 'xpressme') . '" name="submit_update" />'; 87 echo '<input type="submit" value= "' . __('Preset Config', 'xpressme') . '" name="submit_reset" />'; 88 echo '</p>'; 89 90 echo '</form>' ; 91 echo '</div>'; 134 echo "</form>\n" ; 135 echo "</div>\n"; 92 136 } 93 94 function is_use_xoops_upload_path_html()95 {96 97 echo '<tr>';98 echo '<th><label for="images_to_link">' . __('Media Upload Base Path','xpressme') . '</label></th>';99 echo '<td>';100 101 if ($this->is_use_xoops_upload_path == true){102 echo '<label><input type="radio" name="ch_is_use_xoops_upload_path" value="1" checked="checked" /> ' . __('Use XOOPS UPLOAD PATH','xpressme') .'</label><br />';103 echo '<label><input type="radio" name="ch_is_use_xoops_upload_path" value="0" />' . __('USE WordPress BASE_PATH','xpressme') . '</label>';104 } else {105 echo '<label><input type="radio" name="ch_is_use_xoops_upload_path" value="1" /> ' . __('Use XOOPS UPLOAD PATH','xpressme') .'</label><br />';106 echo '<label><input type="radio" name="ch_is_use_xoops_upload_path" value="0" checked="checked" />' . __('USE WordPress BASE_PATH','xpressme') . '</label>';107 }108 echo '</td>';109 echo '</tr><tr>';110 111 }112 113 137 114 138 function xpress_upload_filter($uploads) … … 132 156 return $uploads; 133 157 } 158 134 159 } 135 160 ?>
Note: See TracChangeset
for help on using the changeset viewer.