本文整理汇总了PHP中shopFunctionsF::loadVmTemplateStyle方法的典型用法代码示例。如果您正苦于以下问题:PHP shopFunctionsF::loadVmTemplateStyle方法的具体用法?PHP shopFunctionsF::loadVmTemplateStyle怎么用?PHP shopFunctionsF::loadVmTemplateStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shopFunctionsF
的用法示例。
在下文中一共展示了shopFunctionsF::loadVmTemplateStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
if (!class_exists('VmImage')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$usermodel = VmModel::getModel('user');
JToolBarHelper::title(JText::_('COM_VIRTUEMART_CONFIG'), 'head vm_config_48');
$this->addStandardEditViewCommands();
$config = VmConfig::loadConfig();
if (!empty($config->_params)) {
unset($config->_params['pdf_invoice']);
// parameter remove and replaced by inv_os
}
$this->assignRef('config', $config);
$mainframe = JFactory::getApplication();
$this->assignRef('joomlaconfig', $mainframe);
$userparams = JComponentHelper::getParams('com_users');
$this->assignRef('userparams', $userparams);
$templateList = ShopFunctions::renderTemplateList(JText::_('COM_VIRTUEMART_ADMIN_CFG_JOOMLA_TEMPLATE_DEFAULT'));
$this->assignRef('jTemplateList', $templateList);
$vmLayoutList = $model->getLayoutList('virtuemart');
$this->assignRef('vmLayoutList', $vmLayoutList);
$categoryLayoutList = $model->getLayoutList('category');
$this->assignRef('categoryLayoutList', $categoryLayoutList);
$productLayoutList = $model->getLayoutList('productdetails');
$this->assignRef('productLayoutList', $productLayoutList);
$noimagelist = $model->getNoImageList();
$this->assignRef('noimagelist', $noimagelist);
$orderStatusModel = VmModel::getModel('orderstatus');
$this->assignRef('orderStatusModel', $orderStatusModel);
$currConverterList = $model->getCurrencyConverterList();
$this->assignRef('currConverterList', $currConverterList);
$moduleList = $model->getModuleList();
$this->assignRef('moduleList', $moduleList);
$activeLanguages = $model->getActiveLanguages(VmConfig::get('active_languages'));
$this->assignRef('activeLanguages', $activeLanguages);
$orderByFieldsProduct = $model->getProductFilterFields('browse_orderby_fields');
$this->assignRef('orderByFieldsProduct', $orderByFieldsProduct);
VmModel::getModel('category');
foreach (VirtueMartModelCategory::$_validOrderingFields as $key => $field) {
if ($field == 'c.category_shared') {
continue;
}
$fieldWithoutPrefix = $field;
$dotps = strrpos($fieldWithoutPrefix, '.');
if ($dotps !== false) {
$prefix = substr($field, 0, $dotps + 1);
$fieldWithoutPrefix = substr($field, $dotps + 1);
}
$text = JText::_('COM_VIRTUEMART_' . strtoupper($fieldWithoutPrefix));
$orderByFieldsCat[] = JHTML::_('select.option', $field, $text);
}
//$orderByFieldsCat = $model->get;
$this->assignRef('orderByFieldsCat', $orderByFieldsCat);
$searchFields = $model->getProductFilterFields('browse_search_fields');
$this->assignRef('searchFields', $searchFields);
$aclGroups = $usermodel->getAclGroupIndentedTree();
$this->assignRef('aclGroups', $aclGroups);
if (!class_exists('shopFunctionsF')) {
require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
$vmtemplate = shopFunctionsF::loadVmTemplateStyle();
if (is_Dir(JPATH_ROOT . DS . 'templates' . DS . $vmtemplate . DS . 'images' . DS . 'availability' . DS)) {
$imagePath = '/templates/' . $vmtemplate . '/images/availability/';
} else {
$imagePath = '/components/com_virtuemart/assets/images/availability/';
}
$this->assignRef('imagePath', $imagePath);
shopFunctions::checkSafePath();
$this->checkVmUserVendor();
parent::display($tpl);
}
示例2: getAvai
function getAvai()
{
jimport('joomla.filesystem.folder');
if (!class_exists('shopFunctionsF')) {
require JPATH_VM_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
if (method_exists('shopFunctionsF', 'loadVmTemplateStyle')) {
$vmtemplate = shopFunctionsF::loadVmTemplateStyle();
if (is_Dir(JPATH_ROOT . DS . 'templates' . DS . $vmtemplate . DS . 'images' . DS . 'availability' . DS)) {
$imagePath = 'templates' . DS . $vmtemplate . DS . 'images' . DS . 'availability' . DS;
} else {
$imagePath = 'components' . DS . 'com_virtuemart' . DS . 'assets' . DS . 'images' . DS . 'availability' . DS;
}
} else {
$imagePath = 'components' . DS . 'com_virtuemart' . DS . 'assets' . DS . 'images' . DS . 'availability' . DS;
}
$imagePath = JPATH_SITE . DS . $imagePath;
jimport('joomla.filesystem.file');
$avail = JFolder::files($imagePath, '.gif|.png|.jpg|.jpeg', false, false);
$ret = array();
foreach ($avail as $img) {
$obj = new stdClass();
$pattern = '/[^\\w]+/';
//'[^a-zA-Z\s]';
$key2 = preg_replace($pattern, '_', $img);
//var_dump($key2);
//var_dump($img); die();
//$key2 .= md5($img);
$obj->{$key2} = $img;
$obj->img = $img;
//1-2m.gif
switch ($img) {
case "24h.gif":
$avai = 24;
$deliverydate = "24 hours";
break;
case "ihned.gif":
$avai = 24;
$deliverydate = "24 hours";
break;
case "2-3d.gif":
$avai = 60;
$deliverydate = "2-3 days";
break;
case "48h.gif":
$avai = 48;
$deliverydate = "48 hours";
break;
case "1-2m.gif":
$avai = 60;
$deliverydate = "1 to 2 months";
break;
case "1-4w.gif":
$avai = 14;
$deliverydate = "1 to 4 weeks";
break;
case "14d.gif":
$avai = 14;
$deliverydate = "2 weeks";
break;
case "24h.gif":
$avai = 1;
$deliverydate = "24 hours";
break;
case "3-5d.gif":
$avai = 4;
$deliverydate = "3 to 5 days";
break;
case "48h.gif":
$avai = 2;
$deliverydate = "48 hours";
break;
case "7d.gif":
$avai = 7;
$deliverydate = "7 days";
break;
case "not_available.gif":
$avai = 60;
$deliverydate = "Not available";
break;
case "on-order.gif":
$avai = 168;
$deliverydate = "1 week";
break;
default:
$avai = 60;
$deliverydate = "2-3 days";
}
$obj->avai = $avai;
$obj->deliverytext = $deliverydate;
$ret[$key2] = $obj;
}
return $ret;
}