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


PHP mainwp_do_not_have_permissions函数代码示例

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


在下文中一共展示了mainwp_do_not_have_permissions函数的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: upgradePluginTheme

 function upgradePluginTheme()
 {
     try {
         $websiteId = $type = null;
         $slugs = array();
         if (isset($_POST['websiteId'])) {
             $websiteId = $_POST['websiteId'];
         }
         if (isset($_POST['slugs'])) {
             $slugs = $_POST['slugs'];
         }
         if (isset($_POST['type'])) {
             $type = $_POST['type'];
         }
         $error = '';
         if ($type == 'plugin' && !mainwp_current_user_can('dashboard', 'update_plugins')) {
             $error = mainwp_do_not_have_permissions(__('update plugins', 'mainwp'), false);
         } else {
             if ($type == 'theme' && !mainwp_current_user_can('dashboard', 'update_themes')) {
                 $error = mainwp_do_not_have_permissions(__('update themes', 'mainwp'), false);
             }
         }
         if (!empty($error)) {
             die(json_encode(array('error' => $error)));
         }
         if (MainWP_Utility::ctype_digit($websiteId)) {
             $website = MainWP_DB::Instance()->getWebsiteById($websiteId);
             if (MainWP_Utility::can_edit_website($website)) {
                 $information = MainWP_Utility::fetchUrlAuthed($website, 'upgradeplugintheme', array('type' => $type, 'list' => urldecode(implode(',', $slugs))));
                 die(json_encode($information));
             }
         }
     } catch (MainWP_Exception $e) {
         die(json_encode(array('error' => $e->getMessage())));
     }
     die;
 }
开发者ID:jexmex,项目名称:mainwp,代码行数:37,代码来源:class-mainwp-hooks.php

示例3: 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

示例4: renderAutoUpdate

    public static function renderAutoUpdate()
    {
        $cachedThemesSearch = null;
        if (isset($_SESSION['SNThemesAllStatus'])) {
            $cachedThemesSearch = $_SESSION['SNThemesAllStatus'];
        }
        self::renderHeader('AutoUpdate');
        if (!mainwp_current_user_can('dashboard', 'trust_untrust_updates')) {
            mainwp_do_not_have_permissions(__('trust/untrust updates', 'mainwp'));
            return;
        } else {
            $snAutomaticDailyUpdate = get_option('mainwp_automaticDailyUpdate');
            ?>
			<div id="mainwp-au" class=""><strong><?php 
            if ($snAutomaticDailyUpdate == 1) {
                ?>
						<div class="mainwp-au-on"><?php 
                _e('Auto Updates are ON and Trusted Plugins will be Automatically Updated', 'mainwp');
                ?>
 -
							<a href="<?php 
                echo admin_url();
                ?>
admin.php?page=Settings"><?php 
                _e('Change this in Settings', 'mainwp');
                ?>
</a>
						</div>
					<?php 
            } elseif ($snAutomaticDailyUpdate === false || $snAutomaticDailyUpdate == 2) {
                ?>
						<div class="mainwp-au-email"><?php 
                _e('Auto Updates are OFF - Email Update Notification is ON', 'mainwp');
                ?>
 -
							<a href="<?php 
                echo admin_url();
                ?>
admin.php?page=Settings"><?php 
                _e('Change this in Settings', 'mainwp');
                ?>
</a>
						</div>
					<?php 
            } else {
                ?>
						<div class="mainwp-au-off"><?php 
                _e('Auto Updates are OFF - Email Update Notification is OFF', 'mainwp');
                ?>
 -
							<a href="<?php 
                echo admin_url();
                ?>
admin.php?page=Settings"><?php 
                _e('Change this in Settings', 'mainwp');
                ?>
</a>
						</div>
					<?php 
            }
            ?>
</strong></div>
			<div class="mainwp_info-box"><?php 
            _e('Only mark Themes as Trusted if you are absolutely sure they can be updated', 'mainwp');
            ?>
</div>

			<div class="postbox">
				<h3 class="mainwp_box_title"><i class="fa fa-binoculars"></i> <?php 
            _e('Search Themes', 'mainwp');
            ?>
				</h3>

				<div class="inside">
					<span><?php 
            _e('Status:', 'mainwp');
            ?>
 </span>
					<select id="mainwp_au_theme_status">
						<option value="all" <?php 
            if ($cachedThemesSearch != null && $cachedThemesSearch['theme_status'] == 'all') {
                echo 'selected';
            }
            ?>
><?php 
            _e('All Themes', 'mainwp');
            ?>
</option>
						<option value="active" <?php 
            if ($cachedThemesSearch != null && $cachedThemesSearch['theme_status'] == 'active') {
                echo 'selected';
            }
            ?>
><?php 
            _e('Active Themes', 'mainwp');
            ?>
</option>
						<option value="inactive" <?php 
            if ($cachedThemesSearch != null && $cachedThemesSearch['theme_status'] == 'inactive') {
                echo 'selected';
//.........这里部分代码省略.........
开发者ID:jexmex,项目名称:mainwp,代码行数:101,代码来源:page-mainwp-themes.php

示例5: 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

示例6: renderMainWPTools

    public static function renderMainWPTools()
    {
        if (!mainwp_current_user_can("dashboard", "manage_dashboard_settings")) {
            mainwp_do_not_have_permissions("manage dashboard settings");
            return;
        }
        self::renderHeader('MainWPTools');
        ?>
            <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');
        ?>
 <?php 
        MainWPUtility::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 
        _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');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Use this option to scan child sites for known issues.', 'mainwp'));
        ?>
</th>
                                <td>
                                    <a href="<?php 
        echo admin_url('admin.php?page=MainWPChildScan');
        ?>
" class="button-primary button"><?php 
        _e('Scan', 'mainwp');
        ?>
</a><br/>
                                    <em>
                                        <?php 
        _e('Scans each site individually for known issues.', 'mainwp');
        ?>
                                    </em>
                                </td>
                            </tr>
                            </tbody>
                    </table>
                </div>
            </div>
        <?php 
        self::renderFooter('MainWPTools');
    }
开发者ID:BjornW,项目名称:mainwp,代码行数:66,代码来源:MainWPSettings.page.php

示例7: 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

示例8: renderBulkAdd

    public static function renderBulkAdd()
    {
        if (!mainwp_current_user_can('dashboard', 'manage_posts')) {
            mainwp_do_not_have_permissions(__('manage posts', 'mainwp'));
            return;
        }
        $src = get_site_url() . '/wp-admin/post-new.php?post_type=bulkpost&hideall=1' . (isset($_REQUEST['select']) ? '&select=' . $_REQUEST['select'] : '');
        $src = apply_filters('mainwp_bulkpost_edit_source', $src);
        //Loads the post screen via AJAX, which redirects to the "posting()" to really post the posts to the saved sites
        self::renderHeader('BulkAdd');
        ?>
		<iframe scrolling="auto" id="mainwp_iframe" src="<?php 
        echo $src;
        ?>
"></iframe>
		<?php 
        self::renderFooter('BulkAdd');
    }
开发者ID:senlin,项目名称:mainwp,代码行数:18,代码来源:page-mainwp-post.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: renderAllSites

    public static function renderAllSites(&$website, $updated, $groups, $statusses, $pluginDir)
    {
        if (!mainwp_current_user_can('dashboard', 'edit_sites')) {
            mainwp_do_not_have_permissions(__('edit sites', 'mainwp'));
            return;
        }
        $remote_destinations = apply_filters('mainwp_backups_remote_get_destinations', null, array('website' => $website->id));
        $hasRemoteDestinations = $remote_destinations == null ? $remote_destinations : count($remote_destinations);
        ?>
        <div class="error below-h2" style="display: none;" id="ajax-error-zone"></div>
        <div id="ajax-information-zone" class="updated" style="display: none;"></div>
        <?php 
        if ($updated) {
            ?>
            <div id="mainwp_managesites_edit_message" class="updated"><p><?php 
            _e('Website updated.', 'mainwp');
            ?>
</p></div>
            <?php 
        }
        ?>
        <form method="POST" action="" id="mainwp-edit-single-site-form" enctype="multipart/form-data">
            <div class="postbox">
            <h3 class="mainwp_box_title"><i class="fa fa-cog"></i> <?php 
        _e('General Options', 'mainwp');
        ?>
</h3>
            <div class="inside">
            <table class="form-table">
                <tbody>
                <tr>
                    <th scope="row"><?php 
        _e('Site Name', 'mainwp');
        ?>
</th>
                    <td><input type="text" name="mainwp_managesites_edit_sitename"
                               value="<?php 
        echo stripslashes($website->name);
        ?>
" class="regular-text"/></td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Site URL', 'mainwp');
        ?>
</th>
                    <td><select id="mainwp_managesites_edit_siteurl_protocol" name="mainwp_managesites_edit_siteurl_protocol"><option <?php 
        echo MainWP_Utility::startsWith($website->url, 'http:') ? 'selected' : '';
        ?>
 value="http">http://</option><option <?php 
        echo MainWP_Utility::startsWith($website->url, 'https:') ? 'selected' : '';
        ?>
 value="https">https://</option></select> <input type="text" id="mainwp_managesites_edit_siteurl" disabled="disabled"
                               value="<?php 
        echo MainWP_Utility::removeHttpPrefix($website->url, true);
        ?>
" class="regular-text" /> <span
                            class="mainwp-form_hint-display"><?php 
        _e('Site URL cannot be changed.', 'mainwp');
        ?>
</span></td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Administrator Username', 'mainwp');
        ?>
</th>
                    <td><input type="text" name="mainwp_managesites_edit_siteadmin"
                               id="mainwp_managesites_edit_siteadmin"
                               value="<?php 
        echo $website->adminname;
        ?>
"
                               class="regular-text"/></td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Groups', 'mainwp');
        ?>
</th>
                    <td>
                        <input type="text" name="mainwp_managesites_edit_addgroups"
                               id="mainwp_managesites_edit_addgroups" value=""
                               class="regular-text"/> <span
                            class="mainwp-form_hint"><?php 
        _e('Separate groups by commas (e.g. Group 1, Group 2).', 'mainwp');
        ?>
</span>

                        <div id="selected_groups" style="display: block; width: 25em">
                            <?php 
        if (count($groups) == 0) {
            echo 'No groups added yet.';
        }
        $groupsSite = MainWP_DB::Instance()->getGroupsByWebsiteId($website->id);
        foreach ($groups as $group) {
            echo '<div class="mainwp_selected_groups_item"><input type="checkbox" name="selected_groups[]" value="' . $group->id . '" ' . (isset($groupsSite[$group->id]) && $groupsSite[$group->id] ? 'checked' : '') . ' />&nbsp' . stripslashes($group->name) . '</div>';
        }
        ?>
                        </div>
//.........这里部分代码省略.........
开发者ID:senlin,项目名称:mainwp,代码行数:101,代码来源:view-mainwp-manage-sites-view.php

示例11: on_show_page

    function on_show_page()
    {
        if (!mainwp_current_user_can('dashboard', 'access_global_dashboard')) {
            mainwp_do_not_have_permissions(__('global dashboard', 'mainwp'));
            return;
        }
        global $screen_layout_columns;
        ?>
		<div id="mainwp_tab-general" class="wrap">
			<a href="https://mainwp.com" id="mainwplogo" title="MainWP" target="_blank"><img src="<?php 
        echo plugins_url('images/logo.png', dirname(__FILE__));
        ?>
" height="50" alt="MainWP"/></a>

			<h2><i class="fa fa-tachometer"></i> <?php 
        _e('MainWP Dashboard', 'mainwp');
        ?>
</h2>

			<div style="clear: both;"></div>
			<br/><br/>
			<?php 
        if (MainWP_Utility::showUserTip('mainwp-dashboard-tips')) {
            ?>
				<div id="mainwp-tip-zone">
					<div class="mainwp-tips mainwp_info-box-blue">
						<span class="mainwp-tip" id="mainwp-dashboard-tips"><strong><?php 
            _e('MainWP Tip', 'mainwp');
            ?>
: </strong><?php 
            _e('You can move the Widgets around to fit your needs and even adjust the number of columns by selecting "Screen Options" on the top right.', 'mainwp');
            ?>
</span><span><a href="#" class="mainwp-dismiss"><i class="fa fa-times-circle"></i> <?php 
            _e('Dismiss', 'mainwp');
            ?>
							</a></span></div>
				</div>
			<?php 
        }
        ?>

			<?php 
        $websites = MainWP_DB::Instance()->query(MainWP_DB::Instance()->getSQLWebsitesForCurrentUser(false, null, 'wp_sync.dtsSync DESC, wp.url ASC'));
        self::renderDashboardBody($websites, $this->dashBoard, $screen_layout_columns);
        @MainWP_DB::free_result($websites);
        ?>
		</div>
		<?php 
    }
开发者ID:senlin,项目名称:mainwp,代码行数:49,代码来源:page-mainwp-main.php

示例12: 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

示例13: renderNew

    public static function renderNew()
    {
        if (!mainwp_current_user_can("dashboard", "add_backup_tasks")) {
            mainwp_do_not_have_permissions("add backup tasks");
            return;
        }
        self::renderHeader('AddNew');
        ?>
        <div class="mainwp_info-box-yellow"><?php 
        _e('We recommend only scheduling 1 site per backup, multiples sites can cause unintended issues.', 'mainwp');
        ?>
</div>
        <div id="mainwp_managebackups_add_errors" class="mainwp_error error"></div>
        <div id="mainwp_managebackups_add_message" class="mainwp_updated updated" style="display: none"></div>
        <div class="error below-h2" style="display: none;" id="ajax-error-zone"></div>
        <div id="ajax-information-zone" class="updated" style="display: none;"></div>
        <div id="mainwp_managbackups_cont">
            <form method="POST" action="" id="mainwp_managebackups_add_form">
                <?php 
        MainWPManageBackups::renderNewEdit(null);
        ?>
                <p class="submit"><input type="button" name="mainwp_managebackups_add" id="mainwp_managebackups_add" class="button-primary" value="<?php 
        _e('Add New Task', 'mainwp');
        ?>
"  /></p>
            </form>
        </div>
        <?php 
        self::renderFooter('AddNew');
    }
开发者ID:BjornW,项目名称:mainwp,代码行数:30,代码来源:MainWPManageBackups.page.php

示例14: 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

示例15: 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


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