當前位置: 首頁>>代碼示例>>PHP>>正文


PHP VmConfig::_virtuemart_vendor_id方法代碼示例

本文整理匯總了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;
         }
     }
 }
開發者ID:brenot,項目名稱:forumdesenvolvimento,代碼行數:19,代碼來源:config.php

示例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;
    }
開發者ID:lenard112,項目名稱:cms,代碼行數:32,代碼來源:config.php


注:本文中的VmConfig::_virtuemart_vendor_id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。