当前位置: 首页>>代码示例>>PHP>>正文


PHP mainwp_current_user_can函数代码示例

本文整理汇总了PHP中mainwp_current_user_can函数的典型用法代码示例。如果您正苦于以下问题:PHP mainwp_current_user_can函数的具体用法?PHP mainwp_current_user_can怎么用?PHP mainwp_current_user_can使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mainwp_current_user_can函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render

 public static function render()
 {
     if (!mainwp_current_user_can('dashboard', 'access_wpadmin_on_child_sites')) {
         mainwp_do_not_have_permissions(__('WP-Admin on child sites', 'mainwp'));
         return;
     }
     if (!isset($_GET['websiteid'])) {
         exit;
     }
     $id = $_GET['websiteid'];
     $website = MainWP_DB::Instance()->getWebsiteById($id);
     if (!MainWP_Utility::can_edit_website($website)) {
         exit;
     }
     $location = '';
     if (isset($_GET['location'])) {
         $location = base64_decode($_GET['location']);
     }
     MainWP_Site_Open::openSite($website, $location, isset($_GET['newWindow']) ? $_GET['newWindow'] : null);
 }
开发者ID:jexmex,项目名称:mainwp,代码行数:20,代码来源:page-mainwp-site-open.php

示例2: column_task_name

 function column_task_name($item)
 {
     $actions = array('edit' => sprintf('<a href="admin.php?page=ManageBackups&id=%s">' . '<i class="fa fa-pencil-square-o"></i> ' . __('Edit', 'mainwp') . '</a>', $item->id), 'delete' => sprintf('<a class="submitdelete" href="#" task_id="%s" onClick="return managebackups_remove(this);">' . '<i class="fa fa-trash-o"></i> ' . __('Delete', 'mainwp') . '</a>', $item->id));
     if (!mainwp_current_user_can('dashboard', 'edit_backup_tasks')) {
         unset($actions['edit']);
     }
     if (!mainwp_current_user_can('dashboard', 'delete_backup_tasks')) {
         unset($actions['delete']);
     }
     if ($item->paused == 1) {
         if (mainwp_current_user_can('dashboard', 'pause_resume_backup_tasks')) {
             $actions['resume'] = sprintf('<a href="#" task_id="%s" onClick="return managebackups_resume(this)">' . '<i class="fa fa-play"></i> ' . __('Resume', 'mainwp') . '</a>', $item->id);
         }
         return sprintf('<strong><a style="color: #999;" href="admin.php?page=ManageBackups&id=%s" title="Paused">%s</a></strong><br /><div id="task-status-%s" style="float: left; padding-right: 20px"></div>%s', $item->id, $item->name, $item->id, $this->row_actions($actions));
     } else {
         if (mainwp_current_user_can('dashboard', 'pause_resume_backup_tasks')) {
             $actions['pause'] = sprintf('<a href="#" task_id="%s" onClick="return managebackups_pause(this)">' . '<i class="fa fa-pause"></i> ' . __('Pause', 'mainwp') . '</a>', $item->id);
         }
         return sprintf('<strong><a href="admin.php?page=ManageBackups&id=%s">%s</a></strong><br /><div id="task-status-%s" style="float: left; padding-right: 20px"></div>%s', $item->id, $item->name, $item->id, $this->row_actions($actions));
     }
 }
开发者ID:jexmex,项目名称:mainwp,代码行数:21,代码来源:table-mainwp-manage-backups-list-table.php

示例3: initMenu

 public static function initMenu()
 {
     if (mainwp_current_user_can('dashboard', 'manage_security_issues')) {
         add_submenu_page('mainwp_tab', 'SecurityIssues', '<div class="mainwp-hidden">' . __('SecurityIssues', 'mainwp') . '</div>', 'read', 'SecurityIssues', array(MainWP_Security_Issues::getClassName(), 'render'));
     }
 }
开发者ID:sacredwebsite,项目名称:mainwp,代码行数:6,代码来源:page-mainwp-security-issues.php

示例4: render

    public static function render()
    {
        if (!mainwp_current_user_can("dashboard", "manage_users")) {
            mainwp_do_not_have_permissions("manage users");
            return;
        }
        $cachedSearch = MainWPCache::getCachedContext('Users');
        self::renderHeader('');
        ?>
         <div>
            <div class="postbox mainwp-postbox" style="width: 555px !important;">
            <h3 class="mainwp_box_title"><i class="fa fa-binoculars"></i> <?php 
        _e('Search Users', 'mainwp');
        ?>
</h3>
            <div class="inside">                  
            <div class="mainwp-search-box">
                <input type="text" aria-required="true" value="<?php 
        if ($cachedSearch != null && isset($cachedSearch['keyword'])) {
            echo $cachedSearch['keyword'];
        }
        ?>
"
                        id="mainwp_search_users" name="mainwp_search_users">
                <input type="button" value="<?php 
        _e('Search Users', 'mainwp');
        ?>
" class="button"
                        id="mainwp_btn_search_users" name="mainwp_btn_search_users">
                <span id="mainwp_users_searching">
                    <i class="fa fa-spinner fa-pulse"></i>
                </span>                 
            </div>
            <h3><?php 
        _e('Show Users', 'mainwp');
        ?>
</h3>
            <ul class="mainwp_checkboxes">
                <li>
                    <input type="checkbox" id="mainwp_user_role_administrator" <?php 
        echo $cachedSearch == null || $cachedSearch != null && in_array('administrator', $cachedSearch['status']) ? 'checked="checked"' : '';
        ?>
 class="mainwp-checkbox2"/>
                    <label for="mainwp_user_role_administrator" class="mainwp-label2"><?php 
        _e('Administrator', 'mainwp');
        ?>
</label>
                </li>
                <li>
                    <input type="checkbox" id="mainwp_user_role_editor" <?php 
        echo $cachedSearch != null && in_array('editor', $cachedSearch['status']) ? 'checked="checked"' : '';
        ?>
 class="mainwp-checkbox2"/>
                    <label for="mainwp_user_role_editor" class="mainwp-label2"><?php 
        _e('Editor', 'mainwp');
        ?>
</label>
                </li>
                <li>
                    <input type="checkbox" id="mainwp_user_role_author" <?php 
        echo $cachedSearch != null && in_array('author', $cachedSearch['status']) ? 'checked="checked"' : '';
        ?>
 class="mainwp-checkbox2"/>
                    <label for="mainwp_user_role_author" class="mainwp-label2"><?php 
        _e('Author', 'mainwp');
        ?>
</label>
                </li>
                <li>
                    <input type="checkbox" id="mainwp_user_role_contributor" <?php 
        echo $cachedSearch != null && in_array('contributor', $cachedSearch['status']) ? 'checked="checked"' : '';
        ?>
 class="mainwp-checkbox2"/>
                    <label for="mainwp_user_role_contributor" class="mainwp-label2"><?php 
        _e('Contributor', 'mainwp');
        ?>
</label>
                </li>
                <li>
                    <input type="checkbox" id="mainwp_user_role_subscriber" <?php 
        echo $cachedSearch != null && in_array('subscriber', $cachedSearch['status']) ? 'checked="checked"' : '';
        ?>
 class="mainwp-checkbox2"/>
                    <label for="mainwp_user_role_subscriber" class="mainwp-label2"><?php 
        _e('Subscriber', 'mainwp');
        ?>
</label>
                </li>
            </ul>
            </div>
            </div>
            <?php 
        MainWPUI::select_sites_box(__("Select Sites", 'mainwp'), 'checkbox', true, true, 'mainwp_select_sites_box_left');
        ?>
            <div class="postbox" style="float: left; width: 255px; margin-left: 2em;">
            <h3 class="box_title mainwp_box_title"><i class="fa fa-key"></i> <?php 
        _e('Update Password', 'mainwp');
        ?>
</h3>
            <div class="inside mainwp_inside" style="padding-bottom: .2em !important;">
//.........这里部分代码省略.........
开发者ID:HasClass0,项目名称:mainwp,代码行数:101,代码来源:MainWPUser.page.php

示例5: renderWidget


//.........这里部分代码省略.........
            }
            ?>
					<div class="mainwp-row mainwp-active">
						<input class="pluginSlug" type="hidden" name="slug" value="<?php 
            echo $actived_plugins[$i]['slug'];
            ?>
"/>
						<input class="websiteId" type="hidden" name="id" value="<?php 
            echo $website->id;
            ?>
"/>
						<span class="mainwp-left-col">
							<a href="<?php 
            echo admin_url() . 'plugin-install.php?tab=plugin-information&plugin=' . dirname($actived_plugins[$i]['slug']) . '&TB_iframe=true&width=640&height=477';
            ?>
" target="_blank" class="thickbox" title="More information about <?php 
            echo $actived_plugins[$i]['name'];
            ?>
">
								<?php 
            echo $actived_plugins[$i]['name'];
            ?>
							</a>
							<?php 
            echo ' ' . $actived_plugins[$i]['version'];
            ?>
 <?php 
            echo $outdate_notice;
            ?>
						</span>

						<div class="mainwp-right-col pluginsAction">
							<?php 
            if (mainwp_current_user_can('dashboard', 'activate_deactivate_plugins')) {
                ?>
								<a href="#" class="mainwp-plugin-deactivate"><i class="fa fa-toggle-off"></i> <?php 
                _e('Deactivate', 'mainwp');
                ?>
								</a>
							<?php 
            }
            ?>
						</div>
						<div style="clear: left;"></div>
						<div class="mainwp-row-actions-working">
							<i class="fa fa-spinner fa-pulse"></i> <?php 
            _e('Please wait', 'mainwp');
            ?>
</div>
						<div>&nbsp;</div>
					</div>
				<?php 
        }
        ?>
			</div>

			<div class="mainwp_plugins_inactive" style="display: none">
				<?php 
        for ($i = 0; $i < count($inactive_plugins); $i++) {
            $outdate_notice = '';
            $slug = $inactive_plugins[$i]['slug'];
            if (isset($plugins_outdate[$slug])) {
                $plugin_outdate = $plugins_outdate[$slug];
                $now = new \DateTime();
                $last_updated = $plugin_outdate['last_updated'];
                $plugin_last_updated_date = new \DateTime('@' . $last_updated);
开发者ID:senlin,项目名称:mainwp,代码行数:67,代码来源:widget-mainwp-widget-plugins.php

示例6: render

    public static function render()
    {
        if (!mainwp_current_user_can("dashboard", "see_server_information")) {
            mainwp_do_not_have_permissions("server information");
            return;
        }
        self::renderHeader('');
        ?>
        <div class="updated below-h2">
            <p><?php 
        _e("Please include this information when requesting support:", "mainwp");
        ?>
</p><span class="mwp_close_srv_info"><a href="#" id="mwp_download_srv_info"><?php 
        _e("Download", "mainwp");
        ?>
</a> | <a href="#" id="mwp_close_srv_info"><i class="fa fa-eye-slash"></i> <?php 
        _e("Hide", "mainwp");
        ?>
</a></span>
            <p class="submit"><a class="button-primary mwp-get-system-report-btn" href="#"><?php 
        _e("Get System Report", "mainwp");
        ?>
</a></p>
            <div id="mwp-server-information"><textarea readonly="readonly"  wrap="off"></textarea></div>
        </div>
        <br />
        <div class="mwp_server_info_box">
                <table id="mainwp-table" class="wp-list-table widefat" cellspacing="0">
                    <thead>
                    <tr>
                        <th scope="col" class="manage-column column-posts mwp-not-generate-row" style="width: 1px;"><?php 
        _e('', 'mainwp');
        ?>
</th>
                        <th scope="col" class="manage-column sorted" style=""><span><?php 
        _e('Server Configuration', 'mainwp');
        ?>
</span></th>
                        <th scope="col" class="manage-column column-posts" style=""><?php 
        _e('Required Value', 'mainwp');
        ?>
</th>
                        <th scope="col" class="manage-column column-posts" style=""><?php 
        _e('Value', 'mainwp');
        ?>
</th>
                        <th scope="col" class="manage-column column-posts" style=""><?php 
        _e('Status', 'mainwp');
        ?>
</th>
                    </tr>
                    </thead>

                    <tbody id="the-sites-list" class="list:sites">
                        <tr><td style="background: #333; color: #fff;" colspan="5"><?php 
        _e('MAINWP DASHBOARD', 'mainwp');
        ?>
</td></tr>
                        <tr><td><?php 
        MainWPUtility::renderToolTip('MainWP requires the latest version to be installed for extension and child plugin compatibility issues.', 'mainwp');
        ?>
</td><td>MainWP Dashboard Version</td><td><?php 
        echo self::getMainWPVersion();
        ?>
</td><td><?php 
        echo self::getCurrentVersion();
        ?>
</td><td><?php 
        echo self::getMainWPVersionCheck();
        ?>
</td></tr>
                        <?php 
        self::checkDirectoryMainWPDirectory();
        ?>
                        <tr><td style="background: #333; color: #fff;" colspan="5"><?php 
        _e('WORDPRESS', 'mainwp');
        ?>
</td></tr><?php 
        self::renderRow('WordPress Version', '>=', '3.6', 'getWordpressVersion', '', '', null, 'MainWP requires the WordPress version 3.6 or higher. If the condition is not met, please update your Website. Click the help icon to read more.');
        self::renderRow('WordPress Memory Limit', '>=', '64M', 'getWordpressMemoryLimit', '', '', null, 'MainWP requires at least 64MB for proper functioning.');
        ?>
<tr><td style="background: #333; color: #fff;" colspan="5"><?php 
        _e('PHP SETTINGS', 'mainwp');
        ?>
</td></tr><?php 
        self::renderRow('PHP Version', '>=', '5.3', 'getPHPVersion', '', '', null, 'MainWP requires the PHP version 5.3 or higher. If the condition is not met, PHP version needs to be updated on your server. Before doing anything by yourself, we highly recommend contacting your hosting support department and asking them to do it for you. Click the help icon to read more.');
        self::renderRow('PHP Safe Mode Disabled', '=', true, 'getPHPSafeMode', '', '', null, 'MainWP Requires PHP Safe Mode to be disabled.');
        self::renderRow('PHP Max Execution Time', '>=', '30', 'getMaxExecutionTime', 'seconds', '=', '0', 'Changed by modifying the value max_execution_time in your php.ini file. Click the help icon to read more.');
        self::renderRow('PHP Memory Limit', '>=', '128M', 'getPHPMemoryLimit', '', '', null, 'MainWP requires at least 128MB for proper functioning (256M+ recommended for big backups)', 'filesize');
        self::renderRow('PHP Upload Max Filesize', '>=', '2M', 'getUploadMaxFilesize', '(2MB+ best for upload of big plugins)', '', null, 'Changed by modifying the value upload_max_filesize in your php.ini file. Click the help icon to read more.', 'filesize');
        self::renderRow('PHP Post Max Size', '>=', '2M', 'getPostMaxSize', '(2MB+ best for upload of big plugins)', '', null, 'Changed by modifying the value post_max_size in your php.ini file. Click the help icon to read more.', 'filesize');
        self::renderRow('SSL Extension Enabled', '=', true, 'getSSLSupport', '', '', null, 'Changed by uncommenting the ;extension=php_openssl.dll line in your php.ini file by removing the ";" character. Click the help icon to read more.');
        self::renderRow('SSL Warnings', '=', '', 'getSSLWarning', 'empty', '', null, 'If your SSL Warnings has any errors we suggest speaking with your web host so they can help troubleshoot the specific error you are getting. Click the help icon to read more.');
        self::renderRow('cURL Extension Enabled', '=', true, 'getCurlSupport', '', '', null, 'Changed by uncommenting the ;extension=php_curl.dll line in your php.ini file by removing the ";" character. Click the help icon to read more.');
        self::renderRow('cURL Timeout', '>=', '300', 'getCurlTimeout', 'seconds', '=', '0', 'Changed by modifying the value default_socket_timeout in your php.ini file. Click the help icon to read more.');
        if (function_exists('curl_version')) {
            self::renderRow('cURL Version', '>=', "7.18.1", 'getCurlVersion', '', '', null, 'MainWP Requires cURL 7.18.1 version or later.');
            self::renderRow('cURL SSL Version', '>=', array('version_number' => 0x9080cf, 'version' => 'OpenSSL/0.9.8l'), 'getCurlSSLVersion', '', '', null, 'MainWP Requires cURL SSL OpenSSL/0.9.8l version or later.', 'curlssl');
        }
        ?>
//.........这里部分代码省略.........
开发者ID:HasClass0,项目名称:mainwp,代码行数:101,代码来源:MainWPServerInformation.page.php

示例7: renderMainWPTools

    public static function renderMainWPTools()
    {
        if (!mainwp_current_user_can('dashboard', 'manage_dashboard_settings')) {
            mainwp_do_not_have_permissions(__('manage dashboard settings', 'mainwp'));
            return;
        }
        $wp_menu_items = array('dashboard' => __('Dashboard', 'mainwp'), 'posts' => __('Posts', 'mainwp'), 'media' => __('Media', 'mainwp'), 'pages' => __('Pages', 'mainwp'), 'appearance' => __('Appearance', 'mainwp'), 'comments' => __('Comments', 'mainwp'), 'users' => __('Users', 'mainwp'), 'tools' => __('Tools', 'mainwp'));
        $hide_menus = get_option('mwp_setup_hide_wp_menus');
        if (!is_array($hide_menus)) {
            $hide_menus = array();
        }
        self::renderHeader('MainWPTools');
        ?>
		<form method="POST" action="">
			<div class="postbox" id="mainwp-tools">
				<h3 class="mainwp_box_title">
					<span><i class="fa fa-wrench"></i> <?php 
        _e('MainWP Tools', 'mainwp');
        ?>
</span></h3>

				<div class="inside">
					<table class="form-table">
						<tbody>
						<tr>
							<th scope="row"><?php 
        _e('Force Dashboard to Establish New Connection', 'mainwp');
        ?>
&nbsp;<?php 
        MainWP_Utility::renderToolTip(__('Use this option to establish new connection with child sites.', 'mainwp'));
        ?>
</th>
							<td>
								<input type="submit" name="" id="force-destroy-sessions-button" class="button-primary button" value="<?php 
        esc_attr_e('Establish New Connection', 'mainwp');
        ?>
"/><br/>
								<em>
									<?php 
        _e('Forces your Dashboard to reconnect with your Child sites. This feature will log out any currently logged in users on the Child sites and require them to re-log in. Only needed if suggested by MainWP Support.', 'mainwp');
        ?>
								</em>
							</td>
						</tr>
						<tr>
							<th scope="row"><?php 
        _e('Scan child sites for known issues', 'mainwp');
        ?>
&nbsp;<?php 
        MainWP_Utility::renderToolTip(__('Use this option to scan child sites for known issues.', 'mainwp'));
        ?>
</th>
							<td>
								<a href="<?php 
        echo admin_url('admin.php?page=MainWP_Child_Scan');
        ?>
" class="button-primary button"><?php 
        _e('Scan', 'mainwp');
        ?>
</a><br/>
								<em>
									<?php 
        _e('Scans each site individually for known issues.', 'mainwp');
        ?>
								</em>
							</td>
						</tr>
						<tr>
							<th scope="row"><?php 
        _e('MainWP Quick Setup', 'mainwp');
        ?>
</th>
							<td>
								<a href="admin.php?page=mainwp-setup" class="button-primary button"/><?php 
        _e('Start Quick Setup', 'mainwp');
        ?>
</a><br/>
								<em>
									<?php 
        _e('MainWP Quick Setup allows you to quickly set your MainWP Dashboard preferences.', 'mainwp');
        ?>
								</em>
							</td>
						</tr>
						</tbody>
					</table>
					<div class="mainwp_info-box"><?php 
        _e('Changing this settings will overwrite Clean & Lock Extension settings. Do not forget to migrate the settings you wish to keep.', 'mainwp');
        ?>
</div>
					<table class="form-table">
						<tbody>
						<tr>
							<th scope="row"><?php 
        _e('Hide WP Menus', 'mainwp');
        ?>
</th>
							<td>
								<ul class="mainwp_checkboxes mainwp_hide_wpmenu_checkboxes">
									<?php 
//.........这里部分代码省略.........
开发者ID:jexmex,项目名称:mainwp,代码行数:101,代码来源:page-mainwp-settings.php

示例8: render

    public static function render()
    {
        if (!mainwp_current_user_can('dashboard', 'manage_offline_checks')) {
            mainwp_do_not_have_permissions(__('manage offline checks', 'mainwp'));
            return;
        }
        $websites = MainWP_DB::Instance()->query(MainWP_DB::Instance()->getSQLWebsitesForCurrentUser());
        $statusses = array('hourly', '2xday', 'daily', 'weekly');
        do_action('mainwp-pageheader-settings', 'OfflineChecks');
        ?>
        <div class="mainwp_info-box-red">
        <strong>IMPORTANT:</strong> This feature is being retired and replaced by the Free MainWP Advanced Uptime Monitor Extension which provides more advanced monitoring system.<br/>
        <a href="https://mainwp.com/extension/advanced-uptime-monitor/">Get the Free MainWP Advanced Uptime Monitor Extension here!</a>
        </div>
		<div class="mainwp_info-box">
			<strong><?php 
        _e('Notifications will be sent to', 'mainwp');
        ?>
				<i><?php 
        echo MainWP_Utility::getNotificationEmail();
        ?>
</i> (<a href="<?php 
        echo admin_url();
        ?>
admin.php?page=Settings"><?php 
        _e('change', 'mainwp');
        ?>
</a>)</strong>
			<br/><br/><?php 
        _e('MainWP performs two tests when checking your site for up-time.', 'mainwp');
        ?>
			<br/>
			<?php 
        _e('The first test we do is to check that the domain is valid.', 'mainwp');
        ?>
			<br/>
			<?php 
        _e('If this test passes we use a browser emulator to visit the website, this sends out a user agent (just like your web browser from your computer) and waits for a status message.', 'mainwp');
        ?>
			<br/>
			<?php 
        _e('We report any http status code from 200-399 as a success. Any other http status code returned is considered "offline" which is treated as a failure.', 'mainwp');
        ?>
		</div>
		<table class="wp-list-table widefat fixed" id="mainwp_offlinechecks">
			<thead>
			<tr>
				<th scope="col" class="manage-column" style="text-align: left"><?php 
        _e('Site', 'mainwp');
        ?>
</th>
				<th scope="col" id="col_status" class="manage-column"><?php 
        _e('Status', 'mainwp');
        ?>
</th>
				<th scope="col" id="col_disabled" class="manage-column">
					<a href="#" class="mainwp_offline_check_bulk" value="disabled"><?php 
        _e('Disabled', 'mainwp');
        ?>
</a>
				</th>
				<th scope="col" id="col_hourly" class="manage-column">
					<a href="#" class="mainwp_offline_check_bulk" value="hourly"><?php 
        _e('Hourly', 'mainwp');
        ?>
</a>
				</th>
				<th scope="col" id="col_2timesday" class="manage-column">
					<a href="#" class="mainwp_offline_check_bulk" value="2xday"><?php 
        _e('2x Day', 'mainwp');
        ?>
</a>
				</th>
				<th scope="col" id="col_daily" class="manage-column">
					<a href="#" class="mainwp_offline_check_bulk" value="daily"><?php 
        _e('Daily', 'mainwp');
        ?>
</a>
				</th>
				<th scope="col" id="col_weekly" class="manage-column">
					<a href="#" class="mainwp_offline_check_bulk" value="weekly"><?php 
        _e('Weekly', 'mainwp');
        ?>
</a>
				</th>
				<th scope="col" id="col_test" class="manage-column">
					<a href="#" class="button button-primary" id="mainwp_offline_check_check_all"><?php 
        _e('Check All', 'mainwp');
        ?>
</a>
				</th>
			</tr>
			</thead>
			<tbody id="the-list">
			<?php 
        while ($websites && ($website = @MainWP_DB::fetch_object($websites))) {
            ?>
				<tr>
					<input type="hidden" name="offline_check_website_id" id="offline_check_website_id"
						value="<?php 
//.........这里部分代码省略.........
开发者ID:jexmex,项目名称:mainwp,代码行数:101,代码来源:page-mainwp-offline-checks.php

示例9: renderAllGroups

    public static function renderAllGroups()
    {
        if (!mainwp_current_user_can("dashboard", "manage_groups")) {
            mainwp_do_not_have_permissions("manage groups");
            return;
        }
        ?>
        <div class="wrap">
            <?php 
        do_action("mainwp-pageheader-sites", "ManageGroups");
        ?>
                <div class="mainwp_managegroups-outsidebox">
                    <span id="mainwp_managegroups-addnew-container"><input type="button" name="Add new" value="<?php 
        _e('Add New', 'mainwp');
        ?>
" class="managegroups-addnew button" /></span>
                    <h3><?php 
        _e('Groups', 'mainwp');
        ?>
</h3>
                    <div class="mainwp_managegroups-insidebox">
                        <input id="managegroups-filter" style="margin-top: .5em;" type="text" value="" placeholder="Type here to filter groups" />
                        <hr>
                        <ul id="managegroups-list">
                            <li class="managegroups-listitem managegroups-group-add hidden">
                                <span class="mainwp_group-actions actions-input"><a href="#" class="managegroups-savenew"><?php 
        _e('Save', 'mainwp');
        ?>
</a> | <a href="#" class="managegroups-cancel"><?php 
        _e('Cancel', 'mainwp');
        ?>
</a></span>
                                <input type="text" name="name" value="" />
                            </li>
                            <?php 
        echo MainWPManageGroups::getGroupListContent();
        ?>
                        </ul>
                    </div>
                </div>

                <div class="mainwp_managegroups-outsidebox">
                    <div style="float: right; margin-top: 12px;"><?php 
        _e('Display by:', 'mainwp');
        ?>
 <a href="#" class="mainwp_action left mainwp_action_down" id="group_sites_by_name"><strong><?php 
        _e('Site Name', 'mainwp');
        ?>
</strong></a><a href="#" class="mainwp_action right" id="group_sites_by_url"><?php 
        _e('URL', 'mainwp');
        ?>
</a></div>
                    <h3><?php 
        _e('Websites', 'mainwp');
        ?>
</h3>
                    <div class="mainwp_managegroups-insidebox" id="managegroups-sites-list">
                        <input id="managegroups_site-filter" style="margin-top: .5em;" type="text" value="" placeholder="Type here to filter sites" />
                        <div style="float:right; margin-top: .7em"><?php 
        _e('Select: ', 'mainwp');
        ?>
<a href="#" onClick="return mainwp_managegroups_ss_select(this, true)"><?php 
        _e('All', 'mainwp');
        ?>
</a> | <a href="#" onClick="return mainwp_managegroups_ss_select(this, false)"><?php 
        _e('None', 'mainwp');
        ?>
</a></div>
                        <hr>
                        <ul id="managegroups-listsites">
                            <?php 
        echo MainWPManageGroups::getWebsiteListContent();
        ?>
                        </ul>
                    </div>
                </div>
                <div style="clear: both;"></div>
                <br />
                <input type="button" name="Save selection" value="<?php 
        _e('Save Selection', 'mainwp');
        ?>
" class="managegroups-saveAll button-primary" /> <span id="managegroups-saved"><?php 
        _e('Saved', 'mainwp');
        ?>
</span>
        </div>
        <?php 
        do_action("mainwp-pagefooter-sites", "ManageGroups");
        ?>
        <script type="text/javascript">
            jQuery(document).ready(function () {
                jQuery('#group_sites_by_name').live('click', function(event)
                {
                    jQuery(this).addClass('mainwp_action_down');
                    jQuery('#group_sites_by_url').removeClass('mainwp_action_down');
                    jQuery('#managegroups-sites-list').find('.website_url').hide();
                    jQuery('#managegroups-sites-list').find('.website_name').show();
                    return false;
                });
                jQuery('#group_sites_by_url').live('click', function(event)
//.........这里部分代码省略.........
开发者ID:HasClass0,项目名称:mainwp,代码行数:101,代码来源:MainWPManageGroups.page.php

示例10: renderSites


//.........这里部分代码省略.........
</option>
								<option value="0" <?php 
            echo $userExtension->site_view == 0 ? 'selected' : '';
            ?>
><?php 
            esc_html_e('Plugin/Theme', 'mainwp');
            ?>
</option>
							</select>
						</form>
					</span>
				</div>
			</div>
			<?php 
        }
        ?>
		<div class="clear">
			<div class="<?php 
        echo $globalView ? 'mainwp-row' : 'mainwp-row-top';
        ?>
">
				<span class="mainwp-left-col"><span class="mainwp-rightnow-number"><?php 
        echo $total_upgrades;
        ?>
</span> <?php 
        echo _n('Upgrade', 'Upgrades', $total_upgrades, 'mainwp');
        ?>
 <?php 
        _e('available', 'mainwp');
        ?>
</span>
				<span class="mainwp-mid-col">&nbsp;</span>
				<?php 
        if (mainwp_current_user_can('dashboard', 'update_wordpress') && mainwp_current_user_can('dashboard', 'update_plugins') && mainwp_current_user_can('dashboard', 'update_themes')) {
            ?>
					<span class="mainwp-right-col"><?php 
            if ($total_upgrades == 0) {
                ?>
							<a class="button" disabled="disabled"><?php 
                _e('Upgrade Everything', 'mainwp');
                ?>
</a><?php 
            } else {
                ?>
							<a href="#" onClick="return rightnow_global_upgrade_all();" class="mainwp-upgrade-button button"><?php 
                _e('Upgrade Everything', 'mainwp');
                ?>
</a><?php 
            }
            ?>
</span>
				<?php 
        }
        ?>
			</div>
		</div>
		<div class="clear">
			<div class="mainwp-row">
				<span class="mainwp-left-col">
					<a href="#" id="mainwp_upgrades_show" onClick="return rightnow_show('upgrades', true);">
						<span class="mainwp-rightnow-number"><?php 
        echo $total_wp_upgrades;
        ?>
</span> <?php 
        echo _n('WordPress upgrade', 'WordPress upgrades', $total_wp_upgrades, 'mainwp');
        ?>
开发者ID:senlin,项目名称:mainwp,代码行数:67,代码来源:widget-mainwp-right-now.php

示例11: render

    public static function render($title, $type = "plugin")
    {
        if ($type == "plugin" && !mainwp_current_user_can("dashboard", "install_plugins") || $type == "theme" && !mainwp_current_user_can("dashboard", "install_themes")) {
            mainwp_do_not_have_permissions("install plugins");
            return;
        }
        $tab = 'search';
        if (isset($_REQUEST['tab'])) {
            $tab = $_REQUEST['tab'];
        }
        ?>
            <?php 
        if ($tab == 'install') {
        } else {
            ?>
                <a href="#" class="mainwp_action left <?php 
            if ($tab == 'search') {
                echo 'mainwp_action_down';
            }
            ?>
" id="MainWPInstallBulkNavSearch"><?php 
            _e('Search', 'mainwp');
            ?>
</a><a href="#" class="mainwp_action right <?php 
            if ($tab == 'upload') {
                echo 'mainwp_action_down';
            }
            ?>
" id="MainWPInstallBulkNavUpload"><?php 
            _e('Upload', 'mainwp');
            ?>
</a>


                <br class="clear" /><br />
                <form method="POST" action="">
                    <div class="mainwp_config_box_right stick-to-window">
<!--                    <div>-->
                        <?php 
            MainWPUI::select_sites_box();
            ?>
                  	</div>
                        <div class="mainwp_config_box_left">
               	 	<div class="error below-h2" style="display: none;" id="ajax-error-zone"></div>
                    <div id="MainWPInstallBulkAjax">
                        <?php 
            switch ($tab) {
                case 'search':
                    MainWPInstallBulk::renderSearch($title);
                    break;
                case 'upload':
                    MainWPInstallBulk::renderUpload($title);
                    break;
                default:
                    MainWPInstallBulk::renderSearch($title);
            }
            ?>
                    </div>
                   	</div>
                </form>
                <?php 
        }
        ?>
            <div id="MainWPInstallBulkNew" style="display: none">
                <br />
                <a href="<?php 
        echo get_admin_url();
        ?>
admin.php?page=<?php 
        echo $title;
        ?>
Install" class="add-new-h2" target="_top"><?php 
        _e('Add New', 'mainwp');
        ?>
</a>
                <a href="<?php 
        echo get_admin_url();
        ?>
admin.php?page=mainwp_tab" class="add-new-h2" target="_top"><?php 
        _e('Return to Dashboard', 'mainwp');
        ?>
</a>
            </div>
        <?php 
    }
开发者ID:HasClass0,项目名称:mainwp,代码行数:85,代码来源:MainWPInstallBulk.page.php

示例12: renderWidget

    public static function renderWidget($renew, $pExit = true)
    {
        $current_wpid = MainWPUtility::get_current_wpid();
        if (empty($current_wpid)) {
            return;
        }
        $sql = MainWPDB::Instance()->getSQLWebsiteById($current_wpid);
        $websites = MainWPDB::Instance()->query($sql);
        $allPlugins = array();
        if ($websites) {
            $website = @MainWPDB::fetch_object($websites);
            if ($website && $website->plugins != '') {
                $plugins = json_decode($website->plugins, 1);
                if (is_array($plugins) && count($plugins) != 0) {
                    foreach ($plugins as $plugin) {
                        $allPlugins[] = $plugin;
                    }
                }
            }
            @MainWPDB::free_result($websites);
        }
        $actived_plugins = MainWPUtility::getSubArrayHaving($allPlugins, 'active', 1);
        $actived_plugins = MainWPUtility::sortmulti($actived_plugins, 'name', 'desc');
        $inactive_plugins = MainWPUtility::getSubArrayHaving($allPlugins, 'active', 0);
        $inactive_plugins = MainWPUtility::sortmulti($inactive_plugins, 'name', 'desc');
        ?>
        <div class="clear">            
            <a class="mainwp_action left mainwp_action_down plugins_actived_lnk" href="#"><?php 
        _e('Active', 'mainwp');
        ?>
 (<?php 
        echo count($actived_plugins);
        ?>
)</a><a class="mainwp_action mid plugins_inactive_lnk right" href="#" ><?php 
        _e('Inactive', 'mainwp');
        ?>
 (<?php 
        echo count($inactive_plugins);
        ?>
)</a><br/><br/>
            <div class="mainwp_plugins_active">
                <?php 
        for ($i = 0; $i < count($actived_plugins); $i++) {
            ?>
                <div class="mainwp-row mainwp-active">
                    <input class="pluginSlug" type="hidden" name="slug" value="<?php 
            echo $actived_plugins[$i]['slug'];
            ?>
"/>
                    <input class="websiteId" type="hidden" name="id" value="<?php 
            echo $website->id;
            ?>
"/>
                    <span class="mainwp-left-col">						
                            <a href="<?php 
            echo admin_url() . 'plugin-install.php?tab=plugin-information&plugin=' . dirname($actived_plugins[$i]['slug']) . '&TB_iframe=true&width=640&height=477';
            ?>
" target="_blank"
                                                                                                                class="thickbox" title="More information about <?php 
            echo $actived_plugins[$i]['name'];
            ?>
">
                        <?php 
            echo $actived_plugins[$i]['name'];
            ?>
                    </a><?php 
            echo " " . $actived_plugins[$i]['version'];
            ?>
 
					</span>					       
                    <div class="mainwp-right-col pluginsAction">
                        <?php 
            if (mainwp_current_user_can("dashboard", "activate_deactivate_plugins")) {
                ?>
                            <a href="#" class="mainwp-plugin-deactivate"><i class="fa fa-toggle-off"></i> <?php 
                _e('Deactivate', 'mainwp');
                ?>
</a>
                        <?php 
            }
            ?>
                    </div>                    
                    <div style="clear: left;"></div>
                    <div class="mainwp-row-actions-working"><i class="fa fa-spinner fa-pulse"></i> <?php 
            _e('Please wait', 'mainwp');
            ?>
</div>                    
                    <div>&nbsp;</div>
                </div>
                <?php 
        }
        ?>
            </div>

            <div class="mainwp_plugins_inactive" style="display: none">
                <?php 
        for ($i = 0; $i < count($inactive_plugins); $i++) {
            ?>
                <div class="mainwp-row mainwp-inactive">
                    <input class="pluginSlug" type="hidden" name="slug" value="<?php 
//.........这里部分代码省略.........
开发者ID:HasClass0,项目名称:mainwp,代码行数:101,代码来源:MainWPWidgetPlugins.widget.php

示例13: renderMetabox

    public static function renderMetabox()
    {
        $website = MainWPUtility::get_current_wpid();
        if (!$website) {
            return;
        }
        $website = MainWPDB::Instance()->getWebsiteById($website);
        MainWPManageSites::showBackups($website);
        ?>
        <?php 
        if (mainwp_current_user_can("dashboard", "execute_backups")) {
            ?>
        <hr />
        <div style="text-align: center;"><a href="<?php 
            echo admin_url('admin.php?page=managesites&backupid=' . $website->id);
            ?>
" class="button-primary"><?php 
            _e('Backup Now', 'mainwp');
            ?>
</a></div>
        <?php 
        }
        ?>
        <?php 
    }
开发者ID:BjornW,项目名称:mainwp,代码行数:25,代码来源:MainWPManageBackups.page.php

示例14: renderAllSites

 public static function renderAllSites()
 {
     global $current_user;
     if (isset($_REQUEST['do'])) {
         if ($_REQUEST['do'] == 'new') {
             self::renderNewSite();
         } else {
             if ($_REQUEST['do'] == 'test') {
                 self::renderTest();
             }
         }
         return;
     }
     $website = null;
     if (isset($_GET['backupid']) && MainWPUtility::ctype_digit($_GET['backupid'])) {
         $websiteid = $_GET['backupid'];
         $backupwebsite = MainWPDB::Instance()->getWebsiteById($websiteid);
         if (MainWPUtility::can_edit_website($backupwebsite)) {
             MainWPManageSites::renderBackupSite($backupwebsite);
             return;
         }
     }
     if (isset($_GET['scanid']) && MainWPUtility::ctype_digit($_GET['scanid'])) {
         $websiteid = $_GET['scanid'];
         $scanwebsite = MainWPDB::Instance()->getWebsiteById($websiteid);
         if (MainWPUtility::can_edit_website($scanwebsite)) {
             MainWPManageSites::renderScanSite($scanwebsite);
             return;
         }
     }
     if (isset($_GET['seowebsiteid']) && MainWPUtility::ctype_digit($_GET['seowebsiteid'])) {
         $websiteid = $_GET['seowebsiteid'];
         $seoWebsite = MainWPDB::Instance()->getWebsiteById($websiteid);
         if (MainWPUtility::can_edit_website($seoWebsite)) {
             MainWPManageSites::renderSeoPage($seoWebsite);
             return;
         }
     }
     if (isset($_GET['dashboard']) && MainWPUtility::ctype_digit($_GET['dashboard'])) {
         $websiteid = $_GET['dashboard'];
         $dashboardWebsite = MainWPDB::Instance()->getWebsiteById($websiteid);
         if (MainWPUtility::can_edit_website($dashboardWebsite)) {
             MainWPManageSites::renderDashboard($dashboardWebsite);
             return;
         }
     }
     if (isset($_GET['id']) && MainWPUtility::ctype_digit($_GET['id'])) {
         $websiteid = $_GET['id'];
         $website = MainWPDB::Instance()->getWebsiteById($websiteid);
         if (!MainWPUtility::can_edit_website($website)) {
             $website = null;
         }
     }
     if ($website == null) {
         self::_renderAllSites();
     } else {
         $updated = false;
         //Edit website!
         if (isset($_POST['submit']) && isset($_POST['mainwp_managesites_edit_siteadmin']) && $_POST['mainwp_managesites_edit_siteadmin'] != '') {
             //update site
             $groupids = array();
             $groupnames = array();
             if (isset($_POST['selected_groups'])) {
                 foreach ($_POST['selected_groups'] as $group) {
                     $groupids[] = $group;
                 }
             }
             if (isset($_POST['mainwp_managesites_edit_addgroups']) && $_POST['mainwp_managesites_edit_addgroups'] != '') {
                 $tmpArr = explode(',', $_POST['mainwp_managesites_edit_addgroups']);
                 foreach ($tmpArr as $tmp) {
                     $group = MainWPDB::Instance()->getGroupByNameForUser(trim($tmp));
                     if ($group) {
                         if (!in_array($group->id, $groupids)) {
                             $groupids[] = $group->id;
                         }
                     } else {
                         $groupnames[] = trim($tmp);
                     }
                 }
             }
             $newPluginDir = isset($_POST['mainwp_options_footprint_plugin_folder']) ? $_POST['mainwp_options_footprint_plugin_folder'] : '';
             $maximumFileDescriptorsOverride = isset($_POST['mainwp_options_maximumFileDescriptorsOverride']);
             $maximumFileDescriptorsAuto = isset($_POST['mainwp_maximumFileDescriptorsAuto']);
             $maximumFileDescriptors = isset($_POST['mainwp_options_maximumFileDescriptors']) && MainWPUtility::ctype_digit($_POST['mainwp_options_maximumFileDescriptors']) ? $_POST['mainwp_options_maximumFileDescriptors'] : 150;
             $archiveFormat = isset($_POST['mainwp_archiveFormat']) ? $_POST['mainwp_archiveFormat'] : 'global';
             $http_user = $_POST['mainwp_managesites_edit_http_user'];
             $http_pass = $_POST['mainwp_managesites_edit_http_pass'];
             MainWPDB::Instance()->updateWebsite($website->id, $current_user->ID, $_POST['mainwp_managesites_edit_sitename'], $_POST['mainwp_managesites_edit_siteadmin'], $groupids, $groupnames, $_POST['offline_checks'], $newPluginDir, $maximumFileDescriptorsOverride, $maximumFileDescriptorsAuto, $maximumFileDescriptors, $_POST['mainwp_managesites_edit_verifycertificate'], $archiveFormat, isset($_POST['mainwp_managesites_edit_uniqueId']) ? $_POST['mainwp_managesites_edit_uniqueId'] : '', $http_user, $http_pass);
             do_action('mainwp_update_site', $website->id);
             $backup_before_upgrade = isset($_POST['mainwp_backup_before_upgrade']) ? intval($_POST['mainwp_backup_before_upgrade']) : 2;
             if ($backup_before_upgrade > 2) {
                 $backup_before_upgrade = 2;
             }
             $newValues = array('automatic_update' => !isset($_POST['mainwp_automaticDailyUpdate']) ? 0 : 1, 'backup_before_upgrade' => $backup_before_upgrade, 'loadFilesBeforeZip' => $_POST['mainwp_options_loadFilesBeforeZip']);
             if (mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
                 $newValues['is_ignoreCoreUpdates'] = isset($_POST['mainwp_is_ignoreCoreUpdates']) && $_POST['mainwp_is_ignoreCoreUpdates'] ? 1 : 0;
                 $newValues['is_ignorePluginUpdates'] = isset($_POST['mainwp_is_ignorePluginUpdates']) && $_POST['mainwp_is_ignorePluginUpdates'] ? 1 : 0;
                 $newValues['is_ignoreThemeUpdates'] = isset($_POST['mainwp_is_ignoreThemeUpdates']) && $_POST['mainwp_is_ignoreThemeUpdates'] ? 1 : 0;
             }
             MainWPDB::Instance()->updateWebsiteValues($website->id, $newValues);
//.........这里部分代码省略.........
开发者ID:BjornW,项目名称:mainwp,代码行数:101,代码来源:MainWPManageSites.page.php

示例15: renderAllGroups

    public static function renderAllGroups()
    {
        if (!mainwp_current_user_can('dashboard', 'manage_groups')) {
            mainwp_do_not_have_permissions(__('manage groups', 'mainwp'));
            return;
        }
        ?>
		<div class="wrap">
			<?php 
        do_action('mainwp-pageheader-sites', 'ManageGroups');
        ?>
			<div class="mainwp_info-box-blue">
				<span><?php 
        _e('In case you are managing large number of WordPress sites, it would be very useful for you to split them in different groups. Later, you will be able to make site selection by group which will speed up your work and make it much easier.', 'mainwp');
        ?>
</span>
			</div>
			<div class="mainwp_managegroups-outsidebox">
				<div class="mainwp_managegroups-insidebox">
					<h2 style="border-bottom: 1px Solid #e5e5e5;"><?php 
        _e('Groups', 'mainwp');
        ?>
</h2>
					<input id="managegroups-filter" style="margin: 1em 0; width: 40%;" type="text" value="" placeholder="<?php 
        esc_attr_e('Type here to filter groups', 'mainwp');
        ?>
" />
					<span id="mainwp_managegroups-addnew-container"><a class="managegroups-addnew" href="javascript:void(0)"><i class="fa fa-plus"></i> <?php 
        _e('Create New Group', 'mainwp');
        ?>
</a></span>
					<hr>
					<ul id="managegroups-list">
						<li class="managegroups-listitem managegroups-group-add hidden">
							<span class="mainwp_group-actions actions-input"><a href="#" class="managegroups-savenew"><i class="fa fa-floppy-o"></i> <?php 
        _e('Save', 'mainwp');
        ?>
</a> | <a href="#" class="managegroups-cancel"><i class="fa fa-times-circle"></i> <?php 
        _e('Cancel', 'mainwp');
        ?>
</a></span>
							<input type="text" style="width: 50%;" placeholder="<?php 
        esc_attr_e('Enter Group Name', 'mainwp');
        ?>
" name="name" value="" />
						</li>
						<?php 
        echo MainWP_Manage_Groups::getGroupListContent();
        ?>
					</ul>
				</div>
			</div>

			<div class="mainwp_managegroups-outsidebox">
				<div class="mainwp_managegroups-insidebox" id="managegroups-sites-list">
					<h2 style="border-bottom: 1px Solid #e5e5e5;"><?php 
        _e('Child Sites', 'mainwp');
        ?>
</h2>
					<input id="managegroups_site-filter" style="margin: 1em 0; width: 40%;" type="text" value="" placeholder="<?php 
        esc_attr_e('Type here to filter sites', 'mainwp');
        ?>
" />
					<div style="float: right; margin-top: 20px; margin-left: 1em;"><?php 
        _e('Select: ', 'mainwp');
        ?>
<a href="#" onClick="return mainwp_managegroups_ss_select(this, true)"><?php 
        _e('All', 'mainwp');
        ?>
</a> | <a href="#" onClick="return mainwp_managegroups_ss_select(this, false)"><?php 
        _e('None', 'mainwp');
        ?>
</a></div>
					<div style="float: right; margin-top: 20px;"><?php 
        _e('Display by:', 'mainwp');
        ?>
 <a href="#" id="group_sites_by_name"><?php 
        _e('Site Name', 'mainwp');
        ?>
</a> | <a href="#" id="group_sites_by_url"><?php 
        _e('URL', 'mainwp');
        ?>
</a></div>
					<div style="clear: both;"></div>
					<hr>
					<ul id="managegroups-listsites">
						<?php 
        echo MainWP_Manage_Groups::getWebsiteListContent();
        ?>
					</ul>
				</div>
			</div>
			<div style="clear: both;"></div>
			<br/>
			<input type="button" name="Save selection" value="<?php 
        _e('Save Selection', 'mainwp');
        ?>
" class="managegroups-saveAll button-primary button button-hero"/>
			<span id="managegroups-saved"><?php 
        _e('Saved', 'mainwp');
//.........这里部分代码省略.........
开发者ID:senlin,项目名称:mainwp,代码行数:101,代码来源:page-mainwp-manage-groups.php


注:本文中的mainwp_current_user_can函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。