function prepare_items() { global $status, $themes, $totals, $page, $orderby, $order, $s; nxt_reset_vars(array('orderby', 'order', 's')); $themes = array('all' => apply_filters('all_themes', get_themes()), 'search' => array(), 'enabled' => array(), 'disabled' => array(), 'upgrade' => array()); $site_allowed_themes = get_site_allowed_themes(); if (!$this->is_site_themes) { $allowed_themes = $site_allowed_themes; $themes_per_page = $this->get_items_per_page('themes_network_per_page'); } else { $allowed_themes = nxtmu_get_blog_allowedthemes($this->site_id); $themes_per_page = $this->get_items_per_page('site_themes_network_per_page'); } $current = get_site_transient('update_themes'); foreach ((array) $themes['all'] as $key => $theme) { $theme_key = $theme['Stylesheet']; if (isset($allowed_themes[$theme_key])) { $themes['all'][$key]['enabled'] = true; $themes['enabled'][$key] = $themes['all'][$key]; } else { $themes['all'][$key]['enabled'] = false; $themes['disabled'][$key] = $themes['all'][$key]; } if (isset($current->response[$theme['Template']])) { $themes['upgrade'][$key] = $themes['all'][$key]; } if ($this->is_site_themes && isset($site_allowed_themes[$theme_key])) { unset($themes['all'][$key]); unset($themes['enabled'][$key]); unset($themes['disabled'][$key]); } } if (!current_user_can('update_themes') || $this->is_site_themes) { $themes['upgrade'] = array(); } if ($s) { $status = 'search'; $themes['search'] = array_filter($themes['all'], array(&$this, '_search_callback')); } $totals = array(); foreach ($themes as $type => $list) { $totals[$type] = count($list); } if (empty($themes[$status]) && !in_array($status, array('all', 'search'))) { $status = 'all'; } $this->items = $themes[$status]; $total_this_page = $totals[$status]; if ($orderby) { $orderby = ucfirst($orderby); $order = strtoupper($order); uasort($this->items, array(&$this, '_order_callback')); } $start = ($page - 1) * $themes_per_page; if ($total_this_page > $themes_per_page) { $this->items = array_slice($this->items, $start, $themes_per_page); } $this->set_pagination_args(array('total_items' => $total_this_page, 'per_page' => $themes_per_page)); }
function handle_repair_panel() { global $action, $page, $M_options; nxt_reset_vars(array('action', 'page')); ?> <div class='wrap nosubsub'> <div class="icon32" id="icon-tools"><br></div> <h2><?php _e('Repair Membership', 'membership'); ?> </h2> <?php if (isset($_GET['msg'])) { echo '<div id="message" class="updated fade"><p>' . $messages[(int) $_GET['msg']] . '</p></div>'; $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); } ?> <p><?php _e('If you are having problems with your membership site, or have recently upgraded and are seeing strange behaviour then try the membership check below to see if there are any issues with your table structure. Click on the repair button if you want to repair any issues found (back up your database first).', 'membership'); ?> </p> <p> <?php echo "<a href='" . nxt_nonce_url("?page=" . $page . "&verify=yes", 'verify-membership') . "' class='button'>" . __('Verify Membership Tables', 'membership') . "</a> "; ?> <?php echo "<a href='" . nxt_nonce_url("?page=" . $page . "&repair=yes", 'repair-membership') . "' class='button'>" . __('Repair Membership Tables', 'membership') . "</a>"; ?> </p> <?php if (isset($_GET['verify'])) { check_admin_referer('verify-membership'); include_once membership_dir('membershipincludes/classes/upgrade.php'); ?> <p><strong><?php _e('Verifying', 'membership'); ?> </strong></p> <?php M_verify_tables(); } if (isset($_GET['repair'])) { check_admin_referer('repair-membership'); include_once membership_dir('membershipincludes/classes/upgrade.php'); ?> <p><strong><?php _e('Verifying and Repairing', 'membership'); ?> </strong></p> <?php M_repair_tables(); } ?> </div> <!-- wrap --> <?php }
function __construct() { global $post_type, $taxonomy, $tax; nxt_reset_vars(array('action', 'taxonomy', 'post_type')); if (empty($taxonomy)) { $taxonomy = 'post_tag'; } if (!taxonomy_exists($taxonomy)) { nxt_die(__('Invalid taxonomy')); } $tax = get_taxonomy($taxonomy); if (empty($post_type) || !in_array($post_type, get_post_types(array('show_ui' => true)))) { $post_type = 'post'; } parent::__construct(array('plural' => 'tags', 'singular' => 'tag')); }
function prepare_items() { global $cat_id, $s, $orderby, $order; nxt_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'orderby', 'order', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]', 's')); $args = array('hide_invisible' => 0, 'hide_empty' => 0); if ('all' != $cat_id) { $args['category'] = $cat_id; } if (!empty($s)) { $args['search'] = $s; } if (!empty($orderby)) { $args['orderby'] = $orderby; } if (!empty($order)) { $args['order'] = $order; } $this->items = get_bookmarks($args); }
unset($response); } unset($c); } } require_once ABSPATH . 'nxt-admin/includes/admin.php'; auth_redirect(); nocache_headers(); // Schedule trash collection if (!nxt_next_scheduled('nxt_scheduled_delete') && !defined('nxt_INSTALLING')) { nxt_schedule_event(time(), 'daily', 'nxt_scheduled_delete'); } set_screen_options(); $date_format = get_option('date_format'); $time_format = get_option('time_format'); nxt_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'text', 'trackback', 'pingback')); nxt_enqueue_script('common'); nxt_enqueue_script('jquery-color'); $editing = false; if (isset($_GET['page'])) { $plugin_page = stripslashes($_GET['page']); $plugin_page = plugin_basename($plugin_page); } if (isset($_REQUEST['post_type']) && post_type_exists($_REQUEST['post_type'])) { $typenow = $_REQUEST['post_type']; } else { $typenow = ''; } if (isset($_REQUEST['taxonomy']) && taxonomy_exists($_REQUEST['taxonomy'])) { $taxnow = $_REQUEST['taxonomy']; } else {
<?php /** * Edit post administration panel. * * Manage Post actions: post, edit, delete, etc. * * @package NXTClass * @subpackage Administration */ /** NXTClass Administration Bootstrap */ require_once './admin.php'; $parent_file = 'edit.php'; $submenu_file = 'edit.php'; nxt_reset_vars(array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder')); if (isset($_GET['post'])) { $post_id = $post_ID = (int) $_GET['post']; } elseif (isset($_POST['post_ID'])) { $post_id = $post_ID = (int) $_POST['post_ID']; } else { $post_id = $post_ID = 0; } $post = $post_type = $post_type_object = null; if ($post_id) { $post = get_post($post_id); } if ($post) { $post_type = $post->post_type; $post_type_object = get_post_type_object($post_type); } /**
function prepare_items() { include ABSPATH . 'nxt-admin/includes/theme-install.php'; global $tabs, $tab, $paged, $type, $term, $theme_field_defaults; nxt_reset_vars(array('tab')); $paged = $this->get_pagenum(); $per_page = 36; // These are the tabs which are shown on the page, $tabs = array(); $tabs['dashboard'] = __('Search'); if ('search' == $tab) { $tabs['search'] = __('Search Results'); } $tabs['upload'] = __('Upload'); $tabs['featured'] = _x('Featured', 'Theme Installer'); //$tabs['popular'] = _x( 'Popular','Theme Installer' ); $tabs['new'] = _x('Newest', 'Theme Installer'); $tabs['updated'] = _x('Recently Updated', 'Theme Installer'); $nonmenu_tabs = array('theme-information'); // Valid actions to perform which do not have a Menu item. $tabs = apply_filters('install_themes_tabs', $tabs); $nonmenu_tabs = apply_filters('install_themes_nonmenu_tabs', $nonmenu_tabs); // If a non-valid menu tab has been selected, And its not a non-menu action. if (empty($tab) || !isset($tabs[$tab]) && !in_array($tab, (array) $nonmenu_tabs)) { $tab = key($tabs); } $args = array('page' => $paged, 'per_page' => $per_page, 'fields' => $theme_field_defaults); switch ($tab) { case 'search': $type = isset($_REQUEST['type']) ? stripslashes($_REQUEST['type']) : ''; $term = isset($_REQUEST['s']) ? stripslashes($_REQUEST['s']) : ''; switch ($type) { case 'tag': $terms = explode(',', $term); $terms = array_map('trim', $terms); $terms = array_map('sanitize_title_with_dashes', $terms); $args['tag'] = $terms; break; case 'term': $args['search'] = $term; break; case 'author': $args['author'] = $term; break; } if (!empty($_POST['features'])) { $terms = $_POST['features']; $terms = array_map('trim', $terms); $terms = array_map('sanitize_title_with_dashes', $terms); $args['tag'] = $terms; $_REQUEST['s'] = implode(',', $terms); $_REQUEST['type'] = 'tag'; } add_action('install_themes_table_header', 'install_theme_search_form'); break; case 'featured': //case 'popular': //case 'popular': case 'new': case 'updated': $args['browse'] = $tab; break; default: $args = false; } if (!$args) { return; } $api = themes_api('query_themes', $args); if (is_nxt_error($api)) { nxt_die($api->get_error_message() . '</p> <p><a href="#" onclick="document.location.reload(); return false;">' . __('Try again') . '</a>'); } $this->items = $api->themes; $this->set_pagination_args(array('total_items' => $api->info['results'], 'per_page' => $per_page)); }
<?php /** * NXTClass Options Header. * * Resets variables: 'action', 'standalone', and 'option_group_id'. Displays * updated message, if updated variable is part of the URL query. * * @package NXTClass * @subpackage Administration */ nxt_reset_vars(array('action', 'standalone', 'option_group_id')); if (isset($_GET['updated']) && isset($_GET['page'])) { // For backwards compat with plugins that don't use the Settings API and just set updated=1 in the redirect add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated'); } settings_errors();
<?php /** * Media management action handler. * * @package NXTClass * @subpackage Administration */ /** Load NXTClass Administration Bootstrap */ require_once './admin.php'; $parent_file = 'upload.php'; $submenu_file = 'upload.php'; nxt_reset_vars(array('action')); switch ($action) { case 'editattachment': $attachment_id = (int) $_POST['attachment_id']; check_admin_referer('media-form'); if (!current_user_can('edit_post', $attachment_id)) { nxt_die(__('You are not allowed to edit this attachment.')); } $errors = media_upload_form_handler(); if (empty($errors)) { $location = 'media.php'; if ($referer = nxt_get_original_referer()) { if (false !== strpos($referer, 'upload.php') || url_to_postid($referer) == $attachment_id) { $location = $referer; } } if (false !== strpos($location, 'upload.php')) { $location = remove_query_arg('message', $location); $location = add_query_arg('posted', $attachment_id, $location);
function prepare_items() { global $status, $plugins, $totals, $page, $orderby, $order, $s; nxt_reset_vars(array('orderby', 'order', 's')); $plugins = array('all' => apply_filters('all_plugins', get_plugins()), 'search' => array(), 'active' => array(), 'inactive' => array(), 'recently_activated' => array(), 'upgrade' => array(), 'mustuse' => array(), 'dropins' => array()); $screen = get_current_screen(); if (!is_multisite() || $screen->is_network && current_user_can('manage_network_plugins')) { if (apply_filters('show_advanced_plugins', true, 'mustuse')) { $plugins['mustuse'] = get_mu_plugins(); } if (apply_filters('show_advanced_plugins', true, 'dropins')) { $plugins['dropins'] = get_dropins(); } $current = get_site_transient('update_plugins'); foreach ((array) $plugins['all'] as $plugin_file => $plugin_data) { if (isset($current->response[$plugin_file])) { $plugins['upgrade'][$plugin_file] = $plugin_data; } } } set_transient('plugin_slugs', array_keys($plugins['all']), 86400); $recently_activated = get_option('recently_activated', array()); $one_week = 7 * 24 * 60 * 60; foreach ($recently_activated as $key => $time) { if ($time + $one_week < time()) { unset($recently_activated[$key]); } } update_option('recently_activated', $recently_activated); foreach ((array) $plugins['all'] as $plugin_file => $plugin_data) { // Filter into individual sections if (is_multisite() && is_network_only_plugin($plugin_file) && !$screen->is_network) { unset($plugins['all'][$plugin_file]); } elseif (is_plugin_active_for_network($plugin_file) && !$screen->is_network) { unset($plugins['all'][$plugin_file]); } elseif (is_multisite() && is_network_only_plugin($plugin_file) && !current_user_can('manage_network_plugins')) { $plugins['network'][$plugin_file] = $plugin_data; } elseif (!$screen->is_network && is_plugin_active($plugin_file) || $screen->is_network && is_plugin_active_for_network($plugin_file)) { $plugins['active'][$plugin_file] = $plugin_data; } else { if (!$screen->is_network && isset($recently_activated[$plugin_file])) { // Was the plugin recently activated? $plugins['recently_activated'][$plugin_file] = $plugin_data; } $plugins['inactive'][$plugin_file] = $plugin_data; } } if (!current_user_can('update_plugins')) { $plugins['upgrade'] = array(); } if ($s) { $status = 'search'; $plugins['search'] = array_filter($plugins['all'], array(&$this, '_search_callback')); } $totals = array(); foreach ($plugins as $type => $list) { $totals[$type] = count($list); } if (empty($plugins[$status]) && !in_array($status, array('all', 'search'))) { $status = 'all'; } $this->items = array(); foreach ($plugins[$status] as $plugin_file => $plugin_data) { // Translate, Don't Apply Markup, Sanitize HTML $this->items[$plugin_file] = _get_plugin_data_markup_translate($plugin_file, $plugin_data, false, true); } $total_this_page = $totals[$status]; if ($orderby) { $orderby = ucfirst($orderby); $order = strtoupper($order); uasort($this->items, array(&$this, '_order_callback')); } $plugins_per_page = $this->get_items_per_page(str_replace('-', '_', $screen->id . '_per_page'), 999); $start = ($page - 1) * $plugins_per_page; if ($total_this_page > $plugins_per_page) { $this->items = array_slice($this->items, $start, $plugins_per_page); } $this->set_pagination_args(array('total_items' => $total_this_page, 'per_page' => $plugins_per_page)); }
<?php /** * Add Link Administration Screen. * * @package NXTClass * @subpackage Administration */ /** Load NXTClass Administration Bootstrap */ require_once './admin.php'; if (!current_user_can('manage_links')) { nxt_die(__('You do not have sufficient permissions to add links to this site.')); } $title = __('Add New Link'); $parent_file = 'link-manager.php'; nxt_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]')); nxt_enqueue_script('link'); nxt_enqueue_script('xfn'); $link = get_default_link_to_edit(); include './edit-link-form.php'; require './admin-footer.php';
function transactions() { global $page, $action, $type; nxt_reset_vars(array('type')); if (empty($type)) { $type = 'past'; } ?> <div class='wrap'> <div class="icon32" id="icon-plugins"><br></div> <h2><?php echo esc_html($this->title) . __(' transactions', 'membership'); ?> </h2> <ul class="subsubsub"> <li><a href="<?php echo add_query_arg('type', 'past'); ?> " class="rbutton <?php if ($type == 'past') { echo 'current'; } ?> "><?php _e('Recent transactions', 'membership'); ?> </a> | </li> <li><a href="<?php echo add_query_arg('type', 'pending'); ?> " class="rbutton <?php if ($type == 'pending') { echo 'current'; } ?> "><?php _e('Pending transactions', 'membership'); ?> </a> | </li> <li><a href="<?php echo add_query_arg('type', 'future'); ?> " class="rbutton <?php if ($type == 'future') { echo 'current'; } ?> "><?php _e('Future transactions', 'membership'); ?> </a></li> </ul> <?php if (has_action('M_gateways_transactions_' . $this->gateway)) { do_action('M_gateways_transactions_' . $this->gateway, $type); } else { $this->mytransactions($type); } ?> </div> <!-- wrap --> <?php }
<?php /** * Edit user administration panel. * * @package NXTClass * @subpackage Administration */ /** NXTClass Administration Bootstrap */ require_once './admin.php'; nxt_reset_vars(array('action', 'redirect', 'profile', 'user_id', 'nxt_http_referer')); $user_id = (int) $user_id; $current_user = nxt_get_current_user(); if (!defined('IS_PROFILE_PAGE')) { define('IS_PROFILE_PAGE', $user_id == $current_user->ID); } if (!$user_id && IS_PROFILE_PAGE) { $user_id = $current_user->ID; } elseif (!$user_id && !IS_PROFILE_PAGE) { nxt_die(__('Invalid user ID.')); } elseif (!get_userdata($user_id)) { nxt_die(__('Invalid user ID.')); } nxt_enqueue_script('user-profile'); $title = IS_PROFILE_PAGE ? __('Profile') : __('Edit User'); if (current_user_can('edit_users') && !IS_PROFILE_PAGE) { $submenu_file = 'users.php'; } else { $submenu_file = 'profile.php'; } if (current_user_can('edit_users') && !is_user_admin()) {
function handle_pings_panel() { global $action, $page, $pings; nxt_reset_vars(array('action', 'page')); switch (addslashes($action)) { case 'edit': if (!empty($_GET['ping'])) { // Make a communication $this->show_ping_edit((int) $_GET['ping']); } else { $this->show_ping_edit(false); } return; // so we don't show the list below break; case 'history': if (!empty($_GET['ping'])) { $this->handle_ping_history_panel((int) $_GET['ping']); } return; break; } $messages = array(); $messages[1] = __('Ping details updated.', 'membership'); $messages[2] = __('Ping details not updated.', 'membership'); $messages[3] = __('Ping details added.', 'membership'); $messages[4] = __('Ping details not added.', 'membership'); $messages[5] = __('Ping details deleted.', 'membership'); $messages[6] = __('Ping details not deleted.', 'membership'); $messages[7] = __('Ping details deleted.', 'membership'); ?> <div class='wrap'> <div class="icon32" id="icon-link-manager"><br></div> <h2><?php _e('Edit Pings', 'membership'); ?> </h2> <?php if (isset($_GET['msg'])) { echo '<div id="message" class="updated fade"><p>' . $messages[(int) $_GET['msg']] . '</p></div>'; $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); } //$pings = $this->get_pings(); $pings = apply_filters('M_pings_list', $pings); ?> <form method="get" action="?page=<?php echo esc_attr($page); ?> " id="posts-filter"> <input type='hidden' name='page' value='<?php echo esc_attr($page); ?> ' /> <div class="tablenav"> <div class="alignleft actions"> <select name="action"> <option selected="selected" value=""><?php _e('Bulk Actions'); ?> </option> <option value="delete"><?php _e('Delete'); ?> </option> </select> <input type="submit" class="button-secondary action" id="doaction" name="doaction" value="<?php _e('Apply'); ?> "> </div> <?php if (M_can_add_pings()) { ?> <div class="alignright actions"> <input type="button" class="button-secondary addnenxtingbutton" value="<?php _e('Add New'); ?> " name="addnewgroup"> </div> <?php } ?> <br class="clear"> </div> <div class="clear"></div> <?php nxt_original_referer_field(true, 'previous'); nxt_nonce_field('bulk-pings'); $columns = array("name" => __('Ping Name', 'membership')); $columns = apply_filters('membership_pingscolumns', $columns); ?> <table cellspacing="0" class="widefat fixed"> <thead> <tr> <th style="" class="manage-column column-cb check-column" id="cb" scope="col"><input type="checkbox"></th> <?php foreach ($columns as $key => $col) { ?> <th style="" class="manage-column column-<?php echo $key; ?> " id="<?php echo $key; ?> " scope="col"><?php echo $col; ?> </th> <?php } ?> </tr> </thead> <tfoot> <tr> <th style="" class="manage-column column-cb check-column" scope="col"><input type="checkbox"></th> <?php reset($columns); foreach ($columns as $key => $col) { ?> <th style="" class="manage-column column-<?php echo $key; ?> " id="<?php echo $key; ?> " scope="col"><?php echo $col; ?> </th> <?php } ?> </tr> </tfoot> <tbody> <?php if (!empty($pings)) { foreach ($pings as $key => $ping) { ?> <tr valign="middle" class="alternate" id="ping-<?php echo $ping->id; ?> "> <th class="check-column" scope="row"><input type="checkbox" value="<?php echo esc_attr($ping->id); ?> " name="pingcheck[]"></th> <td class="column-name"> <strong><a title="Edit <?php echo esc_attr(stripslashes($ping->pingname)); ?> " href="?page=<?php echo $page; ?> &action=edit&ping=<?php echo $ping->id; ?> " class="row-title"><?php echo esc_html(stripslashes($ping->pingname)); ?> </a></strong> <?php $actions = array(); $actions['edit'] = "<span class='edit'><a href='?page=" . $page . "&action=edit&ping=" . $ping->id . "'>" . __('Edit') . "</a></span>"; $actions['trans'] = "<span class='edit'><a href='?page=" . $page . "&action=history&ping=" . $ping->id . "'>" . __('History') . "</a></span>"; $actions['delete'] = "<span class='delete'><a href='" . nxt_nonce_url("?page=" . $page . "&action=delete&ping=" . $ping->id . "", 'delete-ping_' . $ping->id) . "'>" . __('Delete', 'membership') . "</a></span>"; ?> <br><div class="row-actions"><?php echo implode(" | ", $actions); ?> </div> </td> </tr> <?php } } else { $columncount = count($columns) + 1; ?> <tr valign="middle" class="alternate" > <td colspan="<?php echo $columncount; ?> " scope="row"><?php _e('No Pings have been set up.', 'membership'); ?> </td> </tr> <?php } ?> </tbody> </table> <div class="tablenav"> <div class="alignleft actions"> <select name="action2"> <option selected="selected" value=""><?php _e('Bulk Actions'); ?> </option> <option value="delete"><?php _e('Delete'); ?> </option> </select> <input type="submit" class="button-secondary action" id="doaction2" name="doaction2" value="Apply"> </div> <?php if (M_can_add_pings()) { ?> <div class="alignright actions"> <input type="button" class="button-secondary addnenxtingbutton" value="<?php _e('Add New'); ?> " name="addnewgroup2"> </div> <?php } ?> <br class="clear"> </div> </form> </div> <!-- wrap --> <?php }
<?php /** * Revisions administration panel. * * @package NXTClass * @subpackage Administration */ /** NXTClass Administration Bootstrap */ require_once './admin.php'; nxt_enqueue_script('list-revisions'); nxt_reset_vars(array('revision', 'left', 'right', 'action')); $revision_id = absint($revision); $left = absint($left); $right = absint($right); $redirect = 'edit.php'; switch ($action) { case 'restore': if (!($revision = nxt_get_post_revision($revision_id))) { break; } if (!current_user_can('edit_post', $revision->post_parent)) { break; } if (!($post = get_post($revision->post_parent))) { break; } // Revisions disabled and we're not looking at an autosave if ((!nxt_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions')) && !nxt_is_post_autosave($revision)) { $redirect = 'edit.php?post_type=' . $post->post_type; break;
* and there is no way to remove options via this page. It is not linked to from * anywhere else in the admin. * * This file is also the target of the forms in core and custom options pages * that use the Settings API. In this case it saves the new option values * and returns the user to their page of origin. * * @package NXTClass * @subpackage Administration */ /** NXTClass Administration Bootstrap */ require_once './admin.php'; $title = __('Settings'); $this_file = 'options.php'; $parent_file = 'options-general.php'; nxt_reset_vars(array('action', 'option_page')); $capability = 'manage_options'; if (empty($option_page)) { // This is for back compat and will eventually be removed. $option_page = 'options'; } else { $capability = apply_filters("option_page_capability_{$option_page}", $capability); } if (!current_user_can($capability)) { nxt_die(__('Cheatin’ uh?')); } // Handle admin email change requests if (is_multisite()) { if (!empty($_GET['adminhash'])) { $new_admin_details = get_option('adminhash'); $redirect = 'options-general.php?updated=false';
nxt_redirect(network_admin_url('theme-editor.php')); exit; } if (!current_user_can('edit_themes')) { nxt_die('<p>' . __('You do not have sufficient permissions to edit templates for this site.') . '</p>'); } $title = __("Edit Themes"); $parent_file = 'themes.php'; get_current_screen()->add_help_tab(array('id' => 'overview', 'title' => __('Overview'), 'content' => '<p>' . __('You can use the Theme Editor to edit the individual CSS and PHP files which make up your theme.') . '</p> <p>' . __('Begin by choosing a theme to edit from the dropdown menu and clicking Select. A list then appears of all the template files. Clicking once on any file name causes the file to appear in the large Editor box.') . '</p> <p>' . __('For PHP files, you can use the Documentation dropdown to select from functions recognized in that file. Lookup takes you to a web page with reference material about that particular function.') . '</p> <p>' . __('After typing in your edits, click Update File.') . '</p> <p>' . __('<strong>Advice:</strong> think very carefully about your site crashing if you are live-editing the theme currently in use.') . '</p> <p>' . __('Upgrading to a newer version of the same theme will override changes made here. To avoid this, consider creating a <a href="http://codex.nxtclass.org/Child_Themes" target="_blank">child theme</a> instead.') . '</p>' . (is_network_admin() ? '<p>' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '</p>' : ''))); get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Theme_Development" target="_blank">Documentation on Theme Development</a>') . '</p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Using_Themes" target="_blank">Documentation on Using Themes</a>') . '</p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Editing_Files" target="_blank">Documentation on Editing Files</a>') . '</p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Template_Tags" target="_blank">Documentation on Template Tags</a>') . '</p>' . '<p>' . __('<a href="http://nxtclass.org/support/" target="_blank">Support Forums</a>') . '</p>'); nxt_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme', 'dir')); $themes = get_themes(); if (empty($theme)) { $theme = get_current_theme(); } else { $theme = stripslashes($theme); } if (!isset($themes[$theme])) { nxt_die(__('The requested theme does not exist.')); } $allowed_files = array_merge($themes[$theme]['Stylesheet Files'], $themes[$theme]['Template Files']); if (empty($file)) { if (false !== array_search($themes[$theme]['Stylesheet Dir'] . '/style.css', $allowed_files)) { $file = $themes[$theme]['Stylesheet Dir'] . '/style.css'; } else { $file = $allowed_files[0];
/** * Handle OpenID profile management. */ function openid_profile_management() { global $action; nxt_reset_vars(array('action')); switch ($action) { case 'add': check_admin_referer('openid-add_openid'); $user = nxt_get_current_user(); $auth_request = openid_begin_consumer($_POST['openid_identifier']); $userid = get_user_by_openid($auth_request->endpoint->claimed_id); if ($userid) { global $error; if ($user->ID == $userid) { $error = __('You already have this OpenID!', 'openid'); } else { $error = __('This OpenID is already associated with another user.', 'openid'); } return; } $finish_url = admin_url(current_user_can('edit_users') ? 'users.php' : 'profile.php'); $finish_url = add_query_arg('page', $_REQUEST['page'], $finish_url); openid_start_login($_POST['openid_identifier'], 'verify', $finish_url); break; case 'delete': openid_profile_delete_openids($_REQUEST['delete']); break; default: if (array_key_exists('message', $_REQUEST)) { $message = $_REQUEST['message']; $messages = array('', __('Unable to authenticate OpenID.', 'openid'), __('OpenID assertion successful, but this URL is already associated with another user on this blog.', 'openid'), __('Added association with OpenID.', 'openid')); if (is_numeric($message)) { $message = $messages[$message]; } else { $message = htmlentities2($message); } $message = __($message, 'openid'); if (array_key_exists('update_url', $_REQUEST) && $_REQUEST['update_url']) { $message .= '<br />' . __('<strong>Note:</strong> For security reasons, your profile URL has been updated to match your OpenID.', 'openid'); } openid_message($message); openid_status($_REQUEST['status']); } break; } }