/**
  * register_post_types()
  *
  * Static function to register the assignments post types, taxonomies and capabilities.
  */
 function register_post_types()
 {
     $assignment_post_def = array('label' => __('Assignments', 'bpsp'), 'singular_label' => __('Assignment', 'bpsp'), 'description' => __('BuddyPress ScholarPress Courseware Assignments', 'bpsp'), 'public' => BPSP_DEBUG, 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_ui' => BPSP_DEBUG, 'capability_type' => 'assignment', 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array('title', 'editor', 'author', 'custom-fields'), 'taxonomies' => array('course_id', 'group_id'));
     if (!register_post_type('assignment', $assignment_post_def)) {
         nxt_die(__('BuddyPress Courseware error while registering assignment post type.', 'bpsp'));
     }
 }
Example #2
0
 /**
  * register_post_types()
  *
  * Static function to register the responses post types, taxonomies and capabilities.
  */
 function register_post_types()
 {
     $response_post_def = array('label' => __('Responses', 'bpsp'), 'singular_label' => __('Response', 'bpsp'), 'description' => __('BuddyPress ScholarPress Courseware Responses', 'bpsp'), 'public' => BPSP_DEBUG, 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_ui' => BPSP_DEBUG, 'capability_type' => 'response', 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array('title', 'editor', 'author'));
     if (!register_post_type('response', $response_post_def)) {
         nxt_die(__('BuddyPress Courseware error while registering response post type.', 'bpsp'));
     }
 }
Example #3
0
/**
 * Update a comment with values provided in $_POST.
 *
 * @since 2.0.0
 */
function edit_comment()
{
    if (!current_user_can('edit_comment', (int) $_POST['comment_ID'])) {
        nxt_die(__('You are not allowed to edit comments on this post.'));
    }
    $_POST['comment_author'] = $_POST['newcomment_author'];
    $_POST['comment_author_email'] = $_POST['newcomment_author_email'];
    $_POST['comment_author_url'] = $_POST['newcomment_author_url'];
    $_POST['comment_approved'] = $_POST['comment_status'];
    $_POST['comment_content'] = $_POST['content'];
    $_POST['comment_ID'] = (int) $_POST['comment_ID'];
    foreach (array('aa', 'mm', 'jj', 'hh', 'mn') as $timeunit) {
        if (!empty($_POST['hidden_' . $timeunit]) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit]) {
            $_POST['edit_date'] = '1';
            break;
        }
    }
    if (!empty($_POST['edit_date'])) {
        $aa = $_POST['aa'];
        $mm = $_POST['mm'];
        $jj = $_POST['jj'];
        $hh = $_POST['hh'];
        $mn = $_POST['mn'];
        $ss = $_POST['ss'];
        $jj = $jj > 31 ? 31 : $jj;
        $hh = $hh > 23 ? $hh - 24 : $hh;
        $mn = $mn > 59 ? $mn - 60 : $mn;
        $ss = $ss > 59 ? $ss - 60 : $ss;
        $_POST['comment_date'] = "{$aa}-{$mm}-{$jj} {$hh}:{$mn}:{$ss}";
    }
    nxt_update_comment($_POST);
}
Example #4
0
/**
 * Determines if the available space defined by the admin has been exceeded by the user.
 *
 * @deprecated 3.0.0
 * @see is_upload_space_available()
 */
function nxtmu_checkAvailableSpace()
{
    _deprecated_function(__FUNCTION__, '3.0', 'is_upload_space_available()');
    if (!is_upload_space_available()) {
        nxt_die(__('Sorry, you must delete files before you can upload any more.'));
    }
}
 /**
  * register_post_types()
  *
  * Static function to register the lecture post type, taxonomies and capabilities.
  */
 function register_post_types()
 {
     $lecture_post_def = array('label' => __('Lecture', 'bpsp'), 'singular_label' => __('Lecture', 'bpsp'), 'description' => __('BuddyPress ScholarPress Courseware Lectures', 'bpsp'), 'public' => BPSP_DEBUG, 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_ui' => BPSP_DEBUG, 'capability_type' => 'lecture', 'hierarchical' => true, 'rewrite' => false, 'query_var' => false, 'supports' => array('title', 'editor', 'author', 'page-attributes'), 'taxonomies' => array('group_id'));
     if (!register_post_type('lecture', $lecture_post_def)) {
         nxt_die(__('BuddyPress Courseware error while registering lecture post type.', 'bpsp'));
     }
     $course_rel_def = array('public' => BPSP_DEBUG, 'show_ui' => BPSP_DEBUG, 'hierarchical' => false, 'label' => __('Course ID', 'bpsp'), 'query_var' => 'course_id', 'rewrite' => false, 'capabilities' => array('manage_terms' => 'manage_course_id', 'edit_terms' => 'manage_course_id', 'delete_terms' => 'manage_course_id', 'assign_terms' => 'edit_courses'));
     register_taxonomy('course_id', array('lecture'), $course_rel_def);
     if (!get_taxonomy('course_id')) {
         nxt_die(__('BuddyPress Courseware error while registering course taxonomy.', 'bpsp'));
     }
 }
 /**
  * register_post_types()
  *
  * Static function to register the assignments post types, taxonomies and capabilities.
  */
 function register_post_types()
 {
     $grade_post_def = array('label' => __('Gradebooks', 'bpsp'), 'singular_label' => __('Gradebook', 'bpsp'), 'description' => __('BuddyPress ScholarPress Courseware Gradebook', 'bpsp'), 'public' => BPSP_DEBUG, 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_ui' => BPSP_DEBUG, 'capability_type' => 'gradebook', 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array('author', 'custom-fields'), 'taxonomies' => array('group_id'));
     if (!register_post_type('gradebook', $grade_post_def)) {
         nxt_die(__('BuddyPress Courseware error while registering grade post type.', 'bpsp'));
     }
     $assignment_rel_def = array('public' => BPSP_DEBUG, 'show_ui' => BPSP_DEBUG, 'hierarchical' => false, 'label' => __('Assignment ID', 'bpsp'), 'query_var' => 'assignment_id', 'rewrite' => false, 'capabilities' => array('manage_terms' => 'manage_assignment_id', 'edit_terms' => 'manage_assignment_id', 'delete_terms' => 'manage_assignment_id', 'assign_terms' => 'edit_gradebooks'));
     register_taxonomy('assignment_id', array('gradebook'), $assignment_rel_def);
     if (!get_taxonomy('assignment_id')) {
         nxt_die(__('BuddyPress Courseware error while registering assignment taxonomy.', 'bpsp'));
     }
 }
 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'));
 }
Example #8
0
 /**
  * register_post_types()
  *
  * Static function to register the bibliography post types and capabilities.
  */
 function register_post_types()
 {
     $bib_post_def = array('label' => __('Bibliography', 'bpsp'), 'singular_label' => __('Bibliography', 'bpsp'), 'description' => __('BuddyPress ScholarPress Courseware Bibliography', 'bpsp'), 'public' => BPSP_DEBUG, 'publicly_queryable' => false, 'exclude_from_search' => true, 'show_ui' => BPSP_DEBUG, 'capability_type' => 'bib', 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array('title', 'custom-fields'));
     if (!register_post_type('bib', $bib_post_def)) {
         nxt_die(__('BuddyPress Courseware error while registering bibliography post type.', 'bpsp'));
     }
     /**
      * Dummy post definition for storing the bibs entries as custom-fields
      */
     $bibdb_def = array('post_title' => 'BIBSDB', 'post_status' => 'draft', 'post_type' => 'bib');
     if (!get_posts($bibdb_def)) {
         $bibs_id = nxt_insert_post($bibdb_def);
         if (!$bibs_id) {
             nxt_die('BuddyPress Courseware error while creating bibliography database.', 'bpsp');
         }
     }
 }
Example #9
0
/**
 * Update or insert a link using values provided in $_POST.
 *
 * @since 2.0.0
 *
 * @param int $link_id Optional. ID of the link to edit.
 * @return int|nxt_Error Value 0 or nxt_Error on failure. The link ID on success.
 */
function edit_link($link_id = 0)
{
    if (!current_user_can('manage_links')) {
        nxt_die(__('Cheatin’ uh?'));
    }
    $_POST['link_url'] = esc_html($_POST['link_url']);
    $_POST['link_url'] = esc_url($_POST['link_url']);
    $_POST['link_name'] = esc_html($_POST['link_name']);
    $_POST['link_image'] = esc_html($_POST['link_image']);
    $_POST['link_rss'] = esc_url($_POST['link_rss']);
    if (!isset($_POST['link_visible']) || 'N' != $_POST['link_visible']) {
        $_POST['link_visible'] = 'Y';
    }
    if (!empty($link_id)) {
        $_POST['link_id'] = $link_id;
        return nxt_update_link($_POST);
    } else {
        return nxt_insert_link($_POST);
    }
}
Example #10
0
            }
            $help = '<p><strong>' . __('For more information:') . '</strong></p>';
            if ('category' == $taxonomy) {
                $help .= '<p>' . __('<a href="http://codex.nxtclass.org/Posts_Categories_Screen" target="_blank">Documentation on Categories</a>') . '</p>';
            } elseif ('link_category' == $taxonomy) {
                $help .= '<p>' . __('<a href="http://codex.nxtclass.org/Links_Link_Categories_Screen" target="_blank">Documentation on Link Categories</a>') . '</p>';
            } else {
                $help .= '<p>' . __('<a href="http://codex.nxtclass.org/Posts_Tags_Screen" target="_blank">Documentation on Tags</a>') . '</p>';
            }
            $help .= '<p>' . __('<a href="http://nxtclass.org/support/" target="_blank">Support Forums</a>') . '</p>';
            get_current_screen()->set_help_sidebar($help);
            unset($help);
        }
        require_once 'admin-header.php';
        if (!current_user_can($tax->cap->edit_terms)) {
            nxt_die(__('You are not allowed to edit this item.'));
        }
        $messages[1] = __('Item added.');
        $messages[2] = __('Item deleted.');
        $messages[3] = __('Item updated.');
        $messages[4] = __('Item not added.');
        $messages[5] = __('Item not updated.');
        $messages[6] = __('Items deleted.');
        ?>

<div class="wrap nosubsub">
<?php 
        screen_icon();
        ?>
<h2><?php 
        echo esc_html($title);
Example #11
0
function _show_post_preview()
{
    if (isset($_GET['preview_id']) && isset($_GET['preview_nonce'])) {
        $id = (int) $_GET['preview_id'];
        if (false == nxt_verify_nonce($_GET['preview_nonce'], 'post_preview_' . $id)) {
            nxt_die(__('You do not have permission to preview drafts.'));
        }
        add_filter('the_preview', '_set_preview');
    }
}
Example #12
0
 /**
  * Wraps errors in a nice header and footer and dies.
  *
  * Will not die if nxtdb::$show_errors is true
  *
  * @since 1.5.0
  *
  * @param string $message The Error message
  * @param string $error_code Optional. A Computer readable string to identify the error.
  * @return false|void
  */
 function bail($message, $error_code = '500')
 {
     if (!$this->show_errors) {
         if (class_exists('nxt_Error')) {
             $this->error = new nxt_Error($error_code, $message);
         } else {
             $this->error = $message;
         }
         return false;
     }
     nxt_die($message);
 }
Example #13
0
/**
 * Display theme information in dialog box form.
 *
 * @since 2.8.0
 */
function install_theme_information()
{
    //TODO: This function needs a LOT of UI work :)
    global $tab, $themes_allowedtags;
    $api = themes_api('theme_information', array('slug' => stripslashes($_REQUEST['theme'])));
    if (is_nxt_error($api)) {
        nxt_die($api);
    }
    // Sanitize HTML
    foreach ((array) $api->sections as $section_name => $content) {
        $api->sections[$section_name] = nxt_kses($content, $themes_allowedtags);
    }
    foreach (array('version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug') as $key) {
        if (isset($api->{$key})) {
            $api->{$key} = nxt_kses($api->{$key}, $themes_allowedtags);
        }
    }
    iframe_header(__('Theme Install'));
    if (empty($api->download_link)) {
        echo '<div id="message" class="error"><p>' . __('<strong>ERROR:</strong> This theme is currently not available. Please try again later.') . '</p></div>';
        iframe_footer();
        exit;
    }
    if (!empty($api->tested) && version_compare($GLOBALS['nxt_version'], $api->tested, '>')) {
        echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has <strong>not been tested</strong> with your current version of NXTClass.') . '</p></div>';
    } else {
        if (!empty($api->requires) && version_compare($GLOBALS['nxt_version'], $api->requires, '<')) {
            echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This theme has not been marked as <strong>compatible</strong> with your version of NXTClass.') . '</p></div>';
        }
    }
    // Default to a "new" theme
    $type = 'install';
    // Check to see if this theme is known to be installed, and has an update awaiting it.
    $update_themes = get_site_transient('update_themes');
    if (is_object($update_themes) && isset($update_themes->response)) {
        foreach ((array) $update_themes->response as $theme_slug => $theme_info) {
            if ($theme_slug === $api->slug) {
                $type = 'update_available';
                $update_file = $theme_slug;
                break;
            }
        }
    }
    $themes = get_themes();
    foreach ((array) $themes as $this_theme) {
        if (is_array($this_theme) && $this_theme['Stylesheet'] == $api->slug) {
            if ($this_theme['Version'] == $api->version) {
                $type = 'latest_installed';
            } elseif ($this_theme['Version'] > $api->version) {
                $type = 'newer_installed';
                $newer_version = $this_theme['Version'];
            }
            break;
        }
    }
    ?>

<div class='available-theme'>
<img src='<?php 
    echo esc_url($api->screenshot_url);
    ?>
' width='300' class="theme-preview-img" />
<h3><?php 
    echo $api->name;
    ?>
</h3>
<p><?php 
    printf(__('by %s'), $api->author);
    ?>
</p>
<p><?php 
    printf(__('Version: %s'), $api->version);
    ?>
</p>

<?php 
    $buttons = '<a class="button" id="cancel" href="#" onclick="tb_close();return false;">' . __('Cancel') . '</a> ';
    switch ($type) {
        default:
        case 'install':
            if (current_user_can('install_themes')) {
                $buttons .= '<a class="button-primary" id="install" href="' . nxt_nonce_url(self_admin_url('update.php?action=install-theme&theme=' . $api->slug), 'install-theme_' . $api->slug) . '" target="_parent">' . __('Install Now') . '</a>';
            }
            break;
        case 'update_available':
            if (current_user_can('update_themes')) {
                $buttons .= '<a class="button-primary" id="install"	href="' . nxt_nonce_url(self_admin_url('update.php?action=upgrade-theme&theme=' . $update_file), 'upgrade-theme_' . $update_file) . '" target="_parent">' . __('Install Update Now') . '</a>';
            }
            break;
        case 'newer_installed':
            if (current_user_can('install_themes') || current_user_can('update_themes')) {
                ?>
<p><?php 
                printf(__('Newer version (%s) is installed.'), $newer_version);
                ?>
</p><?php 
            }
            break;
        case 'latest_installed':
            if (current_user_can('install_themes') || current_user_can('update_themes')) {
                ?>
<p><?php 
                _e('This version is already installed.');
                ?>
</p><?php 
            }
            break;
    }
    ?>
<br class="clear" />
</div>

<p class="action-button">
<?php 
    echo $buttons;
    ?>
<br class="clear" />
</p>

<?php 
    iframe_footer();
    exit;
}
Example #14
0
/**
 * Edit user settings based on contents of $_POST
 *
 * Used on user-edit.php and profile.php to manage and process user options, passwords etc.
 *
 * @since 2.0
 *
 * @param int $user_id Optional. User ID.
 * @return int user id of the updated user
 */
function edit_user($user_id = 0)
{
    global $nxt_roles, $nxtdb;
    $user = new stdClass();
    if ($user_id) {
        $update = true;
        $user->ID = (int) $user_id;
        $userdata = get_userdata($user_id);
        $user->user_login = $nxtdb->escape($userdata->user_login);
    } else {
        $update = false;
    }
    if (!$update && isset($_POST['user_login'])) {
        $user->user_login = sanitize_user($_POST['user_login'], true);
    }
    $pass1 = $pass2 = '';
    if (isset($_POST['pass1'])) {
        $pass1 = $_POST['pass1'];
    }
    if (isset($_POST['pass2'])) {
        $pass2 = $_POST['pass2'];
    }
    if (isset($_POST['role']) && current_user_can('edit_users')) {
        $new_role = sanitize_text_field($_POST['role']);
        $potential_role = isset($nxt_roles->role_objects[$new_role]) ? $nxt_roles->role_objects[$new_role] : false;
        // Don't let anyone with 'edit_users' (admins) edit their own role to something without it.
        // Multisite super admins can freely edit their blog roles -- they possess all caps.
        if (is_multisite() && current_user_can('manage_sites') || $user_id != get_current_user_id() || $potential_role && $potential_role->has_cap('edit_users')) {
            $user->role = $new_role;
        }
        // If the new role isn't editable by the logged-in user die with error
        $editable_roles = get_editable_roles();
        if (!empty($new_role) && empty($editable_roles[$new_role])) {
            nxt_die(__('You can&#8217;t give users that role.'));
        }
    }
    if (isset($_POST['email'])) {
        $user->user_email = sanitize_text_field($_POST['email']);
    }
    if (isset($_POST['url'])) {
        if (empty($_POST['url']) || $_POST['url'] == 'http://') {
            $user->user_url = '';
        } else {
            $user->user_url = esc_url_raw($_POST['url']);
            $user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://' . $user->user_url;
        }
    }
    if (isset($_POST['first_name'])) {
        $user->first_name = sanitize_text_field($_POST['first_name']);
    }
    if (isset($_POST['last_name'])) {
        $user->last_name = sanitize_text_field($_POST['last_name']);
    }
    if (isset($_POST['nickname'])) {
        $user->nickname = sanitize_text_field($_POST['nickname']);
    }
    if (isset($_POST['display_name'])) {
        $user->display_name = sanitize_text_field($_POST['display_name']);
    }
    if (isset($_POST['description'])) {
        $user->description = trim($_POST['description']);
    }
    foreach (_nxt_get_user_contactmethods($user) as $method => $name) {
        if (isset($_POST[$method])) {
            $user->{$method} = sanitize_text_field($_POST[$method]);
        }
    }
    if ($update) {
        $user->rich_editing = isset($_POST['rich_editing']) && 'false' == $_POST['rich_editing'] ? 'false' : 'true';
        $user->admin_color = isset($_POST['admin_color']) ? sanitize_text_field($_POST['admin_color']) : 'fresh';
        $user->show_admin_bar_front = isset($_POST['admin_bar_front']) ? 'true' : 'false';
    }
    $user->comment_shortcuts = isset($_POST['comment_shortcuts']) && 'true' == $_POST['comment_shortcuts'] ? 'true' : '';
    $user->use_ssl = 0;
    if (!empty($_POST['use_ssl'])) {
        $user->use_ssl = 1;
    }
    $errors = new nxt_Error();
    /* checking that username has been typed */
    if ($user->user_login == '') {
        $errors->add('user_login', __('<strong>ERROR</strong>: Please enter a username.'));
    }
    /* checking the password has been typed twice */
    do_action_ref_array('check_passwords', array($user->user_login, &$pass1, &$pass2));
    if ($update) {
        if (empty($pass1) && !empty($pass2)) {
            $errors->add('pass', __('<strong>ERROR</strong>: You entered your new password only once.'), array('form-field' => 'pass1'));
        } elseif (!empty($pass1) && empty($pass2)) {
            $errors->add('pass', __('<strong>ERROR</strong>: You entered your new password only once.'), array('form-field' => 'pass2'));
        }
    } else {
        if (empty($pass1)) {
            $errors->add('pass', __('<strong>ERROR</strong>: Please enter your password.'), array('form-field' => 'pass1'));
        } elseif (empty($pass2)) {
            $errors->add('pass', __('<strong>ERROR</strong>: Please enter your password twice.'), array('form-field' => 'pass2'));
        }
    }
    /* Check for "\" in password */
    if (false !== strpos(stripslashes($pass1), "\\")) {
        $errors->add('pass', __('<strong>ERROR</strong>: Passwords may not contain the character "\\".'), array('form-field' => 'pass1'));
    }
    /* checking the password has been typed twice the same */
    if ($pass1 != $pass2) {
        $errors->add('pass', __('<strong>ERROR</strong>: Please enter the same password in the two password fields.'), array('form-field' => 'pass1'));
    }
    if (!empty($pass1)) {
        $user->user_pass = $pass1;
    }
    if (!$update && isset($_POST['user_login']) && !validate_username($_POST['user_login'])) {
        $errors->add('user_login', __('<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.'));
    }
    if (!$update && username_exists($user->user_login)) {
        $errors->add('user_login', __('<strong>ERROR</strong>: This username is already registered. Please choose another one.'));
    }
    /* checking e-mail address */
    if (empty($user->user_email)) {
        $errors->add('empty_email', __('<strong>ERROR</strong>: Please enter an e-mail address.'), array('form-field' => 'email'));
    } elseif (!is_email($user->user_email)) {
        $errors->add('invalid_email', __('<strong>ERROR</strong>: The e-mail address isn&#8217;t correct.'), array('form-field' => 'email'));
    } elseif (($owner_id = email_exists($user->user_email)) && (!$update || $owner_id != $user->ID)) {
        $errors->add('email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.'), array('form-field' => 'email'));
    }
    // Allow plugins to return their own errors.
    do_action_ref_array('user_profile_update_errors', array(&$errors, $update, &$user));
    if ($errors->get_error_codes()) {
        return $errors;
    }
    if ($update) {
        $user_id = nxt_update_user(get_object_vars($user));
    } else {
        $user_id = nxt_insert_user(get_object_vars($user));
        nxt_new_user_notification($user_id, isset($_POST['send_password']) ? $pass1 : '');
    }
    return $user_id;
}
Example #15
0
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];
    }
} else {
    $file = stripslashes($file);
    if ('theme' == $dir) {
        $file = dirname(dirname($themes[$theme]['Template Dir'])) . $file;
    } else {
        if ('style' == $dir) {
            $file = dirname(dirname($themes[$theme]['Stylesheet Dir'])) . $file;
Example #16
0
<?php

/**
 * Edit user network administration panel.
 *
 * @package NXTClass
 * @subpackage Multisite
 * @since 3.1.0
 */
/** Load NXTClass Administration Bootstrap */
require_once './admin.php';
if (!is_multisite()) {
    nxt_die(__('Multisite support is not enabled.'));
}
require '../user-edit.php';
Example #17
0
                nxt_die(__('You do not have permission to access this page.'));
            }
            update_blog_status($id, 'mature', '1');
            nxt_safe_redirect(add_query_arg(array('updated' => 'true', 'action' => 'mature'), nxt_get_referer()));
            exit;
            break;
            // Common
        // Common
        case 'confirm':
            check_admin_referer('confirm');
            if (!headers_sent()) {
                nocache_headers();
                header('Content-Type: text/html; charset=utf-8');
            }
            if ($current_site->blog_id == $id) {
                nxt_die(__('You are not allowed to change the current site.'));
            }
            ?>
			<!DOCTYPE html>
			<html xmlns="http://www.w3.org/1999/xhtml" <?php 
            if (function_exists('language_attributes')) {
                language_attributes();
            }
            ?>
>
				<head>
					<title><?php 
            _e('NXTClass &rsaquo; Confirm your action');
            ?>
</title>
Example #18
0
<?php

/**
 * Privacy Options Settings Administration Screen.
 *
 * @package NXTClass
 * @subpackage Administration
 */
/** Load NXTClass Administration Bootstrap */
require_once './admin.php';
if (!current_user_can('manage_options')) {
    nxt_die(__('You do not have sufficient permissions to manage options for this site.'));
}
$title = __('Privacy Settings');
$parent_file = 'options-general.php';
get_current_screen()->add_help_tab(array('id' => 'overview', 'title' => __('Overview'), 'content' => '<p>' . __('You can choose whether or not your site will be crawled by robots, ping services, and spiders. If you want those services to ignore your site, click the radio button next to &#8220;Ask search engines not to index this site&#8221; and click the Save Changes button at the bottom of the screen. Note that your privacy is not complete; your site is still visible on the web.') . '</p>' . '<p>' . __('When this setting is in effect a reminder is shown in the Right Now box of the Dashboard that says, &#8220;Search Engines Blocked,&#8221; to remind you that your site is not being crawled.') . '</p>'));
get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Settings_Privacy_Screen" target="_blank">Documentation on Privacy Settings</a>') . '</p>' . '<p>' . __('<a href="http://nxtclass.org/support/" target="_blank">Support Forums</a>') . '</p>');
include './admin-header.php';
?>

<div class="wrap">
<?php 
screen_icon();
?>
<h2><?php 
echo esc_html($title);
?>
</h2>

<form method="post" action="options.php">
<?php 
Example #19
0
        nxt_redirect(add_query_arg('deleted', count($bulklinks), admin_url('link-manager.php')));
        exit;
    }
} elseif (!empty($_GET['_nxt_http_referer'])) {
    nxt_redirect(remove_query_arg(array('_nxt_http_referer', '_nxtnonce'), stripslashes($_SERVER['REQUEST_URI'])));
    exit;
}
$nxt_list_table->prepare_items();
$title = __('Links');
$this_file = $parent_file = 'link-manager.php';
get_current_screen()->add_help_tab(array('id' => 'overview', 'title' => __('Overview'), 'content' => '<p>' . sprintf(__('You can add links here to be displayed on your site, usually using <a href="%s">Widgets</a>. By default, links to several sites in the NXTClass community are included as examples.'), 'widgets.php') . '</p>' . '<p>' . __('Links may be separated into Link Categories; these are different than the categories used on your posts.') . '</p>' . '<p>' . __('You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.') . '</p>'));
get_current_screen()->add_help_tab(array('id' => 'deleting-links', 'title' => __('Deleting Links'), 'content' => '<p>' . __('If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.') . '</p>'));
get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Links_Screen" target="_blank">Documentation on Managing Links</a>') . '</p>' . '<p>' . __('<a href="http://nxtclass.org/support/" target="_blank">Support Forums</a>') . '</p>');
include_once './admin-header.php';
if (!current_user_can('manage_links')) {
    nxt_die(__("You do not have sufficient permissions to edit the links for this site."));
}
?>

<div class="wrap nosubsub">
<?php 
screen_icon();
?>
<h2><?php 
echo esc_html($title);
?>
 <a href="link-add.php" class="add-new-h2"><?php 
echo esc_html_x('Add New', 'link');
?>
</a> <?php 
if (!empty($_REQUEST['s'])) {
Example #20
0
<?php

/**
 * Import NXTClass Administration Screen
 *
 * @package NXTClass
 * @subpackage Administration
 */
define('nxt_LOAD_IMPORTERS', true);
/** Load NXTClass Bootstrap */
require_once 'admin.php';
if (!current_user_can('import')) {
    nxt_die(__('You do not have sufficient permissions to import content in this site.'));
}
$title = __('Import');
get_current_screen()->add_help_tab(array('id' => 'overview', 'title' => __('Overview'), 'content' => '<p>' . __('This screen lists links to plugins to import data from blogging/content management platforms. Choose the platform you want to import from, and click Install Now when you are prompted in the popup window. If your platform is not listed, click the link to search the plugin directory for other importer plugins to see if there is one for your platform.') . '</p>' . '<p>' . __('In previous versions of NXTClass, all importers were built-in.  They have been turned into plugins since most people only use them once or infrequently.') . '</p>'));
get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Tools_Import_Screen" target="_blank">Documentation on Import</a>') . '</p>' . '<p>' . __('<a href="http://nxtclass.org/support/" target="_blank">Support Forums</a>') . '</p>');
$popular_importers = array();
if (current_user_can('install_plugins')) {
    $popular_importers = array('blogger' => array(__('Blogger'), __('Install the Blogger importer to import posts, comments, and users from a Blogger blog.'), 'install'), 'nxtcat2tag' => array(__('Categories and Tags Converter'), __('Install the category/tag converter to convert existing categories to tags or tags to categories, selectively.'), 'install', 'nxt-cat2tag'), 'livejournal' => array(__('LiveJournal'), __('Install the LiveJournal importer to import posts from LiveJournal using their API.'), 'install'), 'movabletype' => array(__('Movable Type and TypePad'), __('Install the Movable Type importer to import posts and comments from a Movable Type or TypePad blog.'), 'install', 'mt'), 'opml' => array(__('Blogroll'), __('Install the blogroll importer to import links in OPML format.'), 'install'), 'rss' => array(__('RSS'), __('Install the RSS importer to import posts from an RSS feed.'), 'install'), 'tumblr' => array(__('Tumblr'), __('Install the Tumblr importer to import posts &amp; media from Tumblr using their API.'), 'install'), 'nxtclass' => array('NXTClass', __('Install the NXTClass importer to import posts, pages, comments, custom fields, categories, and tags from a NXTClass export file.'), 'install'));
}
if (!empty($_GET['invalid']) && !empty($popular_importers[$_GET['invalid']][3])) {
    nxt_redirect(admin_url('import.php?import=' . $popular_importers[$_GET['invalid']][3]));
    exit;
}
add_thickbox();
nxt_enqueue_script('plugin-install');
require_once 'admin-header.php';
$parent_file = 'tools.php';
?>
Example #21
0
     if (empty($plugins)) {
         nxt_redirect(self_admin_url("plugins.php?plugin_status={$status}&paged={$page}&s={$s}"));
         exit;
     }
     deactivate_plugins($plugins);
     $deactivated = array();
     foreach ($plugins as $plugin) {
         $deactivated[$plugin] = time();
     }
     update_option('recently_activated', $deactivated + (array) get_option('recently_activated'));
     nxt_redirect(self_admin_url("plugins.php?deactivate-multi=true&plugin_status={$status}&paged={$page}&s={$s}"));
     exit;
     break;
 case 'delete-selected':
     if (!current_user_can('delete_plugins')) {
         nxt_die(__('You do not have sufficient permissions to delete plugins for this site.'));
     }
     check_admin_referer('bulk-plugins');
     //$_POST = from the plugin form; $_GET = from the FTP details screen.
     $plugins = isset($_REQUEST['checked']) ? (array) $_REQUEST['checked'] : array();
     if (empty($plugins)) {
         nxt_redirect(self_admin_url("plugins.php?plugin_status={$status}&paged={$page}&s={$s}"));
         exit;
     }
     $plugins = array_filter($plugins, 'is_plugin_inactive');
     // Do not allow to delete Activated plugins.
     if (empty($plugins)) {
         nxt_redirect(self_admin_url("plugins.php?error=true&main=true&plugin_status={$status}&paged={$page}&s={$s}"));
         exit;
     }
     include ABSPATH . 'nxt-admin/update.php';
Example #22
0
    nxt_die(__('Slow down cowboy, no need to check for new mails so often!'));
}
set_transient('mailserver_last_checked', true, nxt_MAIL_INTERVAL);
$time_difference = get_option('gmt_offset') * 3600;
$phone_delim = '::';
$pop3 = new POP3();
if (!$pop3->connect(get_option('mailserver_url'), get_option('mailserver_port')) || !$pop3->user(get_option('mailserver_login'))) {
    nxt_die(esc_html($pop3->ERROR));
}
$count = $pop3->pass(get_option('mailserver_pass'));
if (false === $count) {
    nxt_die(esc_html($pop3->ERROR));
}
if (0 === $count) {
    $pop3->quit();
    nxt_die(__('There doesn&#8217;t seem to be any new mail.'));
}
for ($i = 1; $i <= $count; $i++) {
    $message = $pop3->get($i);
    $bodysignal = false;
    $boundary = '';
    $charset = '';
    $content = '';
    $content_type = '';
    $content_transfer_encoding = '';
    $post_author = 1;
    $author_found = false;
    $dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
    foreach ($message as $line) {
        // body signal
        if (strlen($line) < 3) {
Example #23
0
 * @since 3.0.0
 * @return string Base domain.
 */
function get_clean_basedomain()
{
    if ($existing_domain = network_domain_check()) {
        return $existing_domain;
    }
    $domain = preg_replace('|https?://|', '', get_option('siteurl'));
    if ($slash = strpos($domain, '/')) {
        $domain = substr($domain, 0, $slash);
    }
    return $domain;
}
if (!network_domain_check() && (!defined('nxt_ALLOW_MULTISITE') || !nxt_ALLOW_MULTISITE)) {
    nxt_die(__('You must define the <code>nxt_ALLOW_MULTISITE</code> constant as true in your nxt-config.php file to allow creation of a Network.'));
}
if (is_network_admin()) {
    $title = __('Network Setup');
    $parent_file = 'settings.php';
} else {
    $title = __('Create a Network of NXTClass Sites');
    $parent_file = 'tools.php';
}
$network_help = '<p>' . __('This screen allows you to configure a network as having subdomains (<code>site1.example.com</code>) or subdirectories (<code>example.com/site1</code>). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.') . '</p>' . '<p>' . __('Choose subdomains or subdirectories; this can only be switched afterwards by reconfiguring your install. Fill out the network details, and click install. If this does not work, you may have to add a wildcard DNS record (for subdomains) or change to another setting in Permalinks (for subdirectories).') . '</p>' . '<p>' . __('The next screen for Network Setup will give you individually-generated lines of code to add to your nxt-config.php and .htaccess files. Make sure the settings of your FTP client make files starting with a dot visible, so that you can find .htaccess; you may have to create this file if it really is not there. Make backup copies of those two files.') . '</p>' . '<p>' . __('Add a <code>blogs.dir</code> directory under <code>/nxt-content</code> and add the designated lines of code to nxt-config.php (just before <code>/*...stop editing...*/</code>) and <code>.htaccess</code> (replacing the existing NXTClass rules).') . '</p>' . '<p>' . __('Once you add this code and refresh your browser, multisite should be enabled. This screen, now in the Network Admin navigation menu, will keep an archive of the added code. You can toggle between Network Admin and Site Admin by clicking on the Network Admin or an individual site name under the My Sites dropdown in the Toolbar.') . '</p>' . '<p>' . __('The choice of subdirectory sites is disabled if this setup is more than a month old because of permalink problems with &#8220;/blog/&#8221; from the main site. This disabling will be addressed in a future version.') . '</p>' . '<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Create_A_Network" target="_blank">Documentation on Creating a Network</a>') . '</p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Tools_Network_Screen" target="_blank">Documentation on the Network Screen</a>') . '</p>';
get_current_screen()->add_help_tab(array('id' => 'network', 'title' => __('Network'), 'content' => $network_help));
get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Create_A_Network" target="_blank">Documentation on Creating a Network</a>') . '</p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Tools_Network_Screen" target="_blank">Documentation on the Network Screen</a>') . '</p>' . '<p>' . __('<a href="http://nxtclass.org/support/" target="_blank">Support Forums</a>') . '</p>');
include ABSPATH . 'nxt-admin/admin-header.php';
?>
<div class="wrap">
<?php 
Example #24
0
/**
 * Redirects to the installer if NXTClass is not installed.
 *
 * Dies with an error message when multisite is enabled.
 *
 * @access private
 * @since 3.0.0
 */
function nxt_not_installed()
{
    if (is_multisite()) {
        if (!is_blog_installed() && !defined('nxt_INSTALLING')) {
            nxt_die(__('The site you have requested is not installed properly. Please contact the system administrator.'));
        }
    } elseif (!is_blog_installed() && false === strpos($_SERVER['PHP_SELF'], 'install.php') && !defined('nxt_INSTALLING')) {
        $link = nxt_guess_url() . '/nxt-admin/install.php';
        require ABSPATH . nxtINC . '/kses.php';
        require ABSPATH . nxtINC . '/pluggable.php';
        require ABSPATH . nxtINC . '/formatting.php';
        nxt_redirect($link);
        die;
    }
}
Example #25
0
function remote_login_js()
{
    global $current_blog, $current_user, $nxtdb;
    if (0 == get_site_option('dm_remote_login')) {
        return false;
    }
    $nxtdb->dmtablelogins = $nxtdb->base_prefix . 'domain_mapping_logins';
    $hash = get_dm_hash();
    if (false == isset($_SERVER['HTTPS'])) {
        $_SERVER['HTTPS'] = 'Off';
    }
    $protocol = 'on' == strtolower($_SERVER['HTTPS']) ? 'https://' : 'http://';
    if ($_GET['dm'] == $hash) {
        if ($_GET['action'] == 'load') {
            if (!is_user_logged_in()) {
                exit;
            }
            $key = md5(time() . mt_rand());
            $nxtdb->query($nxtdb->prepare("INSERT INTO {$nxtdb->dmtablelogins} ( `id`, `user_id`, `blog_id`, `t` ) VALUES( %s, %d, %d, NOW() )", $key, $current_user->ID, $_GET['blogid']));
            $url = add_query_arg(array('action' => 'login', 'dm' => $hash, 'k' => $key, 't' => mt_rand()), $_GET['back']);
            echo "window.location = '{$url}'";
            exit;
        } elseif ($_GET['action'] == 'login') {
            if ($details = $nxtdb->get_row($nxtdb->prepare("SELECT * FROM {$nxtdb->dmtablelogins} WHERE id = %s AND blog_id = %d", $_GET['k'], $nxtdb->blogid))) {
                if ($details->blog_id == $nxtdb->blogid) {
                    $nxtdb->query($nxtdb->prepare("DELETE FROM {$nxtdb->dmtablelogins} WHERE id = %s", $_GET['k']));
                    $nxtdb->query($nxtdb->prepare("DELETE FROM {$nxtdb->dmtablelogins} WHERE t < %d", time() - 120));
                    // remote logins survive for only 2 minutes if not used.
                    nxt_set_auth_cookie($details->user_id);
                    nxt_redirect(remove_query_arg(array('dm', 'action', 'k', 't', $protocol . $current_blog->domain . $_SERVER['REQUEST_URI'])));
                    exit;
                } else {
                    nxt_die(__("Incorrect or out of date login key", 'nxtclass-mu-domain-mapping'));
                }
            } else {
                nxt_die(__("Unknown login key", 'nxtclass-mu-domain-mapping'));
            }
        } elseif ($_GET['action'] == 'logout') {
            if ($details = $nxtdb->get_row($nxtdb->prepare("SELECT * FROM {$nxtdb->dmtablelogins} WHERE id = %d AND blog_id = %d", $_GET['k'], $_GET['blogid']))) {
                $nxtdb->query($nxtdb->prepare("DELETE FROM {$nxtdb->dmtablelogins} WHERE id = %s", $_GET['k']));
                $blog = get_blog_details($_GET['blogid']);
                nxt_clear_auth_cookie();
                nxt_redirect(trailingslashit($blog->siteurl) . "nxt-login.php?loggedout=true");
                exit;
            } else {
                nxt_die(__("Unknown logout key", 'nxtclass-mu-domain-mapping'));
            }
        }
    }
}
Example #26
0
function _access_denied_splash()
{
    if (!is_user_logged_in() || is_network_admin()) {
        return;
    }
    $blogs = get_blogs_of_user(get_current_user_id());
    if (nxt_list_filter($blogs, array('userblog_id' => get_current_blog_id()))) {
        return;
    }
    $blog_name = get_bloginfo('name');
    if (empty($blogs)) {
        nxt_die(sprintf(__('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'), $blog_name));
    }
    $output = '<p>' . sprintf(__('You attempted to access the "%1$s" dashboard, but you do not currently have privileges on this site. If you believe you should be able to access the "%1$s" dashboard, please contact your network administrator.'), $blog_name) . '</p>';
    $output .= '<p>' . __('If you reached this screen by accident and meant to visit one of your own sites, here are some shortcuts to help you find your way.') . '</p>';
    $output .= '<h3>' . __('Your Sites') . '</h3>';
    $output .= '<table>';
    foreach ($blogs as $blog) {
        $output .= "<tr>";
        $output .= "<td valign='top'>";
        $output .= "{$blog->blogname}";
        $output .= "</td>";
        $output .= "<td valign='top'>";
        $output .= "<a href='" . esc_url(get_admin_url($blog->userblog_id)) . "'>" . __('Visit Dashboard') . "</a> | <a href='" . esc_url(get_home_url($blog->userblog_id)) . "'>" . __('View Site') . "</a>";
        $output .= "</td>";
        $output .= "</tr>";
    }
    $output .= '</table>';
    nxt_die($output);
}
Example #27
0
     $sendback = add_query_arg('untrashed', $untrashed, $sendback);
     break;
 case 'delete':
     $deleted = 0;
     foreach ((array) $post_ids as $post_id) {
         $post_del =& get_post($post_id);
         if (!current_user_can($post_type_object->cap->delete_post, $post_id)) {
             nxt_die(__('You are not allowed to delete this item.'));
         }
         if ($post_del->post_type == 'attachment') {
             if (!nxt_delete_attachment($post_id)) {
                 nxt_die(__('Error in deleting...'));
             }
         } else {
             if (!nxt_delete_post($post_id)) {
                 nxt_die(__('Error in deleting...'));
             }
         }
         $deleted++;
     }
     $sendback = add_query_arg('deleted', $deleted, $sendback);
     break;
 case 'edit':
     if (isset($_REQUEST['bulk_edit'])) {
         $done = bulk_edit_posts($_REQUEST);
         if (is_array($done)) {
             $done['updated'] = count($done['updated']);
             $done['skipped'] = count($done['skipped']);
             $done['locked'] = count($done['locked']);
             $sendback = add_query_arg($done, $sendback);
         }
Example #28
0
    nxt_die(__('Multisite support is not enabled.'));
}
if (!current_user_can('read')) {
    nxt_die(__('You do not have sufficient permissions to view this page.'));
}
$action = isset($_POST['action']) ? $_POST['action'] : 'splash';
$blogs = get_blogs_of_user($current_user->ID);
$updated = false;
if ('updateblogsettings' == $action && isset($_POST['primary_blog'])) {
    check_admin_referer('update-my-sites');
    $blog = get_blog_details((int) $_POST['primary_blog']);
    if ($blog && isset($blog->domain)) {
        update_user_option($current_user->ID, 'primary_blog', (int) $_POST['primary_blog'], true);
        $updated = true;
    } else {
        nxt_die(__('The primary site you chose does not exist.'));
    }
}
$title = __('My Sites');
$parent_file = 'index.php';
get_current_screen()->add_help_tab(array('id' => 'overview', 'title' => __('Overview'), 'content' => '<p>' . __('This screen shows an individual user all of their sites in this network, and also allows that user to set a primary site. He or she can use the links under each site to visit either the frontend or the dashboard for that site.') . '</p>' . '<p>' . __('Up until NXTClass version 3.0, what is now called a Multisite Network had to be installed separately as NXTClass MU (multi-user).') . '</p>'));
get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Dashboard_My_Sites_Screen" target="_blank">Documentation on My Sites</a>') . '</p>' . '<p>' . __('<a href="http://nxtclass.org/support/" target="_blank">Support Forums</a>') . '</p>');
require_once './admin-header.php';
if ($updated) {
    ?>
	<div id="message" class="updated"><p><strong><?php 
    _e('Settings saved.');
    ?>
</strong></p></div>
<?php 
}
Example #29
0
        nxt_redirect(admin_url('update-core.php'));
        exit;
    }
    $url = 'update.php?action=update-selected&plugins=' . urlencode(implode(',', $plugins));
    $url = nxt_nonce_url($url, 'bulk-update-plugins');
    $title = __('Update Plugins');
    require_once ABSPATH . 'nxt-admin/admin-header.php';
    echo '<div class="wrap">';
    screen_icon('plugins');
    echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
    echo "<iframe src='{$url}' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
    echo '</div>';
    include ABSPATH . 'nxt-admin/admin-footer.php';
} elseif ('do-theme-upgrade' == $action) {
    if (!current_user_can('update_themes')) {
        nxt_die(__('You do not have sufficient permissions to update this site.'));
    }
    check_admin_referer('upgrade-core');
    if (isset($_GET['themes'])) {
        $themes = explode(',', $_GET['themes']);
    } elseif (isset($_POST['checked'])) {
        $themes = (array) $_POST['checked'];
    } else {
        nxt_redirect(admin_url('update-core.php'));
        exit;
    }
    $url = 'update.php?action=update-selected-themes&themes=' . urlencode(implode(',', $themes));
    $url = nxt_nonce_url($url, 'bulk-update-themes');
    $title = __('Update Themes');
    require_once ABSPATH . 'nxt-admin/admin-header.php';
    echo '<div class="wrap">';
Example #30
0
<?php

/**
 * NXTClass Export Administration Screen
 *
 * @package NXTClass
 * @subpackage Administration
 */
/** Load NXTClass Bootstrap */
require_once 'admin.php';
if (!current_user_can('export')) {
    nxt_die(__('You do not have sufficient permissions to export the content of this site.'));
}
/** Load NXTClass export API */
require_once './includes/export.php';
$title = __('Export');
function add_js()
{
    ?>
<script type="text/javascript">
//<![CDATA[
	jQuery(document).ready(function($){
 		var form = $('#export-filters'),
 			filters = form.find('.export-filters');
 		filters.hide();
 		form.find('input:radio').change(function() {
			filters.slideUp('fast');
			switch ( $(this).val() ) {
				case 'posts': $('#post-filters').slideDown(); break;
				case 'pages': $('#page-filters').slideDown(); break;
			}