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


PHP Media::getJqueryUIPath方法代码示例

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


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

示例1: getJqueryUIPath

 /**
  * return jqueryUI component path.
  *
  * @param mixed $component
  * @return string
  */
 public static function getJqueryUIPath($component, $theme, $check_dependencies)
 {
     $ui_path = array('js' => array(), 'css' => array());
     $folder = _PS_JS_DIR_ . 'jquery/ui/';
     $file = 'jquery.' . $component . '.min.js';
     $url_data = parse_url($folder . $file);
     $file_uri = _PS_ROOT_DIR_ . Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
     $file_uri_host_mode = _PS_CORE_DIR_ . Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
     $ui_tmp = array();
     if (isset(Media::$jquery_ui_dependencies[$component]) && Media::$jquery_ui_dependencies[$component]['theme'] && $check_dependencies) {
         $theme_css = Media::getCSSPath($folder . 'themes/' . $theme . '/jquery.ui.theme.css');
         $comp_css = Media::getCSSPath($folder . 'themes/' . $theme . '/jquery.' . $component . '.css');
         if (!empty($theme_css) || $theme_css) {
             $ui_path['css'] = array_merge($ui_path['css'], $theme_css);
         }
         if (!empty($comp_css) || $comp_css) {
             $ui_path['css'] = array_merge($ui_path['css'], $comp_css);
         }
     }
     if ($check_dependencies && array_key_exists($component, self::$jquery_ui_dependencies)) {
         foreach (self::$jquery_ui_dependencies[$component]['dependencies'] as $dependency) {
             $ui_tmp[] = Media::getJqueryUIPath($dependency, $theme, false);
             if (self::$jquery_ui_dependencies[$dependency]['theme']) {
                 $dep_css = Media::getCSSPath($folder . 'themes/' . $theme . '/jquery.' . $dependency . '.css');
             }
             if (isset($dep_css) && (!empty($dep_css) || $dep_css)) {
                 $ui_path['css'] = array_merge($ui_path['css'], $dep_css);
             }
         }
     }
     if (@filemtime($file_uri) || defined('_PS_HOST_MODE_') && @filemtime($file_uri_host_mode)) {
         if (!empty($ui_tmp)) {
             foreach ($ui_tmp as $ui) {
                 if (!empty($ui['js'])) {
                     $ui_path['js'][] = $ui['js'];
                 }
                 if (!empty($ui['css'])) {
                     $ui_path['css'][] = $ui['css'];
                 }
             }
             $ui_path['js'][] = Media::getJSPath($folder . $file);
         } else {
             $ui_path['js'] = Media::getJSPath($folder . $file);
         }
     }
     //add i18n file for datepicker
     if ($component == 'ui.datepicker') {
         if (!is_array($ui_path['js'])) {
             $ui_path['js'] = array($ui_path['js']);
         }
         $ui_path['js'][] = Media::getJSPath($folder . 'i18n/jquery.ui.datepicker-' . Context::getContext()->language->iso_code . '.js');
     }
     return $ui_path;
 }
开发者ID:IngenioContenidoDigital,项目名称:americana,代码行数:60,代码来源:Media.php

示例2: addJqueryUI

 /**
  * Add a new javascript file in page header.
  *
  * @param mixed $js_uri
  * @return void
  */
 public function addJqueryUI($component, $theme = 'base', $check_dependencies = true)
 {
     $ui_path = array();
     if (!is_array($component)) {
         $component = array($component);
     }
     foreach ($component as $ui) {
         $ui_path = Media::getJqueryUIPath($ui, $theme, $check_dependencies);
         $this->addCSS($ui_path['css']);
         $this->addJS($ui_path['js']);
     }
 }
开发者ID:carloslastresDev,项目名称:HealthyTaiwan_UsingPrestaShop,代码行数:18,代码来源:Controller.php

示例3: displayAccount

 public function displayAccount()
 {
     if (!isset($this->context->cookie->stats_date_from)) {
         $this->context->cookie->stats_date_from = date('Y-m-01');
     }
     if (!isset($this->context->cookie->stats_date_to)) {
         $this->context->cookie->stats_date_to = date('Y-m-t');
     }
     Referrer::refreshCache(array(array('id_referrer' => (int) $this->context->cookie->tracking_id)));
     $referrer = new Referrer((int) $this->context->cookie->tracking_id);
     $this->smarty->assign('referrer', $referrer);
     $this->smarty->assign('datepickerFrom', $this->context->cookie->stats_date_from);
     $this->smarty->assign('datepickerTo', $this->context->cookie->stats_date_to);
     $display_tab = array('uniqs' => $this->l('Unique visitors'), 'visitors' => $this->l('Visitors'), 'visits' => $this->l('Visits'), 'pages' => $this->l('Pages viewed'), 'registrations' => $this->l('Registrations'), 'orders' => $this->l('Orders'), 'base_fee' => $this->l('Base fee'), 'percent_fee' => $this->l('Percent fee'), 'click_fee' => $this->l('Click fee'), 'sales' => $this->l('Sales'), 'cart' => $this->l('Average cart'), 'reg_rate' => $this->l('Registration rate'), 'order_rate' => $this->l('Order rate'));
     $this->smarty->assign('displayTab', $display_tab);
     $products = Product::getSimpleProducts($this->context->language->id);
     $products_array = array();
     foreach ($products as $product) {
         $products_array[] = $product['id_product'];
     }
     $js_files = array();
     $jquery_files = Media::getJqueryPath();
     if (is_array($jquery_files)) {
         $js_files = array_merge($js_files, $jquery_files);
     } else {
         $js_files[] = $jquery_files;
     }
     $jquery_ui_files = Media::getJqueryUIPath('ui.datepicker', 'base', true);
     $js_files = array_merge($js_files, $jquery_ui_files['js']);
     $css_files = $jquery_ui_files['css'];
     $js_files[] = $this->_path . 'js/trackingfront.js';
     $js_tpl_var = array('product_ids' => implode(', ', $products_array), 'referrer_id' => $referrer->id, 'token' => $this->context->cookie->tracking_passwd, 'display_tab' => implode('", "', array_keys($display_tab)));
     $this->smarty->assign(array('js' => $js_files, 'css' => $css_files, 'js_tpl_var' => $js_tpl_var));
     return $this->display(__FILE__, 'views/templates/front/account.tpl');
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:35,代码来源:trackingfront.php


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