本文整理匯總了PHP中VmConfig::_virtuemart_vendor_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP VmConfig::_virtuemart_vendor_id方法的具體用法?PHP VmConfig::_virtuemart_vendor_id怎麽用?PHP VmConfig::_virtuemart_vendor_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類VmConfig
的用法示例。
在下文中一共展示了VmConfig::_virtuemart_vendor_id方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: storeConfig
public static function storeConfig()
{
$user = JFactory::getUser();
if ($user->authorise('core.admin', 'com_virtuemart')) {
$installed = VirtueMartModelConfig::checkVirtuemartInstalled();
if ($installed) {
VirtueMartModelConfig::installVMconfigTable();
$confData = array();
$confData['virtuemart_config_id'] = 1;
$confData['config'] = VmConfig::$_jpConfig->toString();
$confTable = VmTable::getInstance('configs', 'Table', array());
if (!$confTable->bindChecknStore($confData)) {
vmError('storeConfig was not able to store config');
}
} else {
self::$_virtuemart_vendor_id = 1;
}
}
}
示例2: isSuperVendor
/**
* Checks if user is admin or has vendorId=1,
* if superadmin, but not a vendor it gives back vendorId=1 (single vendor, but multiuser administrated)
*
* @author Mattheo Vicini
* @author Max Milbers
*/
public static function isSuperVendor()
{
if (self::$_virtuemart_vendor_id === null) {
$user = JFactory::getUser();
if (!empty($user->id)) {
$q = 'SELECT `virtuemart_vendor_id` FROM `#__virtuemart_vmusers` `au`
WHERE `au`.`virtuemart_user_id`="' . $user->id . '" AND `au`.`user_is_vendor` = "1" ';
$db = JFactory::getDbo();
$db->setQuery($q);
$virtuemart_vendor_id = $db->loadResult();
if ($virtuemart_vendor_id) {
self::$_virtuemart_vendor_id = $virtuemart_vendor_id;
} else {
if ($user->authorise('core.admin', 'com_virtuemart') or self::get('multix', 'none') == 'none' and $user->authorise('core.manage', 'com_virtuemart')) {
self::$_virtuemart_vendor_id = 1;
}
}
} else {
self::$_virtuemart_vendor_id = 0;
vmdebug('Not a vendor');
}
}
//vmdebug('isSuperVendor',self::$_virtuemart_vendor_id);
return self::$_virtuemart_vendor_id;
}