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


PHP WYSIJA::current_user_can方法代码示例

本文整理汇总了PHP中WYSIJA::current_user_can方法的典型用法代码示例。如果您正苦于以下问题:PHP WYSIJA::current_user_can方法的具体用法?PHP WYSIJA::current_user_can怎么用?PHP WYSIJA::current_user_can使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WYSIJA的用法示例。


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

示例1: __construct

 function __construct()
 {
     if (!WYSIJA::current_user_can('wysija_config')) {
         die("Action is forbidden.");
     }
     parent::__construct();
 }
开发者ID:duboisGeof,项目名称:deliciousMeals,代码行数:7,代码来源:config.php

示例2: WYSIJA_control_back_config

 function WYSIJA_control_back_config()
 {
     if (!WYSIJA::current_user_can('wysija_config')) {
         die("Action is forbidden.");
     }
     parent::WYSIJA_control();
 }
开发者ID:pablomarsan,项目名称:iftheme-docs,代码行数:7,代码来源:config.php

示例3: WYSIJA_control_back_campaigns

 function WYSIJA_control_back_campaigns()
 {
     if (!WYSIJA::current_user_can('wysija_newsletters')) {
         die("Action is forbidden.");
     }
     parent::WYSIJA_control();
 }
开发者ID:sontv1003,项目名称:fashionbeans,代码行数:7,代码来源:campaigns.php

示例4: whats_new

 /**
  * Welcome page for updaters
  * @return boolean
  */
 function whats_new()
 {
     $this->title = $this->viewObj->title = __('What\'s new?', WYSIJA);
     $this->jsTrans['instalwjp'] = __('Installing Wysija Newsletter Premium plugin', WYSIJA);
     $helper_readme =& WYSIJA::get('readme', 'helper');
     $helper_readme->scan();
     $this->data = array();
     $this->data['abouttext'] = __('You updated! It\'s like having the next gadget, but better.', WYSIJA);
     $is_multisite = is_multisite();
     $is_network_admin = WYSIJA::current_user_can('manage_network');
     $mConfig =& WYSIJA::get('config', 'model');
     if ($is_multisite) {
         if ($is_network_admin) {
             $mConfig->save(array('ms_wysija_whats_new' => WYSIJA::get_version()));
         }
     } else {
         $mConfig->save(array('wysija_whats_new' => WYSIJA::get_version()));
     }
     $major_release = true;
     $except_version = array('2.4.1', '2.4.2');
     $wysija_version = WYSIJA::get_version();
     if (!in_array($wysija_version, $except_version) && count(explode('.', $wysija_version)) > 2) {
         $major_release = false;
     }
     if ($major_release) {
         $this->data['sections'][] = array('title' => __('Added', WYSIJA), 'cols' => array(array('title' => __('Your data... tada!', WYSIJA), 'content' => str_replace(array('[link]', '[/link]', '[ajaxlink]', '[/ajaxlink]'), array('<a title="Open in new tab" target="_blank" href="http://support.wysija.com/knowledgebase/share-your-data/">', '</a>', '<a id="share_analytics" href="javascript:;">', '</a>'), __("We're looking for [link]anonymous data[/link] to build a better plugin. [ajaxlink]<strong>Yes, count me in!</strong>[/ajaxlink]", WYSIJA))), array('title' => __('Edit the HTML of your text blocks', WYSIJA), 'content' => __('You can now edit the HTML of text blocks in the visual editor. Activate this option in the Settings first.', WYSIJA)), array('title' => __('Improving the forms', WYSIJA), 'content' => __('This is a first step in several improvements to the subscription forms. Find your forms in your Settings.', WYSIJA))), 'format' => 'three-col');
         $this->data['sections'][] = array('title' => __('Improved', WYSIJA), 'cols' => array(array('title' => __('Timely autoresponders', WYSIJA), 'content' => "Send an email to a new subscriber... now works with imported subscribers. Moreover, it works retroactively as well."), array('title' => __('In your language', WYSIJA), 'content' => str_replace(array('[link]', '[/link]'), array('<a title="Open in new tab" target="_blank" href="https://www.transifex.com/projects/p/wysija/">', '</a>'), __('Our translations are getting better. But we\'re always looking for experienced translators. We give out Wysija Premium in exchange. [link]Join the translation teams[/link].', WYSIJA))), array('title' => __('Dozen of bug fixes', WYSIJA), 'content' => __('Thanks to all for your feedback. We\'re able to improve our plugin for everybody. Keep it coming.', WYSIJA))), 'format' => 'three-col');
     }
     $this->data['sections'][] = array('title' => __('Keep this plugin essentially free', WYSIJA), 'review' => array('title' => '1. ' . __('Love kittens?', WYSIJA) . ' ' . __('We love stars...', WYSIJA), 'content' => str_replace(array('[link]', '[/link]'), array('<a href="http://wordpress.org/support/view/plugin-reviews/wysija-newsletters" target="_blank" title="On wordpress.org">', '</a>'), __('Each time one of our users forgets to write a review, a kitten dies. It\'s sad and breaks our hearts. [link]Add your own review[/link] and save a kitten today.', WYSIJA))), 'follow' => array('title' => '2. ' . __('Follow us and don\'t miss anything!', WYSIJA), 'content' => $this->__get_social_buttons(false)), 'format' => 'review-follow');
     $this->data['sections'][] = array('title' => 'Change log', 'format' => 'bullets', 'paragraphs' => $helper_readme->changelog[WYSIJA::get_version()]);
     $this->viewObj->skip_header = true;
     return true;
 }
开发者ID:sontv1003,项目名称:fashionbeans,代码行数:37,代码来源:campaigns.php

示例5: welcome_new

    /**
     * Welcome page first time install
     * @return boolean
     */
    function welcome_new()
    {
        $this->title = $this->viewObj->title = __('Welcome Page!', WYSIJA);
        $this->jsTrans['instalwjp'] = __('Installing MailPoet Newsletter Premium plugin', WYSIJA);
        $helper_readme = WYSIJA::get('readme', 'helper');
        $helper_readme->scan();
        $this->data = array();
        $this->data['abouttext'] = __('A Brand New MailPoet. Let the Fun Begin.', WYSIJA);
        $model_config = WYSIJA::get('config', 'model');
        $is_multisite = is_multisite();
        $is_network_admin = WYSIJA::current_user_can('manage_network');
        if ($is_multisite && $is_network_admin) {
            $model_config->save(array('ms_wysija_whats_new' => WYSIJA::get_version()));
        } else {
            $model_config->save(array('wysija_whats_new' => WYSIJA::get_version()));
        }
        //add a new language code with a new video
        $video_language = array();
        //$video_language['en_EN'] = '<iframe width="853" height="480" src="http://www.youtube.com/embed/pYzaHDTg5Jk" frameborder="0" allowfullscreen></iframe>';
        $video_language['en_EN'] = '<iframe src="//player.vimeo.com/video/81479899" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
        //$video_language['fr_FR'] = '<iframe width="853" height="480" src="http://www.youtube.com/embed/W5EyW5w7aWQ" frameborder="0" allowfullscreen></iframe>';
        // $video_language['sv_SE']='<iframe width="853" height="480" src="http://www.youtube.com/embed/O8_t_dekx74" frameborder="0" allowfullscreen></iframe>';
        //$video_language['ar']='<iframe width="853" height="480" src="http://www.youtube.com/embed/cyDHlX_qgOo" frameborder="0" allowfullscreen></iframe>';
        $wp_lang = get_locale();
        if (!empty($wp_lang) && isset($video_language[$wp_lang])) {
            $welcome_video_link = $video_language[$wp_lang];
        } else {
            $welcome_video_link = $video_language['en_EN'];
        }
        $this->data['sections'][] = array('title' => __('Hey, we\'re curious! How did you find out about us?', WYSIJA) . '<span id="poll_result"></span>', 'format' => 'normal', 'paragraphs' => array('<ul class="welcome_poll">
						<li>
							<input type="radio" id="how_did_you_find_us_1" value="repository" name="how_did_you_find_us">
							<label value="lab1" for="how_did_you_find_us_1">' . __('WordPress.org plugin repository', WYSIJA) . '</label>
						</li>
						<li>
							<input type="radio" id="how_did_you_find_us_2" value="search_engine" name="how_did_you_find_us">
							<label value="lab2" for="how_did_you_find_us_2">' . __('Google or other search engine', WYSIJA) . '</label>
						</li>
						<li>
							<input type="radio" id="how_did_you_find_us_3" value="friend" name="how_did_you_find_us">
							<label value="lab3" for="how_did_you_find_us_3">' . __('Friend recommendation', WYSIJA) . '</label>
						</li>
						<li>
							<input type="radio" id="how_did_you_find_us_4" value="url" name="how_did_you_find_us">
							<label value="lab4" for="how_did_you_find_us_4">' . __('Blog post, online review, forum:', WYSIJA) . '</label>
							<input type="text" id="how_did_you_find_us_4_url"  name="how_did_you_find_us_url" placeholder="' . __('Please enter the address where you\'ve found out about us', WYSIJA) . '">
						</li>
					</ul>'));
        $this->data['sections'][] = array('title' => __('First Time? See it in Action', WYSIJA), 'format' => 'normal', 'paragraphs' => array(__('You can start by watching this video by one of our users.', WYSIJA), $welcome_video_link));
        // Check if user is already sharing data, and hide the share link.
        if (!$model_config->getValue('analytics')) {
            $share_section = array('title' => __('Share your data', WYSIJA), 'content' => str_replace(array('[link]', '[/link]', '[ajaxlink]', '[/ajaxlink]'), array('<a title="Anonymous Data" target="_blank" href="http://support.mailpoet.com/knowledgebase/share-your-data/?utm_source=wpadmin&utm_campaign=welcome_page">', '</a>', '<a id="share_analytics" href="javascript:;">', '</a>'), __("We know too little about our users. We're looking for [link]anonymous data[/link] to build a better plugin. [ajaxlink]Yes, count me in![/ajaxlink]", WYSIJA)));
        } else {
            $share_section = array('title' => __('Share your data', WYSIJA), 'content' => str_replace(array('[link]', '[/link]'), array('<a title="Anonymous Data" target="_blank" href="http://support.mailpoet.com/knowledgebase/share-your-data/?utm_source=wpadmin&utm_campaign=welcome_page">', '</a>', '<a id="share_analytics" href="javascript:;">', '</a>'), __("We know too little about our users. We're looking for [link]anonymous data[/link] to build a better plugin. Thanks, you're already sharing!", WYSIJA)));
        }
        $this->data['sections'][] = array('title' => __('What You Can Do', WYSIJA), 'cols' => array(array('title' => __('5 minute newbie guide', WYSIJA), 'content' => __('Your MailPoet comes with an example newsletter. You\'ll see it when you close this welcome page. Edit it to start playing with it.', WYSIJA)), $share_section, array('title' => __('Help yourself. Or let us help you.', WYSIJA), 'content' => str_replace(array('[link]', '[/link]'), array('<a href="http://support.mailpoet.com/" target="_blank" title="On our blog!">', '</a>'), __('We got documentation and a ticket system on [link]support.mailpoet.com[/link]. We answer within 24h.', WYSIJA)))), 'format' => 'three-col');
        $this->viewObj->skip_header = true;
        return true;
    }
开发者ID:pablomarsan,项目名称:iftheme-docs,代码行数:63,代码来源:campaigns.php

示例6: WYSIJA_control_back_campaigns

 function WYSIJA_control_back_campaigns()
 {
     $modelC =& WYSIJA::get("config", "model");
     if (!WYSIJA::current_user_can('wysija_newsletters')) {
         die("Action is forbidden.");
     }
     parent::WYSIJA_control();
 }
开发者ID:fwelections,项目名称:fwelections,代码行数:8,代码来源:campaigns.php

示例7: WYSIJA_control_back_tmce

 function WYSIJA_control_back_tmce()
 {
     if (!WYSIJA::current_user_can('wysija_subscriwidget')) {
         die("Action is forbidden.");
     }
     parent::WYSIJA_control();
     $this->viewObj =& WYSIJA::get('tmce', 'view');
 }
开发者ID:rotoballer,项目名称:emily,代码行数:8,代码来源:tmce.php

示例8: defaultDisplay

 public function defaultDisplay()
 {
     if (!WYSIJA::current_user_can('wysija_stats_dashboard')) {
         die('Action is forbidden.');
     }
     $this->pre_defined_dates = $this->get_pre_defined_dates();
     // Define view
     $this->viewShow = $this->action = 'main';
     $this->js['jquery.core'] = 'jquery/ui/jquery.ui.core';
     $this->js['jquery.datepicker'] = 'jquery/ui/jquery.ui.datepicker';
     $this->js['wysijalazyload'] = 'wysija-lazyload';
     $this->js['admin-statistics-filter'] = 'admin-statistics-filter';
     wp_enqueue_style('jquery.core', WYSIJA_URL . 'css/jquery/ui/themes/base/jquery.ui.core.min.css', array(), WYSIJA::get_version());
     wp_enqueue_style('jquery.core', WYSIJA_URL . 'css/jquery/ui/themes/base/jquery.ui.theme.min.css', array(), WYSIJA::get_version());
     // date filter
     $default_duration = $this->get_default_duration();
     if (function_exists('date_diff')) {
         $this->data['date_interval'] = date_diff(date_create($default_duration->from), date_create($default_duration->to));
     } else {
         $duration = strtotime($default_duration->to) - strtotime($default_duration->from);
         $helper_toolbox = WYSIJA::get('toolbox', 'helper');
         $this->data['date_interval'] = (object) $helper_toolbox->convert_seconds_to_array($duration, false);
     }
     $this->data['custom_dates'] = $this->pre_defined_dates;
     $this->data['default_duration'] = $default_duration;
     $this->data['js_date_format'] = $this->js_date_format;
     // Process and push data into view
     $this->data['lazy_load'] = $this->lazy_load;
     $hook_name = 'hook_stats';
     $hook_params = array();
     $hook_params['top'] = WYSIJA_module_statistics::DEFAULT_TOP_RECORDS;
     $hook_params['from'] = !empty($_REQUEST['filter']['from']) ? $_REQUEST['filter']['from'] : $default_duration->from;
     $hook_params['to'] = !empty($_REQUEST['filter']['to']) ? $_REQUEST['filter']['to'] : $default_duration->to;
     $hook_params['group_by'] = $this->data['date_interval']->days == 0 || $this->data['date_interval']->days > WYSIJA_module_statistics::SWITCHING_DATE_TO_MONTH_THRESHOLD ? WYSIJA_module_statistics::GROUP_BY_MONTH : WYSIJA_module_statistics::GROUP_BY_DATE;
     // $this->data['date_interval']->days == 0, means, no begin date, no end date
     // Hack!
     $_REQUEST['limit_pp'] = $hook_params['top'];
     // Pagination, mark current selected value
     // Modify TO date to make sure we always count 23:59:59 of that day
     $to = new DateTime($hook_params['to']);
     $to->modify('+1 day');
     $hook_params['to'] = $to->format($this->date_format);
     $modules = WYSIJA_module::get_modules_from_hook($hook_name);
     $this->data['modules'] = $modules;
     $this->data['lazy_load_modules'] = array();
     $this->data['first_module'] = '';
     if (!$this->lazy_load) {
         $this->data['hooks'][$hook_name] = apply_filters('hook_stats', '', $hook_params);
     } else {
         if (!empty($modules)) {
             $first_module = array_shift($modules);
             // List of lazy loaded modules
             $this->data['lazy_load_modules'] = $modules;
             // Evenly we are lazy loading, we always load the first module by default
             $this->data['first_module'] = apply_filters('custom_module_hook', '', $first_module, $hook_name, $hook_params);
         }
     }
 }
开发者ID:crazyyy,项目名称:octagram,代码行数:58,代码来源:statistics.php

示例9: get_block

 /**
  * Render a hook of a specific module
  * @return string
  */
 public function get_block()
 {
     if (!WYSIJA::current_user_can('wysija_stats_dashboard')) {
         die('Action is forbidden.');
     }
     if (empty($_REQUEST['block'])) {
         return '';
     }
     $module = $_REQUEST['block'];
     $hook_name = 'hook_stats';
     return apply_filters('custom_module_hook', '', $module, $hook_name, $this->get_post_params());
 }
开发者ID:christocmp,项目名称:bingopaws,代码行数:16,代码来源:statistics.php

示例10: update_footer

 function update_footer($text)
 {
     $screen = get_current_screen();
     if (strpos($screen->base, 'wysija') === false) {
         return $text;
     }
     $title = esc_attr(WYSIJA::is_beta() ? __('Revert to stable', WYSIJA) : __('Switch to beta', WYSIJA));
     $warn_message = esc_attr(WYSIJA::is_beta() ? __('Confirm going back to the stable version?', WYSIJA) : __('Great! But the beta version might be buggy, and we expect you to report any bugs. Confirm to installing the Beta version?', WYSIJA));
     $args = array('page' => 'wysija_config', 'action' => 'packager-switch', '_wpnonce' => wp_create_nonce('packager-switch'));
     if (WYSIJA::is_beta()) {
         $args["stable"] = 1;
     }
     $switch_link = esc_attr(add_query_arg($args, admin_url('admin.php')));
     $switch_text = esc_attr(WYSIJA::is_beta() ? __('Revert to Stable', WYSIJA) : __('Switch to Beta', WYSIJA));
     $version_link = esc_url(add_query_arg(array('page' => 'wysija_campaigns', 'action' => 'whats_new'), admin_url('admin.php')));
     $premium = false;
     if (is_plugin_active('wysija-newsletters-premium/index.php')) {
         $premium = WYSIJA::get_version('wysija-newsletters-premium/index.php');
     }
     return (is_multisite() && WYSIJA::current_user_can('manage_network') || !is_multisite() && WYSIJA::current_user_can('switch_themes') ? "<span class='wrap'>" . "<a id='switch_to_package' href='{$switch_link}' title='{$title}' data-warn='{$warn_message}' class='add-new-h2'>{$switch_text}</a>" . (WYSIJA::is_beta() ? "<a target='_blank' class='add-new-h2' href='http://support.mailpoet.com/feedback/?utm_source=wpadmin&utm_campaign=contact_beta'>" . __('Report Bugs', WYSIJA) . "</a>" : "") . "</span>" : "") . "</p>" . "<p class='alignright'>" . __("MailPoet Version", WYSIJA) . ": <a href='{$version_link}'>" . esc_attr(WYSIJA::get_version()) . "</a>" . ($premium ? " | " . __("Premium", WYSIJA) . ": " . esc_attr($premium) . "</a>" : "");
 }
开发者ID:pablomarsan,项目名称:iftheme-docs,代码行数:21,代码来源:back.php

示例11: editTemplate

    function editTemplate($data = false)
    {
        $wjEngine = WYSIJA::get('wj_engine', 'helper');
        if (isset($data['email']['wj_data'])) {
            $wjEngine->setData($data['email']['wj_data'], true);
        } else {
            $wjEngine->setData();
        }
        if (isset($data['email']['wj_styles'])) {
            $wjEngine->setStyles($data['email']['wj_styles'], true);
        } else {
            $wjEngine->setStyles();
        }
        //print "\n\n--------\n\n";
        //echo '<div style="width:900px;margin:0 auto;">';
        //echo $wjEngine->renderEmail($data['email']);
        //echo '</div>';
        //print "\n\n--------\n\n";
        //exit;
        ?>
            <style type="text/css" id="wj_css">
                <?php 
        echo $wjEngine->renderStyles();
        ?>
            </style>

            <!-- BEGIN: Wysija Editor -->
            <?php 
        echo $wjEngine->renderEditor();
        ?>
            <!-- END: Wysija Editor -->
            <?php 
        $defaultData = $wjEngine->getDefaultData();
        ?>
            <div id="wysija_default_header" style="display:none;"><?php 
        echo $wjEngine->renderEditorHeader($defaultData['header']);
        ?>
</div>
            <div id="wysija_default_footer" style="display:none;"><?php 
        echo $wjEngine->renderEditorFooter($defaultData['footer']);
        ?>
</div>
            <div id="wysija_widgets_settings" style="display:none;">
                <div class="autopost"><?php 
        // if it's a post notification that should be sent immediately after an article is published, constrain to only 1 autopost with 1 post_limit
        if ((int) $data['email']['type'] === 2 && $data['email']['params']['autonl']['event'] === 'new-articles' && $data['email']['params']['autonl']['when-article'] === 'immediate') {
            print 'single';
        } else {
            print 'multiple';
        }
        ?>
</div>
                <div class="divider">
                    <?php 
        $params = $data['email']['params'];
        if (is_array($params) and isset($params['divider'])) {
            $divider = $params['divider'];
        } else {
            $divider = $defaultData['widgets']['divider'];
        }
        echo $wjEngine->renderEditorBlock(array_merge(array('type' => 'divider', 'no-block' => true), $divider));
        ?>
                </div>
                <div class="image"><?php 
        print WYSIJA_EDITOR_IMG . "transparent.png";
        ?>
</div>
                <div class="theme"><?php 
        if (isset($data['email']['params']['theme'])) {
            print $data['email']['params']['theme'];
        } else {
            print 'default';
        }
        ?>
</div>
            </div>

            <!-- BEGIN: Wysija Toolbar -->
            <div id="wysija_toolbar">
                <ul class="wysija_toolbar_tabs">
                    <li class="wjt-content">
                        <a class="selected" href="javascript:;" rel="content"><?php 
        _e("Content", WYSIJA);
        ?>
</a>
                    </li>
                    <li class="wjt-images"><a href="javascript:;" rel="images"><?php 
        _e("Images", WYSIJA);
        ?>
</a></li>
                    <?php 
        if (WYSIJA::current_user_can('wysija_style_tab')) {
            ?>
                        <li class="wjt-styles"><a href="javascript:;" rel="styles"><?php 
            _e("Styles", WYSIJA);
            ?>
</a></li>
                    <?php 
        }
        ?>
//.........这里部分代码省略.........
开发者ID:pauEscarcia,项目名称:AIMM,代码行数:101,代码来源:campaigns.php

示例12: save


//.........这里部分代码省略.........
                 $fs = 'bounce_rule_';
                 if (strpos($key, $fs) !== false) {
                     if (strpos($key, '_forwardto') === false) {
                         $indexrule = str_replace($fs, '', $key);
                         $helper_rules = WYSIJA::get('rules', 'helper', false, 'wysija-newsletters', false);
                         $rules = $helper_rules->getRules();
                         foreach ($rules as $keyy => $vals) {
                             if (isset($vals['behave'])) {
                                 $ruleMain = $helper_rules->getRules($vals['behave']);
                                 $data[$fs . $vals['key']] = $value;
                             }
                         }
                     }
                 }
             }
             // the regenerate box appeared for old versions of MailPoet where we had to switch from a 512 bits DKIM key to a 1024 for better score with Gmail
             // if the dkim_regenerate box has been ticked then we unset the dkim values so that they are regenerated in the next page load
             if (isset($data['dkim_regenerate']) && $data['dkim_regenerate'] == 'regenerate') {
                 if (isset($this->values['dkim_pubk'])) {
                     unset($data['dkim_pubk']);
                     unset($this->values['dkim_pubk']);
                     unset($data['dkim_privk']);
                     unset($this->values['dkim_privk']);
                     unset($data['dkim_regenerate']);
                 }
             }
             // when we switch the double optin value on to off or off to on, we refresh the total user count which is different in both cases
             if (isset($data['confirm_dbleoptin']) && isset($this->values['confirm_dbleoptin']) && $data['confirm_dbleoptin'] != $this->values['confirm_dbleoptin']) {
                 $helper_user = WYSIJA::get('user', 'helper');
                 $helper_user->refreshUsers();
             }
         }
         $is_multisite = is_multisite();
         $is_network_admin = WYSIJA::current_user_can('manage_network');
         $global_MS_settings = array();
         foreach ($data as $key => $value) {
             // we detect a ms value, so we put it in a separate array to store it somewhere else central
             if ($is_multisite && $is_network_admin && strpos($key, 'ms_') !== false) {
                 $global_MS_settings[$key] = $value;
                 continue;
             }
             // verify that the confirm email body contains an activation link
             // if it doesn't add it at the end of the email
             if ($key == 'confirm_email_body' && strpos($value, '[activation_link]') === false) {
                 $value .= "\n" . '[activation_link]Click here to confirm your subscription.[/activation_link]';
             }
             // I'm not sure why do we do that, we separate the DKIm wrappers from teh value saved in the option.. why not, there must be a reason
             if ($key == 'dkim_pubk') {
                 $value = str_replace(array('-----BEGIN PUBLIC KEY-----', '-----END PUBLIC KEY-----', "\n"), '', $value);
             }
             if (is_string($value)) {
                 $value = preg_replace('#< *script(?:(?!< */ *script *>).)*< */ *script *>#isU', '', $value);
                 $value = preg_replace("#<([^><]+?)([^a-z_\\-]on\\w*|xmlns)(\\s*=\\s*[^><]*)([><]*)#i", "<\\1\\4", $value);
             }
             // for the manage subscription option you can select which list appear publicy to the user in their subscription page.
             // this piece of code  make sure that they appear or not
             if ($key == 'manage_subscriptions_lists') {
                 $model_list = WYSIJA::get('list', 'model');
                 $model_list->update(array('is_public' => 0), array('is_public' => 1));
                 $model_list->reset();
                 $model_list->update(array('is_public' => 1), array('list_id' => $value));
                 unset($this->values[$key]);
             }
             // we have a variable in this class which is defaults
             // we save the option only if its value is different than the default one: no need to overload the db.
             if (!isset($this->defaults[$key]) || isset($this->defaults[$key]) && $value != $this->defaults[$key]) {
开发者ID:duboisGeof,项目名称:deliciousMeals,代码行数:67,代码来源:config.php

示例13: check

 function check()
 {
     $config =& WYSIJA::get('config', 'model');
     if (!$config->getValue('wysija_db_version') || version_compare($config->getValue('wysija_db_version'), WYSIJA::get_version()) < 0) {
         $this->update(WYSIJA::get_version());
     }
     $noredirect = false;
     if (WYSIJA::current_user_can('switch_themes')) {
         if (isset($_REQUEST['page']) && in_array($_REQUEST['page'], array('wysija_config', 'wysija_campaigns', 'wysija_subscribers'))) {
             $whats_new_option = 'wysija_whats_new';
             $is_multisite = is_multisite();
             $is_network_admin = WYSIJA::current_user_can('manage_network');
             if ($is_multisite) {
                 if ($is_network_admin) {
                     $whats_new_option = 'ms_wysija_whats_new';
                 } else {
                     return;
                 }
             }
             if (!$config->getValue($whats_new_option) || version_compare($config->getValue($whats_new_option), WYSIJA::get_version()) < 0) {
                 if (isset($_REQUEST['action']) && in_array($_REQUEST['action'], array('whats_new', 'welcome_new', 'activate-plugin'))) {
                     $noredirect = true;
                 }
                 if (!$noredirect) {
                     $timeInstalled = $config->getValue('installed_time') + 3600;
                     if (time() > $timeInstalled) {
                         WYSIJA::redirect('admin.php?page=wysija_campaigns&action=whats_new');
                     } else {
                         WYSIJA::redirect('admin.php?page=wysija_campaigns&action=welcome_new');
                     }
                 }
             }
         }
     }
 }
开发者ID:sontv1003,项目名称:fashionbeans,代码行数:35,代码来源:update.php

示例14: version

 /**
  *
  */
 function version()
 {
     $wysija_footer_links = '<div class="wysija-version">';
     $wysija_footer_links .= '<div class="social-foot">';
     $link_start = ' | <a target="_blank" id="switch_to_package" href="admin.php?page=wysija_campaigns&action=switch_to_package&plugin=wysija-newsletters&_wpnonce=' . WYSIJA_view::secure(array('controller' => 'wysija_campaigns', 'action' => 'switch_to_package'), true);
     if (WYSIJA::is_beta()) {
         $beta_link = $link_start . '&stable=1"  title="' . __('Switch back to stable', WYSIJA) . '">' . __('Switch back to stable', WYSIJA) . '</a>';
     } else {
         $beta_link = $link_start . '"   title="' . __('Switch to beta', WYSIJA) . '">' . __('Switch to beta', WYSIJA) . '</a>';
     }
     if (is_multisite() && !WYSIJA::current_user_can('manage_network') || !is_multisite() && !WYSIJA::current_user_can('switch_themes')) {
         $beta_link = '';
     }
     $wysija_footer_links .= '<div id="upperfoot"><div class="support"><a target="_blank" href="http://support.mailpoet.com/?utm_source=wpadmin&utm_campaign=footer" >' . __('Support', WYSIJA) . '</a>' . $beta_link;
     add_filter('wysija_footer_add_stars', array($this, 'footer_add_stars'), 10);
     $wysija_footer_links .= apply_filters('wysija_footer_add_stars', '');
     $wysija_footer_links .= '<div class="version">' . __('Wysija Version: ', WYSIJA) . '<a href="admin.php?page=wysija_campaigns&action=whats_new">' . WYSIJA::get_version() . '</a></div></div>';
     /*$config=WYSIJA::get('config','model');
       $msg=$config->getValue('ignore_msgs');
       if(!isset($msg['socialfoot'])){
           $wysijaversion .= $this->controller->__get_social_buttons();
       }*/
     $wysija_footer_links .= '</div></div>';
     echo $wysija_footer_links;
 }
开发者ID:namwoody,项目名称:curry,代码行数:28,代码来源:back.php

示例15: _inject_alert

    private function _inject_alert($data)
    {
        if (WYSIJA::current_user_can('install_plugins') && version_compare(PHP_VERSION, '5.3', '<')) {
            $data['abouttext'] .= '</div><div class="mp_php_alert">
                    <h3>' . __('Hey! Your site is running an old software!', WYSIJA) . '</h3>
                    <ul>
                        <li> ' . __('MailPoet is modernizing itself in the coming months.', WYSIJA) . '</li>
                        <li>' . __("In order to enjoy our latest enhancements, you'll need to ask your hosting company to update your site.", WYSIJA) . '</li>

                        <li>' . ' <h4>' . __("What are the benefits of updating my site now?", WYSIJA) . '</h4>' . '</li>
                        <li>
                            <ol>
                                <li>' . __("Your website will be more secure, running an updated software.", WYSIJA) . '</li>
                                <li>' . __("Your MailPoet will be more performant, scalable and reliable.", WYSIJA) . '</li>
                                <li>' . __("You will be one-step closer to the next generation of WordPress coming in 2015 which will require more recent software.", WYSIJA) . '</li>
                            </ol>
                        </li>
                        <li><h4>' . __("Ready to Update your site?", WYSIJA) . '</h4></li>
                        <li><a href="http://support.mailpoet.com/knowledgebase/how-to-prepare-my-site-for-mailpoet-3-0" target="_blank">' . __("Yes, please guide me!", WYSIJA) . '</a> - <a href="http://support.mailpoet.com/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=contact_php_update" class="mp_negative" target="_blank">' . __("No, I have a few concerns...", WYSIJA) . '</a></li>
                    </ul>';
        }
        return $data;
    }
开发者ID:namwoody,项目名称:SAAZINDIAN.COM,代码行数:23,代码来源:campaigns.php


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