コード例 #1
0
 /**
  * Processes tags in the templates for the given view.
  *
  * @return string tag value, if tag has been processed. NULL, otherwise.
  */
 function getTag($tag, $arg_list = array())
 {
     global $application;
     $value = null;
     switch ($tag) {
         case 'Local_Columns':
             $value = $this->columns;
             break;
         case 'Local_ProductNumberToDisplay':
             $value = count($this->__product_list_to_display);
             break;
         case 'Local_NextProductIdToDisplay':
             if ($this->__index >= count($this->__product_list_to_display)) {
                 $value = null;
             } else {
                 $value = $this->__product_list_to_display[$this->__index]['product_id'];
                 $this->__index++;
             }
             $this->__current_product_id_to_display = $value;
             break;
         case 'Local_CurrentProductIdToDisplay':
             return $this->__current_product_id_to_display;
             break;
         case 'Local_ProductDetails':
             $pid = $this->getTag('Local_NextProductIdToDisplay');
             if ($pid == null) {
                 $value = '';
             } else {
                 $value = $this->renderProductInfo($pid);
             }
             break;
             # override the PaginatorRows tag behavior
         # override the PaginatorRows tag behavior
         case 'PaginatorLine':
             $value = getPaginatorLine($this->__paginator_name, 'ProductList', $this->__filter_hash);
             //
             break;
             # override the PaginatorRows tag behavior
         # override the PaginatorRows tag behavior
         case 'PaginatorDropdown':
             $value = getPaginatorDropdown($this->__paginator_name, 'ProductList');
             break;
         case 'CategoryName':
             $catobj = new CCategoryInfo($this->__tag_settings->filter->category_id);
             $value = $catobj->getCategoryTagValue('name');
             break;
         case 'ProductOptionsForm':
             $value = getOptionsChoice($this->_Product_Info->getProductTagValue('ID'));
             break;
         case 'RelatedProducts':
             $value = getRelatedProducts($this->_Product_Info->getProductTagValue('ID'));
             break;
         case 'Local_JSfuncProductFormSubmit':
             $value = "<script type=\"text/javascript\">" . "function ProductFormSubmit_" . $this->_Product_Info->getProductTagValue('ID') . "()" . "{" . " document.forms['ProductForm_" . $this->_Product_Info->getProductTagValue('ID') . "'].submit();" . "};" . "</script>";
             break;
         case 'Local_ProductFormStart':
             $value = '<form action="cart.php" name="ProductForm_' . $this->_Product_Info->getProductTagValue('ID') . '" id="ProductForm_' . $this->_Product_Info->getProductTagValue('ID') . '" method="post">
                       <input type="hidden" name="asc_action" value="AddToCart" />
                       <input type="hidden" name="prod_id" value="' . $this->_Product_Info->getProductTagValue('ID') . '" />
                     <script type="text/javascript">
                     function ProductFormSubmit_' . $this->_Product_Info->getProductTagValue('ID') . '()
                     {
                         document.forms[\'ProductForm_' . $this->_Product_Info->getProductTagValue('ID') . '\'].submit();
                     };
                     </script>';
             break;
         case 'Local_ProductFormEnd':
             $value = '</form>';
             break;
         case 'Local_ProductAddToCart':
             $value = 'javascript: ProductFormSubmit_' . $this->_Product_Info->getProductTagValue('ID') . '();';
             break;
         case 'ProductDetailedImages':
             $value = getProductDetailedImages($this->_Product_Info->getProductTagValue('ID'));
             break;
         case 'Local_FormQuantityFieldName':
             $value = 'quantity_in_cart';
             break;
         case 'Local_ProductQuantityOptions':
             $qty_in_cart = modApiFunc("Cart", "getProductQuantity", $this->_Product_Info->getProductTagValue('ID'));
             $value = modApiFunc("Cart", "getProductQuantityOptions", $qty_in_cart, $this->_Product_Info->getProductTagValue('ID'));
             break;
         default:
             list($entity, $tag) = getTagName($tag);
             if ($entity == 'product' && is_object($this->_Product_Info)) {
                 $value = $this->_Product_Info->getProductTagValue($tag);
             }
             break;
     }
     return $value;
 }
コード例 #2
0
 function getTag($tag)
 {
     // overriding paginator line
     if ($tag == 'PaginatorLine') {
         return getPaginatorLine($this->_pagname, $this->_pagblock, modApiFunc('CProductListFilter', 'getCurrentCategoryId'), $this->product_id);
     }
     // overriding paginator dropdown
     if ($tag == 'PaginatorDropdown') {
         return getPaginatorDropdown($this->_pagname, $this->_pagblock, 'customer reviews');
     }
     return getKeyIgnoreCase($tag, $this->_Template_Contents);
 }
コード例 #3
0
 function output()
 {
     global $application;
     $searchForm = $this->out_SearchForm();
     $customersTable = $this->out_CustomersTable();
     $resultMessage = $this->out_ResultMessage();
     $template_contents = array('SearchForm' => $searchForm, 'CustomersTable' => $customersTable, 'PaginatorLine' => getPaginatorLine('CustomersList', 'CustomersList'), 'PaginatorRows' => getPaginatorRows('CustomersList', 'CustomersList', 'PGNTR_CUST_ITEMS'), 'ResultMessage' => $resultMessage);
     $this->_Template_Contents = $template_contents;
     $application->registerAttributes($this->_Template_Contents);
     $this->mTmplFiller =& $application->getInstance('TmplFiller');
     return $this->mTmplFiller->fill("customer_account/customers_list/", "container.tpl.html", array());
 }
コード例 #4
0
 /**
  * Processes tags in the templates for the given view.
  *
  * @return string tag value, if tag has been processed. NULL, otherwise.
  */
 function getTag($tag, $arg_list = array())
 {
     global $application;
     $value = null;
     switch ($tag) {
         case 'Local_Items':
             $skin = modApiFunc('Look_Feel', 'getCurrentSkin');
             if ($skin == 'digiCenter' || $skin == 'foodCourt' || $skin == 'flowers') {
                 $value = $this->getProductsList();
             } else {
                 $value = $this->getDefaultProductsList();
             }
             break;
         case 'Local_Columns':
             $value = $this->columns;
             break;
         case 'Local_ItemCount':
             $value = $this->getProductsListCount();
             break;
             # override the PaginatorRows tag behavior
         # override the PaginatorRows tag behavior
         case 'PaginatorLine':
             $value = getPaginatorLine($this->getPagName(), $this->getBlockName(), $this->getPagParam());
             break;
             # override the PaginatorRows tag behavior
         # override the PaginatorRows tag behavior
         case 'PaginatorDropdown':
             $value = getPaginatorDropdown($this->getPagName(), $this->getBlockName());
             break;
         case 'CategoryName':
             $catobj =& $application->getInstance('CCategoryInfo', $this->pl_tag_settings->filter->category_id);
             $value = $catobj->getCategoryTagValue('name');
             break;
         case 'ProductOptionsForm':
             $value = getOptionsChoice($this->_Product_Info->getProductTagValue('ID'));
             break;
         case 'RelatedProducts':
             $value = getRelatedProducts($this->_Product_Info->getProductTagValue('ID'));
             break;
         case 'Local_JSfuncProductFormSubmit':
             $value = "<script type=\"text/javascript\">" . "function ProductFormSubmit_" . $this->_Product_Info->getProductTagValue('ID') . "()" . "{" . " document.forms['ProductForm_" . $this->_Product_Info->getProductTagValue('ID') . "'].submit();" . "};" . "</script>";
             break;
         case 'Local_ProductFormStart':
             if (empty($this->_product_form_action)) {
                 $this->_product_form_action = getpageurl('CartContent');
             }
             $buy_link = $this->_Product_Info->getProductTagValue('BuyLink');
             $redirect = modApiFunc('Configuration', 'getValue', SYSCONFIG_STORE_SHOW_CART);
             $script = $redirect ? $this->_product_form_action : $_SERVER["PHP_SELF"];
             $pid = $this->_Product_Info->getProductTagValue('ID');
             $value = '<form action="' . $script . '" name="ProductForm_' . $pid . '" id="ProductForm_' . $pid . '" method="post">
                       <input type="hidden" name="asc_action" value="AddToCart" />
                       <input type="hidden" name="prod_id" value="' . $pid . '" />
                     <script type="text/javascript">
                     function ProductFormSubmit_' . $pid . '()
                     {
                         document.forms[\'ProductForm_' . $pid . '\'].submit();
                     };
                     </script>';
             break;
         case 'Local_ProductFormEnd':
             $value = '</form>';
             break;
         case 'Local_ProductAddToCart':
             $value = 'javascript: ProductFormSubmit_' . $this->_Product_Info->getProductTagValue('ID') . '();';
             break;
         case 'ProductDetailedImages':
             $value = getProductDetailedImages($this->_Product_Info->getProductTagValue('ID'));
             break;
         case 'Local_FormQuantityFieldName':
             $value = 'quantity_in_cart';
             break;
         case 'Local_ProductQuantityOptions':
             $qty_in_cart = modApiFunc("Cart", "getProductQuantity", $this->_Product_Info->getProductTagValue('ID'));
             $value = modApiFunc("Cart", "getProductQuantityOptions", $qty_in_cart, $this->_Product_Info->getProductTagValue('ID'));
             break;
         case 'Local_Thumbnail':
             break;
         case 'Local_ThumbnailSide':
             $pi_settings = modApiFunc('Product_Images', 'getSettings');
             $value = $pi_settings['MAIN_IMAGE_SIDE'];
             break;
         case 'ProductColorSwatchImages':
             $value = getColorSwatchImages($this->_Product_Info->getProductTagValue('ID'));
             break;
         default:
             list($entity, $tag) = getTagName($tag);
             if ($entity == 'product' && is_object($this->_Product_Info)) {
                 $value = $this->_Product_Info->getProductTagValue($tag);
             }
             break;
     }
     return $value;
 }