当前位置: 首页>>代码示例>>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;未经允许,请勿转载。