Changeset 498362
- Timestamp:
- 02/01/2012 06:30:25 AM (14 years ago)
- Location:
- islamic-graphics/trunk
- Files:
-
- 2 edited
-
islamic_graphics.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
islamic-graphics/trunk/islamic_graphics.php
r498323 r498362 5 5 Plugin URI: http://plugins.muslimmatters.org 6 6 Description: Shortcodes for the insertion of graphics representing the common Islamic phrases: SAW, RA, SWT and AS, into Wordpress posts and pages. 7 Version: 1.1. 07 Version: 1.1.1 8 8 Author: Mehzabeen Ibrahim 9 9 Author URI: http://imuslim.tv … … 42 42 // Register settings 43 43 function islamic_graphics_init(){ 44 add_settings_section('islamic_graphics_main', 'Main Settings', 'islamic_graphics_section_text', 'islamic-graphics'); 45 add_settings_field('islamic_graphics_default_height', 'Default height (pixels)', 'add_field_default_height', 'islamic-graphics', 'islamic_graphics_main'); 46 add_settings_field('islamic_graphics_default_colour', 'Default colour', 'add_field_default_colour', 'islamic-graphics', 'islamic_graphics_main'); 47 add_settings_field('islamic_graphics_display_type', 'Display type', 'add_field_display_type', 'islamic-graphics', 'islamic_graphics_main'); 48 44 49 register_setting( 'islamic-graphics-option-group', 'islamic_graphics_default_height', 'validate_default_height' ); 45 50 register_setting( 'islamic-graphics-option-group', 'islamic_graphics_display_type' ); 46 51 register_setting( 'islamic-graphics-option-group', 'islamic_graphics_default_colour' ); 47 52 } 53 54 function islamic_graphics_section_text(){ 55 echo '<p>Use the following options to alter the display of Islamic Graphics in your posts and pages.</p>'; 56 } 57 58 function add_field_default_height(){ 59 echo '<input type="text" name="islamic_graphics_default_height" value="'; 60 echo get_option('islamic_graphics_default_height', 20); 61 echo '" />'; 62 } 63 64 function add_field_default_colour(){ 65 echo '<select name="islamic_graphics_default_colour" id="islamic_graphics_default_colour">'; 66 67 $display_type_options = array( 68 "black" => "Black", 69 "white" => "White"); 70 71 $stored_type = get_option('islamic_graphics_default_colour', 'black'); 72 73 foreach ($display_type_options as $key => $row) { 74 echo '<option value="' . $key . '"'; 75 if ($stored_type == $key) { echo 'selected="selected"'; } 76 echo '>'. $row .'</option>'; 77 } 78 79 echo '</select>'; 80 } 81 82 function add_field_display_type(){ 83 echo '<select name="islamic_graphics_display_type" id="islamic_graphics_display_type">'; 84 85 $display_type_options = array( 86 "images" => "Images only", 87 "images_trans" => "Images (with translation)", 88 "text_rom_trans" => "Romanized text (with translation)", 89 "text_rom" => "Romanized text only", 90 "text_trans" => "Translation only"); 91 92 $stored_type = get_option('islamic_graphics_display_type', 'images'); 93 94 foreach ($display_type_options as $key => $row) { 95 echo '<option value="' . $key . '"'; 96 if ($stored_type == $key) { echo 'selected="selected"'; } 97 echo '>'. $row .'</option>'; 98 } 99 100 echo '</select>'; 101 } 102 103 // Validate height input 104 function validate_default_height($input) { 105 $newinput = trim($input); 106 107 if (!is_numeric($newinput)){ 108 $newinput = 20; // if not numeric, then use 20 as default value 109 } 110 return $newinput; 111 } 48 112 49 113 // HTML for options page … … 54 118 ?> 55 119 <div class="wrap"> 56 <h2>Islamic Graphics - Options</h2> 57 <p>Use the following options to alter the display of Islamic Graphics in your posts and pages.</p> 120 <h2>Islamic Graphics - Options Page</h2> 58 121 <form method="post" action="options.php"> 59 122 <?php settings_fields( 'islamic-graphics-option-group' ); ?> 60 <?php do_settings_fields( 'islamic-graphics-option-group' ); ?> 61 <!-- Input for default img height --> 62 <p>Default height of embedded images in pixels (value > 40 will be accepted, but not recommended!) 63 <br/><input type="text" name="islamic_graphics_default_height" value="<?php echo get_option('islamic_graphics_default_height', 20); ?>" /> 64 </p> 65 <!-- Options for Islamic Graphics colour --> 66 <p>Default colour of images? 67 <br/><select name="islamic_graphics_default_colour" id="islamic_graphics_default_colour"> 68 <!-- Select the option that is stored in wp_options; else select black --> 69 <?php 70 $display_type_options = array( 71 "black" => "Black", 72 "white" => "White"); 73 74 $stored_type = get_option('islamic_graphics_default_colour', 'black'); 75 76 foreach ($display_type_options as $key => $row) { 77 echo '<option value="' . $key . '"'; 78 if ($stored_type == $key) { echo 'selected="selected"'; } 79 echo '>'. $row .'</option>'; 80 } 81 ?> 82 </select> 83 </p> 84 <!-- Options for Islamic Graphics type --> 85 <p>How do you wish to display the Islamic Graphics? 86 <br/><select name="islamic_graphics_display_type" id="islamic_graphics_display_type"> 87 <!-- Select the option that is stored in wp_options; else select images --> 88 <?php 89 $display_type_options = array( 90 "images" => "Images only", 91 "images_trans" => "Images (with translation)", 92 "text_rom_trans" => "Romanized text (with translation)", 93 "text_rom" => "Romanized text only", 94 "text_trans" => "Translation only"); 95 96 $stored_type = get_option('islamic_graphics_display_type', 'images'); 97 98 foreach ($display_type_options as $key => $row) { 99 echo '<option value="' . $key . '"'; 100 if ($stored_type == $key) { echo 'selected="selected"'; } 101 echo '>'. $row .'</option>'; 102 } 103 ?> 104 </select> 105 </p> 123 <?php do_settings_sections('islamic-graphics'); ?> 106 124 <!-- Submit Button --> 107 <p class="submit"> 108 <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> 109 </p> 125 <p class="submit"> <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /></p> 110 126 </form> 111 127 </div> 112 128 113 129 <?php } 114 115 116 // Validate height input117 function validate_default_height($input) {118 $newinput = trim($input);119 120 if (!is_numeric($newinput)){121 $newinput = 20; // if not numeric, then use 20 as default value122 }123 return $newinput;124 }125 130 126 131 -
islamic-graphics/trunk/readme.txt
r498328 r498362 4 4 Tags: islam, islamic, muslim, arabic, prophet, muhammad, sallalahu 'alayhi wa salam, radiallahu anhu, radiallahu anhum, alayhis salam, subhanahu wa ta ala, rahimaha Allah, rahimahu Allah, rahimahum Allah, SAW, RA, AS, SWT, shortcode, post, page, plugin, images, image 5 5 Requires at least: 2.7.0 6 Tested up to: 3. 2.17 Stable tag: 1.1. 06 Tested up to: 3.3.1 7 Stable tag: 1.1.1 8 8 9 9 Shortcode for the insertion of graphics representing the common Islamic phrases: SAW, RA, SWT and AS, into Wordpress posts and pages. … … 112 112 == Changelog == 113 113 114 = 1.1.1 = 115 Added section to settings page to fix error seen in 3.3.1 version of Wordpress. 116 114 117 = 1.1.0 = 115 118 Major changes to code: … … 145 148 == Upgrade Notice == 146 149 150 = 1.1.1 = 151 Major improvements to the plugin! Added an options page for setting of default display options. English translation can now be inserted with images. Consult FAQ for more details. (Settings page bug fix included). 152 147 153 = 1.1.0 = 148 154 Major improvements to the plugin! Added an options page for setting of default display options. English translation can now be inserted with images. Consult FAQ for more details.
Note: See TracChangeset
for help on using the changeset viewer.