本文整理汇总了PHP中hikashop_config函数的典型用法代码示例。如果您正苦于以下问题:PHP hikashop_config函数的具体用法?PHP hikashop_config怎么用?PHP hikashop_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hikashop_config函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: options
function options(&$params)
{
$this->id = $params->get('id');
$this->name = str_replace('[]', '', $params->get('name'));
$this->element = $params->get('value');
$this->pricetaxType = hikashop_get('type.pricetax');
$this->discountDisplayType = hikashop_get('type.discount_display');
$this->priceDisplayType = hikashop_get('type.priceDisplay');
$this->arr = array(JHTML::_('select.option', '-1', JText::_('HIKA_INHERIT')), JHTML::_('select.option', '1', JText::_('HIKASHOP_YES')), JHTML::_('select.option', '0', JText::_('HIKASHOP_NO')));
$this->arr[0]->class = 'btn-primary';
$this->arr[1]->class = 'btn-success';
$this->arr[2]->class = 'btn-danger';
$this->type = 'cart';
if (preg_match('/wishlist/', $this->name)) {
$this->type = 'wishlist';
}
$cid = JRequest::getInt('id', '');
if (empty($cid)) {
$cid = hikashop_getCID();
}
$modulesClass = hikashop_get('class.modules');
$module = $modulesClass->get($cid);
if (empty($this->element)) {
$this->element = $module->hikashop_params;
}
$config = hikashop_config();
$this->default_params = $config->get('default_params');
}
示例3: hikashopAcltableType
function hikashopAcltableType()
{
if (version_compare(JVERSION, '1.6.0', '<')) {
$acl =& JFactory::getACL();
$this->groups = $acl->get_group_children_tree(null, 'USERS', false);
} else {
$db = JFactory::getDBO();
$db->setQuery('SELECT a.*, a.title as text, a.id as value FROM #__usergroups AS a ORDER BY a.lft ASC');
$this->groups = $db->loadObjectList('id');
foreach ($this->groups as $id => $group) {
if (isset($this->groups[$group->parent_id])) {
$this->groups[$id]->level = intval(@$this->groups[$group->parent_id]->level) + 1;
$this->groups[$id]->text = str_repeat('- - ', $this->groups[$id]->level) . $this->groups[$id]->text;
}
}
}
$this->choice = array();
$this->choice[] = JHTML::_('select.option', 'all', JText::_('HIKA_ALL'));
$this->choice[] = JHTML::_('select.option', 'special', JText::_('HIKA_CUSTOM'));
$this->config =& hikashop_config();
$js = "function updateACLTable(cat, action) {\r\n\t\t\tchoice = document['adminForm']['acl_'+cat];\r\n\t\t\tchoiceValue = 'special';\r\n\t\t\tfor (var i=0; i < choice.length; i++){\r\n\t\t\t\t if (choice[i].checked){\r\n\t\t\t\t\t choiceValue = choice[i].value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(choiceValue == 'all'){\r\n\t\t\t\tdocument.getElementById('div_acl_'+cat).style.display = 'none';\r\n\t\t\t}else{\r\n\t\t\t\tdocument.getElementById('div_acl_'+cat).style.display = 'block';\r\n\t\t\t\tfinalValue = '';\r\n\t\t\t\tfor(i=0;i<allGroups.length;i++){\r\n\t\t\t\t\tvar myvar = document.getElementById('acl_'+cat+'_'+allGroups[i]+'_'+action);\r\n\t\t\t\t\tif(myvar && myvar.checked){\r\n\t\t\t\t\t\t\t finalValue += myvar.value+',';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdocument.getElementById('acl_'+cat+'_'+action).value = finalValue;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfunction updateGroup(cat,groupid,actions){\r\n\t\t\tfor(i=0;i<actions.length;i++){\r\n\t\t\t\tvar myvar = document.getElementById('acl_'+cat+'_'+groupid+'_'+actions[i]);\r\n\t\t\t\tif(!myvar) return;\r\n\t\t\t\tmyvar.checked = 1 - myvar.checked;\r\n\t\t\t\tupdateACLTable(cat,actions[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfunction updateAction(cat,action){\r\n\t\t\tfor(i=0;i<allGroups.length;i++){\r\n\t\t\t\tvar myvar = document.getElementById('acl_'+cat+'_'+allGroups[i]+'_'+action);\r\n\t\t\t\tif(myvar) myvar.checked = 1 - myvar.checked;\r\n\t\t\t}\r\n\t\t\tupdateACLTable(cat,action);\r\n\t\t}\r\n\t\tvar allGroups = new Array(";
foreach ($this->groups as $oneGroup) {
$js .= "'" . $oneGroup->value . "',";
}
$js = rtrim($js, ',') . ");";
if (!HIKASHOP_PHP5) {
$doc =& JFactory::getDocument();
} else {
$doc = JFactory::getDocument();
}
$doc->addScriptDeclaration($js);
}
示例4: pricesSelection
function pricesSelection(&$prices, $quantity)
{
$matches = array();
$otherCurrencies = array();
if (!empty($prices)) {
foreach ($prices as $k2 => $price) {
if ($price->price_min_quantity > $quantity) {
continue;
}
if (empty($price->price_orig_currency_id)) {
$matches[] = $price;
} else {
$otherCurrencies[] = $price;
}
}
}
if (empty($matches) && !empty($otherCurrencies)) {
$config =& hikashop_config();
$main_currency = (int) $config->get('main_currency', 1);
foreach ($otherCurrencies as $price) {
if ($price->price_orig_currency_id == $main_currency) {
$matches[] = $price;
}
}
if (empty($matches)) {
$matches = $otherCurrencies;
}
}
$prices = $matches;
}
示例5: loadValues
function loadValues($optGroup, $files)
{
$this->values[] = JHTML::_('select.optgroup', $optGroup);
foreach ($files as $file) {
if (preg_match('#^listing_((?!div|list|price|table|vote).*)\\.php$#', $file, $match)) {
$val = strtoupper($match[1]);
$trans = JText::_($val);
if ($trans == $val) {
$trans = $match[1];
}
$this->values[$match[1]] = JHTML::_('select.option', $match[1], $trans);
}
}
if (version_compare(JVERSION, '1.6.0', '>=')) {
$this->values[] = JHTML::_('select.optgroup', $optGroup);
}
if (JRequest::getVar('inherit', true) == true) {
$config = hikashop_config();
$defaultParams = $config->get('default_params');
$default = '';
if (isset($defaultParams['div_item_layout_type'])) {
$default = ' (' . $this->values[$defaultParams['div_item_layout_type']]->text . ')';
}
$this->values[] = JHTML::_('select.option', 'inherit', JText::_('HIKA_INHERIT') . $default);
}
}
示例6: display
function display($map, $volume_unit, $type = 'dimension', $id = '', $extra = '')
{
$config =& hikashop_config();
$symbols = explode(',', $config->get('volume_symbols', 'm,cm'));
if (empty($volume_unit)) {
$volume_unit = $symbols[0];
}
$this->values = array();
if (!in_array($volume_unit, $symbols)) {
$text = JText::_($volume_unit);
if ($type != 'dimension') {
$text .= '³';
}
$this->values[] = JHTML::_('select.option', $volume_unit, $text);
}
foreach ($symbols as $symbol) {
$text = JText::_($symbol);
if ($type != 'dimension') {
$text .= '³';
}
$this->values[] = JHTML::_('select.option', $symbol, $text);
}
if (!empty($extra)) {
$extra = ' ' . trim($extra);
}
if (!empty($id)) {
return JHTML::_('select.genericlist', $this->values, $map, 'class="inputbox volumeselect" size="1"' . $extra, 'value', 'text', $volume_unit, $id);
}
return JHTML::_('select.genericlist', $this->values, $map, 'class="inputbox volumeselect" size="1"' . $extra, 'value', 'text', $volume_unit);
}
示例7: 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;
}
示例8: 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;
}
示例9: checkProducts
function checkProducts()
{
$db = JFactory::getDBO();
$query = 'SELECT * FROM ' . hikashop_table('product') . ' WHERE ' . ' product_quantity < ' . (int) $this->stock_limit . ' AND product_published = 1 AND product_quantity != -1 ' . ' AND (product_sale_start = 0 OR product_sale_start < ' . time() . ') AND (product_sale_end = 0 OR product_sale_end > ' . time() . ')';
$db->setQuery($query);
$products = $db->loadObjectList();
if (!empty($products)) {
$mailClass = hikashop_get('class.mail');
$infos = new stdClass();
$infos->products =& $products;
$mail = $mailClass->get('out_of_stock', $infos);
$mail->subject = JText::sprintf($mail->subject, HIKASHOP_LIVE);
$config =& hikashop_config();
if (!empty($infos->email)) {
$mail->dst_email = $infos->email;
} else {
$mail->dst_email = $config->get('from_email');
}
if (!empty($infos->name)) {
$mail->dst_name = $infos->name;
} else {
$mail->dst_name = $config->get('from_name');
}
$mailClass->sendMail($mail);
}
$app = JFactory::getApplication();
$this->message = 'Products quantity checked';
$app->enqueueMessage($this->message);
return true;
}
示例10: edit
function edit()
{
$tmpl = JRequest::getCmd('tmpl', '');
$subtask = JRequest::getCmd('subtask', '');
$addrtype = JRequest::getCmd('address_type', '');
$config = hikashop_config();
if ($tmpl == 'component' && ($addrtype != '' || $subtask != '') && $config->get('checkout_address_selector', 0)) {
JRequest::setVar('hidemainmenu', 1);
JRequest::setVar('layout', 'show');
JRequest::setVar('edition', true);
ob_end_clean();
if (HIKASHOP_J25) {
$app = JFactory::getApplication();
$messages = $app->getMessageQueue();
if (!empty($messages)) {
foreach ($messages as $message) {
hikashop_display($message['message'], 'error');
}
}
}
parent::display();
exit;
}
parent::edit();
}
示例11: onAfterOrderCreate
public function onAfterOrderCreate(&$order)
{
if (empty($order) || empty($order->order_type) || $order->order_type != 'sale' || !isset($order->order_full_price)) {
return;
}
$this->init();
$send_confirmation = $this->params->get('send_confirmation', 1);
if (!$send_confirmation && $order->order_status == 'confirmed') {
$class = hikashop_get('class.cart');
$class->cleanCartFromSession();
return;
}
if ($send_confirmation && bccomp($order->order_full_price, 0, 5) == 0) {
$config = hikashop_config();
$orderObj = new stdClass();
$orderObj->order_id = (int) $order->order_id;
$orderObj->order_status = $config->get('order_confirmed_status', 'confirmed');
$orderObj->history = new stdClass();
$orderObj->history->history_notified = 1;
$orderClass = hikashop_get('class.order');
$orderClass->save($orderObj);
$class = hikashop_get('class.cart');
$class->cleanCartFromSession();
}
}
示例12: checkOrders
function checkOrders($notify = false)
{
$db = JFactory::getDBO();
$config =& hikashop_config();
$status = $config->get('order_created_status');
$query = 'SELECT order_id, order_status, order_created FROM ' . hikashop_table('order') . ' WHERE order_type = ' . $db->Quote('sale') . ' AND order_created < ' . (time() - $this->period) . ' AND order_status = ' . $db->Quote($status) . ' ORDER BY order_created ASC LIMIT 0, 20';
$db->setQuery($query);
$orders = $db->loadObjectList();
if (!empty($orders)) {
$orderClass = hikashop_get('class.order');
$status = $config->get('cancelled_order_status');
$statuses = explode(',', $status);
$status = reset($statuses);
foreach ($orders as $order) {
$update = new stdClass();
$update->order_id = $order->order_id;
$update->order_status = $status;
if ($notify) {
$update->history = new stdClass();
$update->history->history_notified = 1;
}
$orderClass->save($update);
}
}
$app = JFactory::getApplication();
$this->message = 'Orders checked';
$app->enqueueMessage($this->message);
return true;
}
示例13: listing
function listing()
{
hikashop_setTitle(JText::_('DOCUMENTATION'), 'help_header', 'documentation');
if (!HIKASHOP_PHP5) {
$bar =& JToolBar::getInstance('toolbar');
} else {
$bar = JToolBar::getInstance('toolbar');
}
$bar->appendButton('Link', 'hikashop', JText::_('HIKASHOP_CPANEL'), hikashop_completeLink('dashboard'));
$config =& hikashop_config();
$level = $config->get('level');
$url = HIKASHOP_HELPURL . 'documentation&level=' . $level;
if (hikashop_isSSL()) {
$url = str_replace('http://', 'https://', $url);
}
$config =& hikashop_config();
$menu_style = $config->get('menu_style', 'title_bottom');
if (HIKASHOP_J30) {
$menu_style = 'content_top';
}
if ($menu_style == 'content_top') {
echo hikashop_getMenu('', $menu_style);
}
?>
<div id="hikashop_div">
<iframe allowtransparency="true" scrolling="auto" height="450px" frameborder="0" width="100%" name="hikashop_frame" id="hikashop_frame" src="<?php
echo $url;
?>
">
</iframe>
</div>
<?php
}
示例14: 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;
}
示例15: displayMultiple
public function displayMultiple($map, $values)
{
if (empty($this->values)) {
$this->load();
}
if (empty($values)) {
$values = array();
} else {
if (is_string($values)) {
$values = explode(',', $values);
}
}
$config = hikashop_config();
hikashop_loadJslib('otree');
if (substr($map, -2) == '[]') {
$map = substr($map, 0, -2);
}
$id = str_replace(array('[', ']'), array('_', ''), $map);
$ret = '<div class="nameboxes" id="' . $id . '" onclick="window.oNameboxes[\'' . $id . '\'].focus(\'' . $id . '_text\');">';
if (!empty($values)) {
foreach ($values as $key) {
if (isset($this->values[$key])) {
$name = $this->values[$key]->text;
} else {
$name = JText::sprintf('UNKNOWN_PACK_X', $key);
}
$ret .= '<div class="namebox" id="' . $id . '_' . $key . '">' . '<input type="hidden" name="' . $map . '[]" value="' . $key . '"/>' . $name . ' <a class="closebutton" href="#" onclick="window.oNameboxes[\'' . $id . '\'].unset(this,\'' . $key . '\');window.oNamebox.cancelEvent();return false;"><span>X</span></a>' . '</div>';
}
}
$ret .= '<div class="namebox" style="display:none;" id="' . $id . 'tpl">' . '<input type="hidden" name="{map}" value="{key}"/>{name}' . ' <a class="closebutton" href="#" onclick="window.oNameboxes[\'' . $id . '\'].unset(this,\'{key}\');window.oNamebox.cancelEvent();return false;"><span>X</span></a>' . '</div>';
$ret .= '<div class="nametext">' . '<input id="' . $id . '_text" type="text" style="width:50px;min-width:60px" onfocus="window.oNameboxes[\'' . $id . '\'].focus(this);" onkeyup="window.oNameboxes[\'' . $id . '\'].search(this);" onchange="window.oNameboxes[\'' . $id . '\'].search(this);"/>' . '<span style="position:absolute;top:0px;left:-2000px;visibility:hidden" id="' . $id . '_span">span</span>' . '</div>';
$data = array();
foreach ($this->values as $key => $value) {
if (empty($key)) {
continue;
}
$data[$key] = $value->text;
}
$namebox_options = array('mode' => 'list', 'img_dir' => HIKASHOP_IMAGES, 'map' => $map, 'min' => $config->get('namebox_search_min_length', 3), 'multiple' => true);
$ret .= '<div style="clear:both;float:none;"></div></div>
<div class="namebox-popup">
<div id="' . $id . '_olist" style="display:none;" class="oList namebox-popup-content"></div>
</div>
<script type="text/javascript">
new window.oNamebox(
\'' . $id . '\',
' . json_encode($data) . ',
' . json_encode($namebox_options) . '
);';
if (!empty($values)) {
$ret .= '
try{
window.oNameboxes[\'' . $id . '\'].content.block(' . json_encode($values) . ');
}catch(e){}';
}
$ret .= '
</script>';
return $ret;
}