Changeset 206397
- Timestamp:
- 02/16/2010 07:45:58 AM (16 years ago)
- Location:
- wp-yamli/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
yamli.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-yamli/trunk/readme.txt
r205365 r206397 4 4 Requires at least: 2.1 5 5 Tested up to: 2.9 6 Stable tag: 1. 16 Stable tag: 1.2 7 7 8 8 WP Yamli allows blog editors and commenters to write Arabic spelling text in English or French and Yamli will convert them. -
wp-yamli/trunk/yamli.php
r205365 r206397 2 2 /* 3 3 Plugin Name: WP Yamli 4 Version: 1. 14 Version: 1.2 5 5 Plugin URI: http://dev.holooli.com/2009/01/22/wp-yamli 6 6 Description: WP Yamli allows blog editors and commenters to write Arabic spelling text in English or French and Yamli will convert them. … … 8 8 Author URI: http://holooli.com 9 9 */ 10 11 10 12 11 if( !class_exists('Yamli') ) { … … 26 25 27 26 #Execute Yamli script 28 add_action( 'admin_footer', array($this, 'execute'));29 add_action( 'wp_footer', array($this, 'execute'));27 add_action('admin_footer', array($this, 'execute')); 28 add_action('wp_footer', array($this, 'execute')); 30 29 31 30 //VERSION CONTROL 32 if ( $wp_version < 2.1) {31 if ($wp_version < 2.1) { 33 32 add_action('admin_notices', array($this, 'versionWarning')); 34 33 } 35 34 } 36 35 37 function versionWarning(){ //Show warning if plugin is installed on a WordPress lower than 2.1 38 36 function versionWarning() { //Show warning if plugin is installed on a WordPress lower than 2.1 39 37 global $wp_version; 40 38 … … 46 44 "</strong></p> 47 45 </div>"; 48 49 46 } 50 47 … … 52 49 // Add action to build an yamli page 53 50 function addPanel() { 54 55 51 //Add the Settings and User Panels 56 add_options_page( 'Yamli', 'Yamli', 10, 'yamli', array($this, 'yamliSettings') ); 57 52 add_options_page('Yamli', 'Yamli', 10, 'yamli', array($this, 'yamliSettings')); 58 53 } 59 54 … … 64 59 'title' => '0', 65 60 'content' => '0', 61 'new-tag-post_tag' => '0', 66 62 'author' => '0', 67 63 'email' => '0', … … 78 74 } else { // Set Defaults if new value does not exist 79 75 $yamli = get_option( 'yamli' ); 76 80 77 // Check to see if all defaults exists in option table's record, and assign values to empty keys 81 foreach ( $default as $key => $val) {82 if ( !$yamli[$key]) {78 foreach ($default as $key => $val) { 79 if (!$yamli[$key]) { 83 80 $yamli[$key] = $val; 84 81 $new = true; … … 87 84 88 85 if ( $new ) { 89 update_option( 'yamli', $yamli);86 update_option('yamli', $yamli); 90 87 } 91 88 } … … 119 116 <th scope="row"><label for="name"><?php _e('New Post:', 'yamli');?></label></th> 120 117 <td> 121 <label><input type="checkbox" name="yamli_title" value="1" <?php if( $yamli['title'] ) echo 'checked="checked"';?> /> <?php _e('Post title', 'yamli');?></label> 122 <label><input type="checkbox" name="yamli_content" value="1" <?php if( $yamli['title'] ) echo 'checked="checked"';?> /> <?php _e('Post content', 'yamli');?></label> 118 <label><input type="checkbox" name="yamli_title" value="1" <?php if ($yamli['title']) echo 'checked="checked"';?> /> <?php _e('Post title', 'yamli');?></label> 119 <label><input type="checkbox" name="yamli_content" value="1" <?php if ($yamli['content']) echo 'checked="checked"';?> /> <?php _e('Post content', 'yamli');?></label> 120 <label><input type="checkbox" name="yamli_tag" value="1" <?php if ($yamli['new-tag-post_tag']) echo 'checked="checked"';?> /> <?php _e('Post tag', 'yamli');?></label> 123 121 </td> 124 122 </tr> … … 148 146 <th scope="row"><label for="text"><?php _e('Interface language:', 'yamli');?></label></th> 149 147 <td> 150 <label><input type="radio" name="yamli_language" value="en" <?php if ( $yamli['language'] == 'en') echo 'checked="checked"';?> /> <?php _e('English', 'yamli');?></label> 151 <label><input type="radio" name="yamli_language" value="ar" <?php if ( $yamli['language'] == 'ar') echo 'checked="checked"';?> /> <?php _e('Arabic', 'yamli');?></label> 152 <label><input type="radio" name="yamli_language" value="fr" <?php if ( $yamli['language'] == 'fr') echo 'checked="checked"';?> /> <?php _e('French', 'yamli');?></label>148 <label><input type="radio" name="yamli_language" value="en" <?php if ($yamli['language'] == 'en') echo 'checked="checked"';?> /> <?php _e('English', 'yamli');?></label> 149 <label><input type="radio" name="yamli_language" value="ar" <?php if ($yamli['language'] == 'ar') echo 'checked="checked"';?> /> <?php _e('Arabic', 'yamli');?></label> 150 <label><input type="radio" name="yamli_language" value="fr" <?php if ($yamli['language'] == 'fr') echo 'checked="checked"';?> /> <?php _e('French', 'yamli');?></label> 153 151 </td> 154 152 </tr> … … 156 154 <th scope="row"><label for="text"><?php _e('Placement:', 'yamli');?></label></th> 157 155 <td> 158 <label><input type="radio" name="yamli_placement" value="inside" <?php if ( $yamli['placement'] == 'inside') echo 'checked="checked"';?> /> <?php _e('inside', 'yamli');?></label> 159 <label><input type="radio" name="yamli_placement" value="bottomRight" <?php if ( $yamli['placement'] == 'bottomRight') echo 'checked="checked"';?> /> <?php _e('bottom right', 'yamli');?></label> 160 <label><input type="radio" name="yamli_placement" value="bottomLeft" <?php if ( $yamli['placement'] == 'bottomLeft') echo 'checked="checked"';?> /> <?php _e('bottom left', 'yamli');?></label> 161 <label><input type="radio" name="yamli_placement" value="topRight" <?php if ( $yamli['placement'] == 'topRight') echo 'checked="checked"';?> /> <?php _e('top right', 'yamli');?></label> 162 <label><input type="radio" name="yamli_placement" value="topLeft" <?php if ( $yamli['placement'] == 'topLeft') echo 'checked="checked"';?> /> <?php _e('top left', 'yamli');?></label> 163 <label><input type="radio" name="yamli_placement" value="rightTop" <?php if ( $yamli['placement'] == 'rightTop') echo 'checked="checked"';?> /> <?php _e('right top', 'yamli');?></label> 164 <label><input type="radio" name="yamli_placement" value="leftTop" <?php if ( $yamli['placement'] == 'leftTop') echo 'checked="checked"';?> /> <?php _e('left top', 'yamli');?></label> 165 <label><input type="radio" name="yamli_placement" value="rightBottom" <?php if ( $yamli['placement'] == 'rightBottom') echo 'checked="checked"';?> /> <?php _e('right bottom', 'yamli');?></label> 166 <label><input type="radio" name="yamli_placement" value="leftBottom" <?php if ( $yamli['placement'] == 'leftBottom') echo 'checked="checked"';?> /> <?php _e('left bottom', 'yamli');?></label> 156 <label><input type="radio" name="yamli_placement" value="inside" <?php if ($yamli['placement'] == 'inside') echo 'checked="checked"';?> /> <?php _e('inside', 'yamli');?></label> 157 <label><input type="radio" name="yamli_placement" value="bottomRight" <?php if ($yamli['placement'] == 'bottomRight') echo 'checked="checked"';?> /> <?php _e('bottom right', 'yamli');?></label> 158 <label><input type="radio" name="yamli_placement" value="bottomLeft" <?php if ($yamli['placement'] == 'bottomLeft') echo 'checked="checked"';?> /> <?php _e('bottom left', 'yamli');?></label> 159 <label><input type="radio" name="yamli_placement" value="topRight" <?php if ($yamli['placement'] == 'topRight') echo 'checked="checked"';?> /> <?php _e('top right', 'yamli');?></label> 160 <label><input type="radio" name="yamli_placement" value="topLeft" <?php if ($yamli['placement'] == 'topLeft') echo 'checked="checked"';?> /> <?php _e('top left', 'yamli');?></label> 161 <label><input type="radio" name="yamli_placement" value="rightTop" <?php if ($yamli['placement'] == 'rightTop') echo 'checked="checked"';?> /> <?php _e('right top', 'yamli');?></label> 162 <label><input type="radio" name="yamli_placement" value="leftTop" <?php if ($yamli['placement'] == 'leftTop') echo 'checked="checked"';?> /> <?php _e('left top', 'yamli');?></label> 163 <label><input type="radio" name="yamli_placement" value="rightBottom" <?php if ($yamli['placement'] == 'rightBottom') echo 'checked="checked"';?> /> <?php _e('right bottom', 'yamli');?></label> 164 <label><input type="radio" name="yamli_placement" value="leftBottom" <?php if ($yamli['placement'] == 'leftBottom') echo 'checked="checked"';?> /> <?php _e('left bottom', 'yamli');?></label> 167 165 </td> 168 166 </tr> … … 184 182 185 183 // Get the new values from the submitted POST 186 $update['title'] = $_POST['yamli_title']; 187 $update['content'] = $_POST['yamli_content']; 188 $update['author'] = $_POST['yamli_author']; 189 $update['email'] = $_POST['yamli_email']; 190 $update['url'] = $_POST['yamli_url']; 191 $update['comment'] = $_POST['yamli_comment']; 192 $update['s'] = $_POST['yamli_s']; 193 194 $update['language'] = $_POST['yamli_language']; 195 $update['placement'] = $_POST['yamli_placement']; 184 $update['title'] = $_POST['yamli_title']; 185 $update['content'] = $_POST['yamli_content']; 186 $update['new-tag-post_tag'] = $_POST['yamli_tag']; 187 $update['author'] = $_POST['yamli_author']; 188 $update['email'] = $_POST['yamli_email']; 189 $update['url'] = $_POST['yamli_url']; 190 $update['comment'] = $_POST['yamli_comment']; 191 $update['s'] = $_POST['yamli_s']; 192 193 $update['language'] = $_POST['yamli_language']; 194 $update['placement'] = $_POST['yamli_placement']; 196 195 197 196 // Save the new settings to option table's record
Note: See TracChangeset
for help on using the changeset viewer.