/**
  * Processes tags in the templates for the given view.
  *
  * @return string tag value, if tag has been processed. NULL, otherwise.
  */
 function getTag($tag)
 {
     global $application;
     $value = null;
     switch ($tag) {
         case 'Local_ProductID':
             $value = $this->_ProductInfo['ID'];
             break;
         case 'Local_JSfuncProductFormSubmit':
             $value = "<script type=\"text/javascript\">" . "function ProductFormSubmit_" . $this->_ProductInfo['ID'] . "()" . "{" . " document.forms['ProductForm_" . $this->_ProductInfo['ID'] . "'].submit();" . "};" . "</script>";
             break;
         case 'Local_ProductStockWarnings':
             if (!modApiFunc('Session', 'is_set', 'StockDiscardedBy')) {
                 $value = '';
             } else {
                 $stock_discarded_by = modApiFunc('Session', 'get', 'StockDiscardedBy');
                 modApiFunc('Session', 'un_set', 'StockDiscardedBy');
                 $value = $stock_discarded_by;
                 //cz_getMsg($stock_discarded_by);
             }
             break;
         case 'Local_ProductFormStart':
             $skin = modApiFunc('Look_Feel', 'getCurrentSkin');
             if ($skin == 'digiCenter' || $skin == 'foodCourt' || $skin == 'flowers') {
                 if (empty($this->_product_form_action)) {
                     $this->_product_form_action = getpageurl('CartContent');
                 }
                 $redirect = modApiFunc('Configuration', 'getValue', SYSCONFIG_STORE_SHOW_CART);
                 $script = $redirect ? $this->_product_form_action : $_SERVER["PHP_SELF"];
                 $value = '<form action="' . $script . '" name="ProductForm_' . $this->_ProductInfo['ID'] . '" id="product_addtocart_form" method="post" enctype="multipart/form-data">
                       ';
             } else {
                 if (empty($this->_product_form_action)) {
                     $this->_product_form_action = getpageurl('CartContent');
                 }
                 $redirect = modApiFunc('Configuration', 'getValue', SYSCONFIG_STORE_SHOW_CART);
                 $script = $redirect ? $this->_product_form_action : $_SERVER["PHP_SELF"];
                 $value = '<form action="' . $script . '" name="ProductForm_' . $this->_ProductInfo['ID'] . '" id="ProductForm_' . $this->_ProductInfo['ID'] . '" method="post" enctype="multipart/form-data">
                       <input type="hidden" name="asc_action" value="AddToCart" />
                       <input type="hidden" name="prod_id" value="' . $this->_ProductInfo['ID'] . '" />
                     <script type="text/javascript">
                     function ProductFormSubmit_' . $this->_ProductInfo['ID'] . '()
                     {
                         document.forms[\'ProductForm_' . $this->_ProductInfo['ID'] . '\'].submit();
                     };
                     </script>';
             }
             break;
         case 'Local_ProductFormEnd':
             $value = '</form>';
             break;
         case 'Local_ProductAddToCart':
             $value = 'javascript: ProductFormSubmit_' . $this->_ProductInfo['ID'] . '();';
             break;
         case 'ProductOptionsForm':
             $value = getOptionsChoice($this->_ProductInfo['ID']);
             break;
         case 'Local_FormQuantityFieldName':
             $value = 'quantity_in_cart';
             break;
         case 'NextProductID':
             $value = $this->next_product_id;
             break;
         case 'PreviousProductID':
             $value = $this->previous_product_id;
             break;
         case 'Local_ProductQuantityOptions':
             $force_quantity = false;
             if (modApiFunc('Request', 'getValueByKey', 'presetCombination') != '') {
                 list($type, $customer_id, $wl_id) = explode('_', modApiFunc('Request', 'getValueByKey', 'presetCombination'));
                 if ($type == 'wl') {
                     $wl_info = modApiFunc('Wishlist', 'getWishlistRecordCartData', $wl_id, $customer_id);
                     if ($wl_info && @$wl_info['parent_entity'] == 'product' && @$wl_info['entity_id'] == $this->_ProductInfo['ID']) {
                         $qty_in_cart = $wl_info['qty'];
                         $force_quantity = true;
                     }
                 }
             } else {
                 $qty_in_cart = modApiFunc("Cart", "getProductQuantity", $this->_ProductInfo['ID']);
             }
             $value = modApiFunc("Cart", "getProductQuantityOptions", $qty_in_cart, $this->_ProductInfo['ID'], false, false, $force_quantity);
             break;
         case 'Local_ProductSettingsJSON':
             $product_object = new CProductInfo($this->_ProductInfo['ID']);
             $options_settings = modApiFunc('Product_Options', 'getOptionsSettingsForEntity', 'product', $this->_ProductInfo['ID']);
             $settings = array('product_id' => (int) $this->_ProductInfo['ID'], 'sale_price' => (double) getValProductSalePrice(), 'list_price' => (double) getValProductListPrice(), 'currency_settings' => modApiFunc('Localization', 'getCurrencySettings'), 'aanic' => $options_settings['AANIC'], 'aanis' => $options_settings['AANIS'], 'labels' => array('comb_unavailable' => $options_settings['WRN_CI_CR'], 'inv_unavailable' => $options_settings['WRN_CI_INV'], 'comb_limit_stock' => $options_settings['WRN_CI_INV'], 'comb_out_of_stock' => $options_settings['WRN_CI_INV']));
             $json = new Services_JSON();
             $value = $json->encode($settings);
             break;
         case 'Local_ThumbnailSide':
             $pi_settings = modApiFunc('Product_Images', 'getSettings');
             $value = $pi_settings['MAIN_IMAGE_SIDE'];
             break;
         case 'ProductColorSwatchImages':
             $value = getColorSwatchImages($this->_ProductInfo['ID']);
             break;
         default:
             list($entity, $tag) = getTagName($tag);
             if ($entity == 'product') {
                 //$value = getKeyIgnoreCase($tag, $this->_ProductInfo);
                 //               ,               default               switch' .
                 //           ,               $this->_ProductInfo                                          (            ),
                 //                                   getValProduct*,                ,
                 //                .                                             .
                 $product_object = new CProductInfo($this->_ProductInfo['ID']);
                 $value = $product_object->getProductTagValue($tag);
             }
             break;
     }
     return $value;
 }
中的评论:<?php 
        } else {
            ?>
中发表评论:<?php 
        }
        echo $lt["content"];
        ?>
</p>
                    			<span><?php 
        echo date('Y-m-d H:i', $lt["create_time"]);
        ?>
</span>
                    		</div>
                    		<div class="yf-list-center yf-list-other">
                    			<a href="<?php 
        echo getpageurl($lt['type'], $lt['infoid'], $lt["id"]);
        ?>
">查看评论</a>
                    		</div>
                    		<div class="yf-list-center yf-list-del" data-type="UserMessage" data-id="<?php 
        echo $lt["id"];
        ?>
">
                    			<span title="删除">&times;</span>
                    		</div>
                    	</div><?php 
    }
}
?>
                    	<?php 
if (empty($list)) {
 /**
  * Shows onchange action for the language select box
  */
 function showOnChangeAction()
 {
     if (empty($this->_index_url)) {
         $this->_index_url = getpageurl('index');
     }
     return "document.location='" . $this->_index_url . "?asc_action=ChangeLanguage&amp;lng=' + this.value + '&amp;returnURL=' + getReturnURL(this.value)";
 }
Ejemplo n.º 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;
 }