• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP lib3函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: to_html

    /**
     * Overrides parent's to_html() method.
     *
     * Creates an output buffer, outputs the HTML and grabs the buffer content before releasing it.
     * Creates a wrapper 'ms-wrap' HTML element to contain content and navigation. The content inside
     * the navigation gets loaded with dynamic method calls.
     * e.g. if key is 'settings' then render_settings() gets called, if 'bob' then render_bob().
     *
     * @todo Could use callback functions to call dynamic methods from within the helper, thus
     * creating the navigation with a single method call and passing method pointers in the $tabs array.
     *
     * @since  1.0.0
     *
     * @return object
     */
    public function to_html()
    {
        $this->check_simulation();
        $items = $this->data['addon']->get_addon_list();
        $lang = (object) array('active_badge' => __('ACTIVE', 'membership2'), 'show_details' => __('Details...', 'membership2'), 'close_details' => __('Close', 'membership2'));
        $filters = array('all' => __('All', 'membership2'), 'active' => __('Active', 'membership2'), 'inactive' => __('Inactive', 'membership2'), 'options' => __('With options', 'membership2'));
        ob_start();
        ?>
		<div class="ms-wrap ms-addon-list">
			<h2 class="ms-settings-title">
				<i class="wpmui-fa wpmui-fa-puzzle-piece"></i>
				<?php 
        _e('Membership Add-ons', 'membership2');
        ?>
			</h2>
			<form action="" method="post">
				<?php 
        lib3()->html->addon_list($items, $lang, $filters);
        ?>
			</form>
		</div>
		<?php 
        $html = ob_get_clean();
        echo $html;
    }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:40,代码来源:class-ms-view-addon.php


示例2: print_admin_message

 public static function print_admin_message()
 {
     $msg = !empty($_GET['msg']) ? (int) $_GET['msg'] : 0;
     $class = $msg > 0 ? 'updated' : 'error';
     if ($msg = self::get_admin_message($msg)) {
         lib3()->ui->admin_message($msg, $class);
     }
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:8,代码来源:class-ms-helper-member.php


示例3: prepare_fields

 /**
  * Prepare fields that are displayed in the form.
  *
  * @since  1.0.1.0
  * @return array
  */
 protected function prepare_fields()
 {
     $api_status = MS_Addon_Mailchimp::get_api_status();
     $settings = $this->data['settings'];
     $action = MS_Controller_Settings::AJAX_ACTION_UPDATE_CUSTOM_SETTING;
     $auto_opt_in = $settings->get_custom_setting('mailchimp', 'auto_opt_in');
     $auto_opt_in = lib3()->is_true($auto_opt_in);
     $fields = array('mailchimp_api_test' => array('id' => 'mailchimp_api_test', 'type' => MS_Helper_Html::TYPE_HTML_TEXT, 'title' => __('MailChimp API test status: ', 'membership2'), 'value' => $api_status ? __('Verified', 'membership2') : __('Failed', 'membership2'), 'class' => $api_status ? 'ms-ok' : 'ms-nok'), 'mailchimp_api_key' => array('id' => 'mailchimp_api_key', 'name' => 'custom[mailchimp][api_key]', 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'title' => __('MailChimp API Key', 'membership2'), 'desc' => sprintf('<div>' . __('Visit <a href="%1$s">your API dashboard</a> to create an API Key.', 'membership2') . '</div>', 'http://admin.mailchimp.com/account/api" target="_blank'), 'value' => $settings->get_custom_setting('mailchimp', 'api_key'), 'class' => 'ms-text-medium', 'ajax_data' => array('group' => 'mailchimp', 'field' => 'api_key', 'action' => $action)), 'separator' => array('type' => MS_Helper_Html::TYPE_HTML_SEPARATOR), 'auto_opt_in' => array('id' => 'auto_opt_in', 'name' => 'custom[mailchimp][auto_opt_in]', 'type' => MS_Helper_Html::INPUT_TYPE_RADIO_SLIDER, 'title' => __('Automatically opt-in new users to the mailing list.', 'membership2'), 'desc' => __('Users will not receive an email confirmation. You are responsible to inform your users.', 'membership2'), 'value' => $auto_opt_in, 'class' => 'inp-before', 'ajax_data' => array('group' => 'mailchimp', 'field' => 'auto_opt_in', 'action' => $action)), 'separator1' => array('type' => MS_Helper_Html::TYPE_HTML_SEPARATOR), 'mail_list_registered' => array('id' => 'mail_list_registered', 'name' => 'custom[mailchimp][mail_list_registered]', 'type' => MS_Helper_Html::INPUT_TYPE_SELECT, 'title' => __('Registered users mailing list (not members)', 'membership2'), 'field_options' => MS_Addon_Mailchimp::get_mail_lists(), 'value' => $settings->get_custom_setting('mailchimp', 'mail_list_registered'), 'ajax_data' => array('group' => 'mailchimp', 'field' => 'mail_list_registered', 'action' => $action)), 'mail_list_members' => array('id' => 'mail_list_members', 'name' => 'custom[mailchimp][mail_list_members]', 'type' => MS_Helper_Html::INPUT_TYPE_SELECT, 'title' => __('Members mailing list', 'membership2'), 'field_options' => MS_Addon_Mailchimp::get_mail_lists(), 'value' => $settings->get_custom_setting('mailchimp', 'mail_list_members'), 'ajax_data' => array('group' => 'mailchimp', 'field' => 'mail_list_members', 'action' => $action)), 'mail_list_deactivated' => array('id' => 'mail_list_deactivated', 'name' => 'custom[mailchimp][mail_list_deactivated]', 'type' => MS_Helper_Html::INPUT_TYPE_SELECT, 'title' => __('Deactivated memberships mailing list', 'membership2'), 'field_options' => MS_Addon_Mailchimp::get_mail_lists(), 'value' => $settings->get_custom_setting('mailchimp', 'mail_list_deactivated'), 'ajax_data' => array('group' => 'mailchimp', 'field' => 'mail_list_deactivated', 'action' => $action)));
     return $fields;
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:16,代码来源:class-ms-addon-mailchimp-view.php


示例4: set

 /**
  * Change a setting of the addon
  *
  * @since  1.0.0
  *
  * @param string $key
  * @param string $value
  */
 public function set($key, $value)
 {
     switch ($key) {
         case 'is_live':
             // This is a boolean value, not a string.
             $value = lib3()->is_true($value);
             break;
     }
     return $this->set_custom_setting(self::GROUP, $key, $value);
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:18,代码来源:class-ms-addon-taxamo-model.php


示例5: get_query_args

 private function get_query_args()
 {
     $defaults = MS_Model_Invoice::get_query_args();
     lib3()->array->equip_request('s');
     $per_page = $this->get_items_per_page('invoice_per_page', self::DEFAULT_PAGE_SIZE);
     $current_page = $this->get_pagenum();
     $args = array('posts_per_page' => $per_page, 'offset' => ($current_page - 1) * $per_page);
     // Filter by search-term
     $search_filter = $_REQUEST['s'];
     if (!empty($search_filter)) {
         $this->search_string = $search_filter;
     }
     $args = wp_parse_args($args, $defaults);
     return $args;
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:15,代码来源:class-ms-helper-listtable-billing.php


示例6: init

 /**
  * Initializes the Add-on. Always executed.
  *
  * @since  1.0.1.0
  */
 public function init()
 {
     if (self::is_active()) {
         $this->first_click_free = lib3()->is_true($this->get_setting('first_click_free'));
         $this->add_filter('ms_model_membership_is_system', 'is_system', 10, 2);
         $this->add_filter('ms_model_membership_is_valid_type', 'is_valid_type', 10, 2);
         $this->add_filter('ms_model_membership_get_types', 'get_types');
         $this->add_filter('ms_helper_listtable_membership_column_name_actions', 'list_table_actions', 10, 2);
         $this->add_filter('ms_helper_listtable_memberships_name_badge', 'list_table_badge', 10, 2);
         $this->add_action('ms_init_done', 'apply_membership');
         // Last action in the init sequence.
         $this->create_membership();
     } else {
         $this->add_filter('ms_model_membership_get_memberships', 'hide_membership', 10, 2);
     }
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:21,代码来源:class-ms-addon-searchindex.php


示例7: prepare_fields

 protected function prepare_fields()
 {
     $gateway = $this->data['model'];
     $action = MS_Controller_Gateway::AJAX_ACTION_UPDATE_GATEWAY;
     $nonce = wp_create_nonce($action);
     $fields = array('mode' => array('id' => 'mode', 'title' => __('Mode', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_SELECT, 'value' => $gateway->mode, 'field_options' => $gateway->get_mode_types(), 'class' => 'ms-text-large', 'ajax_data' => array(1)), 'api_login_id' => array('id' => 'api_login_id', 'title' => __('API Login ID', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'value' => $gateway->api_login_id, 'class' => 'ms-text-large', 'ajax_data' => array(1)), 'api_transaction_key' => array('id' => 'api_transaction_key', 'title' => __('API Transaction Key', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'value' => $gateway->api_transaction_key, 'class' => 'ms-text-large', 'ajax_data' => array(1)), 'pay_button_url' => array('id' => 'pay_button_url', 'title' => apply_filters('ms_translation_flag', __('Payment button label or URL', 'membership2'), 'gateway-button' . $gateway->id), 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'value' => $gateway->pay_button_url, 'class' => 'ms-text-large', 'ajax_data' => array(1)), 'secure_cc' => array('id' => 'secure_cc', 'title' => __('Secure Payments', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_RADIO_SLIDER, 'value' => lib3()->is_true($gateway->secure_cc), 'ajax_data' => array(1)), 'secure_cc_off' => array('id' => 'secure_cc_off', 'type' => MS_Helper_Html::TYPE_HTML_TEXT, 'value' => __('Default payment option: Credit card details need to be entered once and can be reused without entering the CVC number again.', 'membership2'), 'class' => 'hidden secure_cc_off'), 'secure_cc_on' => array('id' => 'secure_cc_on', 'type' => MS_Helper_Html::TYPE_HTML_TEXT, 'value' => __('Secure payment option: The user needs to enter the credit cards CVC number for every transaction - even for saved credit cards and every recurring payment.', 'membership2'), 'class' => 'hidden secure_cc_on'));
     // Process the fields and add missing default attributes.
     foreach ($fields as $key => $field) {
         if (!empty($field['ajax_data'])) {
             $fields[$key]['ajax_data']['field'] = $fields[$key]['id'];
             $fields[$key]['ajax_data']['_wpnonce'] = $nonce;
             $fields[$key]['ajax_data']['action'] = $action;
             $fields[$key]['ajax_data']['gateway_id'] = $gateway->id;
         }
     }
     return $fields;
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:17,代码来源:class-ms-gateway-authorize-view-settings.php


示例8: process_form

 /**
  * Processes a form submit and changes the rule values, if valid form data
  * is found.
  *
  * @since  1.0.0
  */
 private function process_form()
 {
     $action = false;
     if (isset($_POST['rule_action'])) {
         $action = $_POST['rule_action'];
         if (!$this->verify_nonce($action)) {
             $action = false;
         }
     } elseif (isset($_GET['rule_action'])) {
         $action = $_GET['rule_action'];
         if (!$this->verify_nonce($action, 'GET')) {
             $action = false;
         }
     }
     if (empty($action)) {
         return;
     }
     $redirect = false;
     switch ($action) {
         case self::ACTION_ADD:
             lib3()->array->strip_slashes($_POST, 'url_value');
             $url = $_POST['url_value'];
             $base = MS_Model_Membership::get_base();
             $rule = $base->get_rule(self::RULE_ID);
             $rule->add_url($url);
             $base->set_rule(self::RULE_ID, $rule);
             $base->save();
             $redirect = true;
             break;
         case self::ACTION_DELETE:
             $id = $_REQUEST['item'];
             $base = MS_Model_Membership::get_base();
             $rule = $base->get_rule(self::RULE_ID);
             $rule->delete_url($id);
             $base->set_rule(self::RULE_ID, $rule);
             $base->save();
             $redirect = true;
             break;
     }
     if ($redirect) {
         $target = esc_url_raw(remove_query_arg(array('_wpnonce', 'item', 'rule_action')));
         wp_safe_redirect($target);
         exit;
     }
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:51,代码来源:class-ms-rule-url.php


示例9: widget

 /**
  * Outputs the content of the widget.
  *
  * @since  1.0.0
  *
  * @param array $args
  * @param array $instance
  */
 public function widget($args, $instance)
 {
     $redirect_login = false;
     $redirect_logout = false;
     $shortcode_args = '';
     if (!empty($instance['redirect_login'])) {
         $redirect_login = lib3()->net->expand_url($instance['redirect_login']);
     }
     if (!empty($instance['redirect_logout'])) {
         $redirect_logout = lib3()->net->expand_url($instance['redirect_logout']);
     }
     if (!empty($instance['shortcode_args'])) {
         $shortcode_args = $instance['shortcode_args'];
     }
     echo $args['before_widget'];
     if (!empty($instance['title'])) {
         echo $args['before_title'];
         echo apply_filters('widget_title', $instance['title']);
         echo $args['after_title'];
     }
     $scode = sprintf('[%1$s header="no" %2$s %3$s %4$s]', MS_Helper_Shortcode::SCODE_LOGIN, $redirect_login ? 'redirect_login="' . $redirect_login . '"' : '', $redirect_logout ? 'redirect_logout="' . $redirect_logout . '"' : '', $shortcode_args);
     echo do_shortcode($scode);
     echo $args['after_widget'];
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:32,代码来源:class-ms-widget-login.php


示例10: set_tax_profile_value

 /**
  * Internal helper function that saves a user profile value either to DB or
  * to the session (depending if the user is logged in or not).
  *
  * @since  1.0.0
  * @internal
  *
  * @param  MS_Model_Member $member
  * @param  string $key The field key.
  * @param  mixed $value The value to save
  * @return bool True means that the value was set in $member, otherwise it
  *         was set in the session.
  */
 protected static function set_tax_profile_value($member, $key, $value)
 {
     if (is_object($member) && $member->is_valid()) {
         $member->set_custom_data($key, $value);
         $need_save = true;
     } else {
         lib3()->session->get_clear('ms_' . $key);
         lib3()->session->add('ms_' . $key, $value);
         $need_save = false;
     }
     return $need_save;
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:25,代码来源:class-ms-addon-taxamo-api.php


示例11: activate_addon

 /**
  * Adds activation details for a single add-on to the import object
  *
  * @since  1.0.0
  * @param  string $name The add-on name
  */
 protected function activate_addon($name)
 {
     $this->data->settings['addons'] = lib3()->array->get($this->data->settings['addons']);
     $this->data->settings['addons'][$name] = true;
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:11,代码来源:class-ms-model-import-membership.php


示例12: enqueue_scripts

 /**
  * Load Membership manager specific scripts.
  *
  * @since  1.0.0
  */
 public function enqueue_scripts()
 {
     $data = array('ms_init' => array(), 'lang' => array('msg_delete' => __('Do you want to completely delete the membership <strong>%s</strong> including all subscriptions?', 'membership2'), 'btn_delete' => __('Delete', 'membership2'), 'btn_cancel' => __('Cancel', 'membership2'), 'quickedit_error' => __('Error while saving changes.', 'membership2')));
     $step = $this->get_step();
     switch ($step) {
         case self::STEP_WELCOME_SCREEN:
             break;
         case self::STEP_ADD_NEW:
             $data['ms_init'][] = 'view_membership_add';
             $data['initial_url'] = MS_Controller_Plugin::get_admin_url();
             break;
         case self::STEP_OVERVIEW:
             $data['ms_init'][] = 'view_membership_overview';
             break;
         case self::STEP_PAYMENT:
             $data['ms_init'][] = 'view_membership_payment';
             $data['ms_init'][] = 'view_settings_payment';
             break;
         case self::STEP_EDIT:
             $data['ms_init'][] = 'view_membership_payment';
             $tab = $this->get_active_edit_tab();
             switch ($tab) {
                 case self::TAB_TYPE:
                     add_thickbox();
                     $data['ms_init'][] = 'view_membership_add';
                     break;
                 case self::TAB_UPGRADE:
                     $data['ms_init'][] = 'view_membership_upgrade';
                     break;
                 case self::TAB_MESSAGES:
                     $data['ms_init'][] = 'view_settings_protection';
                     break;
                 case self::TAB_EMAILS:
                     $data['ms_init'][] = 'view_settings_automated_msg';
                     break;
             }
             do_action('ms_controller_membership_enqueue_scripts_tab-' . $tab, $this);
             break;
         case self::STEP_MS_LIST:
             $data['ms_init'][] = 'view_membership_list';
             $data['ms_init'][] = 'view_settings_setup';
             break;
     }
     lib3()->ui->data('ms_data', $data);
     wp_enqueue_script('ms-admin');
     wp_enqueue_script('jquery-validate');
     do_action('ms_controller_membership_enqueue_scripts', $this);
     do_action('ms_controller_membership_enqueue_scripts-' . $step, $this);
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:54,代码来源:class-ms-controller-membership.php


示例13: enqueue_scripts

 /**
  * Load specific scripts.
  *
  * @since  1.0.0
  */
 public function enqueue_scripts()
 {
     $data = array('ms_init' => array('view_help'));
     lib3()->ui->data('ms_data', $data);
     wp_enqueue_script('ms-admin');
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:11,代码来源:class-ms-controller-help.php


示例14: enqueue_scripts

 /**
  * Load Membership admin scripts.
  *
  * @since  1.0.0
  */
 public function enqueue_scripts()
 {
     $active_tab = $this->get_active_tab();
     do_action('ms_controller_settings_enqueue_scripts_' . $active_tab);
     $plugin_url = MS_Plugin::instance()->url;
     $version = MS_Plugin::instance()->version;
     $initial_url = MS_Controller_Plugin::get_admin_url();
     $data = array('ms_init' => array(), 'initial_url' => $initial_url);
     $data['ms_init'][] = 'view_settings';
     switch ($active_tab) {
         case self::TAB_PAYMENT:
             add_thickbox();
             $data['ms_init'][] = 'view_settings_payment';
             break;
         case self::TAB_MESSAGES:
             $data['ms_init'][] = 'view_settings_protection';
             break;
         case self::TAB_EMAILS:
             $data['ms_init'][] = 'view_settings_automated_msg';
             break;
         case self::TAB_GENERAL:
             $data['ms_init'][] = 'view_settings_setup';
             break;
     }
     lib3()->ui->data('ms_data', $data);
     wp_enqueue_script('ms-admin');
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:32,代码来源:class-ms-controller-settings.php


示例15: enqueue_scripts

 /**
  * Enqueues necessary scripts and styles.
  *
  * Related Action Hooks:
  * - wp_enqueue_scripts
  * - admin_enqueue_scripts
  *
  * @since  1.0.0
  */
 public function enqueue_scripts()
 {
     $data = array('ms_init' => array('controller_adminbar'), 'switching_text' => __('Switching...', 'membership2'));
     lib3()->ui->add('select');
     lib3()->ui->data('ms_data', $data);
     wp_enqueue_script('ms-admin');
     wp_enqueue_script('jquery-ui-datepicker');
     wp_enqueue_style('ms-public');
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:18,代码来源:class-ms-controller-adminbar.php


示例16: translate_jquery_validator

    /**
     * Adds a javascript to the page that will translate the jQuery validator
     * messages.
     *
     * @since  1.0.0
     */
    public static function translate_jquery_validator()
    {
        ob_start();
        ?>
		jQuery.extend( jQuery.validator.messages, {
			required: "<?php 
        _e('This field is required.', 'membership2');
        ?>
",
			remote: "<?php 
        _e('Please fix this field.', 'membership2');
        ?>
",
			email: "<?php 
        _e('Please enter a valid email address.', 'membership2');
        ?>
",
			url: "<?php 
        _e('Please enter a valid URL.', 'membership2');
        ?>
",
			date: "<?php 
        _e('Please enter a valid date.', 'membership2');
        ?>
",
			dateISO: "<?php 
        _e('Please enter a valid date ( ISO ).', 'membership2');
        ?>
",
			number: "<?php 
        _e('Please enter a valid number.', 'membership2');
        ?>
",
			digits: "<?php 
        _e('Please enter only digits.', 'membership2');
        ?>
",
			creditcard: "<?php 
        _e('Please enter a valid credit card number.', 'membership2');
        ?>
",
			equalTo: "<?php 
        _e('Please enter the same value again.', 'membership2');
        ?>
",
			maxlength: jQuery.validator.format( "<?php 
        _e('Please enter no more than {0} characters.', 'membership2');
        ?>
" ),
			minlength: jQuery.validator.format( "<?php 
        _e('Please enter at least {0} characters.', 'membership2');
        ?>
" ),
			rangelength: jQuery.validator.format( "<?php 
        _e('Please enter a value between {0} and {1} characters long.', 'membership2');
        ?>
" ),
			range: jQuery.validator.format( "<?php 
        _e('Please enter a value between {0} and {1}.', 'membership2');
        ?>
" ),
			max: jQuery.validator.format( "<?php 
        _e('Please enter a value less than or equal to {0}.', 'membership2');
        ?>
" ),
			min: jQuery.validator.format( "<?php 
        _e('Please enter a value greater than or equal to {0}.', 'membership2');
        ?>
" )
		});
		<?php 
        $script = ob_get_clean();
        lib3()->ui->script($script);
    }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:80,代码来源:class-ms-controller-plugin.php


示例17: reset_form

    /**
     * Returns HTML partial that contains password-reset form.
     * Based on WordPress core code from wp-login.php
     *
     * @since  1.0.0
     *
     * @return string
     */
    private function reset_form()
    {
        static $Reset_Result = null;
        if (null === $Reset_Result) {
            lib3()->array->equip_get('login', 'key');
            lib3()->array->equip_post('pass1', 'pass2');
            $rp_login = wp_unslash($_GET['login']);
            $rp_key = wp_unslash($_GET['key']);
            $err_msg = new WP_Error();
            $fatal_error = false;
            lib3()->array->strip_slashes($_POST, 'pass1', 'pass2');
            $pass1 = $_POST['pass1'];
            $pass2 = $_POST['pass2'];
            // Get the user object and validate the key.
            if ($rp_login && $rp_key) {
                $user = check_password_reset_key($rp_key, $rp_login);
            } else {
                $user = false;
            }
            if (!$user || is_wp_error($user)) {
                // If the user was not found then show an error message.
                if ($user && 'expired_key' == $user->get_error_code()) {
                    $fatal_error = true;
                    $err_msg->add('password_expired_key', __('Sorry, this reset-key is not valid anymore. Please request a new reset email and try again.', 'membership2'));
                } else {
                    $fatal_error = true;
                    $err_msg->add('password_invalid_key', __('Sorry, we did not find a valid reset-key. Please request a new reset email and try again.', 'membership2'));
                }
            } else {
                // If the user provided a new password, then check it now.
                if ($pass1 && $pass1 != $pass2) {
                    $pass1 = false;
                    $err_msg->add('password_reset_mismatch', __('The passwords do not match, try again.', 'membership2'));
                }
            }
            if ($fatal_error && count($err_msg->errors)) {
                $url = esc_url_raw(add_query_arg(array('show' => 'lostpass'), remove_query_arg(array('action', 'key', 'login'))));
                $Reset_Result = sprintf('[ms-note type="warning"]%s[/ms-note]<a href="%s">%s</a>', $err_msg->get_error_message(), $url, __('Request a new password-reset key', 'membership2'));
            } elseif ($pass1) {
                // This action is documented in wp-login.php
                do_action('validate_password_reset', $err_msg, $user);
                reset_password($user, $_POST['pass1']);
                // All done! Show success message and link to login form
                $url = esc_url_raw(remove_query_arg(array('action', 'key', 'login')));
                $Reset_Result = sprintf('[ms-note type="info"]%s[/ms-note]<a href="%s">%s</a>', __('Your Password has been reset.', 'membership2'), $url, __('Login with your new password', 'membership2'));
            } else {
                // This action is documented in wp-login.php
                do_action('validate_password_reset', $err_msg, $user);
                wp_enqueue_script('utils');
                wp_enqueue_script('user-profile');
                ob_start();
                if (count($err_msg->errors)) {
                    printf('[ms-note type="warning"]%s[/ms-note]', implode('<br>', $err_msg->get_error_messages()));
                }
                ?>
				<form name="resetpassform" id="resetpassform"
					action="" method="post" autocomplete="off" class="ms-form">
					<input type="hidden" id="user_login"
						value="<?php 
                echo esc_attr($rp_login);
                ?>
" autocomplete="off"/>

					<p class="user-pass1-wrap">
						<label for="pass1"><?php 
                _e('New password');
                ?>
</label><br />
						<div class="wp-pwd">
							<span class="password-input-wrapper">
								<input type="password" data-reveal="1" data-pw="<?php 
                echo esc_attr(wp_generate_password(16));
                ?>
" name="pass1" id="pass1" class="input" size="20" value="" autocomplete="off" aria-describedby="pass-strength-result" />
							</span>
							<div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php 
                _e('Strength indicator');
                ?>
</div>
						</div>
					</p>
					<p class="user-pass2-wrap">
						<label for="pass2"><?php 
                _e('Confirm new password');
                ?>
</label><br />
						<input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off" />
					</p>

					<p class="description indicator-hint"><?php 
                echo wp_get_password_hint();
                ?>
//.........这里部分代码省略.........
开发者ID:jayjo,项目名称:topdraw,代码行数:101,代码来源:class-ms-view-shortcode-login.php


示例18: __get

 /**
  * Returns property associated with the render.
  *
  * @since  1.0.0
  * @param string $property The name of a property.
  * @return mixed Returns mixed value of a property or NULL if a property doesn't exist.
  */
 public function __get($property)
 {
     $value = null;
     switch ($property) {
         case 'rule_value':
         case 'dripped':
             $this->{$property} = lib3()->array->get($this->{$property});
             $value = $this->{$property};
             break;
         default:
             if (property_exists($this, $property)) {
                 $value = $this->{$property};
             }
             break;
     }
     return apply_filters('ms_rule__get', $value, $property, $this);
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:24,代码来源:class-ms-rule.php


示例19: enqueue_scripts

 /**
  * Load Billing specific scripts.
  *
  * @since  1.0.0
  */
 public function enqueue_scripts()
 {
     $data = array('ms_init' => array());
     if (isset($_GET['action']) && 'edit' == $_GET['action']) {
         wp_enqueue_script('jquery-ui-datepicker');
         wp_enqueue_script('jquery-validate');
         $data['ms_init'][] = 'view_billing_edit';
     } else {
         $module = '';
         if (isset($_GET['show'])) {
             $module = $_GET['show'];
         }
         if ('logs' == $module || 'matching' == $module) {
             $data['ms_init'][] = 'view_billing_transactions';
             $data['lang'] = array('link_title' => __('Link Transaction', 'membership2'));
         }
     }
     lib3()->ui->data('ms_data', $data);
     wp_enqueue_script('ms-admin');
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:25,代码来源:class-ms-controller-billing.php


示例20: ajax_action_update_dripped

 /**
  * Handle Ajax update dripped rules action.
  *
  * Related Action Hooks:
  * - wp_ajax_update_dripped
  *
  * @since  1.0.0
  */
 public function ajax_action_update_dripped()
 {
     $msg = MS_Helper_Membership::MEMBERSHIP_MSG_NOT_UPDATED;
     $this->_resp_reset();
     $fields = array('membership_ids', 'rule_type', 'item_id');
     if (!$this->verify_nonce('inline')) {
         $this->_resp_err('Invalid Nonce');
     } elseif (!$this->is_admin_user()) {
         $this->_resp_err('Access Denied');
     } elseif (!self::validate_required($fields, 'POST', false)) {
         $this->_resp_err('Missing Data');
     }
     if ($this->_resp_ok()) {
         $ids = $_POST['membership_ids'];
         $rule_type = $_POST['rule_type'];
         $item_id = $_POST['item_id'];
         if (!is_array($ids)) {
             $ids = explode(',', $ids);
         }
         // Loop all specified memberships and set the rule values.
         foreach ($ids as $id) {
             if (empty($_POST['ms_' . $id])) {
                 continue;
             }
             $data = lib3()->array->get($_POST['ms_' . $id]);
             lib3()->array->equip($data, 'dripped_type', 'date', 'delay_unit', 'delay_type');
             $membership = MS_Factory::load('MS_Model_Membership', $id);
             $rule = $membership->get_rule($rule_type);
             $rule->set_dripped_value($item_id, $data['dripped_type'], $data['date'], $data['delay_unit'], $data['delay_type']);
             $membership->set_rule($rule_type, $rule);
             $membership->save();
         }
         $msg = MS_Helper_Membership::MEMBERSHIP_MSG_UPDATED;
     }
     if (MS_Helper_Membership::MEMBERSHIP_MSG_UPDATED == $msg) {
         // If everything went well then get a refershed version of the list-table.
         $GLOBALS['hook_suffix'] = 'membership-2_page_' . MS_Controller_Plugin::MENU_SLUG . '-protection';
         $table = apply_filters('ms_rule_listtable-' . $rule_type, null);
         if ($table) {
             $args = array('offset' => isset($_POST['offset']) ? $_POST['offset'] : 0, 'number' => isset($_POST['number']) ? $_POST['number'] : 20);
             $items = $table->get_model()->get_contents($args);
             if (isset($items[$item_id])) {
                 echo $table->display_rows(array($items[$item_id]));
             }
         }
     } else {
         $msg .= $this->_resp_code();
         echo $msg;
     }
     exit;
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:59,代码来源:class-ms-controller-rule.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP libfile函数代码示例发布时间:2022-05-15
下一篇:
PHP lib2函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap