当前位置: 首页>>代码示例>>PHP>>正文


PHP vmAccess类代码示例

本文整理汇总了PHP中vmAccess的典型用法代码示例。如果您正苦于以下问题:PHP vmAccess类的具体用法?PHP vmAccess怎么用?PHP vmAccess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了vmAccess类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: remove

 function remove($ids)
 {
     if (!vmAccess::manager('paymentsetting')) {
         vmWarn('Insufficient permissions to remove paymentsetting');
         return false;
     }
     return parent::remove($ids);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:8,代码来源:paymentsetting.php

示例2: store

 function store(&$data)
 {
     if (!vmAccess::manager('manufacturercategories')) {
         vmWarn('Insufficient permissions to store manufacturer category');
         return false;
     }
     return parent::store($data);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:8,代码来源:manufacturercategories.php

示例3: checkPermissionForTools

 /**
  * Call at begin of every task to check if the permission is high enough.
  * Atm the standard is at least vm admin
  * @author Max Milbers
  */
 private function checkPermissionForTools()
 {
     vRequest::vmCheckToken();
     //Hardcore Block, we may do that better later
     $user = JFactory::getUser();
     if (!vmAccess::manager('core')) {
         $msg = 'Forget IT';
         $this->setRedirect('index.php?option=com_virtuemart', $msg);
     }
     return true;
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:16,代码来源:updatesmigration.php

示例4: save

 /**
  * We want to allow html so we need to overwrite some request data
  *
  * @author Max Milbers
  */
 function save($data = 0)
 {
     if ($data === 0) {
         $data = vRequest::getRequest();
     }
     if (vmAccess::manager('raw')) {
         $data['product_desc'] = vRequest::get('product_desc', '');
         $data['product_s_desc'] = vRequest::get('product_s_desc', '');
         $data['customtitle'] = vRequest::get('customtitle', '');
         if (isset($data['field'])) {
             $data['field'] = vRequest::get('field');
         }
         if (isset($data['childs'])) {
             foreach ($data['childs'] as $k => $v) {
                 if ($n = vRequest::get('product_name', false, FILTER_UNSAFE_RAW, FILTER_FLAG_NO_ENCODE, $data['childs'][$k])) {
                     $data['childs'][$k]['product_name'] = $n;
                 }
             }
         }
     } else {
         if (vmAccess::manager('html')) {
             $data['product_desc'] = vRequest::getHtml('product_desc', '');
             $data['product_s_desc'] = vRequest::getHtml('product_s_desc', '');
             $data['customtitle'] = vRequest::getHtml('customtitle', '');
             if (isset($data['field'])) {
                 $data['field'] = vRequest::getHtml('field');
             }
         } else {
             $data['product_desc'] = vRequest::getString('product_desc', '');
             $data['product_s_desc'] = vRequest::getString('product_s_desc', '');
             $data['customtitle'] = vRequest::getString('customtitle', '');
             if (isset($data['field'])) {
                 $data['field'] = vRequest::getString('field');
             }
         }
         //Why we have this?
         $multix = Vmconfig::get('multix', 'none');
         if ($multix != 'none') {
             //in fact this shoudl be used, when the mode is administrated and the system is so that
             //every product must be approved by an admin.
             unset($data['published']);
             //unset($data['childs']);
         }
     }
     parent::save($data);
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:51,代码来源:product.php

示例5: synchronizeMedia

 function synchronizeMedia()
 {
     if (vmAccess::manager('media')) {
         $configPaths = array('assets_general_path', 'media_category_path', 'media_product_path', 'media_manufacturer_path', 'media_vendor_path');
         foreach ($configPaths as $path) {
             $this->renameFileExtension(VMPATH_ROOT . DS . VmConfig::get($path));
         }
         if (!class_exists('Migrator')) {
             require VMPATH_ADMIN . DS . 'helpers' . DS . 'migrator.php';
         }
         $migrator = new Migrator();
         $result = $migrator->portMedia();
         $this->setRedirect($this->redirectPath, $result);
     } else {
         $msg = 'Forget IT';
         $this->setRedirect('index.php?option=com_virtuemart', $msg);
     }
 }
开发者ID:thumbs-up-sign,项目名称:TuVanDuAn,代码行数:18,代码来源:media.php

示例6: save

 function save($data = 0)
 {
     $data = vRequest::getPost();
     if (vmAccess::manager('raw')) {
         $data['payment_name'] = vRequest::get('payment_name', '');
         $data['payment_desc'] = vRequest::get('payment_desc', '');
         if (isset($data['params'])) {
             $data['params'] = vRequest::get('params', '');
         }
     } else {
         $data['payment_name'] = vRequest::getHtml('payment_name', '');
         $data['payment_desc'] = vRequest::getHtml('payment_desc', '');
         if (isset($data['params'])) {
             $data['params'] = vRequest::getHtml('params', '');
         }
     }
     parent::save($data);
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:18,代码来源:paymentmethod.php

示例7: save

 function save($data = 0)
 {
     if ($data === 0) {
         $data = vRequest::getPost();
     }
     if (vmAccess::manager('raw')) {
         $data['description'] = vRequest::get('description', '');
         if (isset($data['params'])) {
             $data['params'] = vRequest::get('params', '');
         }
     } else {
         $data['description'] = vRequest::getHtml('description', '');
         if (isset($data['params'])) {
             $data['params'] = vRequest::getHtml('params', '');
         }
     }
     $data['name'] = vRequest::getCmd('name');
     // onSaveCustom plugin;
     parent::save($data);
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:20,代码来源:userfields.php

示例8: getInventory

    /**
     * Select the products to list on the product list page
     * @author Max Milbers
     */
    public function getInventory()
    {
        if (!vmAccess::manager('inventory')) {
            vmWarn('Insufficient permissions to remove shipmentmethod');
            return false;
        }
        $select = ' `#__tsmart_products`.`tsmart_product_id`,
     				`#__tsmart_products`.`product_parent_id`,
     				`product_name`,
     				`product_sku`,
     				`product_in_stock`,
     				`product_weight`,
     				`published`,
     				`product_price`';
        $joinedTables = 'FROM `#__tsmart_products`
			LEFT JOIN `#__tsmart_product_prices`
			ON `#__tsmart_products`.`tsmart_product_id` = `#__tsmart_product_prices`.`tsmart_product_id`
			LEFT JOIN `#__tsmart_shoppergroups`
			ON `#__tsmart_product_prices`.`tsmart_shoppergroup_id` = `#__tsmart_shoppergroups`.`tsmart_shoppergroup_id`';
        return $this->_data = $this->exeSortSearchListQuery(0, $select, $joinedTables, $this->getInventoryFilter(), '', $this->_getOrdering());
    }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:25,代码来源:inventory.php

示例9: save

 /**
  * We want to allow html so we need to overwrite some request data
  *
  * @author Max Milbers
  */
 function save($data = 0)
 {
     if ($data === 0) {
         $data = vRequest::getRequest();
     }
     if (vmAccess::manager('raw')) {
         $data['product_desc'] = vRequest::get('product_desc', '');
         $data['product_s_desc'] = vRequest::get('product_s_desc', '');
         $data['customtitle'] = vRequest::get('customtitle', '');
         if (isset($data['field'])) {
             $data['field'] = vRequest::get('field');
         }
         if (isset($data['childs'])) {
             foreach ($data['childs'] as $k => $v) {
                 if ($n = vRequest::get('product_name', false, FILTER_UNSAFE_RAW, FILTER_FLAG_NO_ENCODE, $data['childs'][$k])) {
                     $data['childs'][$k]['product_name'] = $n;
                 }
             }
         }
     } else {
         if (vmAccess::manager('html')) {
             $data['product_desc'] = vRequest::getHtml('product_desc', '');
             $data['product_s_desc'] = vRequest::getHtml('product_s_desc', '');
             $data['customtitle'] = vRequest::getHtml('customtitle', '');
             if (isset($data['field'])) {
                 $data['field'] = vRequest::getHtml('field');
             }
         } else {
             $data['product_desc'] = vRequest::getString('product_desc', '');
             $data['product_s_desc'] = vRequest::getString('product_s_desc', '');
             $data['customtitle'] = vRequest::getString('customtitle', '');
             if (isset($data['field'])) {
                 $data['field'] = vRequest::getString('field');
             }
         }
     }
     parent::save($data);
 }
开发者ID:virtuemart-fr,项目名称:virtuemart-fr,代码行数:43,代码来源:product.php

示例10: Plugin

 /**
  * Method to render the plugin datas
  * this is an entry point to plugin to easy renders json or html
  *
  *
  * @access	public
  */
 function Plugin()
 {
     if (!vmAccess::manager()) {
         return false;
     }
     $type = vRequest::getCmd('type', 'vmcustom');
     $typeWhiteList = array('vmshopper', 'vmcustom', 'vmcalculation', 'vmpayment', 'vmshipment', 'vmuserfield');
     if (!in_array($type, $typeWhiteList)) {
         return false;
     }
     $name = vRequest::getString('name', '');
     JPluginHelper::importPlugin($type, $name);
     $dispatcher = JDispatcher::getInstance();
     // if you want only one render simple in the plugin use jExit();
     // or $render is an array of code to echo as html or json Object!
     $render = null;
     $dispatcher->trigger('plgVmOnSelfCallBE', array($type, $name, &$render));
     if ($render) {
         // Get the document object.
         $document = JFactory::getDocument();
         if (vRequest::getCmd('cache', 'no')) {
             JResponse::setHeader('Cache-Control', 'no-cache, must-revalidate');
             JResponse::setHeader('Expires', 'Mon, 6 Jul 2000 10:00:00 GMT');
         }
         $format = vRequest::getCmd('format', 'json');
         if ($format == 'json') {
             $document->setMimeEncoding('application/json');
             // Change the suggested filename.
             JResponse::setHeader('Content-Disposition', 'attachment;filename="' . $type . '".json"');
             echo vmJsApi::safe_json_encode($render);
         } else {
             echo $render;
         }
     }
     return true;
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:43,代码来源:plugin.php

示例11: display

 function display($tpl = null)
 {
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     $this->vendorId = vmAccess::isSuperVendor();
     // TODO add icon for media view
     $this->SetViewTitle();
     $model = VmModel::getModel('media');
     $layoutName = vRequest::getCmd('layout', 'default');
     if ($layoutName == 'edit') {
         $this->media = $model->getFile();
         $this->addStandardEditViewCommands();
     } else {
         $virtuemart_product_id = vRequest::getInt('virtuemart_product_id');
         if (is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0) {
             $virtuemart_product_id = (int) $virtuemart_product_id[0];
         } else {
             $virtuemart_product_id = (int) $virtuemart_product_id;
         }
         $cat_id = vRequest::getInt('virtuemart_category_id', 0);
         $super = vmAccess::isSuperVendor();
         if ($super == 1) {
             JToolBarHelper::custom('synchronizeMedia', 'new', 'new', vmText::_('COM_VIRTUEMART_TOOLS_SYNC_MEDIA_FILES'), false);
         }
         $this->addStandardDefaultViewCommands();
         $this->addStandardDefaultViewLists($model, null, null, 'searchMedia');
         $options = array('' => vmText::_('COM_VIRTUEMART_LIST_ALL_TYPES'), 'product' => vmText::_('COM_VIRTUEMART_PRODUCT'), 'category' => vmText::_('COM_VIRTUEMART_CATEGORY'), 'manufacturer' => vmText::_('COM_VIRTUEMART_MANUFACTURER'), 'vendor' => vmText::_('COM_VIRTUEMART_VENDOR'));
         $this->lists['search_type'] = VmHTML::selectList('search_type', vRequest::getVar('search_type'), $options, 1, '', 'onchange="this.form.submit();"');
         $options = array('' => vmText::_('COM_VIRTUEMART_LIST_ALL_ROLES'), 'file_is_displayable' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_DISPLAYABLE'), 'file_is_downloadable' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_DOWNLOADABLE'), 'file_is_forSale' => vmText::_('COM_VIRTUEMART_FORM_MEDIA_SET_FORSALE'));
         $this->lists['search_role'] = VmHTML::selectList('search_role', vRequest::getVar('search_role'), $options, 1, '', 'onchange="this.form.submit();"');
         $this->files = $model->getFiles(false, false, $virtuemart_product_id, $cat_id);
         $this->pagination = $model->getPagination();
     }
     parent::display($tpl);
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:36,代码来源:view.html.php

示例12: displayFileHandler

    /**
     * This displays a media handler. It displays the full and the thumb (icon) of the media.
     * It also gives a possibility to upload/change/thumbnail media
     *
     * @param string $imageArgs html atttributes, Just for displaying the fullsized image
     */
    public function displayFileHandler()
    {
        VmConfig::loadJLang('com_virtuemart_media');
        $this->addHiddenByType();
        $html = '<fieldset class="checkboxes">';
        $html .= '<legend>' . vmText::_('COM_VIRTUEMART_IMAGE_INFORMATION') . '</legend>';
        $html .= '<div class="vm__img_autocrop">';
        $imageArgs = array('id' => 'vm_display_image');
        $html .= $this->displayMediaFull($imageArgs, false, '', false) . '</div>';
        //This makes problems, when there is already a form, and there would be form in a form. breaks js in some browsers
        //		$html .= '<form name="adminForm" id="adminForm" method="post" enctype="multipart/form-data">';
        $html .= ' <table class="adminform"> ';
        if ($this->published || $this->virtuemart_media_id === 0) {
            $checked = 1;
        } else {
            $checked = 0;
        }
        $html .= '<tr>';
        //  The following was removed bacause the check box (publish/unpublish) was not functioning...
        // 			$this->media_published = $this->published;
        $html .= '<td class="labelcell" style="width:20em">
	<label for="published">' . vmText::_('COM_VIRTUEMART_FILES_FORM_FILE_PUBLISHED') . '</label>
</td>
<td>';
        if (!class_exists('VmHtml')) {
            require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
        }
        $html .= VmHtml::checkbox('media[media_published]', $checked, 1, 0, 'class="inputbox"', 'media[media_published]');
        //<input type="checkbox" class="inputbox" id="media_published'.$identify.'" name="media_published'.$identify.'" '.$checked.' size="16" value="1" />
        $html .= '</td>';
        $imgWidth = VmConfig::get('img_width', '');
        if (!empty($imgWidth)) {
            $imgWidth = 'width:' . VmConfig::get('img_width', 90) . 'px;';
        } else {
            $imgWidth = 'max-width:200px;width:auto;';
        }
        $imgHeight = VmConfig::get('img_height', '');
        if (!empty($imgHeight)) {
            $imgHeight = 'height:' . VmConfig::get('img_height', 90) . 'px;';
        } else {
            $imgHeight = '';
        }
        $html .= '<td rowspan = "8" min-width = "' . (VmConfig::get('img_width', 90) + 10) . 'px" overflow="hidden">';
        $thumbArgs = array('class' => 'vm_thumb_image', 'style' => 'overflow: auto;' . $imgWidth . $imgHeight);
        $html .= $this->displayMediaThumb($thumbArgs);
        //JHTML::image($this->file_url_thumb, 'thumbnail', 'id="vm_thumb_image" style="overflow: auto; float: right;"');
        // $html .= $this->displayMediaThumb('',false,'id="vm_thumb_image" style="overflow: auto; float: right;"');
        $html .= '</td>';
        $html .= '</tr>';
        if (vmAccess::manager('media')) {
            $readonly = 'readonly';
        } else {
            $readonly = '';
        }
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_TITLE', 'file_title');
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_DESCRIPTION', 'file_description');
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_META', 'file_meta');
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_CLASS', 'file_class');
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_URL', 'file_url', $readonly);
        //remove the file_url_thumb in case it is standard
        if (!empty($this->file_url_thumb) and is_a($this, 'VmImage')) {
            $file_url_thumb = $this->createThumbFileUrl();
            //vmdebug('my displayFileHandler ',$this,$file_url_thumb);
            if ($this->file_url_thumb == $file_url_thumb) {
                $this->file_url_thumb = vmText::sprintf('COM_VIRTUEMART_DEFAULT_URL', $file_url_thumb);
            }
        }
        $html .= $this->displayRow('COM_VIRTUEMART_FILES_FORM_FILE_URL_THUMB', 'file_url_thumb', $readonly);
        $this->addMediaAttributesByType();
        $html .= '<tr>
				<td class="labelcell">' . vmText::_('COM_VIRTUEMART_FILES_FORM_ROLE') . '</td>
				<td><fieldset class="checkboxes">' . JHtml::_('select.radiolist', $this->getOptions($this->_mRoles), 'media[media_roles]', '', 'value', 'text', $this->media_role) . '</fieldset></td></tr>';
        // 			$html .= '<tr><td class="labelcell">'.VmHTML::checkbox('file_is_forSale', $this->file_is_forSale);
        // 			$html .= VmHTML::checkbox('file_is_downloadable', $this->file_is_downloadable);
        if (!empty($this->file_type)) {
            $html .= '<tr>
					<td class="labelcell">' . vmText::_('COM_VIRTUEMART_FILES_FORM_LOCATION') . '</td>
					<td><fieldset class="checkboxes">' . vmText::_('COM_VIRTUEMART_FORM_MEDIA_SET_' . strtoupper($this->file_type)) . '</fieldset></td></tr>';
        } else {
            $mediaattribtemp = $this->media_attributes;
            if (empty($this->media_attributes)) {
                $mediaattribtemp = 'product';
            }
            $html .= '<tr>
					<td class="labelcell">' . vmText::_('COM_VIRTUEMART_FILES_FORM_LOCATION') . '</td>
					<td><fieldset class="checkboxes">' . JHtml::_('select.radiolist', $this->getOptions($this->_mLocation), 'media[media_attributes]', '', 'value', 'text', $mediaattribtemp) . '</fieldset></td></tr>';
        }
        // select language for image
        $active_languages = VmConfig::get('active_languages');
        if (count($active_languages) > 1) {
            $selectedImageLangue = explode(",", $this->file_lang);
            $configM = VmModel::getModel('config');
            $languages = $configM->getActiveLanguages($selectedImageLangue, 'media[active_languages][]');
            $html .= '<tr>
//.........这里部分代码省略.........
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:101,代码来源:mediahandler.php

示例13: getSwitchUserList

 public function getSwitchUserList($superVendor = null, $adminID = false)
 {
     if (!isset($superVendor)) {
         $superVendor = vmAccess::isSuperVendor();
     }
     $result = false;
     if ($superVendor) {
         $db = JFactory::getDbo();
         $search = vRequest::getUword('usersearch', '');
         if (!empty($search)) {
             $search = ' WHERE (`name` LIKE "%' . $search . '%" OR `username` LIKE "%' . $search . '%" OR `customer_number` LIKE "%' . $search . '%")';
         } else {
             if ($superVendor != 1) {
                 $search = ' WHERE vu.tsmart_vendor_id = ' . $superVendor . ' ';
             }
         }
         $q = 'SELECT ju.`id`,`name`,`username` FROM `#__users` as ju';
         if ($superVendor != 1 or !empty($search)) {
             $q .= ' LEFT JOIN #__tsmart_vmusers AS vmu ON vmu.tsmart_user_id = ju.id';
             if ($superVendor != 1) {
                 $q .= ' LEFT JOIN #__tsmart_vendor_users AS vu ON vu.tsmart_user_id = ju.id';
                 $search .= ' AND ( vmu.user_is_vendor = 0 OR (vmu.tsmart_vendor_id) IS NULL)';
             }
         }
         $current = JFactory::getUser();
         $hiddenUserID = $adminID ? $adminID : $current->id;
         if (!empty($search)) {
             $search .= ' AND ju.id!= "' . $hiddenUserID . '" ';
         } else {
             $q .= ' WHERE ju.id!= "' . $hiddenUserID . '" ';
         }
         $q .= $search . ' ORDER BY `name` LIMIT 0,10000';
         $db->setQuery($q);
         $result = $db->loadObjectList();
         if ($result) {
             foreach ($result as $k => $user) {
                 $result[$k]->displayedName = $user->name . '&nbsp;&nbsp;( ' . $user->username . ' )';
             }
         } else {
             $result = array();
         }
         if ($adminID) {
             $user = JFactory::getUser($adminID);
             if ($current->id != $user->id) {
                 $toAdd = new stdClass();
                 $toAdd->id = $user->id;
                 $toAdd->name = $user->name;
                 $toAdd->username = $user->username;
                 $toAdd->displayedName = tsmText::sprintf('com_tsmart_RETURN_TO', $user->name, $user->username);
                 array_unshift($result, $toAdd);
             }
         }
         $toAdd = new stdClass();
         $toAdd->id = 0;
         $toAdd->name = '';
         $toAdd->username = '';
         $toAdd->displayedName = '-' . tsmText::_('com_tsmart_REGISTER') . '-';
         array_unshift($result, $toAdd);
     }
     return $result;
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:61,代码来源:user.php

示例14: getUserList

 /**
  * Todo, works only for small stores, we need a new solution there with a bit filtering
  * For example by time, if already shopper, and a simple search
  * @return object list of users
  */
 function getUserList()
 {
     $result = false;
     if ($this->allowChangeShopper) {
         $this->adminID = vmAccess::getBgManagerId();
         $superVendor = vmAccess::isSuperVendor($this->adminID);
         if ($superVendor) {
             $uModel = VmModel::getModel('user');
             $result = $uModel->getSwitchUserList($superVendor, $this->adminID);
         }
     }
     if (!$result) {
         $this->allowChangeShopper = false;
     }
     return $result;
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:21,代码来源:view.html.php

示例15: display

 function display($tpl = null)
 {
     // Get the task
     $task = vRequest::getCmd('task', $this->getLayout());
     $this->assignRef('task', $task);
     // Load helpers
     if (!class_exists('CurrencyDisplay')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php';
     }
     if (!class_exists('VmHTML')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
     }
     if (!class_exists('VmImage')) {
         require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
     }
     $model = tmsModel::getModel();
     // Handle any publish/unpublish
     switch ($task) {
         case 'add':
         case 'edit':
             //this was in the controller for the edit tasks, we need this for the access by FE
             //$this->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.'product'.DS.'tmpl');
             tsmConfig::loadJLang('com_tsmart_orders', TRUE);
             tsmConfig::loadJLang('com_tsmart_shoppers', TRUE);
             $model_country = tmsModel::getModel('country');
             $this->countries = $model_country->getItemList();
             $tsmart_product_id = vRequest::getInt('tsmart_product_id');
             if (is_array($tsmart_product_id) && count($tsmart_product_id) > 0) {
                 $tsmart_product_id = (int) $tsmart_product_id[0];
             } else {
                 $tsmart_product_id = (int) $tsmart_product_id;
             }
             $product = $model->getItem($tsmart_product_id);
             require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmserviceclass.php';
             $product->tsmart_service_class_ids = tsmserviceclass::get_list_service_class_ids_by_tour_id($tsmart_product_id);
             require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmgroupsize.php';
             $product->tsmart_group_size_ids = tsmGroupSize::get_list_group_size_ids_by_tour_id($tsmart_product_id);
             //$user = JFactory::getUser();
             $superVendor = vmAccess::isSuperVendor();
             if ($superVendor != 1 and $superVendor != $product->tsmart_vendor_id) {
                 vmdebug('Product view.html.php ' . $superVendor, $product->tsmart_vendor_id);
                 JFactory::getApplication()->redirect('index.php?option=com_tsmart&view=tsmart', tsmText::_('com_tsmart_ALERTNOTAUTHOR'), 'error');
             }
             if (!empty($product->product_parent_id)) {
                 $product_parent = $model->getProductSingle($product->product_parent_id, false);
             }
             require_once JPATH_ROOT . '/administrator/components/com_tsmart/helpers/tsmserviceclass.php';
             $this->tour_service_class = tsmserviceclass::get_list_tour_service_class();
             $customfields = tmsModel::getModel('Customfields');
             $product->allIds[] = $product->tsmart_product_id;
             if (!empty($product->product_parent_id)) {
                 $product->allIds[] = $product->product_parent_id;
             }
             $product->customfields = $customfields->getCustomEmbeddedProductCustomFields($product->allIds);
             // Get the category tree
             if (isset($product->categories)) {
                 $this->category_tree = ShopFunctions::categoryListTree($product->categories);
             } else {
                 $this->category_tree = ShopFunctions::categoryListTree();
             }
             //Fallback for categories inherited by parent to correctly calculate the prices
             if (empty($product->categories) and !empty($product_parent->categories)) {
                 $product->categories = $product_parent->categories;
             }
             //Get the shoppergoup list - Cleanshooter Custom Shopper Visibility
             if (!isset($product->shoppergroups)) {
                 $product->shoppergroups = 0;
             }
             $this->shoppergroupList = ShopFunctions::renderShopperGroupList($product->shoppergroups);
             // Load the product price
             if (!class_exists('calculationHelper')) {
                 require VMPATH_ADMIN . DS . 'helpers' . DS . 'calculationh.php';
             }
             //Do we need the children? If there is a C customfield, we dont want them
             $isCustomVariant = false;
             foreach ($product->customfields as $custom) {
                 if ($custom->field_type == 'C' and $custom->tsmart_product_id == $tsmart_product_id) {
                     $isCustomVariant = true;
                     break;
                 }
             }
             if (!class_exists('tsmartModelConfig')) {
                 require VMPATH_ADMIN . '/models/config.php';
             }
             $productLayouts = tsmartModelConfig::getLayoutList('productdetails');
             $this->productLayouts = $productLayouts;
             // Load Images
             $model->addImages($product);
             if (!class_exists('VmTemplate')) {
                 require VMPATH_SITE . DS . 'helpers' . DS . 'vmtemplate.php';
             }
             $vmtemplate = VmTemplate::loadVmTemplateStyle();
             $this->imagePath = shopFunctions::getAvailabilityIconUrl($vmtemplate);
             // Load the vendors
             $vendor_model = tmsModel::getModel('vendor');
             $lists['vendors'] = '';
             if ($this->showVendors()) {
                 $lists['vendors'] = Shopfunctions::renderVendorList($product->tsmart_vendor_id);
             }
             // Load the currencies
//.........这里部分代码省略.........
开发者ID:cuongnd,项目名称:etravelservice,代码行数:101,代码来源:view.html.php


注:本文中的vmAccess类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。