コード例 #1
0
ファイル: vmjcomments.php プロジェクト: romuland/khparts
 /**
  * We clear the product description $product->text by removing {Jcomments} tags
  * And set the config value for the display
  * 
  * @author Florian Voutzinos
  * @param string $context
  * @param object reference $product virtuemart product object
  * @param object reference $params 
  * @param int $limitstart
  * @return void
  */
 function onContentPrepare($context, &$product, &$params, $limitstart = 0)
 {
     // If the trigger is coming from virtuemart productdetails view
     if ($context == 'com_virtuemart.productdetails') {
         // If the plugin is activated in the plugin config
         // we parse {Jcomments} tag and set in in config
         if ($this->params->get('plugin_activated')) {
             // Replaces commenting systems tags like {moscomment}, {jomcomment} with {jcomments}
             VmJcommentsHelperPlugin::processForeignTags($product);
             // Set Jcomments config for the actual $product
             $excludedCatId = $this->params->get('excluded_catids', 0);
             VmJcommentsHelperPlugin::applyConfig($product, $excludedCatId);
         }
         // Clear {Jcomments} tag from the product description
         VmJcommentsHelperPlugin::clear($product);
     }
 }