本文整理汇总了PHP中MS_Controller_Plugin类的典型用法代码示例。如果您正苦于以下问题:PHP MS_Controller_Plugin类的具体用法?PHP MS_Controller_Plugin怎么用?PHP MS_Controller_Plugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MS_Controller_Plugin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: admin_init
/**
* Initialize the admin-side functions.
*
* @since 1.0.0
*/
public function admin_init()
{
$hook = MS_Controller_Plugin::admin_page_hook('protection');
$this->run_action('load-' . $hook, 'admin_page_process');
$this->run_action('admin_print_scripts-' . $hook, 'enqueue_scripts');
$this->run_action('admin_print_styles-' . $hook, 'enqueue_styles');
}
开发者ID:klgrimley,项目名称:mzf,代码行数:12,代码来源:class-ms-controller-protection.php
示例2: prepare_fields
/**
* Prepare html fields.
*
* @since 1.0.0
*
* @return array
*/
function prepare_fields()
{
$invoice = $this->data['invoice'];
$currency = MS_Plugin::instance()->settings->currency;
$user_name = '';
$transaction_link = '';
$user_id = 0;
$user_list = array();
if ($invoice->id) {
$member = $invoice->get_member();
$user_id = $member->id;
$user_name = $member->name;
$transaction_link = sprintf('<a href="%s" target="_blank">%s</a>', MS_Controller_Plugin::get_admin_url('billing', array('show' => 'logs', 'invoice' => $invoice->id)), __('Show Transactions', 'membership2'));
} else {
$user_list = MS_Model_Member::get_usernames(null, MS_Model_Member::SEARCH_ALL_USERS);
}
$fields = array('link_transactions' => array('id' => 'link_transactions', 'title' => $transaction_link, 'type' => MS_Helper_Html::TYPE_HTML_TEXT, 'wrapper_class' => 'ms-transactions-link'), 'txt_user' => array('id' => 'txt_user', 'title' => __('Invoice for member', 'membership2'), 'type' => MS_Helper_Html::TYPE_HTML_TEXT, 'value' => sprintf('<a href="%s">%s</a>', MS_Controller_Plugin::get_admin_url('add-member', array('user_id' => $user_id)), $user_name)), 'txt_membership' => array('id' => 'txt_membership', 'title' => __('Payment for membership', 'membership2'), 'type' => MS_Helper_Html::TYPE_HTML_TEXT), 'txt_created' => array('id' => 'txt_created', 'title' => __('Invoice created on', 'membership2'), 'type' => MS_Helper_Html::TYPE_HTML_TEXT), 'txt_separator' => array('type' => MS_Helper_Html::TYPE_HTML_SEPARATOR), 'status' => array('id' => 'status', 'title' => __('Invoice status', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_SELECT, 'field_options' => MS_Model_Invoice::get_status_types(true), 'value' => $invoice->status), 'user_id' => array('id' => 'user_id', 'title' => __('Invoice for member', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_SELECT, 'value' => $invoice->user_id, 'field_options' => $user_list), 'membership_id' => array('id' => 'membership_id', 'title' => __('Payment for membership', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_SELECT, 'value' => $invoice->membership_id, 'field_options' => $this->data['memberships']), 'amount' => array('id' => 'amount', 'title' => sprintf(__('Amount (%s)', 'membership2'), $currency), 'type' => MS_Helper_Html::INPUT_TYPE_NUMBER, 'value' => MS_Helper_Billing::format_price($invoice->amount), 'config' => array('step' => 'any', 'min' => 0)), 'discount' => array('id' => 'discount', 'title' => sprintf(__('Discount (%s)', 'membership2'), $currency), 'type' => MS_Helper_Html::INPUT_TYPE_NUMBER, 'value' => MS_Helper_Billing::format_price($invoice->discount), 'config' => array('step' => 'any', 'min' => 0)), 'due_date' => array('id' => 'due_date', 'title' => __('Due date', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_DATEPICKER, 'value' => $invoice->due_date), 'description' => array('id' => 'description', 'title' => __('Description', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'class' => 'widefat', 'value' => $invoice->description), 'notes' => array('id' => 'notes', 'title' => __('Notes', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_TEXT_AREA, 'class' => 'widefat', 'value' => $invoice->get_notes_desc()), 'invoice_id' => array('id' => 'invoice_id', 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'value' => $invoice->id), '_wpnonce' => array('id' => '_wpnonce', 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'value' => wp_create_nonce($this->data['action'])), 'action' => array('id' => 'action', 'type' => MS_Helper_Html::INPUT_TYPE_HIDDEN, 'value' => $this->data['action']), 'separator' => array('type' => MS_Helper_Html::TYPE_HTML_SEPARATOR), 'execute' => array('id' => 'execute', 'title' => __('Execute status change actions on Save (add/remove membership)', 'membership2'), 'type' => MS_Helper_Html::INPUT_TYPE_CHECKBOX, 'value' => true), 'cancel' => array('id' => 'cancel', 'type' => MS_Helper_Html::TYPE_HTML_LINK, 'title' => __('Cancel', 'membership2'), 'value' => __('Cancel', 'membership2'), 'url' => esc_url_raw(remove_query_arg(array('action', 'invoice_id'))), 'class' => 'wpmui-field-button button'), 'submit' => array('id' => 'submit', 'type' => MS_Helper_Html::INPUT_TYPE_SUBMIT, 'value' => __('Save Changes', 'membership2')));
if ($invoice->id > 0) {
$fields['user_id']['type'] = MS_Helper_Html::INPUT_TYPE_HIDDEN;
$fields['membership_id']['type'] = MS_Helper_Html::INPUT_TYPE_HIDDEN;
$fields['txt_membership']['value'] = $this->data['memberships'][$invoice->membership_id];
$fields['txt_created']['value'] = MS_Helper_Period::format_date($invoice->invoice_date);
} else {
unset($fields['txt_user']);
unset($fields['txt_membership']);
unset($fields['txt_created']);
unset($fields['txt_separator']);
}
return apply_filters('ms_view_billing_edit_prepare_fields', $fields, $this);
}
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:37,代码来源:class-ms-view-billing-edit.php
示例3: to_html
/**
* Create view output.
*
* @since 1.0.0
*
* @return string
*/
public function to_html()
{
$code_list = MS_Factory::create('MS_Addon_Invitation_Helper_Listtable');
$code_list->prepare_items();
$title = __('Invitations', 'membership2');
$add_new_button = array('id' => 'add_new', 'type' => MS_Helper_Html::TYPE_HTML_LINK, 'url' => MS_Controller_Plugin::get_admin_url(MS_Addon_Invitation::SLUG, array('action' => 'edit', 'invitation_id' => 0)), 'value' => __('Add New Code', 'membership2'), 'class' => 'button');
ob_start();
?>
<div class="wrap ms-wrap">
<?php
MS_Helper_Html::settings_header(array('title' => $title, 'title_icon_class' => 'wpmui-fa wpmui-fa-ticket'));
?>
<div>
<?php
MS_Helper_Html::html_element($add_new_button);
?>
</div>
<form action="" method="post">
<?php
$code_list->display();
?>
</form>
<p><em>
<?php
_e('By default all Memberships are protected and require an invitation code to register.<br>You can manually change this for individual memberships via a new setting in the "Payment Options" settings of each membership.', 'membership2');
?>
</em></p>
</div>
<?php
$html = ob_get_clean();
return apply_filters('ms_addon_invitation_view_list_to_html', $html, $this);
}
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:41,代码来源:class-ms-addon-invitation-view-list.php
示例4: to_html
/**
* Create view output.
*
* @since 1.0.0
*
* @return string
*/
public function to_html()
{
$coupon_list = MS_Factory::create('MS_Addon_Coupon_Helper_Listtable');
$coupon_list->prepare_items();
$title = __('Coupons', MS_TEXT_DOMAIN);
$add_new_button = array('id' => 'add_new', 'type' => MS_Helper_Html::TYPE_HTML_LINK, 'url' => MS_Controller_Plugin::get_admin_url('coupons', array('action' => 'edit', 'coupon_id' => 0)), 'value' => __('Add New Coupon', MS_TEXT_DOMAIN), 'class' => 'button');
ob_start();
?>
<div class="wrap ms-wrap">
<?php
MS_Helper_Html::settings_header(array('title' => $title, 'title_icon_class' => 'wpmui-fa wpmui-fa-credit-card'));
?>
<div>
<?php
MS_Helper_Html::html_element($add_new_button);
?>
</div>
<form action="" method="post">
<?php
$coupon_list->display();
?>
</form>
</div>
<?php
$html = ob_get_clean();
return apply_filters('ms_addon_coupon_view_list_to_html', $html, $this);
}
开发者ID:jsandlin85,项目名称:SkylineSports,代码行数:36,代码来源:class-ms-addon-coupon-view-list.php
示例5: get_contents
/**
* Returns the contens of the dialog
*
* @since 1.0.0
*
* @return object
*/
public function get_contents($data)
{
$subscription = $data['model'];
$gateways = MS_Model_Gateway::get_gateway_names();
$invoices = $subscription->get_invoices();
$pay_details = array();
$inv_details = array();
foreach ($subscription->get_payments() as $payment) {
if (isset($gateways[$payment['gateway']])) {
$gateway = $gateways[$payment['gateway']];
} else {
$gateway = '(' . $payment['gateway'] . ')';
}
$pay_details[] = array('title' => __('Recorded Payment', 'membership2'), 'type' => MS_Helper_Html::TYPE_HTML_TABLE, 'value' => array(0 => array('Payment Date', $payment['date']), 1 => array('Payment Gateway', $gateway), 2 => array('Amount', $payment['amount']), 3 => array('External ID', $payment['external_id'])), 'field_options' => array('head_col' => true));
}
$invoice_list = array();
foreach ($invoices as $invoice) {
if (isset($gateways[$invoice->gateway_id])) {
$gateway = $gateways[$invoice->gateway_id];
} else {
$gateway = '(' . $invoice->gateway_id . ')';
}
$transaction_log = sprintf(' <small>- <a href="%s" target="_blank">%s</a></small>', MS_Controller_Plugin::get_admin_url('billing', array('show' => 'logs', 'invoice' => $invoice->id)), __('Show Transaction', 'membership2'));
$invoice_list[] = $invoice->id;
$inv_details[$invoice->id] = array('title' => sprintf(__('Invoice %s', 'membership2'), $invoice->id), 'type' => MS_Helper_Html::TYPE_HTML_TABLE, 'value' => array(0 => array('Invoice ID', $invoice->id . $transaction_log), 2 => array('Create Date', $invoice->invoice_date), 1 => array('Payment Gateway', $gateway), 2 => array('Due Date', $invoice->due_date), 3 => array('Regular amount', $invoice->amount), 4 => array('Total billed', $invoice->total), 5 => array('Status', $invoice->status), 6 => array('Notes', $invoice->description), 7 => array('Checkout IP', $invoice->checkout_ip), 8 => array('Checkout Date', $invoice->checkout_date)), 'field_options' => array('head_col' => true));
if ($invoice->amount == $invoice->total) {
unset($inv_details[$invoice->id]['value'][3]);
$inv_details[$invoice->id]['value'] = array_values($inv_details[$invoice->id]['value']);
}
}
$transaction_url = MS_Controller_Plugin::get_admin_url('billing', array('show' => 'logs', 'invoice' => implode(',', $invoice_list)));
$transaction_log = array('type' => MS_Helper_Html::TYPE_HTML_LINK, 'value' => __('Show all Transactions for this subscription', 'membership2'), 'url' => $transaction_url, 'target' => '_blank');
ob_start();
?>
<div class="wpmui-grid-8 ms-payment-infos">
<div class="col-5">
<?php
foreach ($inv_details as $detail) {
MS_Helper_Html::html_element($detail);
}
?>
</div>
<div class="col-3">
<?php
MS_Helper_Html::html_element($transaction_log);
MS_Helper_Html::html_separator();
foreach ($pay_details as $detail) {
MS_Helper_Html::html_element($detail);
}
?>
</div>
</div>
<?php
$html = ob_get_clean();
return apply_filters('ms_view_member_payment_to_html', $html);
}
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:63,代码来源:class-ms-view-member-payment.php
示例6: column_members
public function column_members($item, $column_name)
{
$html = '';
if (!$item->is_system()) {
$count = $item->get_members_count();
$url = MS_Controller_Plugin::get_admin_url('members', array('membership_id' => $item->id));
$html = sprintf('<a href="%2$s">%1$s</a>', intval($count), $url);
}
return $html;
}
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:10,代码来源:class-ms-helper-listtable-membership.php
示例7: purchase_info_content
/**
* Show manual purchase/payment information.
*
* Returns a default messsage if gateway is not configured.
*
* @hook ms_controller_gateway_purchase_info_content
*
* @since 1.0.0
* @return string The payment info.
*/
public function purchase_info_content()
{
static $Processed = false;
/**
* If some plugin calls `the_content()` multiple times then this
* function will also run multiple times.
* We want to process the details only once, so we have this condition!
*/
if (!$Processed) {
$Processed = true;
do_action('ms_gateway_manual_purchase_info_content_before', $this);
if (empty($this->payment_info)) {
$link = MS_Controller_Plugin::get_admin_url('settings');
ob_start();
?>
<?php
_e('This is only an example of manual payment gateway instructions', 'membership2');
?>
<br />
<?php
printf(__('Edit it %shere%s', 'membership2'), '<a href="' . $link . '">', '</a>');
?>
<br /><br />
<?php
_e('Name: Example name.', 'membership2');
?>
<br />
<?php
_e('Bank: Example bank.', 'membership2');
?>
<br />
<?php
_e('Bank account: Example bank account 1234.', 'membership2');
?>
<br />
<?php
$this->payment_info = ob_get_clean();
}
$this->payment_info = wpautop($this->payment_info);
if (!empty($_POST['ms_relationship_id'])) {
$subscription = MS_Factory::load('MS_Model_Relationship', $_POST['ms_relationship_id']);
$invoice = $subscription->get_current_invoice();
$this->payment_info .= sprintf('<div class="ms-manual-price">%s: <span class="ms-price">%s%s</span></div>', __('Total value', 'membership2'), $invoice->currency, $invoice->total);
// The user did make his intention to pay the invoice. Set status
// to billed.
$invoice->status = MS_Model_Invoice::STATUS_BILLED;
$invoice->save();
}
}
return apply_filters('ms_gateway_manual_purchase_info_content', $this->payment_info);
}
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:61,代码来源:class-ms-gateway-manual.php
示例8: after_load
/**
* Hook to add custom transaction status.
*
* @since 1.0.0
*/
public function after_load()
{
parent::after_load();
$this->id = self::ID;
$this->name = __('PayPal Standard Gateway', MS_TEXT_DOMAIN);
$this->group = 'PayPal';
$this->manual_payment = false;
// Recurring charged automatically
$this->pro_rate = false;
if ($this->active && $this->is_live_mode() && strpos($this->merchant_id, '@')) {
$settings_url = MS_Controller_Plugin::get_admin_url('settings', array('tab' => MS_Controller_Settings::TAB_PAYMENT));
lib2()->ui->admin_message(sprintf(__('Warning: You use your email address for the PayPal Standard gateway instead of your Merchant ID. Please check %syour payment settings%s and enter the Merchant ID instead', MS_TEXT_DOMAIN), '<a href="' . $settings_url . '">', '</a>'), 'err');
}
}
开发者ID:klgrimley,项目名称:mzf,代码行数:19,代码来源:class-ms-gateway-paypalstandard.php
示例9: render_tab
public function render_tab()
{
$fields = $this->prepare_fields();
ob_start();
?>
<div class="ms-addon-wrap">
<?php
MS_Helper_Html::settings_tab_header(array('title' => __('Redirect Settings', 'membership2'), 'desc' => array(__('Specify your custom URLs here. You can use either an absolute URL (starting with "http://") or an site-relative path (like "/some-page/")', 'membership2'), sprintf(__('The URLs you specify here can always be overwritten in the %slogin shortcode%s using the redirect-attributes. Example: <code>[%s redirect_login="/welcome/" redirect_logout="/good-bye/"]</code>.', 'membership2'), sprintf('<a href="%s#ms-membership-login" target="_blank">', MS_Controller_Plugin::get_admin_url('help', array('tab' => 'shortcodes'))), '</a>', MS_Helper_Shortcode::SCODE_LOGIN))));
foreach ($fields as $field) {
MS_Helper_Html::html_element($field);
}
?>
</div>
<?php
$html = ob_get_clean();
echo $html;
}
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:17,代码来源:class-ms-addon-redirect-view.php
示例10: render_tab
/**
* Returns the HTML code of the Settings form.
*
* @since 1.0.0
* @return string
*/
public function render_tab()
{
$fields = $this->prepare_fields();
$manage_url = MS_Controller_Plugin::get_admin_url('settings', array('tab' => MS_Addon_Attributes::ID));
ob_start();
?>
<div class="ms-addon-wrap">
<?php
MS_Helper_Html::settings_tab_header(array('title' => __('Custom Membership Attributes', 'membership2'), 'desc' => sprintf(__('You can manage custom attributes in %sthe plugin settings%s.', 'membership2'), '<a href="' . $manage_url . '">', '</a>')));
echo '<div class="ms-attributes">';
foreach ($fields as $field) {
MS_Helper_Html::html_element($field);
}
echo '</div>';
?>
</div>
<?php
$html = ob_get_clean();
echo $html;
}
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:26,代码来源:class-ms-addon-attributes-view-membership.php
示例11: purchase_info_content
/**
* Show manual purchase/payment information.
*
* Returns a default messsage if gateway is not configured.
*
* * Hooks Actions: *
* * ms_controller_gateway_purchase_info_content
*
* @since 1.0.0
* @return string The payment info.
*/
public function purchase_info_content()
{
do_action('ms_gateway_manual_purchase_info_content_before', $this);
if (empty($this->payment_info)) {
$link = MS_Controller_Plugin::get_admin_url('settings');
ob_start();
?>
<?php
_e('This is only an example of manual payment gateway instructions', MS_TEXT_DOMAIN);
?>
<br />
<?php
printf(__('Edit it %shere%s', MS_TEXT_DOMAIN), '<a href="' . $link . '">', '</a>');
?>
<br /><br />
<?php
_e('Name: Example name.', MS_TEXT_DOMAIN);
?>
<br />
<?php
_e('Bank: Example bank.', MS_TEXT_DOMAIN);
?>
<br />
<?php
_e('Bank account: Example bank account 1234.', MS_TEXT_DOMAIN);
?>
<br />
<?php
$this->payment_info = ob_get_clean();
}
if (!empty($_POST['ms_relationship_id'])) {
$subscription = MS_Factory::load('MS_Model_Relationship', $_POST['ms_relationship_id']);
$invoice = $subscription->get_current_invoice();
$this->payment_info .= sprintf('<br />%s: %s%s', __('Total value', MS_TEXT_DOMAIN), $invoice->currency, $invoice->total);
// The user did make his intention to pay the invoice. Set status
// to billed.
$invoice->status = MS_Model_Invoice::STATUS_BILLED;
$invoice->save();
}
return apply_filters('ms_gateway_manual_purchase_info_content', wpautop($this->payment_info));
}
开发者ID:klgrimley,项目名称:mzf,代码行数:52,代码来源:class-ms-gateway-manual.php
示例12: 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().
*
* @since 1.0.0
* @api
*
* @return string
*/
public function to_html()
{
$form_fields = $this->prepare_fields();
$setup_url = MS_Controller_Plugin::get_admin_url('setup');
ob_start();
// Render tabbed interface.
?>
<div class="ms-wrap wrap">
<form class="ms-welcome-box" action="<?php
echo esc_url($setup_url);
?>
" method="POST">
<h2 class="ms-welcome-title">
<?php
_e('Welcome!', MS_TEXT_DOMAIN);
?>
</h2>
<div class="ms-welcome-text">
<?php
_e('Hello and welcome to <strong>Membership2</strong> by WPMU DEV. Please follow this simple set-up<br />wizard to help us determine the settings that are most relevant to your needs. Don\'t worry, you<br />can always change these settings in the future.', MS_TEXT_DOMAIN);
?>
</div>
<div class="ms-welcome-image-box">
<img src="<?php
echo esc_attr(MS_Plugin::instance()->url);
?>
app/assets/images/welcome.png" class="ms-welcome-image" />
</div>
<?php
foreach ($form_fields as $field) {
MS_Helper_Html::html_element($field);
}
?>
</form>
</div>
<?php
return ob_get_clean();
}
开发者ID:klgrimley,项目名称:mzf,代码行数:54,代码来源:class-ms-view-welcome.php
示例13: form
/**
* Outputs the options form on admin
*
* @since 1.0.0
*
* @param array $instance The widget options
*/
public function form($instance)
{
$title = __('Login', MS_TEXT_DOMAIN);
$redirect_login = '';
$redirect_logout = '';
$shortcode_args = '';
if (isset($instance['title'])) {
$title = $instance['title'];
}
if (isset($instance['redirect_login'])) {
$redirect_login = $instance['redirect_login'];
}
if (isset($instance['redirect_logout'])) {
$redirect_logout = $instance['redirect_logout'];
}
if (isset($instance['shortcode_args'])) {
$shortcode_args = $instance['shortcode_args'];
}
$placeholder_login = MS_Model_Pages::get_url_after_login();
if (strlen($placeholder_login) > 55) {
$parts = explode('://', $placeholder_login);
$placeholder_login = $parts[0] . '://' . substr($parts[1], 0, 5) . '…' . substr($parts[1], -38);
}
$placeholder_logout = MS_Model_Pages::get_url_after_logout();
if (strlen($placeholder_logout) > 55) {
$parts = explode('://', $placeholder_logout);
$placeholder_logout = $parts[0] . '://' . substr($parts[1], 0, 5) . '…' . substr($parts[1], -38);
}
$field_title = array('id' => $this->get_field_id('title'), 'name' => $this->get_field_name('title'), 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'title' => __('Title:', MS_TEXT_DOMAIN), 'value' => $title, 'class' => 'widefat');
$field_redirect_login = array('id' => $this->get_field_id('redirect_login'), 'name' => $this->get_field_name('redirect_login'), 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'title' => __('Show this page after login:', MS_TEXT_DOMAIN), 'value' => $redirect_login, 'placeholder' => $placeholder_login, 'class' => 'widefat');
$field_redirect_logout = array('id' => $this->get_field_id('redirect_logout'), 'name' => $this->get_field_name('redirect_logout'), 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'title' => __('Show this page after logout:', MS_TEXT_DOMAIN), 'value' => $redirect_logout, 'placeholder' => $placeholder_logout, 'class' => 'widefat');
$field_shortcode_args = array('id' => $this->get_field_id('shortcode_args'), 'name' => $this->get_field_name('shortcode_args'), 'type' => MS_Helper_Html::INPUT_TYPE_TEXT, 'title' => __('Shortcode Options:', MS_TEXT_DOMAIN), 'desc' => sprintf(__('Arguments to pass to the %slogin shortcode%s', MS_TEXT_DOMAIN), sprintf('<a href="%s#ms-membership-login" target="_blank">', MS_Controller_Plugin::get_admin_url('help', array('tab' => 'shortcodes'))), '</a>'), 'value' => $shortcode_args, 'placeholder' => 'header="no"', 'class' => 'widefat');
MS_Helper_Html::html_element($field_title);
MS_Helper_Html::html_element($field_redirect_login);
MS_Helper_Html::html_element($field_redirect_logout);
MS_Helper_Html::html_element($field_shortcode_args);
}
开发者ID:klgrimley,项目名称:mzf,代码行数:44,代码来源:class-ms-widget-login.php
示例14: render_tab
/**
* Returns the HTML code of the Settings form.
*
* @since 1.0.0
* @return string
*/
public function render_tab()
{
$groups = $this->prepare_fields();
ob_start();
?>
<div class="ms-addon-wrap">
<?php
MS_Helper_Html::settings_tab_header(array('title' => __('Custom Membership Attributes', MS_TEXT_DOMAIN), 'desc' => __('Define custom fields that are available in the Memberships Edit-Page.', MS_TEXT_DOMAIN)));
foreach ($groups as $key => $fields) {
echo '<div class="ms-group ms-group-' . esc_attr($key) . '">';
foreach ($fields as $field) {
MS_Helper_Html::html_element($field);
}
echo '</div>';
}
MS_Helper_Html::html_separator();
$help_link = MS_Controller_Plugin::get_admin_url('help', array('tab' => 'shortcodes'));
printf('<p>%s</p><ul><li>%s</li><li>%s</li><li>%s</li><li>%s</li></ul>', __('How to use custom attribute values:', MS_TEXT_DOMAIN), sprintf(__('Via the %sshortcode%s %s', MS_TEXT_DOMAIN), '<a href="' . $help_link . '#ms-membership-buy">', '</a>', '<code>[<b>' . MS_Addon_Attributes::SHORTCODE . '</b> slug="slug" id="..."]</code>'), sprintf(__('Via WordPress filter %s', MS_TEXT_DOMAIN), '<code>$val = apply_filters( "<b>ms_membership_attr</b>", "", "slug", $membership_id );</code>'), sprintf(__('Get via php function %s', MS_TEXT_DOMAIN), '<code>$val = <b>ms_membership_attr</b>( "slug", $membership_id );</code>'), sprintf(__('Set via php function %s', MS_TEXT_DOMAIN), '<code><b>ms_membership_attr_set</b>( "slug", $val, $membership_id );</code>'));
?>
</div>
<?php
$html = ob_get_clean();
echo $html;
}
开发者ID:jsandlin85,项目名称:SkylineSports,代码行数:30,代码来源:class-ms-addon-attributes-view-settings.php
示例15: to_html
/**
* Return the HTML form.
*
* @since 1.0.0
* @return string
*/
public function to_html()
{
$fields = $this->get_fields();
// TODO: Fix that condition again.
$has_more = true;
$title = __('Protection Messages', MS_TEXT_DOMAIN);
if (isset($this->data['membership'])) {
$membership = $this->data['membership'];
} else {
$membership = false;
}
if ($membership instanceof MS_Model_Membership) {
$settings_url = MS_Controller_Plugin::get_admin_url('settings', array('tab' => MS_Controller_Settings::TAB_MESSAGES));
$desc = sprintf(__('Here you can override %sdefault settings%s for this membership.', MS_TEXT_DOMAIN), '<a href="' . $settings_url . '">', '</a>');
} else {
$desc = '';
}
ob_start();
MS_Helper_Html::settings_tab_header(array('title' => $title, 'desc' => $desc));
?>
<form class="ms-form" action="" method="post">
<?php
$subtitle = apply_filters('ms_translation_flag', __('Content protection message', MS_TEXT_DOMAIN), 'message-protected');
MS_Helper_Html::settings_box($fields['content'], $subtitle, '', 'open');
$subtitle = apply_filters('ms_translation_flag', __('Shortcode protection message', MS_TEXT_DOMAIN), 'message-shortcode');
MS_Helper_Html::settings_box($fields['shortcode'], $subtitle, '', 'open');
if ($has_more) {
$subtitle = apply_filters('ms_translation_flag', __('More tag protection message', MS_TEXT_DOMAIN), 'message-more_tag');
MS_Helper_Html::settings_box($fields['more_tag'], $subtitle, '', 'open');
}
?>
</form>
<?php
$html = ob_get_clean();
return $html;
}
开发者ID:jsandlin85,项目名称:SkylineSports,代码行数:42,代码来源:class-ms-view-settings-page-messages.php
示例16: column_user
public function column_user($item, $column_name)
{
$member = MS_Factory::load('MS_Model_Member', $item->user_id);
$html = sprintf('<a href="%s">%s</a>', MS_Controller_Plugin::get_admin_url('add-member', array('user_id' => $item->user_id)), $member->username);
return $html;
}
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:6,代码来源:class-ms-helper-listtable-billing.php
示例17: column_username
/**
* Display Username column.
*
* @since 1.0.0
*
* @param mixed $member The table item to display.
*/
public function column_username($member)
{
$actions = array();
$actions['edit'] = sprintf('<a href="%s">%s</a>', MS_Controller_Plugin::get_admin_url('add-member', array('user_id' => $member->id)), __('Subscription Details', MS_TEXT_DOMAIN));
$actions['profile'] = sprintf('<a href="%s">%s</a>', admin_url('user-edit.php?user_id=' . $member->id), __('Edit Profile', MS_TEXT_DOMAIN));
$html = sprintf('%1$s %2$s', $member->username, $this->row_actions($actions));
return $html;
}
开发者ID:jsandlin85,项目名称:SkylineSports,代码行数:15,代码来源:class-ms-helper-listtable-member.php
示例18: collission_check
/**
* Checks, if some BuddyPress pages overlap with M2 membership pages.
*
* In some cases people used the same page-ID for both BuddyPress
* registration and M2 registration. This will cause problems and must be
* resolved to have M2 and BuddyPress work symbiotically.
*
* @since 1.0.1.1
*/
protected function collission_check()
{
$buddy_pages = MS_Factory::get_option('bp-pages');
if (!is_array($buddy_pages)) {
// Okay, no BuddyPress pages set up yet.
return;
}
$duplicates = array();
foreach ($buddy_pages as $type => $page_id) {
$collission = MS_Model_Pages::get_page_by('id', $page_id);
if ($collission) {
$title = $collission->post_title;
if (!$title) {
$title = $collission->post_name;
}
$duplicates[] = sprintf('%s - %s', $page_id, $title);
}
}
if (count($duplicates)) {
$msg = sprintf('%s<br><br>%s', sprintf(__('BuddyPress uses a page that is also used as a Membership page by Membership 2.<br>Please assign a different page for either %sMembership 2%s or %sBuddyPress%s to avoid conflicts.', 'membership2'), '<a href="' . MS_Controller_Plugin::get_admin_url('settings') . '">', '</a>', '<a href="' . admin_url('admin.php?page=bp-page-settings') . '">', '</a>'), implode('<br>', $duplicates));
lib3()->ui->admin_message($msg, 'error');
}
}
开发者ID:oshabaeva,项目名称:project-s-v2,代码行数:32,代码来源:class-ms-addon-buddypress.php
示例19: admin_init
/**
* Initialize the admin-side functions.
*
* @since 1.0.0
*/
public function admin_init()
{
$hook = MS_Controller_Plugin::admin_page_hook('help');
$this->run_action('admin_print_scripts-' . $hook, 'enqueue_scripts');
}
开发者ID:jsandlin85,项目名称:SkylineSports,代码行数:10,代码来源:class-ms-controller-help.php
示例20: settings_tabs
/**
* Add redirect settings tab in settings page.
*
* @since 1.0.0
*
* @param array $tabs The current tabs.
* @return array The filtered tabs.
*/
public function settings_tabs($tabs)
{
$tabs[self::ID] = array('title' => __('Redirect', MS_TEXT_DOMAIN), 'url' => MS_Controller_Plugin::get_admin_url('settings', array('tab' => self::ID)));
return $tabs;
}
开发者ID:jsandlin85,项目名称:SkylineSports,代码行数:13,代码来源:class-ms-addon-redirect.php
注:本文中的MS_Controller_Plugin类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论