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


PHP vmAccess::manager方法代码示例

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


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

示例1: 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

示例2: remove

 function remove($ids)
 {
     if (!vmAccess::manager('general')) {
         vmWarn('Insufficient permissions to remove general');
         return false;
     }
     return parent::remove($ids);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:8,代码来源:general.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: 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

示例12: remove

 /**
  * Delete all record ids selected
  *
  * @return boolean True is the remove was successful, false otherwise.
  */
 function remove($userIds)
 {
     if (vmAccess::manager('user')) {
         $userInfo = $this->getTable('userinfos');
         $vm_shoppergroup_xref = $this->getTable('vmuser_shoppergroups');
         $vmusers = $this->getTable('vmusers');
         $_status = true;
         foreach ($userIds as $userId) {
             $_JUser = JUser::getInstance($userId);
             if ($this->getSuperAdminCount() <= 1) {
                 // Prevent deletion of the only Super Admin
                 //$_u = JUser::getInstance($userId);
                 if ($_JUser->get('gid') == __SUPER_ADMIN_GID) {
                     vmError(tsmText::_('com_tsmart_USER_ERR_LASTSUPERADMIN'));
                     $_status = false;
                     continue;
                 }
             }
             if (!$userInfo->delete($userId)) {
                 return false;
             }
             if (!$vm_shoppergroup_xref->delete($userId)) {
                 $_status = false;
                 continue;
             }
             if (!$vmusers->delete($userId)) {
                 $_status = false;
                 continue;
             }
             if (!$_JUser->delete()) {
                 vmError($_JUser->getError());
                 $_status = false;
                 continue;
             }
         }
     }
     return $_status;
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:43,代码来源:user.php

示例13: checkShipmentMethodsConfigured

 private function checkShipmentMethodsConfigured()
 {
     //For the selection of the shipment method we need the total amount to pay.
     $shipmentModel = VmModel::getModel('Shipmentmethod');
     $shipments = $shipmentModel->getShipments();
     if (empty($shipments)) {
         $text = '';
         $user = JFactory::getUser();
         if (vmAccess::manager() or vmAccess::isSuperVendor()) {
             $uri = JFactory::getURI();
             $link = $uri->root() . 'administrator/index.php?option=com_virtuemart&view=shipmentmethod';
             $text = vmText::sprintf('COM_VIRTUEMART_NO_SHIPPING_METHODS_CONFIGURED_LINK', '<a href="' . $link . '" rel="nofollow">' . $link . '</a>');
         }
         vmInfo('COM_VIRTUEMART_NO_SHIPPING_METHODS_CONFIGURED', $text);
         $tmp = 0;
         $this->assignRef('found_shipment_method', $tmp);
         $this->cart->virtuemart_shipmentmethod_id = 0;
         return false;
     }
     return true;
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:21,代码来源:view.html.php

示例14: display


//.........这里部分代码省略.........
                 $title = 'PRODUCT';
                 $msg = "";
             }
             $this->SetViewTitle($title, $msg);
             $this->addStandardDefaultViewLists($model, 'created_on');
             if ($cI = vRequest::getInt('tsmart_category_id', false)) {
                 $app = JFactory::getApplication();
                 //$old_state = $app->getUserState('tsmart_category_id');
                 $old_state = $app->getUserState('tsmart_category_id');
                 if (empty($old_state) or $old_state != $cI) {
                     vRequest::setVar('com_tsmart.product.filter_order', 'pc.ordering');
                     $model->filter_order = 'pc.ordering';
                     $old_state = $app->setUserState('tsmart_category_id', $cI);
                 }
             }
             //Get the list of products
             $productlist = $model->getItemList();
             //The pagination must now always set AFTER the model load the listing
             $this->pagination = $model->getPagination();
             //Get the category tree
             $categoryId = $model->tsmart_category_id;
             //OSP switched to filter in model, was vRequest::getInt('tsmart_category_id');
             $category_tree = ShopFunctions::categoryListTree(array($categoryId));
             $this->assignRef('category_tree', $category_tree);
             //load service class
             //Load the product price
             if (!class_exists('calculationHelper')) {
                 require VMPATH_ADMIN . DS . 'helpers' . DS . 'calculationh.php';
             }
             $vendor_model = tmsModel::getModel('vendor');
             $productreviews = tmsModel::getModel('ratings');
             $this->mfTable = $model->getTable('manufacturers');
             $this->catTable = $model->getTable('categories');
             $this->lists['vendors'] = '';
             if ($this->showVendors()) {
                 $this->lists['vendors'] = Shopfunctions::renderVendorList(vmAccess::getVendorId());
             }
             foreach ($productlist as $tsmart_product_id => $product) {
                 $product->mediaitems = count($product->tsmart_media_id);
                 $product->reviews = $productreviews->countReviewsForProduct($product->tsmart_product_id);
                 $vendor_model->setId($product->tsmart_vendor_id);
                 $vendor = $vendor_model->getVendor();
                 $currencyDisplay = CurrencyDisplay::getInstance($vendor->vendor_currency, $vendor->tsmart_vendor_id);
                 if (!empty($product->allPrices[$product->selectedPrice]['product_price']) && !empty($product->allPrices[$product->selectedPrice]['product_currency'])) {
                     $product->product_price_display = $currencyDisplay->priceDisplay($product->allPrices[$product->selectedPrice]['product_price'], (int) $product->allPrices[$product->selectedPrice]['product_currency'], 1, true);
                 } else {
                     if (!empty($product->allPrices) and count($product->allPrices) > 1) {
                         $product->product_price_display = tsmText::_('com_tsmart_MULTIPLE_PRICES');
                     } else {
                         $product->product_price_display = tsmText::_('com_tsmart_NO_PRICE_SET');
                     }
                 }
                 // Write the first 5 categories in the list
                 $product->categoriesList = '';
                 if (!empty($product->categories[0])) {
                     $product->categoriesList = shopfunctions::renderGuiList($product->categories, 'categories', 'category_name', 'category');
                 }
                 // Write the first 5 manufacturers in the list
                 $product->manuList = '';
                 if (!empty($product->tsmart_manufacturer_id[0])) {
                     $product->manuList = shopfunctions::renderGuiList($product->tsmart_manufacturer_id, 'manufacturers', 'mf_name', 'manufacturer');
                 }
             }
             $mf_model = tmsModel::getModel('manufacturer');
             $manufacturers = $mf_model->getManufacturerDropdown();
             $this->assignRef('manufacturers', $manufacturers);
             /* add Search filter in lists*/
             /* Search type */
             $options = array('' => tsmText::_('com_tsmart_LIST_EMPTY_OPTION'), 'parent' => tsmText::_('com_tsmart_PRODUCT_LIST_SEARCH_BY_PARENT_PRODUCT'), 'product' => tsmText::_('com_tsmart_PRODUCT_LIST_SEARCH_BY_DATE_TYPE_PRODUCT'), 'price' => tsmText::_('com_tsmart_PRODUCT_LIST_SEARCH_BY_DATE_TYPE_PRICE'), 'withoutprice' => tsmText::_('com_tsmart_PRODUCT_LIST_SEARCH_BY_DATE_TYPE_WITHOUTPRICE'));
             $this->lists['search_type'] = VmHTML::selectList('search_type', vRequest::getVar('search_type'), $options);
             /* Search order */
             $options = array('bf' => tsmText::_('com_tsmart_PRODUCT_LIST_SEARCH_BY_DATE_BEFORE'), 'af' => tsmText::_('com_tsmart_PRODUCT_LIST_SEARCH_BY_DATE_AFTER'));
             $this->lists['search_order'] = VmHTML::selectList('search_order', vRequest::getVar('search_order'), $options);
             // Toolbar
             /*if (vmAccess::manager('product.edit')) {
                   JToolBarHelper::custom('massxref_cats', 'new', 'new', vmText::_('com_tsmart_PRODUCT_XREF_CAT'), true);
                   JToolBarHelper::custom('massxref_sgrps', 'new', 'new', vmText::_('com_tsmart_PRODUCT_XREF_SGRPS'), true);
               }
               if (vmAccess::manager('product.create')) {
                   JToolBarHelper::custom('createchild', 'new', 'new', vmText::_('com_tsmart_PRODUCT_CHILD'), true);
                   JToolBarHelper::custom('cloneproduct', 'copy', 'copy', vmText::_('com_tsmart_PRODUCT_CLONE'), true);
               }*/
             // JToolBarHelper::custom('addrating', 'default', '', vmText::_('com_tsmart_ADD_RATING'), true);
             $view = vRequest::getCmd('view', vRequest::getCmd('controller', 'tsmart'));
             JToolBarHelper::divider();
             if (vmAccess::manager($view . '.edit.state')) {
                 JToolBarHelper::publishList();
                 JToolBarHelper::unpublishList();
             }
             if (vmAccess::manager($view . '.delete')) {
                 JToolBarHelper::spacer('10');
                 JToolBarHelper::deleteList();
             }
             $this->assignRef('productlist', $productlist);
             $this->assignRef('tsmart_category_id', $categoryId);
             $this->assignRef('model', $model);
             break;
     }
     parent::display($tpl);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:101,代码来源:view.html.php

示例15: display


//.........这里部分代码省略.........
             $this->showRating = $ratingModel->showRating();
             $productModel->withRating = $this->showRating;
             $this->orderByList = $productModel->getOrderByList($this->categoryId);
             $this->products = $productModel->getProducts($ids);
             //$products = $productModel->getProductsInCategory($this->categoryId);
             $imgAmount = VmConfig::get('prodimg_browse', 1);
             $productModel->addImages($this->products, $imgAmount);
             if ($this->products) {
                 $currency = CurrencyDisplay::getInstance();
                 $this->assignRef('currency', $currency);
                 $display_stock = VmConfig::get('display_stock', 1);
                 $showCustoms = VmConfig::get('show_pcustoms', 1);
                 if ($display_stock or $showCustoms) {
                     if (!$showCustoms) {
                         foreach ($this->products as $i => $productItem) {
                             $productItem->stock = $productModel->getStockIndicator($productItem);
                         }
                     } else {
                         shopFunctionsF::sortLoadProductCustomsStockInd($this->products, $productModel);
                     }
                 }
                 // add javascript for price and cart, need even for quantity buttons, so we need it almost anywhere
                 vmJsApi::jPrice();
             }
             // Add feed links
             if ($this->showproducts and $this->products && VmConfig::get('feed_cat_published', 0) == 1) {
                 $link = '&format=feed&limitstart=';
                 $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
                 $document->addHeadLink(JRoute::_($link . '&type=rss', FALSE), 'alternate', 'rel', $attribs);
                 $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
                 $document->addHeadLink(JRoute::_($link . '&type=atom', FALSE), 'alternate', 'rel', $attribs);
             }
             $user = JFactory::getUser();
             $this->showBasePrice = (vmAccess::manager() or vmAccess::isSuperVendor());
         }
         //No redirect here, for category id = 0 means show ALL categories! note by Max Milbers
         if (!empty($this->categoryId) and $this->categoryId !== -1 and (empty($category->slug) or !$category->published)) {
             if (empty($category->slug)) {
                 vmInfo(vmText::_('COM_VIRTUEMART_CAT_NOT_FOUND'));
             } else {
                 if ($category->virtuemart_id !== 0 and !$category->published) {
                     vmInfo('COM_VIRTUEMART_CAT_NOT_PUBL', $category->category_name, $this->categoryId);
                 }
             }
             //Fallback
             $categoryLink = '';
             if ($category->category_parent_id) {
                 $categoryLink = '&view=category&virtuemart_category_id=' . $category->category_parent_id;
             } else {
                 $last_category_id = shopFunctionsF::getLastVisitedCategoryId();
                 if (!$last_category_id or $this->categoryId == $last_category_id) {
                     $last_category_id = vRequest::getInt('virtuemart_category_id', false);
                 }
                 if ($last_category_id and $this->categoryId != $last_category_id) {
                     $categoryLink = '&view=category&virtuemart_category_id=' . $last_category_id;
                 }
             }
             if (VmConfig::get('handle_404', 1)) {
                 $app->redirect(JRoute::_('index.php?option=com_virtuemart' . $categoryLink . '&error=404', FALSE));
             } else {
                 JError::raise(E_ERROR, '404', 'Not found');
             }
             return;
         }
         shopFunctionsF::setLastVisitedCategoryId($this->categoryId);
         shopFunctionsF::setLastVisitedManuId($virtuemart_manufacturer_id);
开发者ID:virtuemart-fr,项目名称:virtuemart-fr,代码行数:67,代码来源:view.html.php


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