本文整理汇总了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;
}