| [ Index ] |
PHP Cross Reference of zeList |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * zeList Settings Page 4 * @see includes/admin-hooks.php function zelist_settings_load() for $_POST treatment 5 */ 6 if (isset($_SERVER['SCRIPT_FILENAME']) && basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME'])) 7 die("Are you sure ? "); 8 ?> 9 <div id="zelist_admin" class="wrap"> 10 <h2><?php _e('zeList Settings','zelist'); ?></h2> 11 12 <?php global $errors; if($errors) foreach($errors as $error) echo '<div class="error">'.$error.'</div>'; ?> 13 <?php global $updated; if($updated) : ?> 14 <div id="message" class="updated fade"><p><strong><?php _e('Settings saved.') ?></strong></p></div> 15 <?php endif; ?> 16 <div id="maintenance" class="clearfix"> 17 <h3><?php _e('Maintenance','zelist'); ?></h3> 18 <table> 19 <tr> 20 <td class="action" valign="top"> 21 <a id="deadlinks" class="ajax_settings button" href="#" title="<?php _e('Check for non responding URLS','zelist'); ?>"><?php _e('Check dead links','zelist'); ?></a> 22 <input type="checkbox" class="deadlinks_settings" name="unpublish" id="unpublish" checked="checked" /> 23 <small><?php _e('Unpublish dead links','zelist'); ?></small> 24 </td> 25 26 <td class="action" valign="top"> 27 <a id="updatecounts" class="ajax_settings button" href="#" title="<?php _e('When categories or tags counts are wrong','zelist'); ?>"><?php _e('Update counts','zelist'); ?></a> 28 </td> 29 30 <td class="action" valign="top"> 31 <a id="clean-descriptions" class="ajax_settings button" href="#" title="<?php _e('Strip descriptions for unwanted tags','zelist'); ?>"><?php _e('Clean descriptions','zelist'); ?></a> 32 </td> 33 34 <td class="action" valign="top"> 35 <a id="clean-tags" class="ajax_settings button" href="#" title="<?php _e('Remove tags with no links tagged','zelist'); ?>"><?php _e('Delete empty link tags','zelist'); ?></a> 36 37 </td> 38 <?php do_action('zelist_settings_actions'); ?> 39 </tr> 40 </table> 41 <?php wp_nonce_field('actions'); ?> 42 <p id="action_help" class="tip" style="display:none;"></p> 43 </div> 44 45 <div id="ajax_container" style="display:none;"> 46 <a id="settings_back" href="#"><?php _e('Back to settings','zelist'); ?></a> 47 <div id="ajax_response"><img src="<?php echo admin_url('images/loading.gif'); ?>" /></div> 48 </div> 49 50 51 <div id="normal_container"> 52 53 <?php if (isset($_GET['updated'])) : ?><div id="message" class="updated fade"><p><strong><?php _e('Settings saved.') ?></strong></p></div><?php endif; ?> 54 55 <?php if($counter) $counter->show(); ?> 56 57 <form id="settings_general" action="<?php echo ZELIST_ADMIN_URL_SETTINGS; ?>" method="post"> 58 <?php wp_nonce_field('zelist-settings') ?> 59 60 <div id="general" class="div_settings"> 61 <h3><?php _e('General settings','zelist'); ?></h3> 62 <table class="form-table"> 63 <tr valign="top"> 64 <th scope="row"><label for="zelist_root"><?php _e('Directory Root','zelist'); ?></label></th> 65 <td> 66 <?php if(!get_option('zelist_root') || !get_post(get_option('zelist_root'))) : ?><div class="error"><?php _e('No Page selected. Please choose a page','zelist'); ?></div><?php endif; ?> 67 <?php wp_dropdown_pages('show_option_none='.__('No page').'&selected='.get_option('zelist_root').'&name=settings[zelist_root]'); ?> 68 </td> 69 </tr> 70 71 <tr valign="top"> 72 <th scope="row"><label for="zelist_submit_page"><?php _e('Directory Submit Page','zelist'); ?></label></th> 73 <td> 74 <?php if(!get_option('zelist_submit_page') || !get_post(get_option('zelist_submit_page'))) : ?><p class="error"><?php _e('No Page selected. Please choose a page','zelist'); ?></p><?php endif; ?> 75 <?php wp_dropdown_pages('show_option_none='.__('No page').'&selected='.get_option('zelist_submit_page').'&name=settings[zelist_submit_page]'); ?> 76 </td> 77 </tr> 78 <tr valign="top"> 79 <th scope="row"><label for="zelist_not_directory"><?php _e('Category outside Directory','zelist'); ?></label></th> 80 <td><?php 81 $args = array('name' => 'settings[zelist_not_directory]', 'type' => 'link', 'hide_empty' => 0, 'orderby' => 'name', 'hierarchical' => true, 'show_option_none' => __('No category','zelist')); 82 $args['selected'] = get_option('zelist_not_directory'); 83 wp_dropdown_categories($args); ?> 84 <span class="setting-description"><?php _e('This category will not be handled by zeList. You could use that option to have a regular blogroll outside your directory.','zelist'); ?></span> 85 </td> 86 87 </tr> 88 89 </table> 90 </div> 91 92 <div id="notifications" class="div_settings"> 93 <h3><?php _e('Notification settings','zelist'); ?></h3> 94 <table class="form-table"> 95 <tr valign="top"> 96 <th scope="row"><label for="zelist_cc_admin"><?php _e('CC to admin','zelist'); ?></label></th> 97 <td> 98 <input type="radio" name="settings[zelist_cc_admin]" value="1" <?php checked(get_option('zelist_cc_admin'),1); ?>/><?php _e('Yes','zelist'); ?> 99 <br /><input type="radio" name="settings[zelist_cc_admin]" value="0" <?php checked(get_option('zelist_cc_admin'),0); ?>/><?php _e('No','zelist'); ?> 100 </td> 101 </tr> 102 </table> 103 </div> 104 105 106 107 <div id="rewrite" class="div_settings"> 108 <h3><?php _e('Rewrite settings','zelist'); ?></h3> 109 <table class="form-table"> 110 111 <tr valign="top"> 112 <th scope="row"><label for="zelist_rewrite"><?php _e('Nice URLs','zelist'); ?></label></th> 113 <td> 114 <input type="radio" id="zelist_rewrite_0" name="settings[zelist_rewrite]" value="0" <?php checked(get_option('zelist_rewrite'),0); ?> /> <?php _e('No rewrite','zelist'); ?> 115 <br /> 116 <input type="radio" id="zelist_rewrite_1" name="settings[zelist_rewrite]" value="1" <?php checked(get_option('zelist_rewrite'),1); ?> /> <?php _e('Use fixed rewrite','zelist'); ?> 117 <br /> 118 <input type="radio" id="zelist_rewrite_2" name="settings[zelist_rewrite]" value="2" <?php checked(get_option('zelist_rewrite'),2); ?> /> <?php _e('Use custom rewrite','zelist'); ?> 119 </td> 120 </tr> 121 122 <tr id="zelist_rewrite_fixed" valign="top"> 123 <th scope="row"><label for="zelist_rewrite_fixed"><?php _e('Nice URLs prefix','zelist'); ?></label></th> 124 <td> 125 <?php 126 /* 127 * en fait, est ce que ca : 128 * /annuaire/cat/nom-cat.htm + 129 * /annuaire/tag/nom-tag.htm + 130 * /annuaire/nom-site(.htm) ca t'irait ? 131 * 132 */ 133 $zelist_root = get_post(get_option('zelist_root')); 134 $slug = $zelist_root->post_name; 135 ?> 136 <strong><?php _e('Link Home:','zelist'); ?></strong> 137 <kbd><?php echo get_permalink(get_option('zelist_root')); ?>/</kbd> 138 <br /> 139 140 <strong><?php _e('Link:','zelist'); ?></strong> 141 <kbd><?php echo get_option('home')."/$slug/<link_id>-<link_name>.htm"; ?></kbd> 142 <br /> 143 <strong><?php _e('Link Category:','zelist'); ?></strong> 144 <kbd><?php echo get_option('home')."/$slug/<link_category_name>/"; ?></kbd> 145 <br /> 146 <strong><?php _e('Link Tag:','zelist'); ?></strong> 147 <kbd><?php echo get_option('home')."/$slug/tag/<tag_name>.htm"; ?></kbd> 148 <br /> 149 <span class="setting-description"><?php printf(__('To change the "%s" part, please <a href="%s">change the slug of zeList root page</a>','zelist'),$slug,get_edit_post_link(get_option('zelist_root'))); ?></span> 150 151 152 </td> 153 </tr> 154 155 <tr id="zelist_rewrite_prefix" valign="top"> 156 <th scope="row"><label for="zelist_rewrite_prefix"><?php _e('Nice URLs prefix','zelist'); ?></label></th> 157 <td> 158 <?php _e('Full customisation planned for version 0.9','zelist'); ?> 159 <br /> 160 161 <strong><?php _e('Link prefix:','zelist'); ?></strong> 162 <strike><?php printf(__('You can use these tags: %s','zelist'),'%link_id% %link_name% %link_category_name% %link_author%')?></strike> 163 <br /> 164 <kbd><?php echo get_permalink(get_option('zelist_root')); ?>/</kbd> 165 <input type="text" name="settings[zelist_rewrite_prefix_link]" value="<?php echo get_option('zelist_rewrite_prefix_link'); ?>" /> 166 <kbd>/</kbd> 167 <input type="text" size="50" name="settings[zelist_rewrite_link_structure]" value="%link_category_name%/%link_id%-%link_name%.htm" disabled="disabled" /> 168 <br /> 169 <strong><?php _e('Link tag prefix:','zelist'); ?></strong> 170 <strike><?php printf(__('You can use these tags: %s','zelist'),'%link_tag% ')?></strike> 171 <br /> 172 <kbd><?php echo get_permalink(get_option('zelist_root')); ?>/</kbd> 173 <input type="text" name="settings[zelist_rewrite_prefix_link_tag]" value="<?php echo get_option('zelist_rewrite_prefix_link_tag'); ?>" /> 174 <kbd>/</kbd> 175 <input type="text" size="50" name="settings[zelist_rewrite_link_tag_structure]" value="%link_tag%/" disabled="disabled" /> 176 177 <br /> 178 <strong><?php _e('Link category prefix:','zelist'); ?></strong> 179 <strike><?php printf(__('You can use these tags: %s','zelist'),'%link_category% %link_category_name%')?></strike> 180 <br /> 181 <kbd><?php echo get_permalink(get_option('zelist_root')); ?>/</kbd> 182 <input type="text" name="settings[zelist_rewrite_prefix_link_category]" value="<?php echo get_option('zelist_rewrite_prefix_link_category'); ?>" /> 183 <kbd>/</kbd> 184 <input type="text" size="50" name="settings[zelist_rewrite_category_link_structure]" value="%link_category_name%" disabled="disabled" /> 185 <kbd>/</kbd> 186 </td> 187 </tr> 188 189 190 </table> 191 </div> 192 193 <div id="submission" class="div_settings"> 194 <h3><?php _e('Submission','zelist'); ?></h3> 195 <table class="form-table"> 196 197 198 <tr valign="top"> 199 <th scope="row"><label for="default_link_category"><?php _e('Default link category','zelist'); ?></label></th> 200 <td><?php 201 $args = array('name' => 'settings[default_link_category]', 'type' => 'link', 'hide_empty' => 0, 'orderby' => 'name', 'hierarchical' => true); 202 $args['selected'] = (isset($_POST['cat'])) ? $_POST['cat'] : get_option('default_link_category'); 203 wp_dropdown_categories($args); ?></td> 204 </tr> 205 <tr valign="top"> 206 <th scope="row"><?php _e('Description','zelist'); ?></th> 207 <td> 208 <?php 209 printf( 210 __('From %s to %s characters','zelist'), 211 '<input type="text" name="settings[zelist_description_min_length]" id="zelist_description_min_length" size="4" value="' 212 . get_option('zelist_description_min_length').'" />', 213 '<input type="text" name="settings[zelist_description_max_length]" id="zelist_description_max_length" size="4" value="' 214 . get_option('zelist_description_max_length').'" />'); 215 ?> 216 </td> 217 </tr> 218 <tr valign="top"> 219 <th scope="row"><label for="zelist_multiple_categories"><?php _e('Allow multiple categories','zelist'); ?></label></th> 220 <td> 221 <input type="radio" name="settings[zelist_allow_multiple_categories]" value="0" <?php checked(0,get_option('zelist_allow_multiple_categories')); ?> /><?php _e('No (default)','zelist'); ?> 222 <br /><input type="radio" name="settings[zelist_allow_multiple_categories]" value="1" <?php checked(1,get_option('zelist_allow_multiple_categories')); ?>/><?php _e('Yes','zelist'); ?> 223 </td> 224 </tr> 225 226 227 <tr valign="top"> 228 <th scope="row"><label for="zelist_banreasons"><?php _e('Ban reasons','zelist') ?></label></th> 229 <td><script type="text/javascript">function deletereason(reason){ jQuery(".zelist_ban_reason_"+reason).remove(); } </script> 230 231 <fieldset class="small"> 232 <legend class="hidden"><?php _e('Ban reasons','zelist') ?></legend> 233 <?php 234 $ban_reasons = array(); 235 $ban_reasons = get_option('zelist_banreasons'); 236 237 foreach($ban_reasons as $reason => $label) : 238 if(!$reason) continue; 239 if(!$label) $label = banreason_label($reason); 240 ?> 241 <span class="zelist_ban_reason_<?php echo $reason; ?>"> 242 <label id="zelist_ban_reason_<?php echo $reason; ?>" for="zelist_ban_reason_<?php echo $reason; ?>"></label> 243 <input type="hidden" name="zelist_banreasons[]" size="20" id="zelist_ban_reason_<?php echo $reason; ?>" value="<?php echo $reason; ?>" /> <input type="text" name="dummy" style="display: inline;" disabled="disabled" size="20" value="<?php echo $reason; ?>" /> 244 <input name="zelist_banlabels[]" type="text" size="40" id="zelist_ban_label_<?php echo $reason; ?>" value="<?php echo stripslashes($label); ?>" /> 245 <?php $confirm = sprintf(__('You are about to delete the \\\'%s\\\' edition reason, please confirm or cancel','zelist'),addslashes($label)); ?> 246 247 <a onclick="if (confirm('<?php echo $confirm; ?>')) { deletereason('<?php echo $reason; ?>'); return true; } return false;"><?php _e('Delete'); ?></a> 248 </span> 249 <br /> 250 <?php endforeach; ?> 251 <p id="zelist_ban_reason_add" class="hidden"></p> 252 <a id="add_ban_reason" href="#"><?php _e('Add a reason','zelist'); ?></a> 253 </fieldset> 254 </td> 255 </tr> 256 257 </table> 258 </div> 259 260 <div id="template" class="div_settings"> 261 <h3><?php _e('Design'); ?></h3> 262 <table class="form-table"> 263 <tr valign="top"> 264 <th scope="row"><label for="zelist_breadcrumbs_show_home"><?php _e('Show Directory root in Breadcrumbs','zelist'); ?></label></th> 265 <td> 266 <input type="radio" name="settings[zelist_breadcrumbs_show_home]" value="0" <?php checked(0,get_option('zelist_breadcrumbs_show_home')); ?> /><?php _e('No (default)','zelist'); ?> 267 <span class="setting-description"><?php _e('Breadcrumbs will look like Category > SubCategory.','zelist'); ?></span> 268 <br /><input type="radio" name="settings[zelist_breadcrumbs_show_home]" value="1" <?php checked(1,get_option('zelist_breadcrumbs_show_home')); ?>/><?php _e('Yes','zelist'); ?> 269 <span class="setting-description"><?php _e('Breadcrumbs will look like <strong>Home ></strong> Category > SubCategory.','zelist'); ?></span> 270 </td> 271 </tr> 272 273 </table> 274 </div> 275 276 <?php do_action('zelist_settings_settings'); ?> 277 278 <input type="hidden" name="action" value="update" /> 279 <p class="submit"> 280 <input type="submit" name="Submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> 281 </form> 282 </div>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Sat May 30 23:51:06 2009 | Cross-referenced by PHPXref 0.7 |