本文整理汇总了PHP中Media::getJqueryPluginPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Media::getJqueryPluginPath方法的具体用法?PHP Media::getJqueryPluginPath怎么用?PHP Media::getJqueryPluginPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Media
的用法示例。
在下文中一共展示了Media::getJqueryPluginPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addJqueryPlugin
/**
* Add a new javascript file in page header.
*
* @param $name
* @param null $folder
* @param bool $css
*/
public function addJqueryPlugin($name, $folder = null, $css = true)
{
if (!is_array($name)) {
$name = array($name);
}
if (is_array($name)) {
foreach ($name as $plugin) {
$plugin_path = Media::getJqueryPluginPath($plugin, $folder);
if (!empty($plugin_path['js'])) {
$this->addJS($plugin_path['js']);
}
if ($css && !empty($plugin_path['css'])) {
$this->addCSS(key($plugin_path['css']), 'all');
}
}
}
}
示例2: hookDisplayFooterProduct
/**
* Adds JS files to product page
*/
public function hookDisplayFooterProduct()
{
if (Configuration::get('PS_DISPLAY_JQZOOM') == 1) {
// Remove jQuery Zoom
$jqZoomPluginPath = Media::getJqueryPluginPath('jqzoom');
$this->context->controller->removeJS($jqZoomPluginPath['js']);
$this->context->controller->removeCSS($jqZoomPluginPath['css']);
// Add new version of jqZoom plugin
$this->context->controller->addJS($this->_path . 'views/js/vendor/jquery.zoom.min.js');
}
}
示例3: addJqueryPlugin
/**
* Add a new javascript file in page header.
*
* @param mixed $js_uri
* @return void
*/
public function addJqueryPlugin($name, $folder = null)
{
$plugin_path = array();
if (is_array($name)) {
foreach ($name as $plugin) {
$plugin_path = Media::getJqueryPluginPath($plugin, $folder);
$this->addJS($plugin_path['js']);
$this->addCSS($plugin_path['css']);
}
} else {
$plugin_path = Media::getJqueryPluginPath($name, $folder);
}
$this->addCSS($plugin_path['css']);
$this->addJS($plugin_path['js']);
}
示例4: _displayHeader
/**
* _displayHeader() method add to header JS and CSS
*
* @return array
*/
private function _displayHeader()
{
// set
$aAssign = array();
// set js msg translation
BT_FPCModuleTools::translateJsMsg();
$aAssign['oJsTranslatedMsg'] = BT_FPCModuleTools::jsonEncode($GLOBALS[_FPC_MODULE_NAME . '_JS_MSG']);
// old version
if (version_compare(_PS_VERSION_, '1.4.1', '<')) {
$aAssign['bAddJsCss'] = true;
} else {
// use case - get context
if (version_compare(_PS_VERSION_, '1.5', '>')) {
// add in minify process by prestahsop
Context::getContext()->controller->addCSS(_FPC_URL_CSS . 'hook.css');
Context::getContext()->controller->addJS(_FPC_URL_JS . 'module.js');
if (Tools::getValue('controller') == 'myaccount') {
// get fancybox plugin
$aJsCss = Media::getJqueryPluginPath('fancybox');
// add fancybox plugin
if (!empty($aJsCss['js']) && !empty($aJsCss['css'])) {
Context::getContext()->controller->addCSS($aJsCss['css']);
Context::getContext()->controller->addJS($aJsCss['js']);
}
}
} else {
// add in minify process by prestahsop
Tools::addCSS(_FPC_URL_CSS . 'hook.css');
Tools::addJS(_FPC_URL_JS . 'module.js');
// add fancybox plugin
Tools::addCSS(_PS_CSS_DIR_ . 'jquery.fancybox-1.3.4.css');
Tools::addJS(_PS_JS_DIR_ . 'jquery/jquery.fancybox-1.3.4.js');
}
$aAssign['bAddJsCss'] = false;
}
return array('tpl' => _FPC_TPL_HEADER, 'assign' => $aAssign);
}