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


PHP JHtml::Stylesheet方法代码示例

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


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

示例1: display

 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a JError object.
  *
  * @see     fetch()
  * @since   11.1
  */
 public function display($tpl = null)
 {
     // Request variables
     $prodhelperobj = new producthelper();
     $this->redTemplate = new Redtemplate();
     $this->redHelper = new redhelper();
     $this->textHelper = new text_library();
     $this->app = JFactory::getApplication();
     $this->input = $this->app->input;
     $this->model = $this->getModel('product');
     $this->document = JFactory::getDocument();
     $this->session = JFactory::getSession();
     $pageheadingtag = '';
     $params = $this->app->getParams('com_redshop');
     $menu_meta_keywords = $params->get('menu-meta_keywords');
     $menu_meta_description = $params->get('menu-meta_description');
     $menu_robots = $params->get('robots');
     $this->data = $this->get('data');
     $productTemplate = null;
     $this->itemId = $this->input->getInt('Itemid', null);
     $this->pid = $this->input->getInt('pid', 0);
     $layout = $this->input->getString('layout', 'default');
     $template = $this->input->getString('r_template', '');
     JPluginHelper::importPlugin('redshop_product');
     $this->dispatcher = JDispatcher::getInstance();
     if (!$this->pid) {
         $this->pid = $params->get('productid');
     }
     /*
      *  Include JavaScript.
      *  But, first check if a plugin wants to use its own jQuery.
      */
     $stopJQuery = $this->dispatcher->trigger('stopProductRedshopJQuery', array($this->data, $layout));
     if (in_array(true, $stopJQuery, true)) {
         $stopJQuery = true;
     } else {
         $stopJQuery = false;
     }
     if (!$stopJQuery) {
         JHtml::Script('jquery.js', 'components/com_redshop/assets/js/', false);
     }
     JHtml::Script('redBOX.js', 'components/com_redshop/assets/js/', false);
     JHtml::Script('json.js', 'components/com_redshop/assets/js/', false);
     JHtml::Script('attribute.js', 'components/com_redshop/assets/js/', false);
     JHtml::Script('common.js', 'components/com_redshop/assets/js/', false);
     // Lightbox Javascript
     JHtml::Stylesheet('style.css', 'components/com_redshop/assets/css/');
     JHtml::Stylesheet('scrollable-navig.css', 'components/com_redshop/assets/css/');
     if ($layout == "downloadproduct") {
         $this->setLayout('downloadproduct');
     } elseif ($layout == "compare") {
         $this->setLayout('compare');
     } elseif ($layout == "viewajaxdetail") {
         $this->setLayout('viewajaxdetail');
     } elseif ($layout == "searchletter") {
         $this->setLayout('searchletter');
     } else {
         // Ajax box
         if ($template == 'cartbox' && AJAX_CART_BOX == 1) {
             $this->loadTemplate('cartbox');
             exit;
         } else {
             $this->setLayout('default');
         }
         $prodhelperobj_array_main = $prodhelperobj->getProductNetPrice($this->data->product_id);
         if ($this->data->published == 0) {
             JError::raiseError(404, sprintf(JText::_('COM_REDSHOP_PRODUCT_IS_NOT_PUBLISHED'), $this->data->product_name, $this->data->product_number));
         }
         if ($this->data->canonical_url != "") {
             $main_url = JURI::root() . $this->data->canonical_url;
             $canonical = '<link rel="canonical" href="' . $main_url . '" />';
             $this->document->addCustomTag($canonical);
         } elseif ($this->data->product_parent_id != 0 && $this->data->product_parent_id != "") {
             $product_parent_data = $prodhelperobj->getProductById($this->data->product_parent_id);
             if ($product_parent_data->canonical_url != "") {
                 $main_url = JURI::root() . $product_parent_data->canonical_url;
                 $canonical = '<link rel="canonical" href="' . $main_url . '" />';
                 $this->document->addCustomTag($canonical);
             } else {
                 $main_url = substr_replace(JURI::root(), "", -1);
                 $main_url .= JRoute::_('index.php?option=com_redshop&view=product&layout=detail&Itemid=' . $this->itemId . '&pid=' . $this->data->product_parent_id, false);
                 $canonical = '<link rel="canonical" href="' . $main_url . '" />';
                 $this->document->addCustomTag($canonical);
             }
         }
         $productTemplate = $this->model->getProductTemplate();
         /*
          * Process the prepare Product plugins
          */
         $this->dispatcher->trigger('onPrepareProduct', array(&$productTemplate->template_desc, &$params, $this->data));
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例2: defined

<?php

defined('_JEXEC') or die;
jimport('joomla.application.component.controller');
JLoader::register("SroHelper", JPATH_COMPONENT_ADMINISTRATOR . "/helpers/general.php");
if (version_compare(JVERSION, "2.5", "ge")) {
    $task = JFactory::getApplication()->input->get("task");
} else {
    $task = JRequest::getCmd("task");
}
if (version_compare(JVERSION, "1.6", "ge")) {
    $controller = JController::getInstance("Sro");
    JHtml::Stylesheet("com_sro/site.css", null, true);
} else {
    require_once JPATH_SITE . "/components/com_sro/controller.php";
    $controller = new SroController();
    JHtml::Stylesheet("site.css", JURI::root() . "media/com_sro/css/");
    $lang =& JFactory::getLanguage();
    $lang->load("com_sro", JPATH_SITE, null, true);
    $lang->load("com_sro", JPATH_COMPONENT, null, true);
}
$controller->execute($task);
$controller->redirect();
开发者ID:salatproduction,项目名称:SRO-Registry-Joomla,代码行数:23,代码来源:sro.php


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