本文整理汇总了PHP中hikashop_isAllowed函数的典型用法代码示例。如果您正苦于以下问题:PHP hikashop_isAllowed函数的具体用法?PHP hikashop_isAllowed怎么用?PHP hikashop_isAllowed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hikashop_isAllowed函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
return 'This module can not work without the Hikashop Component';
}
$config =& hikashop_config();
if (!hikashop_isAllowed($config->get('acl_modules_manage', 'all'))) {
return 'Access to the HikaShop options of the modules is restricted';
}
$id = hikashop_getCID('id');
if (!empty($id)) {
$app = JFactory::getApplication();
if ($app->isAmdin()) {
$link = JRoute::_('index.php?option=com_hikashop&ctrl=modules&task=edit&cid[]=' . $id);
} else {
$link = JURI::base() . 'administrator/index.php?option=com_hikashop&ctrl=modules&task=edit&cid[]=' . $id;
}
$text = '<a title="' . JText::_('HIKASHOP_OPTIONS') . '" href="' . $link . '" >' . JText::_('HIKASHOP_OPTIONS') . '</a>';
$config =& hikashop_config();
$level = $config->get('params_' . $id);
} else {
$text = JText::_('HIKASHOP_OPTIONS_EDIT');
}
return $text;
}
示例2: getInput
protected function getInput()
{
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
return 'This plugin can not work without the Hikashop Component';
}
$id = JRequest::getInt('extension_id');
$plugins = hikashop_get('class.plugins');
$plugin = $plugins->get($id);
$name = @$plugin->element;
if (@$plugin->folder == 'hikashopshipping') {
$group = 'shipping';
} elseif (@$plugin->folder == 'hikashop') {
$group = 'plugin';
} else {
$group = 'payment';
}
$config =& hikashop_config();
if (!hikashop_isAllowed($config->get('acl_plugins_manage', 'all'))) {
return 'Access to the HikaShop options of the plugins is restricted';
}
$text = '<a style="float:left;" title="' . JText::_('HIKASHOP_OPTIONS') . '" href="' . JRoute::_('index.php?option=com_hikashop&ctrl=plugins&fromjoomla=1&task=listing&name=' . $name . '&plugin_type=' . $group) . '" >' . JText::_('HIKASHOP_OPTIONS') . '</a>';
return $text;
}
示例3: listing
function listing()
{
$app = JFactory::getApplication();
$database = JFactory::getDBO();
$toggleClass = hikashop_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$pageInfo = $this->getPageInfo('a.warehouse_id');
$filters = array();
$order = '';
$searchMap = array('a.warehouse_id', 'a.warehouse_name', 'a.warehouse_description');
$this->processFilters($filters, $order, $searchMap);
$query = ' FROM ' . hikashop_table('warehouse') . ' AS a' . $filters . $order;
$this->getPageInfoTotal($query, '*');
$database->setQuery('SELECT a.*' . $query, $pageInfo->limit->start, $pageInfo->limit->value);
$rows = $database->loadObjectList();
if (!empty($pageInfo->search)) {
$rows = hikashop_search($pageInfo->search, $rows, 'warehouse_id');
}
$database->setQuery('SELECT count(*)' . $query);
$pageInfo->elements->page = count($rows);
$toggleClass = hikashop_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$this->getPagination();
$this->getOrdering('a.warehouse_ordering', true);
$this->assignRef('order', $order);
hikashop_setTitle(JText::_($this->nameListing), $this->icon, $this->ctrl);
$config =& hikashop_config();
$manage = hikashop_isAllowed($config->get('acl_warehouse_manage', 'all'));
$this->assignRef('manage', $manage);
$this->toolbar = array(array('name' => 'addNew', 'display' => $manage), array('name' => 'editList', 'display' => $manage), array('name' => 'deleteList', 'check' => JText::_('HIKA_VALIDDELETEITEMS'), 'display' => hikashop_isAllowed($config->get('acl_warehouse_delete', 'all'))), '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-listing'), 'dashboard');
}
示例4: getInput
protected function getInput()
{
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
if (!function_exists('hikashop_config') && !(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
return 'This menu options cannot be displayed without the Hikashop Component';
}
$id = JRequest::getInt('id');
if (HIKASHOP_J30) {
$empty = '';
jimport('joomla.html.parameter');
$params = new HikaParameter($empty);
$js = '';
$params->set('id', $this->id);
$params->set('name', $this->name);
$params->set('value', $this->value);
$params->set('type', $this->getAttribute('content'));
$params->set('menu', $this->getAttribute('menu'));
$content = hikashop_getLayout('menus', 'options', $params, $js);
$text = '</div></div>' . $content . '<div><div>';
} elseif (!empty($id)) {
$config =& hikashop_config();
if (!hikashop_isAllowed($config->get('acl_menus_manage', 'all'))) {
return 'Access to the HikaShop options of the menus is restricted';
}
$text = '<a title="' . JText::_('HIKASHOP_OPTIONS') . '" href="' . JRoute::_('index.php?option=com_hikashop&ctrl=menus&fromjoomla=1&task=edit&cid[]=' . $id) . '" >' . JText::_('HIKASHOP_OPTIONS') . '</a>';
} else {
$text = JText::_('HIKASHOP_OPTIONS_EDIT');
}
return $text;
}
示例5: listing
function listing()
{
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->search = $app->getUserStateFromRequest($this->paramBase . ".search", 'search', '', 'string');
$pageInfo->filter->order->value = $app->getUserStateFromRequest($this->paramBase . ".filter_order", 'filter_order', 'a.waitlist_id', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($this->paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
$pageInfo->limit->value = $app->getUserStateFromRequest($this->paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($this->paramBase . '.limitstart', 'limitstart', 0, 'int');
$database = JFactory::getDBO();
$filters = array();
$searchMap = array('a.waitlist_id', 'a.email', 'a.name', 'a.product_id', 'b.product_name', 'b.product_code');
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . hikashop_getEscaped(JString::strtolower(trim($pageInfo->search)), true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}";
}
$order = '';
if (!empty($pageInfo->filter->order->value)) {
$order = ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
if (!empty($filters)) {
$filters = ' WHERE (' . implode(') AND (', $filters) . ')';
} else {
$filters = '';
}
$query = ' FROM ' . hikashop_table('waitlist') . ' AS a LEFT JOIN ' . hikashop_table('product') . ' AS b ON a.product_id=b.product_id ' . $filters . $order;
$database->setQuery('SELECT *' . $query, (int) $pageInfo->limit->start, (int) $pageInfo->limit->value);
$rows = $database->loadObjectList();
$class = hikashop_get('class.product');
foreach ($rows as $i => $element) {
if ($element->product_type == 'variant') {
$database->setQuery('SELECT * FROM ' . hikashop_table('variant') . ' AS a LEFT JOIN ' . hikashop_table('characteristic') . ' AS b ON a.variant_characteristic_id=b.characteristic_id WHERE a.variant_product_id=' . (int) $element->product_id . ' ORDER BY a.ordering');
$element->characteristics = $database->loadObjectList();
$parentProduct = $class->get((int) $element->product_parent_id);
$class->checkVariant($element, $parentProduct);
$rows[$i] = $element;
}
}
if (!empty($pageInfo->search)) {
$rows = hikashop_search($pageInfo->search, $rows, 'waitlist_id');
}
$database->setQuery('SELECT COUNT(*)' . $query);
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($rows);
$toggleClass = hikashop_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$this->getPagination();
hikashop_setTitle(JText::_($this->nameListing), $this->icon, $this->ctrl);
$config =& hikashop_config();
$manage = hikashop_isAllowed($config->get('acl_waitlist_manage', 'all'));
$this->assignRef('manage', $manage);
$this->toolbar = array(array('name' => 'addNew', 'display' => $manage), array('name' => 'editList', 'display' => $manage), array('name' => 'deleteList', 'display' => hikashop_isAllowed($config->get('acl_waitlist_delete', 'all'))), '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-listing'), 'dashboard');
}
示例6: getInput
protected function getInput()
{
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
if (!function_exists('hikashop_config') && !(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
return 'This module can not work without the Hikashop Component';
}
$config =& hikashop_config();
$id = JRequest::getInt('id');
if (HIKASHOP_J30 && !in_array(@$_REQUEST['option'], array('com_falang', 'com_joomfish'))) {
if (preg_match('/hikashopmodule/', $this->name)) {
$associated = false;
$cid = JRequest::getVar('id', '');
if (empty($cid)) {
$cid = hikashop_getCID();
}
foreach ($config->values as $name => $values) {
if (preg_match('#menu_[0-9]#', $name)) {
$params = unserialize(base64_decode($values->config_value));
$modules = array();
if (isset($params['modules'])) {
$modules = explode(',', $params['modules']);
}
if (in_array($cid, $modules)) {
$associated = str_replace('menu_', '', $values->config_namekey);
break;
}
}
}
if ($associated) {
$app = JFactory::getApplication();
$app->enqueueMessage(JText::sprintf('USE_MENU_SETTINGS_INSTEAD_OF_ASSOCIATED_ONES', JRoute::_('index.php?option=com_menus&view=item&layout=edit&id=' . $associated)));
}
$layout = 'modules';
} else {
$layout = 'cartmodules';
}
$empty = '';
jimport('joomla.html.parameter');
$params = new HikaParameter($empty);
$js = '';
$params->set('id', $this->id);
$params->set('name', $this->name);
$params->set('value', $this->value);
$content = hikashop_getLayout($layout, 'options', $params, $js, true);
$text = '</div></div>' . $content . '<div><div>';
} elseif (!empty($id)) {
if (!hikashop_isAllowed($config->get('acl_modules_manage', 'all'))) {
return 'Access to the HikaShop options of the modules is restricted';
}
$text = '<a style="float:left;" title="' . JText::_('HIKASHOP_OPTIONS') . '" href="' . JRoute::_('index.php?option=com_hikashop&ctrl=modules&fromjoomla=1&task=edit&cid[]=' . $id) . '" >' . JText::_('HIKASHOP_OPTIONS') . '</a>';
} else {
$text = JText::_('HIKASHOP_OPTIONS_EDIT');
}
return $text;
}
示例7: display
function display($map, $value)
{
$this->load();
if (count($this->values) == 1 && $this->type == 'style') {
return '<a target="_blank" href="' . HIKASHOP_REDIRECT . 'hikashop-styles' . '">' . hikashop_tooltip(JText::_('STYLE_TOOLTIP_TEXT'), JText::_('STYLE_TOOLTIP_TITLE'), '', JText::_('STYLE_HIKASHOP')) . '</a>';
}
$js = ' onchange="updateCSSLink(\'' . $this->type . '\',\'' . $this->type . '\',this.value);"';
$aStyle = empty($value) ? ' style="display:none"' : '';
$html = JHTML::_('select.genericlist', $this->values, $map, 'class="inputbox" size="1"', 'value', 'text', $value, $this->type . '_choice');
$config =& hikashop_config();
$manage = hikashop_isAllowed($config->get('acl_config_manage', 'all'));
if ($manage) {
$popup = hikashop_get('helper.popup');
$html .= $popup->display('<img src="' . HIKASHOP_IMAGES . 'edit.png" alt="' . JText::_('HIKA_EDIT') . '"/>', 'CSS', '\'' . 'index.php?option=com_hikashop&tmpl=component&ctrl=config&task=css&file=' . $this->type . '_\'+document.getElementById(\'' . $this->type . '_choice' . '\').value+\'&var=' . $this->type . '\'', $this->type . '_link', 760, 480, $aStyle, '', 'link', true);
}
return $html;
}
示例8: display
function display($category, $actions)
{
$oneAction = reset($actions);
$app = JFactory::getApplication();
if ($app->isAdmin() && !HIKASHOP_BACK_RESPONSIVE || !$app->isAdmin() && !HIKASHOP_RESPONSIVE) {
$acltable = '<table class="acltable"><thead><tr><th></th>';
} else {
$acltable = '<table class="table table-striped table-hover"><thead><tr><th></th>';
}
foreach ($actions as $action) {
$trans = JText::_('HIKA_' . strtoupper($action));
if ($trans == 'HIKA_' . strtoupper($action)) {
$trans = JText::_(strtoupper($action));
}
$acltable .= '<th style="cursor:pointer" onclick="updateAction(\'' . $category . '\',\'' . $action . '\')">' . $trans . '<input type="hidden" name="config[acl_' . $category . '_' . $action . ']" id="acl_' . $category . '_' . $action . '" value="' . $this->config->get('acl_' . $category . '_' . $action, 'all') . '"/></th>';
}
$acltable .= '</tr></thead><tbody>';
$custom = false;
foreach ($this->groups as $oneGroup) {
$acltable .= '<tr class="aclline"><td valign="top" class="groupname" style="cursor:pointer" onclick="updateGroup(\'' . $category . '\',\'' . $oneGroup->value . '\',new Array(\'' . implode("','", $actions) . '\'))">' . $oneGroup->text . '</td>';
foreach ($actions as $action) {
$acltable .= '<td class="checkfield">';
$value = $this->config->get('acl_' . $category . '_' . $action, 'all');
if (version_compare(JVERSION, '1.6.0', '>=') || !in_array($oneGroup->value, array(29, 30))) {
if (hikashop_isAllowed($value, $oneGroup->value, 'group')) {
$checked = 'checked="checked"';
} else {
$custom = true;
$checked = '';
}
$acltable .= '<input type="checkbox" id="acl_' . $category . '_' . $oneGroup->value . '_' . $action . '" onclick="updateACLTable(\'' . $category . '\',\'' . $action . '\');" value="' . $oneGroup->value . '" ' . $checked . ' />';
}
$acltable .= '</td>';
}
$acltable .= '</tr>';
}
$acltable .= '</tbody></table>';
$openDiv = JHTML::_('hikaselect.radiolist', $this->choice, "acl_{$category}", 'onclick="updateACLTable(\'' . $category . '\',\'' . $oneAction . '\');"', 'value', 'text', $custom ? 'special' : 'all');
$openDiv .= '<input type="hidden" name="aclcat[]" value="' . $category . '"/><div id="div_acl_' . $category . '"' . ($custom ? ' style="display:block"' : ' style="display:none"') . '>';
$return = $openDiv . $acltable . '</div>';
return $return;
}
示例9: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
return 'This menu options cannot be displayed without the Hikashop Component';
}
$config =& hikashop_config();
if (!hikashop_isAllowed($config->get('acl_menus_manage', 'all'))) {
return 'Access to the HikaShop options of the menus is restricted';
}
$id = reset(JRequest::getVar('cid', array(), '', 'array'));
if (!empty($id)) {
$text = '<a title="' . JText::_('HIKASHOP_OPTIONS') . '" href="' . JRoute::_('index.php?option=com_hikashop&ctrl=menus&task=edit&cid[]=' . $id) . '" >' . JText::_('HIKASHOP_OPTIONS') . '</a>';
$config =& hikashop_config();
$hikashop_params = $config->get('menu_' . $id, null);
if (empty($hikashop_params)) {
$text .= '<br/>' . JText::_('HIKASHOP_SAVE_OPTIONS_ONCE');
}
} else {
$text = JText::_('HIKASHOP_OPTIONS_EDIT') . '<br/>' . JText::_('HIKASHOP_SAVE_OPTIONS_ONCE');
}
return $text;
}
示例10: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
if (!(include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_hikashop' . DS . 'helpers' . DS . 'helper.php')) {
return 'This module can not work without the Hikashop Component';
}
$id = hikashop_getCID('cid');
$plugins = hikashop_get('class.plugins');
$plugin = $plugins->get($id);
$name = @$plugin->element;
if (@$plugin->folder == 'hikashopshipping') {
$group = 'shipping';
} elseif (@$plugin->folder == 'hikashop') {
$group = 'plugin';
} else {
$group = 'payment';
}
$config =& hikashop_config();
if (!hikashop_isAllowed($config->get('acl_plugins_manage', 'all'))) {
return 'Access to the HikaShop options of the plugins is restricted';
}
$text = '<a style="float:left;" title="' . JText::_('HIKASHOP_OPTIONS') . '" href="' . JRoute::_('index.php?option=com_hikashop&ctrl=plugins&task=listing&name=' . $name . '&plugin_type=' . $group) . '" >' . JText::_('HIKASHOP_OPTIONS') . '</a>';
return $text;
}
示例11: check
function check(&$coupon, &$total, $zones, &$products, $display_error = true)
{
JPluginHelper::importPlugin('hikashop');
$dispatcher = JDispatcher::getInstance();
$error_message = '';
$do = true;
if (isset($coupon->discount_value)) {
$coupon = $this->get($coupon->discount_id);
}
$dispatcher->trigger('onBeforeCouponCheck', array(&$coupon, &$total, &$zones, &$products, &$display_error, &$error_message, &$do));
if ($do) {
$user = hikashop_get('class.user');
$currency = hikashop_get('class.currency');
if (empty($coupon)) {
$error_message = JText::_('COUPON_NOT_VALID');
} elseif ($coupon->discount_start > time()) {
$error_message = JText::_('COUPON_NOT_YET_USABLE');
} elseif ($coupon->discount_end && $coupon->discount_end < time()) {
$error_message = JText::_('COUPON_EXPIRED');
} elseif (hikashop_level(2) && !empty($coupon->discount_access) && $coupon->discount_access != 'all' && ($coupon->discount_access == 'none' || !hikashop_isAllowed($coupon->discount_access))) {
$error_message = JText::_('COUPON_NOT_FOR_YOU');
} elseif (empty($error_message) && hikashop_level(1) && !empty($coupon->discount_quota) && $coupon->discount_quota <= $coupon->discount_used_times) {
$error_message = JText::_('QUOTA_REACHED_FOR_COUPON');
} elseif (empty($error_message) && hikashop_level(1)) {
if (!empty($coupon->discount_quota_per_user)) {
$user_id = hikashop_loadUser();
if ($user_id) {
$db = JFactory::getDBO();
$config =& hikashop_config();
$cancelled_order_status = explode(',', $config->get('cancelled_order_status'));
$cancelled_order_status = "'" . implode("','", $cancelled_order_status) . "'";
$query = 'SELECT COUNT(order_id) AS already_used FROM ' . hikashop_table('order') . ' WHERE order_user_id=' . (int) $user_id . ' AND order_status NOT IN (' . $cancelled_order_status . ') AND order_discount_code=' . $db->Quote($coupon->discount_code) . ' GROUP BY order_id';
$db->setQuery($query);
$already_used = $db->loadResult();
if ($coupon->discount_quota_per_user <= $already_used) {
$error_message = JText::_('QUOTA_REACHED_FOR_COUPON');
}
}
}
if (empty($error_message) && $coupon->discount_zone_id) {
if (!is_array($coupon->discount_zone_id)) {
$coupon->discount_zone_id = explode(',', $coupon->discount_zone_id);
}
$class = hikashop_get('class.zone');
$zone = $class->getZones($coupon->discount_zone_id, 'zone_namekey', 'zone_namekey', true);
if ($zone && !count(array_intersect($zone, $zones))) {
$error_message = JText::_('COUPON_NOT_AVAILABLE_IN_YOUR_ZONE');
}
}
$ids = array();
$qty = 0;
foreach ($products as $prod) {
$qty += $prod->cart_product_quantity;
if (!empty($prod->product_parent_id)) {
$ids[$prod->product_parent_id] = (int) $prod->product_parent_id;
} else {
$ids[$prod->product_id] = (int) $prod->product_id;
}
}
if (empty($ids)) {
$error_message = JText::_('COUPON_NOT_FOR_EMPTY_CART');
}
if (!empty($coupon->discount_product_id) && is_string($coupon->discount_product_id)) {
$coupon->discount_product_id = explode(',', $coupon->discount_product_id);
}
if (empty($error_message) && !empty($coupon->discount_product_id) && count(array_intersect($ids, $coupon->discount_product_id)) == 0) {
$error_message = JText::_('COUPON_NOT_FOR_THOSE_PRODUCTS');
}
if (empty($error_message) && $coupon->discount_category_id) {
$db = JFactory::getDBO();
if (!is_array($coupon->discount_category_id)) {
$coupon->discount_category_id = explode(',', trim($coupon->discount_category_id, ','));
}
if ($coupon->discount_category_childs) {
$filters = array('b.category_type=\'product\'', 'a.product_id IN (' . implode(',', $ids) . ')');
$categoryClass = hikashop_get('class.category');
$categories = $categoryClass->getCategories($coupon->discount_category_id, 'category_left, category_right');
if (!empty($categories)) {
$categoriesFilters = array();
foreach ($categories as $category) {
$categoriesFilters[] = 'b.category_left >= ' . $category->category_left . ' AND b.category_right <= ' . $category->category_right;
}
if (count($categoriesFilters)) {
$filters[] = '((' . implode(') OR (', $categoriesFilters) . '))';
hikashop_addACLFilters($filters, 'category_access', 'b');
$select = 'SELECT a.product_id FROM ' . hikashop_table('category') . ' AS b LEFT JOIN ' . hikashop_table('product_category') . ' AS a ON b.category_id=a.category_id WHERE ' . implode(' AND ', $filters);
$db->setQuery($select);
$id = $db->loadRowList();
if (empty($id)) {
$error_message = JText::_('COUPON_NOT_FOR_PRODUCTS_IN_THOSE_CATEGORIES');
}
}
}
} else {
JArrayHelper::toInteger($coupon->discount_category_id);
$filters = array('b.category_id IN (' . implode(',', $coupon->discount_category_id) . ')', 'a.product_id IN (' . implode(',', $ids) . ')');
hikashop_addACLFilters($filters, 'category_access', 'b');
$select = 'SELECT a.product_id FROM ' . hikashop_table('category') . ' AS b LEFT JOIN ' . hikashop_table('product_category') . ' AS a ON b.category_id=a.category_id WHERE ' . implode(' AND ', $filters);
$db->setQuery($select);
$id = $db->loadRowList();
//.........这里部分代码省略.........
示例12: select_coupon
function select_coupon()
{
$badge = JRequest::getVar('badge', 'false');
$this->assignRef('badge', $badge);
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($this->paramBase . ".filter_order", 'filter_order', 'a.discount_id', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($this->paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
$pageInfo->search = $app->getUserStateFromRequest($this->paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$pageInfo->filter->filter_type = $app->getUserStateFromRequest($this->paramBase . ".filter_type", 'filter_type', '', 'string');
$pageInfo->limit->value = $app->getUserStateFromRequest($this->paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
if (empty($pageInfo->limit->value)) {
$pageInfo->limit->value = 500;
}
$pageInfo->limit->start = $app->getUserStateFromRequest($this->paramBase . '.limitstart', 'limitstart', 0, 'int');
$database = JFactory::getDBO();
$searchMap = array('a.discount_code', 'a.discount_id');
$filters = array();
if ($badge != 'false') {
$filters[] = 'a.discount_type="discount"';
}
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . hikashop_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}";
}
$query = ' FROM ' . hikashop_table('discount') . ' AS a';
if ($badge == 'false' && !empty($pageInfo->filter->filter_type)) {
switch ($pageInfo->filter->filter_type) {
case 'all':
break;
default:
$filters[] = 'a.discount_type = ' . $database->Quote($pageInfo->filter->filter_type);
break;
}
}
if (!empty($filters)) {
$query .= ' WHERE (' . implode(') AND (', $filters) . ')';
}
if (!empty($pageInfo->filter->order->value)) {
$query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
$database->setQuery('SELECT a.*' . $query, $pageInfo->limit->start, $pageInfo->limit->value);
$rows = $database->loadObjectList();
if (!empty($pageInfo->search)) {
$rows = hikashop_search($pageInfo->search, $rows, 'discount_id');
}
$database->setQuery('SELECT count(*)' . $query);
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($rows);
if ($pageInfo->limit->value == 500) {
$pageInfo->limit->value = 100;
}
hikashop_setTitle(JText::_($this->nameListing), $this->icon, $this->ctrl);
$config =& hikashop_config();
$manage = hikashop_isAllowed($config->get('acl_discount_manage', 'all'));
$this->assignRef('manage', $manage);
$this->toolbar = array(array('name' => 'custom', 'icon' => 'copy', 'task' => 'copy', 'alt' => JText::_('HIKA_COPY'), 'display' => $manage), array('name' => 'addNew', 'display' => $manage), array('name' => 'editList', 'display' => $manage), array('name' => 'deleteList', 'display' => hikashop_isAllowed($config->get('acl_discount_delete', 'all'))), '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-listing'), 'dashboard');
$discountType = hikashop_get('type.discount');
$this->assignRef('filter_type', $discountType);
$toggleClass = hikashop_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$this->getPagination();
$currencyHelper = hikashop_get('class.currency');
$this->assignRef('currencyHelper', $currencyHelper);
}
示例13: addHeader
function addHeader()
{
hikashop_setTitle(JText::_($this->nameListing), $this->icon, $this->ctrl);
$config =& hikashop_config();
$manage = hikashop_isAllowed($config->get('acl_category_manage', 'all'));
$this->assignRef('manage', $manage);
$importIcon = 'upload';
if (HIKASHOP_J30) {
$importIcon = 'import';
}
$this->toolbar = array(array('name' => 'custom', 'icon' => $importIcon, 'alt' => JText::_('REBUILD'), 'task' => 'rebuild', 'check' => false, 'display' => $manage), array('name' => 'addNew', 'display' => $manage), array('name' => 'editList', 'display' => $manage), array('name' => 'deleteList', 'display' => hikashop_isAllowed($config->get('acl_category_delete', 'all'))), '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-listing'), 'dashboard');
}
示例14: form
function form()
{
$dashboard = false;
$config =& hikashop_config();
$widget_id = hikashop_getCID('widget_id');
$class = hikashop_get('class.widget');
$db = JFactory::getDBO();
if (!empty($widget_id)) {
$element = $class->get($widget_id);
$task = 'edit';
} else {
$element = new stdClass();
$element->widget_published = 1;
$task = 'add';
$element->widget_params = new stdClass();
$element->widget_params->display = 'line';
$element->widget_params->content = 'sales';
$element->widget_params->date_group = '%j %Y';
$element->widget_params->date_type = 'created';
$element->widget_params->periodType = 'proposedPeriod';
$element->widget_params->proposedPeriod = 'thisMonth';
$element->widget_params->format = 'UTF-8';
$element->widget_params->period_compare = 'none';
$element->widget_name = 'New report ' . $widget_id;
$element->widget_params->limit = '7';
}
$class->loadDatas($element);
if (isset($element->widget_params->table)) {
$row_id = count($element->widget_params->table);
$this->assignRef('row_id', $row_id);
foreach ($element->widget_params->table as $row) {
$class->loadDatas($row);
}
} else {
$row_id = 0;
$this->assignRef('row_id', $row_id);
}
if ($element->widget_params->display != 'table') {
if ($element->widget_params->display != 'listing' && ($element->widget_params->content == 'products' || $element->widget_params->content == 'categories' || $element->widget_params->content == 'discount')) {
$element->widget_params->content = 'orders';
}
}
hikashop_setTitle(JText::_($this->nameForm), $this->icon, $this->ctrl . '&task=' . $task . '&widget_id=' . $widget_id);
$this->toolbar = array(array('name' => 'link', 'icon' => 'archive', 'alt' => JText::_('HIKA_EXPORT'), 'url' => hikashop_completeLink('report&task=csv&cid[]=' . $widget_id) . '&' . hikashop_getFormToken() . '=1', 'display' => hikashop_level(2) && !empty($widget_id) && hikashop_isAllowed($config->get('acl_report_view', 'all'))), '|', array('name' => 'save', 'display' => hikashop_isAllowed($config->get('acl_report_manage', 'all'))), array('name' => 'save2new', 'display' => version_compare(JVERSION, '1.7', '>=') && hikashop_isAllowed($config->get('acl_report_manage', 'all'))), array('name' => 'apply', 'display' => hikashop_isAllowed($config->get('acl_report_manage', 'all'))), 'cancel', '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-form'));
$this->assignRef('element', $element);
$translation = false;
$transHelper = hikashop_get('helper.translation');
if ($transHelper && $transHelper->isMulti()) {
$translation = true;
$transHelper->load('hikashop_widget', @$element->widget_id, $element);
$config =& hikashop_config();
$multilang_display = $config->get('multilang_display', 'tabs');
if ($multilang_display == 'popups') {
$multilang_display = 'tabs';
}
$tabs = hikashop_get('helper.tabs');
$this->assignRef('tabs', $tabs);
$this->assignRef('transHelper', $transHelper);
}
$toggle = hikashop_get('helper.toggle');
$this->assignRef('toggle', $toggle);
$this->assignRef('translation', $translation);
$currencyClass = hikashop_get('class.currency');
$this->assignRef('currencyHelper', $currencyClass);
$periodType = hikashop_get('type.period');
$this->assignRef('periodType', $periodType);
$widget_dataType = hikashop_get('type.widget_data');
$this->assignRef('widget_dataType', $widget_dataType);
$status = hikashop_get('type.categorysub');
$status->type = 'status';
$this->assignRef('status', $status);
$delay = hikashop_get('type.delay');
$this->assignRef('delay', $delay);
$region = hikashop_get('type.region');
$this->assignRef('region', $region);
if (hikashop_level(2)) {
$encoding = hikashop_get('type.charset');
$this->assignRef('encoding', $encoding);
}
$widgetClass = hikashop_get('class.widget');
$this->assignRef('widgetClass', $widgetClass);
$dateGroup = hikashop_get('type.dategroup');
$this->assignRef('dateGroup', $dateGroup);
$dateType = hikashop_get('type.datetype');
$this->assignRef('dateType', $dateType);
$shippingMethods = hikashop_get('type.plugins');
$shippingMethods->type = 'shipping';
$shippingMethods->manualOnly = true;
$this->assignRef('shippingMethods', $shippingMethods);
$paymentMethods = hikashop_get('type.plugins');
$paymentMethods->type = 'payment';
$paymentMethods->manualOnly = true;
$this->assignRef('paymentMethods', $paymentMethods);
$dashboard = JRequest::getVar('dashboard');
$this->assignRef('dashboard', $dashboard);
$nameboxType = hikashop_get('type.namebox');
$this->assignRef('nameboxType', $nameboxType);
JHTML::_('behavior.modal');
$script = "\r\n\tfunction deleteRow(divName,inputName,rowName){\r\n\t\tvar d = document.getElementById(divName);\r\n\t\tvar olddiv = document.getElementById(inputName);\r\n\t\tif(d && olddiv){\r\n\t\t\td.removeChild(olddiv);\r\n\t\t\tdocument.getElementById(rowName).style.display='none';\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction updatePeriodSelection(){\r\n\t\tselectedPeriod = document.getElementById('display_proposed_period').checked;\r\n\t\tdocument.getElementById('period_start').disabled=false;\r\n\t\tdocument.getElementById('period_end').disabled=false;\r\n\t\tdocument.getElementById('delayvalue1').disabled=false;\r\n\t\tdocument.getElementById('delaytype1').disabled=false;\r\n\t\tdocument.getElementById('datawidgetwidget_paramsproposedPeriod').disabled=false;\r\n\t\tif(selectedPeriod==true){\r\n\t\t\tdocument.getElementById('period_start').disabled=true;\r\n\t\t\tdocument.getElementById('period_end').disabled=true;\r\n\t\t\tdocument.getElementById('delayvalue1').disabled=true;\r\n\t\t\tdocument.getElementById('delaytype1').disabled=true;\r\n\t\t}else{\r\n\t\t\tdocument.getElementById('datawidgetwidget_paramsproposedPeriod').disabled=true;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateCompare(){\r\n\t\tselectedCompare = document.getElementById('compare_with_values').checked;\r\n\t\tdocument.getElementById('compares_order_status').disabled=false;\r\n\t\tdocument.getElementById('compares_order_currency_id').disabled=false;\r\n\t\tdocument.getElementById('compares_order_payment_method').disabled=false;\r\n\t\tdocument.getElementById('compares_order_shipping_method').disabled=false;\r\n\t\tdocument.getElementById('compares_order_discount_code').disabled=false;\r\n\t\tdocument.getElementById('compares_products').disabled=false;\r\n\t\tdocument.getElementById('compares_categories').disabled=false;\r\n\t\tdocument.getElementById('compare_period').disabled=false;\r\n\t\tif(selectedCompare==true){\r\n\t\t\tdocument.getElementById('compare_period').disabled=true;\r\n\t\t}else{\r\n\t\t\tdocument.getElementById('compares_order_status').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_currency_id').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_payment_method').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_shipping_method').disabled=true;\r\n\t\t\tdocument.getElementById('compares_order_discount_code').disabled=true;\r\n\t\t\tdocument.getElementById('compares_products').disabled=true;\r\n\t\t\tdocument.getElementById('compares_categories').disabled=true;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction updateDisplayType(){\r\n\t\ttheType=false;\r\n\t\tvalues = new Array('gauge', 'column', 'graph', 'line', 'pie', 'area', 'map', 'listing', 'table');\r\n\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\tnewType = document.getElementById('widget_display_'+values[i]).checked;\r\n\t\t\tif(newType==true){\r\n\t\t\t\tdisplayType = document.getElementById('widget_display_'+values[i]).value;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='pie'){\r\n\t\t\tvalues = new Array('orders', 'sales', 'taxes', 'partners', 'customers');\r\n\t\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\t\tif(newType==true){\r\n\t\t\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(theType=='customers' || theType=='partners'){\r\n\t\t\t\t document.getElementById('type_orders').checked=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='map'){\r\n\t\t\tvalues = new Array('orders', 'sales', 'taxes', 'partners', 'customers');\r\n\t\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\t\tif(newType==true){\r\n\t\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tdocument.getElementById('map_options').style.display='none';\r\n\t\t\tdocument.getElementById('filters').style.display='';\r\n\t\t\tif(theType=='orders' || theType=='sales' || theType=='taxes'){\r\n\t\t\t\tdocument.getElementById('map_options').style.display='';\r\n\t\t\t}\r\n\t\t\tif(theType=='customers' || theType=='partners'){\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='gauge' || displayType=='line' || displayType=='area' || displayType=='graph' || displayType=='column'){\r\n\t\t\tvalues = new Array('orders', 'sales', 'taxes', 'partners', 'customers');\r\n\t\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\t\tif(newType==true){\r\n\t\t\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(theType==false){\r\n\t\t\t\ttheType='orders';\r\n\t\t\t \ttheType = document.getElementById('type_orders').checked=true;\r\n\t\t\t}\r\n\t\t\tdocument.getElementById('widget_compare').style.display='';\r\n\t\t\tif(theType=='orders' || theType=='sales' || theType=='taxes'){\r\n\t\t\t\tdocument.getElementById('widget_compare').style.display='';\r\n\t\t\t}\r\n\t\t\tif(theType=='customers' || theType=='partners'){\r\n\t\t\t\tdocument.getElementById('widget_compare').style.display='none';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(displayType=='table'){\r\n\t\t\tdocument.getElementById('products_options').style.display='none';\r\n\t\t\tdocument.getElementById('filters').style.display='none';\r\n\t\t\tdocument.getElementById('customers_options').style.display='none';\r\n\t\t\tdocument.getElementById('partners_options').style.display='none';\r\n\t\t\tdocument.getElementById('orders_options').style.display='none';\r\n\t\t\tdocument.getElementById('product_datas').style.display='none';\r\n\t\t\tdocument.getElementById('widget_compare').style.display='none';\r\n\t\t\tdocument.getElementById('widget_limit').style.display='none';\r\n\t\t\tdocument.getElementById('widget_region').style.display='none';\r\n\t\t\tdocument.getElementById('map_options').style.display='none';\r\n\t\t}\r\n\t\tif(displayType!='listing'){ return 0; }\r\n\r\n\t\tvalues = new Array('orders', 'products', 'customers', 'partners', 'categories', 'discounts');\r\n\t\tfor(var i=0; i<values.length; i++){\r\n\t\t\tnewType = document.getElementById('type_'+values[i]).checked;\r\n\t\t\tif(newType==true){\r\n\t\t\t\ttheType = document.getElementById('type_'+values[i]).value;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(!theType){\r\n\t\t\tdocument.getElementById('type_orders').checked=true;\r\n\t\t\ttheType='orders';\r\n\t\t}\r\n\t\tdocument.getElementById('products_options').style.display='none';\r\n\t\tdocument.getElementById('filters').style.display='none';\r\n\t\tdocument.getElementById('customers_options').style.display='none';\r\n\t\tdocument.getElementById('partners_options').style.display='none';\r\n\t\tdocument.getElementById('orders_options').style.display='none';\r\n\t\tdocument.getElementById('product_datas').style.display='none';\r\n\r\n\t\tif(theType=='orders' || theType=='products' || theType=='categories' || theType=='discounts' || theType=='customers' || theType== 'partners'){\r\n\t\t\tdocument.getElementById('filters').style.display='';\r\n\t\t\tdocument.getElementById('product_datas').style.display='';\r\n\t\t\tif(theType=='categories'){\r\n\t\t\t\tdocument.getElementById('data_hits').style.display='none';\r\n\t\t\t\tclicksValue = document.getElementById('data_clicks').checked;\r\n\t\t\t\tif(clicksValue==true){\r\n\t\t\t\t\tdocument.getElementById('data_orders').checked=true;\r\n\t\t\t\t}\r\n\t\t\t}else if(theType=='products'){\r\n\t\t\t\tdocument.getElementById('data_hits').style.display='';\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(theType=='discounts'){\r\n\t\t\tdocument.getElementById('product_datas').style.display='none';\r\n\t\t}\r\n\t\tif(theType=='products' || theType=='categories' || theType=='discounts'){\r\n\t\t\tdocument.getElementById('products_options').style.display='';\r\n\t\t}\r\n\t\tif(theType=='customers'){\r\n\t\t\tdocument.getElementById('customers_options').style.display='';\r\n\t\t}\r\n\t\tif(theType=='partners'){\r\n\t\t\tdocument.getElementById('partners_options').style.display='';\r\n\t\t}\r\n\t\tif(theType=='orders'){\r\n\t\t\tdocument.getElementById('orders_options').style.display='';\r\n\t\t}\r\n\r\n\t}\r\n\twindow.hikashop.ready( function(){ updateDisplayType(); });\r\n\twindow.hikashop.ready( function(){ updatePeriodSelection(); });\r\n\twindow.hikashop.ready( function(){ updateCompare(); });\r\n\r\n\t\t\t\t";
if (!HIKASHOP_PHP5) {
//.........这里部分代码省略.........
示例15: process
//.........这里部分代码省略.........
$tool = array_merge(array('task' => 'remove', 'alt' => 'HIKA_DELETE', 'msg' => '', 'confirm' => true), $tool);
if ($tool['confirm'] && empty($tool['msg'])) {
$tool['msg'] = JText::_('HIKA_VALIDDELETEITEMS');
}
if (!empty($tool['msg'])) {
$bar->appendButton('Confirm', $tool['msg'], 'delete', $tool['alt'], $tool['task'], true);
} else {
$bar->appendButton('Standard', 'delete', $tool['alt'], $tool['task'], true);
}
break;
case 'custom':
$tool = array_merge(array('icon' => '', 'task' => '', 'alt' => '', 'check' => true, 'hide' => false), $tool);
$bar->appendButton('Standard', $tool['icon'], $tool['alt'], $tool['task'], $tool['check'], $tool['hide']);
break;
case 'confirm':
$tool = array_merge(array('icon' => '', 'task' => '', 'alt' => '', 'check' => true, 'hide' => false, 'msg' => ''), $tool);
$bar->appendButton('Confirm', $tool['msg'], $tool['icon'], $tool['alt'], $tool['task'], $tool['check'], $tool['hide']);
break;
case 'preview':
if (!empty($tool['target']) || !empty($tool['url'])) {
$url = '';
if (!empty($tool['target'])) {
$url = $tool['target'];
}
if (!empty($tool['url'])) {
$url = $tool['url'];
}
$bar->appendButton('Popup', 'preview', 'Preview', $url . '&task=preview');
}
break;
case 'preferences':
$tool = array_merge(array('component' => 'com_hikashop', 'path' => ''), $tool);
$component = urlencode($tool['component']);
$path = urlencode($tool['path']);
if (HIKASHOP_J30) {
$uri = (string) JUri::getInstance();
$return = urlencode(base64_encode($uri));
$bar->appendButton('Link', 'options', 'JToolbar_Options', 'index.php?option=com_config&view=component&component=' . $component . '&path=' . $path . '&return=' . $return);
} else {
$top = 0;
$left = 0;
$height = '550';
$width = '875';
$bar->appendButton('Popup', 'options', 'JToolbar_Options', 'index.php?option=com_config&view=component&component=' . $component . '&path=' . $path . '&tmpl=component', $width, $height, $top, $left, '');
}
break;
case 'help':
break;
case 'back':
break;
case 'link':
$tool = array_merge(array('icon' => '', 'url' => '', 'alt' => ''), $tool);
$bar->appendButton('Link', $tool['icon'], $tool['alt'], $tool['url']);
break;
case 'popup':
$tool = array_merge(array('icon' => '', 'url' => '', 'alt' => '', 'width' => 640, 'height' => 480, 'top' => 0, 'left' => 0, 'onClose' => '', 'title' => '', 'footer' => ''), $tool);
if (HIKASHOP_J30) {
if (!empty($tool['id'])) {
$tool['icon'] = $tool['id'] . '#' . $tool['icon'];
} else {
$tool['icon'] = $tool['icon'] . '#' . $tool['icon'];
}
}
$bar->appendButton('HikaPopup', $tool['icon'], $tool['alt'], $tool['url'], $tool['width'], $tool['height'], $tool['top'], $tool['left'], $tool['onClose'], $tool['title'], $tool['footer']);
break;
case 'close':
$bar->appendButton('Standard', 'cancel', JText::_('HIKA_CLOSE'), 'cancel', false, false);
break;
case 'hikacancel':
$cancel_url = JRequest::getVar('cancel_redirect');
if (!empty($cancel_url) || !empty($tool['url'])) {
if (!empty($cancel_url)) {
$cancel_url = base64_decode($cancel_url);
if (!hikashop_disallowUrlRedirect($cancel_url)) {
$bar->appendButton('Link', 'cancel', JText::_('HIKA_CANCEL'), $cancel_url);
}
} else {
$bar->appendButton('Link', 'cancel', JText::_('HIKA_CANCEL'), $tool['url']);
}
} else {
$bar->appendButton('Standard', 'cancel', JText::_('HIKA_CANCEL'), 'cancel', false, false);
}
break;
case 'pophelp':
if (!empty($tool['target'])) {
$bar->appendButton('Pophelp', $tool['target']);
}
break;
case 'export':
$bar->appendButton('Export');
break;
case 'dashboard':
if (hikashop_isAllowed($config->get('acl_dashboard_view', 'all'))) {
$bar->appendButton('Link', 'hikashop', JText::_('HIKASHOP_CPANEL'), hikashop_completeLink('dashboard'));
}
break;
}
}
}
}