本文整理汇总了PHP中tsmConfig::setdbLanguageTag方法的典型用法代码示例。如果您正苦于以下问题:PHP tsmConfig::setdbLanguageTag方法的具体用法?PHP tsmConfig::setdbLanguageTag怎么用?PHP tsmConfig::setdbLanguageTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tsmConfig
的用法示例。
在下文中一共展示了tsmConfig::setdbLanguageTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPluginMethods
/**
* Fill the array with all plugins found with this plugin for the current vendor
*
* @return True when plugins(s) was (were) found for this vendor, false otherwise
* @author Oscar van Eijk
* @author max Milbers
* @author valerie Isaksen
*/
protected function getPluginMethods($vendorId)
{
if (!class_exists('tsmartModelUser')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'user.php';
}
$usermodel = tmsModel::getModel('user');
$user = $usermodel->getUser();
$user->shopper_groups = (array) $user->shopper_groups;
$db = JFactory::getDBO();
if (empty($vendorId)) {
$vendorId = 1;
}
$select = 'SELECT i.*, ';
$extPlgTable = '#__extensions';
$extField1 = 'extension_id';
$extField2 = 'element';
$select .= 'j.`' . $extField1 . '`,j.`name`, j.`type`, j.`element`, j.`folder`, j.`client_id`, j.`enabled`, j.`access`, j.`protected`, j.`manifest_cache`,
j.`params`, j.`custom_data`, j.`system_data`, j.`checked_out`, j.`checked_out_time`, j.`state`, s.tsmart_shoppergroup_id ';
if (!tsmConfig::$vmlang) {
tsmConfig::setdbLanguageTag();
}
$joins = array();
if (tsmConfig::$defaultLang != tsmConfig::$vmlang and tsmConfig::$langCount > 1) {
$langFields = array($this->_psType . '_name', $this->_psType . '_desc');
$useJLback = false;
if (tsmConfig::$defaultLang != tsmConfig::$jDefLang) {
$joins[] = ' LEFT JOIN `#__tsmart_' . $this->_psType . '_' . tsmConfig::$jDefLang . '` as ljd';
$useJLback = true;
}
foreach ($langFields as $langField) {
$expr2 = 'ld.' . $langField;
if ($useJLback) {
$expr2 = 'IFNULL(ld.' . $langField . ',ljd.' . $langField . ')';
}
$select .= ', IFNULL(l.' . $langField . ',' . $expr2 . ') as ' . $langField . '';
}
$joins[] = ' LEFT JOIN `#__tsmart_' . $this->_psType . 'methods_' . tsmConfig::$defaultLang . '` as ld using (`tsmart_' . $this->_psType . 'method_id`)';
$joins[] = ' LEFT JOIN `#__tsmart_' . $this->_psType . 'methods_' . tsmConfig::$vmlang . '` as l using (`tsmart_' . $this->_psType . 'method_id`)';
} else {
$select .= ', l.* ';
$joins[] = ' LEFT JOIN `#__tsmart_' . $this->_psType . 'methods_' . tsmConfig::$vmlang . '` as l using (`tsmart_' . $this->_psType . 'method_id`)';
}
$q = $select . ' FROM `#__tsmart_' . $this->_psType . 'methods' . '` as i ';
//$joins[] = ' JOIN `#__tsmart_' . $this->_psType . 'methods` AS i USING (`tsmart_' . $this->_psType . 'method_id`) ';
$joins[] = ' LEFT JOIN `' . $extPlgTable . '` as j ON j.`' . $extField1 . '` = i.`' . $this->_psType . '_jplugin_id` ';
$joins[] = ' LEFT OUTER JOIN `#__tsmart_' . $this->_psType . 'method_shoppergroups` AS s ON i.`tsmart_' . $this->_psType . 'method_id` = s.`tsmart_' . $this->_psType . 'method_id` ';
$q .= implode(' ' . "\n", $joins);
$q .= ' WHERE i.`published` = "1" AND j.`' . $extField2 . '` = "' . $this->_name . '"
AND (i.`tsmart_vendor_id` = "' . $vendorId . '" OR i.`tsmart_vendor_id` = "0" OR i.`shared` = "1")
AND (';
foreach ($user->shopper_groups as $groups) {
$q .= ' s.`tsmart_shoppergroup_id`= "' . (int) $groups . '" OR';
}
$q .= ' (s.`tsmart_shoppergroup_id`) IS NULL ) GROUP BY i.`tsmart_' . $this->_psType . 'method_id` ORDER BY i.`ordering`';
$db->setQuery($q);
$this->methods = $db->loadObjectList();
if ($this->methods) {
foreach ($this->methods as $method) {
tsmTable::bindParameterable($method, $this->_xParams, $this->_varsToPushParam);
}
} else {
if ($this->methods === false) {
vmError('Error reading getPluginMethods ' . $q);
}
}
return count($this->methods);
}