本文整理汇总了PHP中ShopFunctionsF::renderCountryList方法的典型用法代码示例。如果您正苦于以下问题:PHP ShopFunctionsF::renderCountryList方法的具体用法?PHP ShopFunctionsF::renderCountryList怎么用?PHP ShopFunctionsF::renderCountryList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShopFunctionsF
的用法示例。
在下文中一共展示了ShopFunctionsF::renderCountryList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserFieldsFilled
//.........这里部分代码省略.........
,'value' => (($_userData == null || !array_key_exists($_fld->name, $_userData))
? $_fld->default
: $_userData[$_fld->name])
,'title' => vmText::_($_fld->title)
,'type' => $_fld->type
,'required' => $_fld->required
,'hidden' => false
,'formcode' => ''
,'description' => vmText::_($_fld->description)
);
$readonly = '';
if(!$admin){
if($_fld->readonly ){
$readonly = ' readonly="readonly" ';
}
}
//vmdebug ('getUserFieldsFilled',$_fld->name,$_return['fields'][$_fld->name]['value']);
// if($_fld->name==='email') vmdebug('user data email getuserfieldbyuser',$_userData);
// First, see if there are predefined fields by checking the name
switch( $_fld->name ) {
// case 'email':
// $_return['fields'][$_fld->name]['formcode'] = $_userData->email;
// break;
case 'virtuemart_country_id':
if(!class_exists('shopFunctionsF'))require(VMPATH_SITE.DS.'helpers'.DS.'shopfunctionsf.php');
$attrib = array();
if ($_fld->size) {
$attrib = array('style'=>"width: ".$_fld->size."px");
}
$_return['fields'][$_fld->name]['formcode'] =
ShopFunctionsF::renderCountryList($_return['fields'][$_fld->name]['value'], false, $attrib , $_prefix, $_fld->required);
if(!empty($_return['fields'][$_fld->name]['value'])){
// Translate the value from ID to name
$_return['fields'][$_fld->name]['virtuemart_country_id'] = (int)$_return['fields'][$_fld->name]['value'];
$db = JFactory::getDBO ();
$q = 'SELECT * FROM `#__virtuemart_countries` WHERE virtuemart_country_id = "' . (int)$_return['fields'][$_fld->name]['value'] . '"';
$db->setQuery ($q);
$r = $db->loadAssoc();
if($r){
$_return['fields'][$_fld->name]['value'] = !empty($r['country_name'])? $r['country_name']:'' ;
$_return['fields'][$_fld->name]['country_2_code'] = !empty($r['country_2_code'])? $r['country_2_code']:'' ;
$_return['fields'][$_fld->name]['country_3_code'] = !empty($r['country_3_code'])? $r['country_3_code']:'' ;
} else {
vmError('Model Userfields, country with id '.$_return['fields'][$_fld->name]['value'].' not found');
}
} else {
$_return['fields'][$_fld->name]['value'] = '' ;
$_return['fields'][$_fld->name]['country_2_code'] = '' ;
$_return['fields'][$_fld->name]['country_3_code'] = '' ;
}
//$_return['fields'][$_fld->name]['value'] = vmText::_(shopFunctions::getCountryByID($_return['fields'][$_fld->name]['value']));
//$_return['fields'][$_fld->name]['state_2_code'] = vmText::_(shopFunctions::getCountryByID($_return['fields'][$_fld->name]['value']));
break;
case 'virtuemart_state_id':
if (!class_exists ('shopFunctionsF'))
require(VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php');
$attrib = array();
if ($_fld->size) {
$attrib = array('style'=>"width: ".$_fld->size."px");
}
示例2: display
function display($tpl = null)
{
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel('calc');
//@todo should be depended by loggedVendor
$this->vendorId = vmAccess::getVendorId();
$this->SetViewTitle();
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
$calc = $model->getCalc();
$this->assignRef('calc', $calc);
$isNew = $calc->virtuemart_calc_id < 1;
if ($isNew) {
$calc->virtuemart_vendor_id = $this->vendorId;
$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` = "' . $this->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;
}
}
$this->entryPointsList = self::renderEntryPointsList($calc->calc_kind);
$this->mathOpList = self::renderMathOpList($calc->calc_value_mathop);
if (empty($calc->calc_categories)) {
$calc->calc_categories = array();
} else {
if (!is_array($calc->calc_categories)) {
$calc->calc_categories = array($calc->calc_categories);
}
}
$calc_categories = $calc->calc_categories;
$this->categoryTree = ShopFunctions::categoryListTree($calc_categories);
$currencyModel = VmModel::getModel('currency');
$this->currencies = $currencyModel->getCurrencies();
$this->shopperGroupList = ShopFunctions::renderShopperGroupList($calc->virtuemart_shoppergroup_ids, True);
if (!class_exists('ShopFunctionsF')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
}
$this->countriesList = ShopFunctionsF::renderCountryList($calc->calc_countries, True);
$this->statesList = ShopFunctionsF::renderStateList($calc->virtuemart_state_ids, '', True);
$this->manufacturerList = ShopFunctions::renderManufacturerList($calc->virtuemart_manufacturers, true);
if ($this->showVendors()) {
$this->vendorList = ShopFunctions::renderVendorList($calc->virtuemart_vendor_id);
}
$this->addStandardEditViewCommands();
} else {
if ($this->showVendors()) {
JToolBarHelper::custom('toggle.shared.1', 'publish', 'yes', vmText::_('COM_VIRTUEMART_SHARED_TOGGLE_ON'), true);
JToolBarHelper::custom('toggle.shared.0', 'unpublish', 'no', vmText::_('COM_VIRTUEMART_SHARED_TOGGLE_OFF'), true);
}
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$search = vRequest::getCmd('search', false);
$this->calcs = $model->getCalcs(false, false, $search);
VmConfig::loadJLang('com_virtuemart_shoppers', true);
foreach ($this->calcs as &$data) {
$data->calcCategoriesList = shopfunctions::renderGuiList($data->virtuemart_calc_id, 'categories', 'category_name', 'category', 'calc_categories', 'virtuemart_calc_id');
$data->calcShoppersList = shopfunctions::renderGuiList($data->virtuemart_calc_id, 'shoppergroups', 'shopper_group_name', 'shoppergroup', 'calc_shoppergroups', 'virtuemart_calc_id');
$data->calcCountriesList = shopfunctions::renderGuiList($data->virtuemart_calc_id, 'countries', 'country_name', 'country', 'calc_countries', 'virtuemart_calc_id');
$data->calcStatesList = shopfunctions::renderGuiList($data->virtuemart_calc_id, 'states', 'state_name', 'states', 'calc_states', 'virtuemart_calc_id');
$data->calcManufacturersList = shopfunctions::renderGuiList($data->virtuemart_calc_id, 'manufacturers', 'mf_name', 'manufacturer', 'calc_manufacturers', 'virtuemart_calc_id');
}
$this->pagination = $model->getPagination();
}
parent::display($tpl);
}