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


PHP ShopFunctions::renderStateList方法代码示例

本文整理汇总了PHP中ShopFunctions::renderStateList方法的典型用法代码示例。如果您正苦于以下问题:PHP ShopFunctions::renderStateList方法的具体用法?PHP ShopFunctions::renderStateList怎么用?PHP ShopFunctions::renderStateList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ShopFunctions的用法示例。


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

示例1: display

 function display($tpl = null)
 {
     if (!class_exists('VmHTML')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
     }
     $model = VmModel::getModel('calc');
     if (!class_exists('Permissions')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'permissions.php';
     }
     $perms = Permissions::getInstance();
     $this->assignRef('perms', $perms);
     //@todo should be depended by loggedVendor
     $vendorId = 1;
     $this->assignRef('vendorId', $vendorId);
     $db = JFactory::getDBO();
     $this->SetViewTitle();
     $layoutName = JRequest::getWord('layout', 'default');
     if ($layoutName == 'edit') {
         $calc = $model->getCalc();
         $this->assignRef('calc', $calc);
         $isNew = $calc->virtuemart_calc_id < 1;
         if ($isNew) {
             $db = JFactory::getDBO();
             //get default currency of the vendor, if not set get default of the shop
             $q = 'SELECT `vendor_currency` FROM `#__virtuemart_vendors` WHERE `virtuemart_vendor_id` = "' . $vendorId . '"';
             $db->setQuery($q);
             $currency = $db->loadResult();
             if (empty($currency)) {
                 $q = 'SELECT `vendor_currency` FROM `#__virtuemart_vendors` WHERE `virtuemart_vendor_id` = "1" ';
                 $db->setQuery($q);
                 $currency = $db->loadResult();
                 $calc->calc_currency = $currency;
             } else {
                 $calc->calc_currency = $currency;
             }
         }
         $entryPointsList = self::renderEntryPointsList($calc->calc_kind);
         $this->assignRef('entryPointsList', $entryPointsList);
         $mathOpList = self::renderMathOpList($calc->calc_value_mathop);
         $this->assignRef('mathOpList', $mathOpList);
         /* Get the category tree */
         $categoryTree = null;
         if (isset($calc->calc_categories)) {
             $calc_categories = $calc->calc_categories;
             $categoryTree = ShopFunctions::categoryListTree($calc_categories);
         } else {
             $categoryTree = ShopFunctions::categoryListTree();
         }
         $this->assignRef('categoryTree', $categoryTree);
         $currencyModel = VmModel::getModel('currency');
         $_currencies = $currencyModel->getCurrencies();
         $this->assignRef('currencies', $_currencies);
         /* Get the shoppergroup tree */
         $shopperGroupList = ShopFunctions::renderShopperGroupList($calc->virtuemart_shoppergroup_ids, True);
         $this->assignRef('shopperGroupList', $shopperGroupList);
         $countriesList = ShopFunctions::renderCountryList($calc->calc_countries, True);
         $this->assignRef('countriesList', $countriesList);
         $statesList = ShopFunctions::renderStateList($calc->virtuemart_state_ids, '', True);
         $this->assignRef('statesList', $statesList);
         $manufacturerList = ShopFunctions::renderManufacturerList($calc->virtuemart_manufacturers, true);
         $this->assignRef('manufacturerList', $manufacturerList);
         if (Vmconfig::get('multix', 'none') !== 'none') {
             $vendorList = ShopFunctions::renderVendorList($calc->virtuemart_vendor_id, false);
             $this->assignRef('vendorList', $vendorList);
         }
         $this->addStandardEditViewCommands();
     } else {
         JToolBarHelper::custom('toggle.calc_shopper_published.0', 'unpublish', 'no', JText::_('COM_VIRTUEMART_CALC_SHOPPER_PUBLISH_TOGGLE_OFF'), true);
         JToolBarHelper::custom('toggle.calc_shopper_published.1', 'publish', 'yes', JText::_('COM_VIRTUEMART_CALC_SHOPPER_PUBLISH_TOGGLE_ON'), true);
         JToolBarHelper::custom('toggle.calc_vendor_published.0', 'unpublish', 'no', JText::_('COM_VIRTUEMART_CALC_VENDOR_PUBLISH_TOGGLE_OFF'), true);
         JToolBarHelper::custom('toggle.calc_vendor_published.1', 'publish', 'yes', JText::_('COM_VIRTUEMART_CALC_VENDOR_PUBLISH_TOGGLE_ON'), true);
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model);
         $search = JRequest::getWord('search', false);
         $calcs = $model->getCalcs(false, false, $search);
         $this->assignRef('calcs', $calcs);
         $pagination = $model->getPagination();
         $this->assignRef('pagination', $pagination);
     }
     parent::display($tpl);
 }
开发者ID:Roma48,项目名称:abazherka_old,代码行数:81,代码来源:view.html.php


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