当前位置: 首页>>代码示例>>PHP>>正文


PHP hikashop_getCID函数代码示例

本文整理汇总了PHP中hikashop_getCID函数的典型用法代码示例。如果您正苦于以下问题:PHP hikashop_getCID函数的具体用法?PHP hikashop_getCID怎么用?PHP hikashop_getCID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了hikashop_getCID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 function store($new = false)
 {
     if (hikashop_getCID('user_id') != hikashop_loadUser()) {
         return false;
     }
     $app = JFactory::getApplication();
     $class = hikashop_get('class.user');
     $class->fields_whitelist = array('user_id', 'user_partner_activated', 'user_partner_email');
     $config =& hikashop_config();
     if ($config->get('allow_currency_selection')) {
         $class->fields_whitelist[] = 'user_currency_id';
     }
     $status = $class->saveForm();
     if ($status) {
         if (!HIKASHOP_J30) {
             $app->enqueueMessage(JText::_('HIKASHOP_SUCC_SAVED'), 'success');
         } else {
             $app->enqueueMessage(JText::_('HIKASHOP_SUCC_SAVED'));
         }
         if (!$new) {
             JRequest::setVar('cid', $status);
         } else {
             JRequest::setVar('cid', 0);
         }
         JRequest::setVar('fail', null);
     } else {
         $app->enqueueMessage(JText::_('ERROR_SAVING'), 'error');
         if (!empty($class->errors)) {
             foreach ($class->errors as $oneError) {
                 $app->enqueueMessage($oneError, 'error');
             }
         }
     }
     return $status;
 }
开发者ID:q0821,项目名称:esportshop,代码行数:35,代码来源:affiliate.php

示例2: createCoupon

 static function createCoupon($code, $card, $discountCurrencyId)
 {
     if (empty($code)) {
         return false;
     }
     $created = new JDate($card->created);
     $created = $created->toUnix();
     $expires = new JDate($card->expires);
     $expires = $expires->toUnix();
     $class = hikashop_get('class.discount');
     $discount = new stdClass();
     $discount->discount_id = hikashop_getCID('discount_id');
     $discount->discount_start = $created;
     $discount->discount_end = $expires;
     $discount->discount_code = $code;
     $discount->discount_type = 'coupon';
     $discount->discount_flat_amount = $card->amount_available;
     $discount->discount_minimum_order = $card->min_amount_total;
     $discount->discount_quota = 0;
     $discount->discount_used_times = 0;
     $discount->discount_published = 1;
     $discount->discount_currency_id = $discountCurrencyId;
     $discount->discount_category_childs = 0;
     $discount->discount_auto_load = 0;
     $discount->discount_access = 'all';
     $discount->discount_tax_id = 0;
     $discount->discount_minimum_products = 0;
     $discount->discount_quota_per_user = 0;
     $discount->discount_affiliate = 0;
     $status = $class->save($discount);
     if ($status) {
         return self::getCouponData($code);
     }
     return false;
 }
开发者ID:Giftd,项目名称:giftd-joomla,代码行数:35,代码来源:hikashop.php

示例3: form

 function form()
 {
     $warehouse_id = hikashop_getCID('warehouse_id');
     $class = hikashop_get('class.warehouse');
     if (!empty($warehouse_id)) {
         $element = $class->get($warehouse_id, true);
         $task = 'edit';
     } else {
         $element = new stdClass();
         $element->warehouse_published = 1;
         $task = 'add';
     }
     hikashop_setTitle(JText::_($this->nameForm), $this->icon, $this->ctrl . '&task=' . $task . '&warehouse=' . $warehouse_id);
     $this->toolbar = array('save', array('name' => 'save2new', 'display' => version_compare(JVERSION, '1.7', '>=')), 'apply', 'cancel', '|', array('name' => 'pophelp', 'target' => $this->ctrl . '-listing'));
     $editor = hikashop_get('helper.editor');
     $editor->name = 'data[warehouse][warehouse_description]';
     $editor->content = @$element->warehouse_description;
     $this->assignRef('editor', $editor);
     $this->assignRef('element', $element);
     $toggle = hikashop_get('helper.toggle');
     $this->assignRef('toggle', $toggle);
     $warehouse = hikashop_get('type.warehouse');
     $this->assignRef('warehouse', $warehouse);
     $popup = hikashop_get('helper.popup');
     $this->assignRef('popup', $popup);
 }
开发者ID:rodhoff,项目名称:MNW,代码行数:26,代码来源:view.html.php

示例4: 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');
 }
开发者ID:q0821,项目名称:esportshop,代码行数:28,代码来源:view.html.php

示例5: saveForm

 function saveForm()
 {
     $entry = new stdClass();
     $entry->entry_id = hikashop_getCID('entry_id');
     $formData = JRequest::getVar('data', array(), '', 'array');
     jimport('joomla.filter.filterinput');
     $safeHtmlFilter =& JFilterInput::getInstance(null, null, 1, 1);
     foreach ($formData['entry'] as $column => $value) {
         hikashop_secureField($column);
         $entry->{$column} = $safeHtmlFilter->clean($value, 'string');
     }
     $status = $this->save($entry);
     if (JRequest::getVar('tmpl', '') == 'component') {
         if ($status) {
             $url = hikashop_completeLink('order&task=edit&cid=' . $entry->order_id, false, true);
             echo '<html><head><script type="text/javascript">parent.window.location.href=\'' . $url . '\';</script></head><body></body></html>';
             exit;
         } else {
             $app = JFactory::getApplication();
             if (version_compare(JVERSION, '1.6', '<')) {
                 $session =& JFactory::getSession();
                 $session->set('application.queue', $app->_messageQueue);
             }
             echo '<html><head><script type="text/javascript">javascript: history.go(-1);</script></head><body></body></html>';
             exit;
         }
     }
     return $status;
 }
开发者ID:q0821,项目名称:esportshop,代码行数:29,代码来源:entry.php

示例6: apply_table

 function apply_table()
 {
     if ($this->store()) {
         echo '<html><head><script type="text/javascript">parent.window.location.href=\'' . hikashop_completeLink('report&task=edit&cid[]=' . hikashop_getCID('widget_id'), false, true) . '\';</script></head><body></body></html>';
         exit;
     }
 }
开发者ID:rodhoff,项目名称:MNW,代码行数:7,代码来源:report.php

示例7: 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;
 }
开发者ID:rodhoff,项目名称:MNW,代码行数:25,代码来源:hikashopmodule.php

示例8: saveForm

 function saveForm()
 {
     $limit = new stdClass();
     $limit->limit_id = hikashop_getCID('limit_id');
     $formData = JRequest::getVar('data', array(), '', 'array');
     jimport('joomla.filter.filterinput');
     $safeHtmlFilter =& JFilterInput::getInstance(null, null, 1, 1);
     foreach ($formData['limit'] as $column => $value) {
         hikashop_secureField($column);
         if (is_array($value)) {
             $value = implode(',', $value);
         }
         $limit->{$column} = $safeHtmlFilter->clean(strip_tags($value), 'string');
     }
     if (!empty($limit->limit_start)) {
         $limit->limit_start = hikashop_getTime($limit->limit_start);
     }
     if (!empty($limit->limit_end)) {
         $limit->limit_end = hikashop_getTime($limit->limit_end);
     }
     if (empty($limit->limit_id)) {
         $limit->limit_created = time();
     }
     $limit->limit_modified = time();
     $status = $this->save($limit);
     return $status;
 }
开发者ID:q0821,项目名称:esportshop,代码行数:27,代码来源:limit.php

示例9: saveForm

 function saveForm()
 {
     $discount = new stdClass();
     $discount->discount_id = hikashop_getCID('discount_id');
     $formData = JRequest::getVar('data', array(), '', 'array');
     jimport('joomla.filter.filterinput');
     $safeHtmlFilter =& JFilterInput::getInstance(null, null, 1, 1);
     $nameboxes = array('discount_product_id', 'discount_category_id', 'discount_zone_id');
     foreach ($formData['discount'] as $column => $value) {
         hikashop_secureField($column);
         if (in_array($column, $nameboxes)) {
             if ($column == 'discount_zone_id') {
                 $discount->{$column} = array();
                 foreach ($value as $i => $v) {
                     $discount->{$column}[] = $safeHtmlFilter->clean(strip_tags($v), 'string');
                 }
             } else {
                 JArrayHelper::toInteger($value);
             }
             $discount->{$column} = $value;
         } else {
             $discount->{$column} = $safeHtmlFilter->clean(strip_tags($value), 'string');
         }
     }
     foreach ($nameboxes as $namebox) {
         if (!isset($discount->{$namebox})) {
             $discount->{$namebox} = '';
         }
     }
     if (!empty($discount->discount_category_id) && !empty($discount->discount_product_id)) {
         $app = JFactory::getApplication();
         $app->enqueueMessage('If you set both categories and products in a discount/coupon, only the products will be taken into account.', 'error');
     }
     if (!empty($discount->discount_start)) {
         $discount->discount_start = hikashop_getTime($discount->discount_start);
     }
     if (!empty($discount->discount_end)) {
         $discount->discount_end = hikashop_getTime($discount->discount_end);
     }
     if (!empty($discount->discount_id) && !empty($discount->discount_code)) {
         $query = 'SELECT discount_id FROM ' . hikashop_table('discount') . ' WHERE discount_code  = ' . $this->database->Quote($discount->discount_code) . ' LIMIT 1';
         $this->database->setQuery($query);
         $res = $this->database->loadResult();
         if (!empty($res) && $res != $discount->discount_id) {
             $app = JFactory::getApplication();
             $app->enqueueMessage(JText::_('DISCOUNT_CODE_ALREADY_USED'), 'error');
             JRequest::setVar('fail', $discount);
             return false;
         }
     }
     $status = $this->save($discount);
     if (!$status) {
         JRequest::setVar('fail', $discount);
         $app = JFactory::getApplication();
         $app->enqueueMessage(JText::_('DISCOUNT_CODE_ALREADY_USED'));
     }
     return $status;
 }
开发者ID:rodhoff,项目名称:MNW,代码行数:58,代码来源:discount.php

示例10: 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;
 }
开发者ID:rodhoff,项目名称:MNW,代码行数:57,代码来源:hikashopmodule.php

示例11: saveForm

 function saveForm()
 {
     $category_id = hikashop_getCID('category_id');
     if (!empty($category_id)) {
         $oldCategory = $this->get($category_id);
     }
     $fieldsClass = hikashop_get('class.field');
     $element = $fieldsClass->getInput('category', $oldCategory);
     if (empty($element)) {
         return false;
     }
     $main = JRequest::getVar('main_category', 0, '', 'int');
     if ($main) {
         $element->category_parent_id = 0;
     } else {
         $element->category_type = '';
     }
     $element->category_description = JRequest::getVar('category_description', '', '', 'string', JREQUEST_ALLOWRAW);
     $translationHelper = hikashop_get('helper.translation');
     $translationHelper->getTranslations($element);
     $config =& hikashop_config();
     if ($config->get('alias_auto_fill', 1) && empty($element->category_alias)) {
         $this->addAlias($element);
         if ($config->get('sef_remove_id', 0) && (int) $element->alias > 0) {
             $element->alias = $config->get('alias_prefix', 'p') . $element->alias;
         }
         $element->category_alias = $element->alias;
         unset($element->alias);
     }
     if (!empty($element->category_alias)) {
         $query = 'SELECT category_id FROM ' . hikashop_table('category') . ' WHERE category_alias=' . $this->database->Quote($element->category_alias);
         $this->database->setQuery($query);
         $element_with_same_alias = $this->database->loadResult();
         if (!empty($element_with_same_alias) && (empty($element->category_id) || $element_with_same_alias != $element->category_id)) {
             $app = JFactory::getApplication();
             $app->enqueueMessage(JText::_('ELEMENT_WITH_SAME_ALIAS_ALREADY_EXISTS'), 'error');
             JRequest::setVar('fail', $element);
             return false;
         }
     }
     $autoKeyMeta = (int) $config->get('auto_keywords_and_metadescription_filling', 0);
     if ($autoKeyMeta) {
         $seoHelper = hikashop_get('helper.seo');
         $seoHelper->autoFillKeywordMeta($element, 'category');
     }
     $status = $this->save($element);
     if ($status) {
         $translationHelper->handleTranslations('category', $status, $element);
         $fileClass = hikashop_get('class.file');
         $fileClass->storeFiles('category', $status);
     } else {
         JRequest::setVar('fail', $element);
     }
     return $status;
 }
开发者ID:rodhoff,项目名称:MNW,代码行数:55,代码来源:category.php

示例12: 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 plugin can not work without the Hikashop Component';
     }
     $id = hikashop_getCID('id');
     if (!empty($id)) {
         $text = '<a title="' . JText::_('Trigger') . '"  href="' . JRoute::_('index.php?option=com_hikashop&ctrl=plugins&task=trigger&function=' . $value . '&cid=' . $id . '&' . hikashop_getFormToken() . '=1') . '" >' . JText::_('Trigger') . '</a>';
     }
     return $text;
 }
开发者ID:rodhoff,项目名称:MNW,代码行数:11,代码来源:plugintrigger.php

示例13: store

 function store($new = false)
 {
     $app = JFactory::getApplication();
     $cartClass = hikashop_get('class.cart');
     $data = JRequest::getVar('data', '0');
     $cart_id = hikashop_getCID('cart_id');
     $cart_type = $data['cart']['cart_type'];
     $cart_name = $data['cart']['cart_name'];
     $cart_user = 0;
     if (!empty($data['user']['user_id'])) {
         $cart_user = (int) $data['user']['user_id'];
     }
     $cart = new stdClass();
     $cart->cart_id = $cart_id;
     if (!empty($cart_user)) {
         $userClass = hikashop_get('class.user');
         $user = $userClass->get($cart_user);
         $cart->user_id = $user->user_cms_id;
     }
     $cart->cart_modified = time();
     $cart->cart_type = $cart_type;
     $cart->cart_name = $cart_name;
     if (isset($data['cart']['cart_coupon'])) {
         $cart->cart_coupon = $data['cart']['cart_coupon'];
     }
     $status = $cartClass->save($cart);
     $formData = JRequest::getVar('item', array(), '', 'array');
     if ($status) {
         if (!empty($formData)) {
             JRequest::setVar($cart_type . '_id', $cart_id);
             JRequest::setVar('cart_type', $cart_type);
             $cartClass->update($formData, 0, 0, 'item');
         }
     }
     if ($status) {
         if (!HIKASHOP_J30) {
             $app->enqueueMessage(JText::_('HIKASHOP_SUCC_SAVED'), 'success');
         } else {
             $app->enqueueMessage(JText::_('HIKASHOP_SUCC_SAVED'));
         }
         JRequest::setVar('cid', $status);
         JRequest::setVar('fail', null);
     } else {
         $app->enqueueMessage(JText::_('ERROR_SAVING'), 'error');
         if (!empty($class->errors)) {
             foreach ($class->errors as $oneError) {
                 $app->enqueueMessage($oneError, 'error');
             }
         }
     }
     return $status;
 }
开发者ID:q0821,项目名称:esportshop,代码行数:52,代码来源:cart.php

示例14: save_translation

 function save_translation()
 {
     $category_id = hikashop_getCID('category_id');
     $class = hikashop_get('class.category');
     $element = $class->get($category_id);
     if (!empty($element->category_id)) {
         $class = hikashop_get('helper.translation');
         $class->getTranslations($element);
         $class->handleTranslations('category', $element->category_id, $element);
     }
     $document = JFactory::getDocument();
     $document->addScriptDeclaration('window.top.hikashop.closeBox();');
 }
开发者ID:q0821,项目名称:esportshop,代码行数:13,代码来源:category.php

示例15: getInput

 function getInput()
 {
     if (!defined('DS')) {
         define('DS', DIRECTORY_SEPARATOR);
     }
     if (!function_exists('hikashop_getCID') && !(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 = hikashop_getCID('extension_id');
     if (!empty($id)) {
         $text = '<fieldset class="radio"><a id="' . $this->id . '" title="' . JText::_('Trigger') . '"  href="' . JRoute::_('index.php?option=com_hikashop&ctrl=plugins&task=trigger&function=' . $this->value . '&cid=' . $id . '&' . hikashop_getFormToken() . '=1') . '" >' . JText::_('Trigger') . '</a></fieldset>';
     }
     return $text;
 }
开发者ID:q0821,项目名称:esportshop,代码行数:14,代码来源:plugintrigger.php


注:本文中的hikashop_getCID函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。