| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package Adminimize | |
| 3 | + * @package Adminimize | |
| 4 | 4 | * @subpackage Link Options |
| 5 | - * @author Frank Bültge | |
| 5 | + * @author Frank Bültge | |
| 6 | 6 | */ |
| 7 | 7 | if ( ! function_exists( 'add_action' ) ) { |
| 8 | 8 | echo "Hi there! I'm just a part of plugin, not much I can do when called directly."; |
| 9 | 9 | exit; |
| @@ -9,125 +9,169 @@ | ||
| 9 | 9 | exit; |
| 10 | 10 | } |
| 11 | 11 | ?> |
| 12 | 12 | |
| 13 | - <div id="poststuff" class="ui-sortable meta-box-sortables"> | |
| 14 | - <div class="postbox"> | |
| 15 | - <div class="handlediv" title="<?php _e('Click to toggle'); ?>"><br/></div> | |
| 16 | - <h3 class="hndle" id="links_options"><?php _e('Links options', FB_ADMINIMIZE_TEXTDOMAIN ); ?></h3> | |
| 17 | - <div class="inside"> | |
| 18 | - <br class="clear" /> | |
| 13 | +<div id="poststuff" class="ui-sortable meta-box-sortables"> | |
| 14 | + <div class="postbox"> | |
| 15 | + <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle' ); ?>"><br /></div> | |
| 16 | + <h3 class="hndle" id="links_options"><?php esc_attr_e( 'Links options', 'adminimize' ); ?></h3> | |
| 19 | 17 | |
| 20 | - <table summary="config_edit_links" class="widefat"> | |
| 21 | - <thead> | |
| 22 | - <tr> | |
| 23 | - <th><?php _e('Option', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th> | |
| 24 | - <?php | |
| 25 | - foreach ($user_roles_names as $role_name) { ?> | |
| 26 | - <th><?php _e('Deactivate for', FB_ADMINIMIZE_TEXTDOMAIN ); echo '<br/>' . $role_name; ?></th> | |
| 27 | - <?php } ?> | |
| 28 | - </tr> | |
| 29 | - </thead> | |
| 18 | + <div class="inside"> | |
| 19 | + <br class="clear" /> | |
| 30 | 20 | |
| 31 | - <tbody> | |
| 32 | - <?php | |
| 33 | - foreach ($user_roles as $role) { | |
| 34 | - $disabled_link_option_[$role] = _mw_adminimize_get_option_value('mw_adminimize_disabled_link_option_'. $role .'_items'); | |
| 35 | - } | |
| 36 | - | |
| 37 | - $link_options = array( | |
| 38 | - '#namediv', | |
| 39 | - '#addressdiv', | |
| 40 | - '#descriptiondiv', | |
| 41 | - '#linkcategorydiv', | |
| 42 | - '#linktargetdiv', | |
| 43 | - '#linkxfndiv', | |
| 44 | - '#linkadvanceddiv', | |
| 45 | - '#misc-publishing-actions' | |
| 46 | - ); | |
| 47 | - | |
| 48 | - $link_options_names = array( | |
| 49 | - __('Name'), | |
| 50 | - __('Web Address'), | |
| 51 | - __('Description'), | |
| 52 | - __('Categories'), | |
| 53 | - __('Target'), | |
| 54 | - __('Link Relationship (XFN)'), | |
| 55 | - __('Advanced'), | |
| 56 | - __('Publish Actions', FB_ADMINIMIZE_TEXTDOMAIN) | |
| 57 | - ); | |
| 58 | - | |
| 59 | - $_mw_adminimize_own_link_values = _mw_adminimize_get_option_value('_mw_adminimize_own_link_values'); | |
| 60 | - $_mw_adminimize_own_link_values = preg_split( "/\r\n/", $_mw_adminimize_own_link_values ); | |
| 61 | - foreach ( (array) $_mw_adminimize_own_link_values as $key => $_mw_adminimize_own_link_value ) { | |
| 62 | - $_mw_adminimize_own_link_value = trim($_mw_adminimize_own_link_value); | |
| 63 | - array_push($link_options, $_mw_adminimize_own_link_value); | |
| 64 | - } | |
| 65 | - | |
| 66 | - $_mw_adminimize_own_link_options = _mw_adminimize_get_option_value('_mw_adminimize_own_link_options'); | |
| 67 | - $_mw_adminimize_own_link_options = preg_split( "/\r\n/", $_mw_adminimize_own_link_options ); | |
| 68 | - foreach ( (array) $_mw_adminimize_own_link_options as $key => $_mw_adminimize_own_link_option ) { | |
| 69 | - $_mw_adminimize_own_link_option = trim($_mw_adminimize_own_link_option); | |
| 70 | - array_push($link_options_names, $_mw_adminimize_own_link_option); | |
| 71 | - } | |
| 72 | - | |
| 73 | - $x = 0; | |
| 74 | - foreach ($link_options as $index => $link_option) { | |
| 75 | - if ( $link_option != '') { | |
| 76 | - $checked_user_role_ = array(); | |
| 77 | - foreach ($user_roles as $role) { | |
| 78 | - $checked_user_role_[$role] = ( isset($disabled_link_option_[$role]) && in_array($link_option, $disabled_link_option_[$role]) ) ? ' checked="checked"' : ''; | |
| 79 | - } | |
| 80 | - echo '<tr>' . "\n"; | |
| 81 | - echo '<td>' . $link_options_names[$index] . ' <span style="color:#ccc; font-weight: 400;">(' . $link_option . ')</span> </td>' . "\n"; | |
| 82 | - foreach ($user_roles as $role) { | |
| 83 | - echo '<td class="num"><input id="check_post'. $role . $x .'" type="checkbox"' . $checked_user_role_[$role] . ' name="mw_adminimize_disabled_link_option_'. $role .'_items[]" value="' . $link_option . '" /></td>' . "\n"; | |
| 84 | - } | |
| 85 | - echo '</tr>' . "\n"; | |
| 86 | - $x++; | |
| 87 | - } | |
| 88 | - } | |
| 89 | - ?> | |
| 90 | - </tbody> | |
| 91 | - </table> | |
| 92 | - | |
| 21 | + <table summary="config_edit_links" class="widefat"> | |
| 22 | + <thead> | |
| 23 | + <tr> | |
| 24 | + <th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th> | |
| 93 | 25 | <?php |
| 94 | - //your own global options | |
| 95 | - ?> | |
| 96 | - <br style="margin-top: 10px;" /> | |
| 97 | - <table summary="config_edit_post" class="widefat"> | |
| 98 | - <thead> | |
| 99 | - <tr> | |
| 100 | - <th><?php _e('Your own Link options', FB_ADMINIMIZE_TEXTDOMAIN ); echo '<br />'; _e('ID or class', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th> | |
| 101 | - <th><?php echo '<br />'; _e('Option', FB_ADMINIMIZE_TEXTDOMAIN ); ?></th> | |
| 102 | - </tr> | |
| 103 | - </thead> | |
| 26 | + foreach ( $user_roles_names as $role_name ) { ?> | |
| 27 | + <th><?php esc_attr_e( 'Deactivate for', 'adminimize' ); | |
| 28 | + echo '<br/>' . $role_name; ?></th> | |
| 29 | + <?php } ?> | |
| 30 | + </tr> | |
| 31 | + <tr> | |
| 32 | + <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td> | |
| 33 | + <?php | |
| 34 | + foreach ( $user_roles_names as $role_name ) { | |
| 35 | + $role_name = strtolower( $role_name ); | |
| 36 | + $role_name = preg_replace( '/[^a-z0-9]+/', '', $role_name ); | |
| 37 | + echo '<td class="num">'; | |
| 38 | + echo '<input id="select_all" class="links_options_' . $role_name | |
| 39 | + . '" type="checkbox" name="" value="" />'; | |
| 40 | + echo '</td>' . "\n"; | |
| 41 | + } ?> | |
| 42 | + </tr> | |
| 43 | + </thead> | |
| 104 | 44 | |
| 105 | - <tbody> | |
| 106 | - <tr valign="top"> | |
| 107 | - <td colspan="2"><?php _e('It is possible to add your own IDs or classes from elements and tags. You can find IDs and classes with the FireBug Add-on for Firefox. Assign a value and the associate name per line.', FB_ADMINIMIZE_TEXTDOMAIN ); ?></td> | |
| 108 | - </tr> | |
| 109 | - <tr valign="top"> | |
| 110 | - <td> | |
| 111 | - <textarea name="_mw_adminimize_own_link_options" cols="60" rows="3" id="_mw_adminimize_own_link_options" style="width: 95%;" ><?php echo _mw_adminimize_get_option_value('_mw_adminimize_own_link_options'); ?></textarea> | |
| 112 | - <br /> | |
| 113 | - <?php _e('Possible nomination for ID or class. Separate multiple nominations through a carriage return.', FB_ADMINIMIZE_TEXTDOMAIN ); ?> | |
| 114 | - </td> | |
| 115 | - <td> | |
| 116 | - <textarea class="code" name="_mw_adminimize_own_link_values" cols="60" rows="3" id="_mw_adminimize_own_link_values" style="width: 95%;" ><?php echo _mw_adminimize_get_option_value('_mw_adminimize_own_link_values'); ?></textarea> | |
| 117 | - <br /> | |
| 118 | - <?php _e('Possible IDs or classes. Separate multiple values through a carriage return.', FB_ADMINIMIZE_TEXTDOMAIN ); ?> | |
| 119 | - </td> | |
| 120 | - </tr> | |
| 121 | - </tbody> | |
| 122 | - </table> | |
| 123 | - | |
| 124 | - <p id="submitbutton"> | |
| 125 | - <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" /> | |
| 126 | - <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php _e('Update Options', FB_ADMINIMIZE_TEXTDOMAIN ); ?> »" /><input type="hidden" name="page_options" value="'dofollow_timeout'" /> | |
| 127 | - </p> | |
| 128 | - | |
| 129 | - <p><a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php _e('scroll to top', FB_ADMINIMIZE_TEXTDOMAIN); ?></a><br class="clear" /></p> | |
| 130 | - | |
| 131 | - </div> | |
| 132 | - </div> | |
| 133 | - </div> | |
| 45 | + <tbody> | |
| 46 | + <?php | |
| 47 | + foreach ( $user_roles as $role ) { | |
| 48 | + $disabled_link_option_[ $role ] = _mw_adminimize_get_option_value( | |
| 49 | + 'mw_adminimize_disabled_link_option_' . $role . '_items' | |
| 50 | + ); | |
| 51 | + } | |
| 52 | + | |
| 53 | + $link_options = array( | |
| 54 | + '#namediv', | |
| 55 | + '#addressdiv', | |
| 56 | + '#descriptiondiv', | |
| 57 | + '#linkcategorydiv', | |
| 58 | + '#linktargetdiv', | |
| 59 | + '#linkxfndiv', | |
| 60 | + '#linkadvanceddiv', | |
| 61 | + '#misc-publishing-actions' | |
| 62 | + ); | |
| 63 | + | |
| 64 | + $link_options_names = array( | |
| 65 | + esc_attr__( 'Name' ), | |
| 66 | + esc_attr__( 'Web Address' ), | |
| 67 | + esc_attr__( 'Description' ), | |
| 68 | + esc_attr__( 'Categories' ), | |
| 69 | + esc_attr__( 'Target' ), | |
| 70 | + esc_attr__( 'Link Relationship (XFN)' ), | |
| 71 | + esc_attr__( 'Advanced' ), | |
| 72 | + esc_attr__( 'Publish Actions', 'adminimize' ) | |
| 73 | + ); | |
| 74 | + | |
| 75 | + $_mw_adminimize_own_link_values = _mw_adminimize_get_option_value( '_mw_adminimize_own_link_values' ); | |
| 76 | + $_mw_adminimize_own_link_values = preg_split( "/\r\n/", $_mw_adminimize_own_link_values ); | |
| 77 | + foreach ( (array) $_mw_adminimize_own_link_values as $key => $_mw_adminimize_own_link_value ) { | |
| 78 | + $_mw_adminimize_own_link_value = trim( $_mw_adminimize_own_link_value ); | |
| 79 | + $link_options[] = $_mw_adminimize_own_link_value; | |
| 80 | + } | |
| 81 | + | |
| 82 | + $_mw_adminimize_own_link_options = _mw_adminimize_get_option_value( '_mw_adminimize_own_link_options' ); | |
| 83 | + $_mw_adminimize_own_link_options = preg_split( "/\r\n/", $_mw_adminimize_own_link_options ); | |
| 84 | + foreach ( (array) $_mw_adminimize_own_link_options as $key => $_mw_adminimize_own_link_option ) { | |
| 85 | + $_mw_adminimize_own_link_option = trim( $_mw_adminimize_own_link_option ); | |
| 86 | + $link_options_names[] = $_mw_adminimize_own_link_option; | |
| 87 | + } | |
| 88 | + | |
| 89 | + $x = 0; | |
| 90 | + foreach ( $link_options as $index => $link_option ) { | |
| 91 | + if ( $link_option != '' ) { | |
| 92 | + $checked_user_role_ = array(); | |
| 93 | + foreach ( $user_roles as $role ) { | |
| 94 | + $checked_user_role_[ $role ] = ( isset( $disabled_link_option_[ $role ] ) | |
| 95 | + && in_array( | |
| 96 | + $link_option, $disabled_link_option_[ $role ] | |
| 97 | + ) ) ? ' checked="checked"' : ''; | |
| 98 | + } | |
| 99 | + echo '<tr>' . "\n"; | |
| 100 | + echo '<td>' . $link_options_names[ $index ] . ' <span>(' . $link_option . ')</span> </td>' . "\n"; | |
| 101 | + foreach ( $user_roles as $role ) { | |
| 102 | + echo '<td class="num">'; | |
| 103 | + echo '<input id="check_post' . $role . $x . '" class="links_options_' | |
| 104 | + . preg_replace( '/[^a-z0-9]+/', '', $role ) . '" type="checkbox"' | |
| 105 | + . $checked_user_role_[ $role ] . ' name="mw_adminimize_disabled_link_option_' | |
| 106 | + . $role . '_items[]" value="' . $link_option . '" />'; | |
| 107 | + echo '</td>' . "\n"; | |
| 108 | + } | |
| 109 | + echo '</tr>' . "\n"; | |
| 110 | + $x ++; | |
| 111 | + } | |
| 112 | + } | |
| 113 | + ?> | |
| 114 | + </tbody> | |
| 115 | + </table> | |
| 116 | + | |
| 117 | + <?php | |
| 118 | + //your own global options | |
| 119 | + ?> | |
| 120 | + <br style="margin-top: 10px;" /> | |
| 121 | + <table summary="config_edit_post" class="widefat"> | |
| 122 | + <thead> | |
| 123 | + <tr> | |
| 124 | + <th><?php esc_attr_e( 'Your own Link options', 'adminimize' ); | |
| 125 | + echo '<br />'; | |
| 126 | + esc_attr_e( 'ID or class', 'adminimize' ); ?></th> | |
| 127 | + <th><?php echo '<br />'; | |
| 128 | + esc_attr_e( 'Option', 'adminimize' ); ?></th> | |
| 129 | + </tr> | |
| 130 | + </thead> | |
| 131 | + | |
| 132 | + <tbody> | |
| 133 | + <tr valign="top"> | |
| 134 | + <td colspan="2"><?php esc_attr_e( | |
| 135 | + 'It is possible to add your own IDs or classes from elements and tags. You can find IDs and classes with the FireBug Add-on for Firefox. Assign a value and the associate name per line.', | |
| 136 | + 'adminimize' | |
| 137 | + ); ?></td> | |
| 138 | + </tr> | |
| 139 | + <tr valign="top"> | |
| 140 | + <td> | |
| 141 | + <textarea name="_mw_adminimize_own_link_options" cols="60" rows="3" id="_mw_adminimize_own_link_options" style="width: 95%;"><?php echo _mw_adminimize_get_option_value( | |
| 142 | + '_mw_adminimize_own_link_options' | |
| 143 | + ); ?></textarea> | |
| 144 | + <br /> | |
| 145 | + <?php esc_attr_e( | |
| 146 | + 'Possible nomination for ID or class. Separate multiple nominations through a carriage return.', | |
| 147 | + 'adminimize' | |
| 148 | + ); ?> | |
| 149 | + </td> | |
| 150 | + <td> | |
| 151 | + <textarea class="code" name="_mw_adminimize_own_link_values" cols="60" rows="3" id="_mw_adminimize_own_link_values" style="width: 95%;"><?php echo _mw_adminimize_get_option_value( | |
| 152 | + '_mw_adminimize_own_link_values' | |
| 153 | + ); ?></textarea> | |
| 154 | + <br /> | |
| 155 | + <?php esc_attr_e( | |
| 156 | + 'Possible IDs or classes. Separate multiple values through a carriage return.', 'adminimize' | |
| 157 | + ); ?> | |
| 158 | + </td> | |
| 159 | + </tr> | |
| 160 | + </tbody> | |
| 161 | + </table> | |
| 162 | + | |
| 163 | + <p id="submitbutton"> | |
| 164 | + <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" /> | |
| 165 | + <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e( | |
| 166 | + 'Update Options', 'adminimize' | |
| 167 | + ); ?> »" /><input type="hidden" name="page_options" value="'dofollow_timeout'" /> | |
| 168 | + </p> | |
| 169 | + | |
| 170 | + <p> | |
| 171 | + <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e( | |
| 172 | + 'scroll to top', 'adminimize' | |
| 173 | + ); ?></a><br class="clear" /></p> | |
| 174 | + | |
| 175 | + </div> | |
| 176 | + </div> | |
| 177 | +</div> | |