本文整理汇总了PHP中RSMembershipHelper::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP RSMembershipHelper::getConfig方法的具体用法?PHP RSMembershipHelper::getConfig怎么用?PHP RSMembershipHelper::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSMembershipHelper
的用法示例。
在下文中一共展示了RSMembershipHelper::getConfig方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
$row = $this->get('extravalue');
$this->assignRef('row', $row);
$this->assign('currency', RSMembershipHelper::getConfig('currency'));
parent::display($tpl);
}
示例2: display
function display($tpl = null)
{
$app = JFactory::getApplication();
// get parameters
$params = clone $app->getParams('com_rsmembership');
$pathway = $app->getPathway();
$pathway->addItem(JText::_('COM_RSMEMBERSHIP_RENEW'), '');
// get the logged user
$this->user = JFactory::getUser();
// get the current layout
$layout = $this->getLayout();
if ($layout == 'default') {
$this->payments = RSMembership::getPlugins();
// get the encoded return url
$this->return = base64_encode(JURI::getInstance());
$this->data = $this->get('data');
// get the membership
$this->membership = $this->get('membership');
$this->membershipterms = $this->get('membershipterms');
$this->fields = RSMembershipHelper::getFields(true);
$this->fields_validation = RSMembershipHelper::getFieldsValidation($this->membership->id);
$this->membership_fields = RSMembershipHelper::getMembershipFields($this->membership->id, true, $this->user->id, true, $this->membership->last_transaction_id);
} elseif ($layout == 'payment') {
$this->html = $this->get('html');
}
// get the extras
$this->extras = $this->get('extras');
$this->cid = $this->get('cid');
$this->config = $this->get('config');
$this->params = $params;
$this->token = JHTML::_('form.token');
$this->currency = RSMembershipHelper::getConfig('currency');
parent::display();
}
示例3: display
function display($tpl = null)
{
$mainframe =& JFactory::getApplication();
$params = clone $mainframe->getParams('com_rsmembership');
$this->assignRef('params', $params);
$this->assignRef('memberships', $this->get('memberships'));
$this->assignRef('pagination', $this->get('pagination'));
$this->assignRef('total', $this->get('total'));
$this->assignRef('action', JRequest::getURI());
$this->assignRef('date_format', RSMembershipHelper::getConfig('date_format'));
$this->assignRef('transactions', $this->get('transactions'));
$this->assignRef('limitstart', JRequest::getInt('limitstart', 0));
$Itemid = JRequest::getInt('Itemid', 0);
if ($Itemid > 0) {
$this->assign('Itemid', '&Itemid=' . $Itemid);
} else {
$this->assign('Itemid', '');
}
if (RSMembershipHelper::isJ16()) {
// Description
if ($params->get('menu-meta_description')) {
$this->document->setDescription($params->get('menu-meta_description'));
}
// Keywords
if ($params->get('menu-meta_keywords')) {
$this->document->setMetadata('keywords', $params->get('menu-meta_keywords'));
}
// Robots
if ($params->get('robots')) {
$this->document->setMetadata('robots', $params->get('robots'));
}
}
parent::display();
}
示例4: display
function display($tpl = null)
{
$this->item = $this->get('Item');
$this->ordering = $this->get('SharedOrdering');
$this->currency = RSMembershipHelper::getConfig('currency');
parent::display($tpl);
}
示例5: display
function display($tpl = null)
{
JToolBarHelper::title('RSMembership!', 'rsmembership');
JSubMenuHelper::addEntry(JText::_('RSM_TRANSACTIONS'), 'index.php?option=com_rsmembership&view=transactions');
JSubMenuHelper::addEntry(JText::_('RSM_MEMBERSHIPS'), 'index.php?option=com_rsmembership&view=memberships');
JSubMenuHelper::addEntry(JText::_('RSM_CATEGORIES'), 'index.php?option=com_rsmembership&view=categories');
JSubMenuHelper::addEntry(JText::_('RSM_MEMBERSHIP_EXTRAS'), 'index.php?option=com_rsmembership&view=extras');
JSubMenuHelper::addEntry(JText::_('RSM_MEMBERSHIP_UPGRADES'), 'index.php?option=com_rsmembership&view=upgrades');
JSubMenuHelper::addEntry(JText::_('RSM_COUPONS'), 'index.php?option=com_rsmembership&view=coupons');
JSubMenuHelper::addEntry(JText::_('RSM_PAYMENT_INTEGRATIONS'), 'index.php?option=com_rsmembership&view=payments');
JSubMenuHelper::addEntry(JText::_('RSM_FILES'), 'index.php?option=com_rsmembership&view=files');
JSubMenuHelper::addEntry(JText::_('RSM_FILE_TERMS'), 'index.php?option=com_rsmembership&view=terms');
JSubMenuHelper::addEntry(JText::_('RSM_USERS'), 'index.php?option=com_rsmembership&view=users');
JSubMenuHelper::addEntry(JText::_('RSM_FIELDS'), 'index.php?option=com_rsmembership&view=fields');
JSubMenuHelper::addEntry(JText::_('RSM_REPORTS'), 'index.php?option=com_rsmembership&view=reports');
JSubMenuHelper::addEntry(JText::_('RSM_CONFIGURATION'), 'index.php?option=com_rsmembership&view=configuration', true);
JSubMenuHelper::addEntry(JText::_('RSM_UPDATES'), 'index.php?option=com_rsmembership&view=updates');
JToolBarHelper::apply();
JToolBarHelper::save();
JToolBarHelper::cancel();
$config = RSMembershipHelper::getConfig();
$this->assignRef('config', $config);
$lists['show_login'] = JHTML::_('select.booleanlist', 'show_login', 'class="inputbox"', $config->show_login);
$create_user_instantly = array(JHTML::_('select.option', '0', JText::_('RSM_WHEN_PAYMENT')), JHTML::_('select.option', '1', JText::_('RSM_WHEN_ORDER')));
$lists['price_show_free'] = JHTML::_('select.booleanlist', 'price_show_free', 'class="inputbox"', $config->price_show_free);
$lists['create_user_instantly'] = JHTML::_('select.genericlist', $create_user_instantly, 'create_user_instantly', 'class="inputbox"', 'value', 'text', $config->create_user_instantly);
$lists['choose_username'] = JHTML::_('select.booleanlist', 'choose_username', 'class="inputbox"', $config->choose_username);
$lists['choose_password'] = JHTML::_('select.booleanlist', 'choose_password', 'class="inputbox"', $config->choose_password);
$lists['disable_registration'] = JHTML::_('select.booleanlist', 'disable_registration', 'class="inputbox" onclick="rsm_enable_registration(this.value)"', $config->disable_registration);
// CAPTCHA
$captcha = array(JHTML::_('select.option', 0, JText::_('No')), JHTML::_('select.option', 1, JText::_('RSM_USE_BUILTIN_CAPTCHA')), JHTML::_('select.option', 2, JText::_('RSM_USE_RECAPTCHA')));
$lists['captcha_enabled'] = JHTML::_('select.genericlist', $captcha, 'captcha_enabled', 'class="inputbox" onclick="rsm_captcha_enable(this.value);"', 'value', 'text', $config->captcha_enabled);
$lists['captcha_enabled_for'] = '';
$captcha_enabled_for = explode(',', $config->captcha_enabled_for);
$lists['captcha_enabled_for'] .= '<input type="checkbox" ' . ($captcha_enabled_for[0] ? 'checked="checked"' : '') . ' ' . ($config->captcha_enabled ? '' : 'disabled="disabled"') . ' name="captcha_enabled_for_unregistered" value="1" id="captcha_enabled_for0" /> <label for="captcha_enabled_for0">' . JText::_('RSM_CAPTCHA_UNREGISTERED') . '</label>';
$lists['captcha_enabled_for'] .= '<input type="checkbox" ' . ($captcha_enabled_for[1] ? 'checked="checked"' : '') . ' ' . ($config->captcha_enabled ? '' : 'disabled="disabled"') . ' name="captcha_enabled_for_registered" value="1" id="captcha_enabled_for1" /> <label for="captcha_enabled_for1">' . JText::_('RSM_CAPTCHA_REGISTERED') . '</label>';
$lists['captcha_lines'] = JHTML::_('select.booleanlist', 'captcha_lines', 'class="inputbox"' . ($config->captcha_enabled != 1 ? ' disabled="disabled"' : ''), $config->captcha_lines);
$lists['captcha_case_sensitive'] = JHTML::_('select.booleanlist', 'captcha_case_sensitive', 'class="inputbox"' . ($config->captcha_enabled != 1 ? ' disabled="disabled"' : ''), $config->captcha_case_sensitive);
$themes = array(JHTML::_('select.option', 'red', JText::_('RSM_RECAPTCHA_THEME_RED')), JHTML::_('select.option', 'white', JText::_('RSM_RECAPTCHA_THEME_WHITE')), JHTML::_('select.option', 'blackglass', JText::_('RSM_RECAPTCHA_THEME_BLACKGLASS')), JHTML::_('select.option', 'clean', JText::_('RSM_RECAPTCHA_THEME_CLEAN')));
$lists['recaptcha_theme'] = JHTML::_('select.genericlist', $themes, 'recaptcha_theme', 'class="inputbox"' . ($config->captcha_enabled != 2 ? ' disabled="disabled"' : ''), 'value', 'text', $config->recaptcha_theme);
$lists['idev_enable'] = JHTML::_('select.booleanlist', 'idev_enable', 'class="inputbox" onclick="rsm_idev_enable(this.value)"', $config->idev_enable);
$lists['idev_track_renewals'] = JHTML::_('select.booleanlist', 'idev_track_renewals', 'class="inputbox" ' . ($config->idev_enable ? '' : 'disabled="disabled"'), $config->idev_track_renewals);
$lists['one_page_checkout'] = JHTML::_('select.booleanlist', 'one_page_checkout', 'class="inputbox"', $config->one_page_checkout, JText::_('RSM_ONE_PAGE_CHECKOUT'), JText::_('RSM_MULTI_PAGE_CHECKOUT'));
$this->assignRef('lists', $lists);
$params = array();
$params['startOffset'] = JRequest::getInt('tabposition', 0);
$pane =& JPane::getInstance('Tabs', $params, true);
$this->assignRef('pane', $pane);
$this->assign('module_helper', RSMembershipHelper::getPatchFile('module'));
$this->assign('module_writable', is_writable($this->module_helper));
$this->assign('module_patched', RSMembershipHelper::checkPatches('module'));
$this->assign('menu_helper', RSMembershipHelper::getPatchFile('menu'));
$this->assign('menu_writable', is_writable($this->menu_helper));
$this->assign('menu_patched', RSMembershipHelper::checkPatches('menu'));
parent::display($tpl);
}
示例6: onAfterDispatch
function onAfterDispatch()
{
if (class_exists('RSMembershipHelper')) {
if (RSMembershipHelper::getConfig('disable_registration')) {
$j_option = JRequest::getVar('option');
$j_view = JRequest::getVar('view');
$j_task = JRequest::getVar('task');
if ($j_option == 'com_user' && ($j_task == 'register' || $j_view == 'register') || $j_option == 'com_users' && ($j_task == 'registration.register' || $j_view == 'registration')) {
$url = JRoute::_('index.php?option=com_rsmembership', false);
$custom_url = RSMembershipHelper::getConfig('registration_page');
if (!empty($custom_url)) {
$url = $custom_url;
}
$mainframe =& JFactory::getApplication();
$mainframe->redirect($url);
}
}
RSMembershipHelper::checkShared();
}
}
示例7: getItem
public function getItem($pk = null)
{
static $cache = array();
if (!isset($cache[$pk])) {
$item = parent::getItem($pk);
if (isset($item->extras)) {
$item->extras = explode(',', $item->extras);
}
if (empty($item->user_id)) {
$item->user_id = JFactory::getApplication()->input->get('user_id', 0, 'int');
}
if (empty($item->currency)) {
$item->currency = RSMembershipHelper::getConfig('currency');
}
@(list($date, $time) = explode(' ', $item->membership_end, 2));
if ($item->membership_end == '0000-00-00 00:00:00' || $date == '1970-01-01' || $date == '1969-12-31') {
$item->unlimited = 1;
}
$membership_info = array();
$hasTransaction = (int) $item->last_transaction_id;
if ($item->membership_id && $hasTransaction) {
if ($membership_fields = RSMembership::getCustomMembershipFields($item->membership_id)) {
// get the trasaction
$transaction = JTable::getInstance('Transaction', 'RSMembershipTable');
$transaction->load($item->last_transaction_id);
$user_data = $transaction->user_data ? (object) unserialize($transaction->user_data) : (object) array();
$selected = isset($user_data->membership_fields) ? $user_data->membership_fields : array();
foreach ($membership_fields as $field) {
$membership_info[] = RSMembershipHelper::showCustomField($field, $selected, true, true, 'membership');
}
}
}
$item->membership_info = $membership_info;
$cache[$pk] = $item;
}
return $cache[$pk];
}
示例8: loadFormData
protected function loadFormData()
{
$data = (array) RSMembershipHelper::getConfig();
return $data;
}
示例9: getUseRecaptcha
function getUseRecaptcha()
{
$captcha_enabled = RSMembershipHelper::getConfig('captcha_enabled');
return $captcha_enabled == 2;
}
示例10: getHTML
/**
* Gets the challenge HTML (javascript and non-javascript version).
* This is called from the browser, and the resulting reCAPTCHA HTML widget
* is embedded within the HTML form it was called from.
* @param string $pubkey A public key for reCAPTCHA
* @param string $error The error given by reCAPTCHA (optional, default is null)
* @param boolean $use_ssl Should the request be made over ssl? (optional, default is false)
* @return string - The HTML to be embedded in the user's form.
*/
static function getHTML($error = null, $use_ssl = false)
{
$pubkey = RSMembershipHelper::getConfig('recaptcha_public_key');
if ($pubkey == null || $pubkey == '') {
return "To use reCAPTCHA you must get an API key from <a href='http://recaptcha.net/api/getkey'>http://recaptcha.net/api/getkey</a>";
}
$return = ' <script type="text/javascript">var RecaptchaOptions = { theme : \'' . RSMembershipHelper::getConfig('recaptcha_theme') . '\' };</script>';
$use_ssl = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' || getenv('SSL_PROTOCOL_VERSION');
if ($use_ssl) {
$server = COM_RSMEMBERSHIP_RECAPTCHA_API_SECURE_SERVER;
} else {
$server = COM_RSMEMBERSHIP_RECAPTCHA_API_SERVER;
}
$errorpart = "";
if ($error) {
$errorpart = "&error=" . $error;
}
$return .= '<script type="text/javascript" src="' . $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
<noscript>
<iframe src="' . $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
</noscript>';
return $return;
}
示例11: captcha
function captcha()
{
$captcha_enabled = RSMembershipHelper::getConfig('captcha_enabled');
if (!$captcha_enabled) {
return false;
}
ob_end_clean();
if ($captcha_enabled == 1) {
if (!class_exists('JSecurImage')) {
require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_rsmembership' . DS . 'helpers' . DS . 'securimage' . DS . 'securimage.php';
}
$captcha = new JSecurImage();
$captcha_lines = RSMembershipHelper::getConfig('captcha_lines');
if ($captcha_lines) {
$captcha->num_lines = 8;
} else {
$captcha->num_lines = 0;
}
$captcha_characters = RSMembershipHelper::getConfig('captcha_characters');
$captcha->code_length = $captcha_characters;
$captcha->image_width = 30 * $captcha_characters + 50;
$captcha->show();
}
die;
}
示例12: onMembershipPayment
public function onMembershipPayment($plugin, $data, $extra, $membership, &$transaction, $html)
{
$this->loadLanguage('plg_system_rsmembership', JPATH_ADMINISTRATOR);
$this->loadLanguage('plg_system_rsmembershipwire', JPATH_ADMINISTRATOR);
if (preg_match('#rsmembershipwire([0-9]+)#', $plugin, $match)) {
$id = $match[1];
$payment = JTable::getInstance('Payment', 'RSMembershipTable');
$payment->load($id);
$tax_value = $payment->tax_value;
if (!empty($tax_value)) {
$tax_type = $payment->tax_type;
// percent ?
if ($tax_type == 0) {
$tax_value = $transaction->price * ($tax_value / 100);
}
$transaction->price = $transaction->price + $tax_value;
}
if (RSMembershipHelper::getConfig('trigger_content_plugins')) {
$payment->details = JHtml::_('content.prepare', $payment->details);
}
$html = $payment->details;
// Store the transaction so we can get an ID
$transaction->store();
$replacements = array('{price}' => RSMembershipHelper::getPriceFormat($transaction->price), '{transaction_id}' => $transaction->id, '{tax}' => RSMembershipHelper::getPriceFormat($tax_value), '{membership}' => $membership->name);
if (!empty($data) && is_object($data)) {
if (isset($data->username)) {
$replacements['{username}'] = $data->username;
}
if (isset($data->name)) {
$replacements['{name}'] = $data->name;
}
if (isset($data->email)) {
$replacements['{email}'] = $data->email;
}
if (isset($data->coupon)) {
$replacements['{coupon}'] = $data->coupon;
}
if (isset($data->fields) && is_array($data->fields)) {
foreach ($data->fields as $field => $value) {
if (is_array($value)) {
$value = implode("\n", $value);
}
$replacements['{' . $field . '}'] = $value;
}
}
}
$replace = array_keys($replacements);
$with = array_values($replacements);
$html = str_replace($replace, $with, $html);
$html .= '<form method="post" action="' . JRoute::_('index.php?option=com_rsmembership&task=thankyou') . '">';
$html .= '<div class="form-actions"><input class="button btn btn-success pull-right" type="submit" value="' . JText::_('COM_RSMEMBERSHIP_CONTINUE') . '" /></div>';
$html .= '<input type="hidden" name="option" value="com_rsmembership" />';
$html .= '<input type="hidden" name="task" value="thankyou" />';
$html .= '</form>';
// No hash for this
$transaction->hash = '';
$transaction->gateway = $payment->name;
if ($membership->activation == 2) {
$transaction->status = 'completed';
}
return $html;
}
}
示例13: captcha
public function captcha()
{
$app = JFactory::getApplication();
$model = $this->getModel('subscribe');
if ($model->getUseBuiltin()) {
// Load Captcha
if (!class_exists('JSecurImage')) {
require_once JPATH_ADMINISTRATOR . '/components/com_rsmembership/helpers/securimage/securimage.php';
}
ob_end_clean();
$captcha = new JSecurImage();
$captcha->num_lines = RSMembershipHelper::getConfig('captcha_lines') ? 8 : 0;
$captcha->code_length = RSMembershipHelper::getConfig('captcha_characters');
$captcha->image_width = 30 * $captcha->code_length + 50;
$captcha->show();
}
$app->close();
}
示例14: validate
/**
* Validate the code to the user code
*
* @access private
*
*/
function validate()
{
// retrieve code from session
$session = JFactory::getSession();
$code = $this->getCode();
if ($code != '' && $this->isCodeExpired()) {
$code = '';
}
$code_entered = $this->code_entered;
if (!RSMembershipHelper::getConfig('captcha_case_sensitive')) {
$code = trim(strtolower($code));
$code_entered = trim(strtolower($code_entered));
}
$this->correct_code = false;
if ($code != '' && $code == $code_entered) {
$this->correct_code = true;
$session->set('com_rsmembership.securimage.value', '');
$session->set('com_rsmembership.securimage.ctime', '');
}
}
示例15: date
?>
</span> <?php
echo JHTML::calendar($this->row->membership_start, 'membership_start', 'membership_start', '%s', 'onchange="rsmembership_date(this.value,\'membership_start\')" style="display: none"');
?>
</td>
</tr>
<tr>
<td width="200"><span class="hasTip" title="<?php
echo JText::_('RSM_MEMBERSHIP_END_DESC');
?>
"><label for="membership_end"><?php
echo JText::_('RSM_MEMBERSHIP_END');
?>
</label></span></td>
<td><span id="membership_end_ajax"><?php
echo date(RSMembershipHelper::getConfig('date_format'), RSMembershipHelper::getCurrentDate($this->row->membership_end));
?>
</span> <?php
echo JHTML::calendar($this->row->membership_end, 'membership_end', 'membership_end', '%s', 'onchange="rsmembership_date(this.value,\'membership_end\')" style="display: none"');
?>
<input type="checkbox" name="unlimited" id="change_unlimited" value="1" onchange="rsmembership_change_unlimited(this);" <?php
echo $this->row->membership_end == 0 ? 'checked="checked"' : '';
?>
/> <label for="change_unlimited"><?php
echo JText::_('RSM_UNLIMITED');
?>
</label>
</td>
</tr>
<tr>
<td width="200"><span class="hasTip" title="<?php