本文整理汇总了PHP中RSMembershipHelper类的典型用法代码示例。如果您正苦于以下问题:PHP RSMembershipHelper类的具体用法?PHP RSMembershipHelper怎么用?PHP RSMembershipHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RSMembershipHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
$mainframe =& JFactory::getApplication();
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', true);
JSubMenuHelper::addEntry(JText::_('RSM_CONFIGURATION'), 'index.php?option=com_rsmembership&view=configuration');
JSubMenuHelper::addEntry(JText::_('RSM_UPDATES'), 'index.php?option=com_rsmembership&view=updates');
$params = array();
$params['allowAllClose'] = true;
$pane =& JPane::getInstance('sliders', $params);
$this->assignRef('pane', $pane);
$date = RSMembershipHelper::getCurrentDate();
if (RSMembershipHelper::isJ16()) {
$date =& JFactory::getDate();
$date = $date->toUnix();
}
$this->assignRef('from_calendar', JHTML::_('calendar', '', 'from_date', 'rsm_from_calendar'));
$this->assignRef('to_calendar', JHTML::_('calendar', date('Y-m-d', $date), 'to_date', 'rsm_to_calendar'));
$this->assign('user_id', $this->get('userId'));
$this->assign('report', $this->get('report'));
$this->assign('count_memberships', $this->get('countMemberships'));
$color_pickers = !empty($this->report) && $this->report == 2 ? '4' : $this->count_memberships;
$this->assign('color_pickers', $color_pickers);
$lists['transaction_types'] = $this->get('transactiontypes');
$lists['memberships'] = $this->get('memberships');
$lists['memberships_transactions'] = $this->get('membershipstransactions');
$units = array();
$units[] = JHTML::_('select.option', 'day', JText::_('RSM_DAY'));
$units[] = JHTML::_('select.option', 'month', JText::_('RSM_MONTH'));
$units[] = JHTML::_('select.option', 'quarter', JText::_('RSM_QUARTER'));
$units[] = JHTML::_('select.option', 'year', JText::_('RSM_YEAR'));
$lists['unit'] = JHTML::_('select.genericlist', $units, 'unit');
$reports = array();
$reports[] = JHTML::_('select.option', 'report_1', JText::_('RSM_REPORT_1'));
$reports[] = JHTML::_('select.option', 'report_2', JText::_('RSM_REPORT_2'));
$lists['report'] = JHTML::_('select.genericlist', $reports, 'report', 'onchange="rsm_check_report(this.value);"');
$gateways = $this->assign('gateways', $this->get('gateways'));
$viewin = array();
$viewin[] = JHTML::_('select.option', 60, JText::_('RSM_MINUTES'));
$viewin[] = JHTML::_('select.option', 3600, JText::_('RSM_HOURS'));
$viewin[] = JHTML::_('select.option', 86400, JText::_('RSM_DAYS'));
$lists['viewin'] = JHTML::_('select.genericlist', $viewin, 'viewin', 'style="display: none;"');
$this->assignRef('lists', $lists);
$this->assign('customer', $this->get('customer'));
if ($this->get('ie')) {
JError::raiseWarning(500, JText::_('RSM_IE_WARNING'));
}
parent::display($tpl);
}
示例2: getPayments
function getPayments()
{
$plugins = RSMembership::getPlugins();
$return = array();
foreach ($plugins as $paymentplugin => $name) {
if (preg_match('#rsmembershipwire([0-9]+)#', $paymentplugin, $match)) {
continue;
}
$tmp = new stdClass();
$tmp->name = $name;
$tmp->limitations = '';
$className = 'plgSystem' . $paymentplugin;
if (class_exists($className) && method_exists($className, 'getLimitations')) {
$dispatcher =& JDispatcher::getInstance();
$plugin = new $className($dispatcher, array());
$tmp->limitations = $plugin->getLimitations();
}
if (RSMembershipHelper::isJ16()) {
$this->_db->setQuery("SELECT `extension_id` FROM #__extensions WHERE `type`='plugin' AND `folder`='system' AND `client_id`='0' AND `element`='" . $this->_db->getEscaped($paymentplugin) . "' LIMIT 1");
} else {
$this->_db->setQuery("SELECT `id` FROM #__plugins WHERE `folder`='system' AND `client_id`='0' AND `element`='" . $this->_db->getEscaped($paymentplugin) . "' LIMIT 1");
}
$tmp->cid = $this->_db->loadResult();
$return[] = $tmp;
}
$return = array_merge($return, $this->getWirePayments());
return $return;
}
示例3: getInput
public function getInput()
{
$multiple = $this->element['multiple'] ? 'multiple="multiple"' : '';
$size = $this->element['size'] ? 'size="' . $this->element['size'] . '"' : '';
$all_statuses = RSMembershipHelper::getStatusesList();
return JHTML::_('select.genericlist', $all_statuses, $this->name, 'class="' . $this->element['class'] . '" ' . $multiple . ' ' . $size, 'value', 'text', $this->value);
}
示例4: display
function display($tpl = null)
{
$this->params = clone JFactory::getApplication()->getParams('com_rsmembership');
$this->items = $this->get('Items');
$this->pagination = $this->get('pagination');
$this->total = $this->get('total');
$this->action = $this->escape(JRoute::_(JURI::getInstance(), false));
$this->date_format = RSMembershipHelper::getConfig('date_format');
$this->transactions = $this->get('transactions');
$this->limitstart = JFactory::getApplication()->input->get('limitstart', 0, 'int');
$Itemid = JFactory::getApplication()->input->get('Itemid', 0, 'int');
if ($Itemid > 0) {
$this->Itemid = '&Itemid=' . $Itemid;
} else {
$this->Itemid = '';
}
// Description
if ($this->params->get('menu-meta_description')) {
$this->document->setDescription($this->params->get('menu-meta_description'));
}
// Keywords
if ($this->params->get('menu-meta_keywords')) {
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
// Robots
if ($this->params->get('robots')) {
$this->document->setMetadata('robots', $this->params->get('robots'));
}
parent::display();
}
示例5: display
function display($tpl = null)
{
$row = $this->get('extravalue');
$this->assignRef('row', $row);
$this->assign('currency', RSMembershipHelper::getConfig('currency'));
parent::display($tpl);
}
示例6: 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();
}
示例7: display
function display($tpl = null)
{
$this->item = $this->get('Item');
$this->ordering = $this->get('SharedOrdering');
$this->currency = RSMembershipHelper::getConfig('currency');
parent::display($tpl);
}
示例8: save
public function save($data)
{
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$config = RSMembershipConfig::getInstance();
// parse rules
if (isset($data['rules'])) {
$rules = new JAccessRules($data['rules']);
$asset = JTable::getInstance('asset');
if (!$asset->loadByName($this->option)) {
$root = JTable::getInstance('asset');
$root->loadByName('root.1');
$asset->name = $this->option;
$asset->title = $this->option;
$asset->setLocation($root->id, 'last-child');
}
$asset->rules = (string) $rules;
if (!$asset->check() || !$asset->store()) {
$this->setError($asset->getError());
return false;
}
}
if (!isset($data['captcha_enabled_for']) && isset($data['captcha_enabled']) && $data['captcha_enabled'] > 0) {
$data['captcha_enabled_for'] = array();
}
foreach ($data as $prop => $val) {
$config->set($prop, $val);
}
RSMembershipHelper::readConfig(true);
return true;
}
示例9: getInput
public function getInput()
{
$options = array();
$multiple = $this->element['multiple'] ? 'multiple="multiple"' : '';
$size = $this->element['size'] ? 'size="' . $this->element['size'] . '"' : '';
$onchange = $this->element['onchange'] ? 'onchange="' . $this->element['onchange'] . '"' : '';
$all_membs = RSMembershipHelper::getMembershipsList();
$options = array_merge($options, $all_membs);
return JHTML::_('select.genericlist', $options, $this->name, 'class="' . $this->element['class'] . '" ' . $onchange . ' ' . $multiple . ' ' . $size, 'value', 'text', $this->value, $this->id);
}
示例10: getYears
function getYears()
{
$return = array();
$tmp = new stdClass();
$tmp->value = 0;
$tmp->text = JText::_('COM_RSMEMBERSHIP_EVERY_YEAR');
$return[] = $tmp;
// $max = date('Y', RSMembershipHelper::getCurrentDate());
$max = RSMembershipHelper::showDate(time(), 'Y');
for ($i = $max; $i <= $max + 50; $i++) {
$tmp = new stdClass();
$tmp->value = $i;
$tmp->text = $i;
$return[] = $tmp;
}
return $return;
}
示例11: buildCSV
public static function buildCSV($type, $data, $fileHash = '', $customFields = null)
{
require_once JPATH_COMPONENT . '/helpers/helper.php';
$rows = '';
if ($fileHash == '') {
// Build header
switch ($type) {
case 'subscribers':
$headers = array(JText::_('COM_RSMEMBERSHIP_SUBSCRIBER_ID'), JText::_('COM_RSMEMBERSHIP_ENABLED'), JText::_('COM_RSMEMBERSHIP_NAME'), JText::_('COM_RSMEMBERSHIP_USERNAME'), JText::_('COM_RSMEMBERSHIP_EMAIL'));
if ($customFields) {
foreach ($customFields as $id => $properties) {
$headers[] = JText::_($properties->label);
}
}
break;
case 'subscriptions':
$headers = array(JText::_('COM_RSMEMBERSHIP_MEMBERSHIP'), JText::_('COM_RSMEMBERSHIP_USERNAME'), JText::_('COM_RSMEMBERSHIP_EMAIL'), JText::_('COM_RSMEMBERSHIP_STATUS'), JText::_('COM_RSMEMBERSHIP_NOTIFIED'), JText::_('COM_RSMEMBERSHIP_START_DATE'), JText::_('COM_RSMEMBERSHIP_START_END'), JText::_('JPUBLISHED'));
break;
}
// Add header to rows
$rows .= '"' . implode('","', $headers) . '"' . "\n";
}
// Add the data to rows
foreach ($data as $i => $entry) {
$row = (array) $entry;
switch ($type) {
case 'subscribers':
$row['block'] = $row['block'] ? JText::_('JNO') : JText::_('JYES');
break;
case 'subscriptions':
unset($row['membership_id']);
unset($row['id']);
unset($row['user_id']);
$row['membership_start'] = RSMembershipHelper::showDate($row['membership_start']);
$row['membership_end'] = $row['membership_end'] != '0000-00-00 00:00:00' ? RSMembershipHelper::showDate($row['membership_end']) : ' - ';
$row['notified'] = $row['notified'] != '0000-00-00 00:00:00' ? RSMembershipHelper::showDate($row['notified']) : ' - ';
$row['status'] = JText::_('COM_RSMEMBERSHIP_STATUS_' . $row['status']);
$row['published'] = $row['published'] ? JText::_('JYES') : JText::_('JNO');
break;
}
$rows .= '"' . implode('","', $row) . '"';
$rows .= "\n";
}
return $rows;
}
示例12: getListQuery
protected function getListQuery()
{
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$layout = JFactory::getApplication()->input->get('layout', '', 'cmd');
$filter_word = $this->getState($this->context . '.filter.search', '');
$listOrdering = $this->getState('list.ordering', 'ordering');
$listDirection = $this->getState('list.direction', 'ASC');
switch ($layout) {
case 'article':
$query->select('a.*, ' . $db->qn('c.title', 'categorytitle'))->from($db->qn('#__content', 'a'))->join('left', $db->qn('#__categories', 'c') . ' ON ' . $db->qn('c.id') . ' = ' . $db->qn('a.catid'));
if ($filter_word) {
$query->where($db->qn('a.title') . ' LIKE ' . $db->q('%' . $filter_word . '%'));
}
$query->order($listOrdering . ' ' . $listDirection);
break;
case 'category':
$query->select('*')->from($db->qn('#__categories'))->where($db->qn('extension') . ' LIKE ' . $db->q('com_content'));
if ($filter_word) {
$query->where($db->qn('title') . ' LIKE ' . $db->q('%' . $filter_word . '%'));
}
$listOrdering = $db->qn('id');
// we don't have an ordering column for
$query->order($listOrdering . ' ' . $listDirection);
break;
case 'module':
$query->select('*')->from($db->qn('#__modules'));
if ($filter_word) {
$query->where($db->qn('title') . ' LIKE ' . $db->q('%' . $filter_word . '%') . ' OR ' . $db->qn('module') . ' LIKE ' . $db->q('%' . $filter_word . '%'));
}
$query->order($listOrdering . ' ' . $listDirection);
break;
case 'menu':
$query->select($db->qn('id') . ', ' . $db->qn('title', 'name') . ', ' . $db->qn('menutype') . ', ' . $db->qn('published'))->from($db->qn('#__menu', 'm'))->where($db->qn('published') . ' != ' . $db->q('-2') . ' AND ' . $db->qn('client_id') . ' = ' . $db->q('0') . ' AND ' . $db->qn('parent_id') . ' > ' . $db->q('0'));
if ($filter_word) {
$query->where($db->qn('title') . ' LIKE ' . $db->q('%' . $filter_word . '%') . ' OR ' . $db->qn('menutype') . ' LIKE ' . $db->q('%' . $filter_word . '%'));
}
if (RSMembershipHelper::isJ3()) {
$listOrdering = $db->qn('lft');
}
$query->order($listOrdering . ' ' . $listDirection);
break;
}
return $query;
}
示例13: onMembershipPayment
function onMembershipPayment($plugin, $data, $extra, $membership, &$transaction)
{
$this->loadLanguage('plg_system_rsmembership', JPATH_ADMINISTRATOR);
$this->loadLanguage('plg_system_rsmembershipwire', JPATH_ADMINISTRATOR);
if (!$this->canRun()) {
return;
}
if (!preg_match('#rsmembershipwire([0-9]+)#', $plugin, $match)) {
return false;
}
$id = (int) $match[1];
$db =& JFactory::getDBO();
$db->setQuery("SELECT * FROM #__rsmembership_payments WHERE `id`='" . $id . "'");
$payment = $db->loadObject();
$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;
}
$html = '';
$html .= $payment->details;
$replace = array('{price}', '{membership}');
$with = array(RSMembershipHelper::getPriceFormat($transaction->price), $membership->name);
$html = str_replace($replace, $with, $html);
$html .= '<form method="post" action="' . JRoute::_('index.php?option=com_rsmembership&task=thankyou') . '">';
$html .= '<input class="button" type="submit" value="' . JText::_('RSM_CONTINUE') . '" />';
$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;
}
示例14: __construct
function __construct()
{
parent::__construct();
$mainframe =& JFactory::getApplication();
$option = 'com_rsmembership';
$user = JFactory::getUser();
if ($user->get('guest')) {
$link = JRequest::getURI();
$link = base64_encode($link);
$user_option = RSMembershipHelper::isJ16() ? 'com_users' : 'com_user';
$mainframe->redirect('index.php?option=' . $user_option . '&view=login&return=' . $link);
}
// Get pagination request variables
$limit = JRequest::getVar('limit', $mainframe->getCfg('list_limit'), '', 'int');
$limitstart = JRequest::getVar('limitstart', 0, '', 'int');
// In case limit has been changed, adjust it
$limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
$this->setState($option . '.memberships.limit', $limit);
$this->setState($option . '.memberships.limitstart', $limitstart);
$this->_query = $this->_buildQuery();
}
示例15: _getDefaultFilters
public function _getDefaultFilters()
{
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$filters = array();
// set the default values for fields in xml
$filters['report'] = 'report_2';
$filters['from_date'] = '';
$filters['to_date'] = RSMembershipHelper::showDate(JFactory::getDate()->toUnix(), 'Y-m-d');
$filters['unit'] = 'day';
$filters['user_id'] = '';
$filters['memberships'] = array_keys(RSMembershipHelper::getMembershipsList(false));
$filters['status_memberships'] = array(0, 1, 2, 3);
$filters['status_transactions'] = array('pending', 'completed', 'denied');
$filters['price_from'] = 0;
$filters['price_to'] = '';
$filters['transaction_types'] = array('new', 'upgrade', 'addextra', 'renew');
$query->select('DISTINCT(gateway)')->from($db->qn('#__rsmembership_transactions'))->order($db->qn('gateway') . ' ASC');
$db->setQuery($query);
$filters['gateways'] = $db->loadColumn();
return $filters;
}