本文整理汇总了PHP中Media::cccJs方法的典型用法代码示例。如果您正苦于以下问题:PHP Media::cccJs方法的具体用法?PHP Media::cccJs怎么用?PHP Media::cccJs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Media
的用法示例。
在下文中一共展示了Media::cccJs方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display()
{
require_once dirname(__FILE__) . '../../../../modules/designerpreview/defines.inc.php';
Tools::safePostVars();
// assign css_files and js_files at the very last time
if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) {
// CSS compressor management
if (Configuration::get('PS_CSS_THEME_CACHE')) {
$this->css_files = Media::cccCSS($this->css_files);
}
//JS compressor management
if (Configuration::get('PS_JS_THEME_CACHE') && !$this->useMobileTheme()) {
$this->js_files = Media::cccJs($this->js_files);
}
}
$this->context->smarty->assign(array('css_files' => $this->css_files, 'errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer));
if ((int) implode(explode('.', _PS_VERSION_)) > 1606) {
// For versions > 1.6.0.6
$this->context->smarty->assign(array('js_files' => $this->getLayout() && (bool) Configuration::get('PS_JS_DEFER') ? array() : $this->js_files, 'js_defer' => (bool) Configuration::get('PS_JS_DEFER')));
} else {
$this->context->smarty->assign(array('js_files' => $this->getLayout() ? array() : $this->js_files));
}
$live_edit_content = '';
// Don't use live edit if on mobile device
if (!$this->useMobileTheme() && $this->checkLiveEditAccess()) {
$live_edit_content = $this->getLiveEditFooter();
}
$layout = $this->getLayout();
if ($layout) {
if ($this->template) {
$this->context->smarty->assign('template', $this->context->smarty->fetch($this->template) . $live_edit_content);
} else {
ob_start();
$this->displayContent();
$template = ob_get_contents();
ob_clean();
$this->context->smarty->assign('template', $template . $live_edit_content);
}
$this->smartyOutputContent($layout);
} else {
Tools::displayAsDeprecated('layout.tpl is missing in your theme directory');
if ($this->display_header) {
$this->smartyOutputContent(getThemeDir() . 'header.tpl');
}
if ($this->template) {
$this->smartyOutputContent($this->template);
} else {
// For retrocompatibility with 1.4 controller
$this->displayContent();
}
if ($this->display_footer) {
$this->smartyOutputContent(getThemeDir() . 'footer.tpl');
}
}
return true;
}
示例2: display
public function display()
{
Tools::safePostVars();
// assign css_files and js_files at the very last time
if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) {
// CSS compressor management
if (Configuration::get('PS_CSS_THEME_CACHE')) {
$this->css_files = Media::cccCSS($this->css_files);
}
//JS compressor management
if (Configuration::get('PS_JS_THEME_CACHE') && !$this->useMobileTheme()) {
$this->js_files = Media::cccJs($this->js_files);
}
}
$this->context->smarty->assign(array('css_files' => $this->css_files, 'js_files' => $this->getLayout() && (bool) Configuration::get('PS_JS_DEFER') ? array() : $this->js_files, 'js_defer' => (bool) Configuration::get('PS_JS_DEFER'), 'errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer));
$layout = $this->getLayout();
if ($layout) {
if ($this->template) {
$template = $this->context->smarty->fetch($this->template);
} else {
ob_start();
$this->displayContent();
$template = ob_get_contents();
ob_clean();
}
$template = $this->context->smarty->assign('template', $template);
$this->smartyOutputContent($layout);
} else {
Tools::displayAsDeprecated('layout.tpl is missing in your theme directory');
if ($this->display_header) {
$this->smartyOutputContent(_PS_THEME_DIR_ . 'header.tpl');
}
if ($this->template) {
$this->smartyOutputContent($this->template);
} else {
// For retrocompatibility with 1.4 controller
$this->displayContent();
}
if ($this->display_footer) {
$this->smartyOutputContent(_PS_THEME_DIR_ . 'footer.tpl');
}
}
return true;
}
示例3: display
public function display()
{
Tools::safePostVars();
// assign css_files and js_files at the very last time
if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) {
// CSS compressor management
if (Configuration::get('PS_CSS_THEME_CACHE')) {
$this->css_files = Media::cccCSS($this->css_files);
}
//JS compressor management
if (Configuration::get('PS_JS_THEME_CACHE')) {
$this->js_files = Media::cccJs($this->js_files);
}
}
$this->context->smarty->assign('css_files', $this->css_files);
$this->context->smarty->assign('js_files', array_unique($this->js_files));
$this->context->smarty->assign(array('errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer));
$live_edit_content = '';
// Don't use live edit if on mobile device
if (!$this->context->getMobileDevice() && $this->checkLiveEditAccess()) {
$live_edit_content = $this->getLiveEditFooter();
}
$layout = $this->getLayout();
if ($layout) {
if ($this->template) {
$this->context->smarty->assign('template', $this->context->smarty->fetch($this->template) . $live_edit_content);
} else {
ob_start();
$this->displayContent();
$template = ob_get_contents();
ob_clean();
$this->context->smarty->assign('template', $template . $live_edit_content);
}
$this->smartyOutputContent($layout);
} else {
// BEGIN - 1.4 retrocompatibility - will be removed in 1.6
Tools::displayAsDeprecated('layout.tpl is missing in your theme directory');
if ($this->display_header) {
$this->smartyOutputContent(_PS_THEME_DIR_ . 'header.tpl');
}
if ($this->template) {
$this->smartyOutputContent($this->template);
} else {
// For retrocompatibility with 1.4 controller
$this->displayContent();
}
if ($this->display_footer) {
$this->smartyOutputContent(_PS_THEME_DIR_ . 'footer.tpl');
}
// END - 1.4 retrocompatibility - will be removed in 1.6
}
return true;
}
示例4: display
public function display()
{
Tools::safePostVars();
// assign css_files and js_files at the very last time
if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) {
// CSS compressor management
if (Configuration::get('PS_CSS_THEME_CACHE')) {
$this->css_files = Media::cccCSS($this->css_files);
}
//JS compressor management
if (Configuration::get('PS_JS_THEME_CACHE')) {
$this->js_files = Media::cccJs($this->js_files);
}
}
$this->context->smarty->assign('css_files', $this->css_files);
$this->context->smarty->assign('js_files', array_unique($this->js_files));
$this->context->smarty->assign(array('errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer));
// Don't use live edit if on mobile device
if ($this->context->getMobileDevice() == false && Tools::isSubmit('live_edit')) {
$this->context->smarty->assign('live_edit', $this->getLiveEditFooter());
}
$layout = $this->getLayout();
if ($layout) {
if ($this->template) {
$this->context->smarty->assign('template', $this->context->smarty->fetch($this->template));
} else {
ob_start();
$this->displayContent();
$template = ob_get_contents();
ob_clean();
$this->context->smarty->assign('template', $template);
}
$this->smartyOutputContent($layout);
} else {
// BEGIN - 1.4 retrocompatibility - will be removed in 1.6
Tools::displayAsDeprecated('layout.tpl is missing in your theme directory');
if ($this->display_header) {
$this->smartyOutputContent(_PS_THEME_DIR_ . 'header.tpl');
}
if ($this->template) {
$this->smartyOutputContent($this->template);
} else {
// For retrocompatibility with 1.4 controller
$this->displayContent();
}
if ($this->display_footer) {
$this->smartyOutputContent(_PS_THEME_DIR_ . 'footer.tpl');
}
// live edit
if (Tools::isSubmit('live_edit') && ($ad = Tools::getValue('ad')) && Tools::getAdminToken('AdminModulesPositions' . (int) Tab::getIdFromClassName('AdminModulesPositions') . (int) Tools::getValue('id_employee'))) {
$this->context->smarty->assign(array('ad' => $ad, 'live_edit' => true));
$this->smartyOutputContent(_PS_ALL_THEMES_DIR_ . 'live_edit.tpl');
}
// END - 1.4 retrocompatibility - will be removed in 1.6
}
return true;
}
示例5: display
/**
* Compiles and outputs full page content.
*
* @return bool
*
* @throws Exception
* @throws SmartyException
*/
public function display()
{
// assign css_files and js_files at the very last time
if (is_writable(_PS_THEME_DIR_ . 'cache')) {
// CSS compressor management
if (Configuration::get('PS_CSS_THEME_CACHE')) {
$this->css_files = Media::cccCss($this->css_files);
}
//JS compressor management
if (Configuration::get('PS_JS_THEME_CACHE')) {
$this->js_files = Media::cccJs($this->js_files);
}
}
$this->context->smarty->assign(array('layout' => $this->getLayout(), 'css_files' => $this->css_files, 'js_files' => $this->getLayout() && (bool) Configuration::get('PS_JS_DEFER') ? array() : $this->js_files, 'js_defer' => (bool) Configuration::get('PS_JS_DEFER'), 'notifications' => $this->prepareNotifications()));
$this->smartyOutputContent($this->template);
return true;
}
示例6: display
public function display()
{
Tools::safePostVars();
// Automatically add js files from js/autoload directory in the template
if (@filemtime($this->getThemeDir() . 'js/autoload/')) {
foreach (scandir($this->getThemeDir() . 'js/autoload/', 0) as $file) {
if (preg_match('/^[^.].*\\.js$/', $file)) {
$this->addJS($this->getThemeDir() . 'js/autoload/' . $file);
}
}
}
// Automatically add css files from css/autoload directory in the template
if (@filemtime($this->getThemeDir() . 'css/autoload/')) {
foreach (scandir($this->getThemeDir() . 'css/autoload', 0) as $file) {
if (preg_match('/^[^.].*\\.css$/', $file)) {
$this->addCSS($this->getThemeDir() . 'css/autoload/' . $file);
}
}
}
// assign css_files and js_files at the very last time
if ((Configuration::get('PS_CSS_THEME_CACHE') || Configuration::get('PS_JS_THEME_CACHE')) && is_writable(_PS_THEME_DIR_ . 'cache')) {
// CSS compressor management
if (Configuration::get('PS_CSS_THEME_CACHE')) {
$this->css_files = Media::cccCSS($this->css_files);
}
//JS compressor management
if (Configuration::get('PS_JS_THEME_CACHE') && !$this->useMobileTheme()) {
$this->js_files = Media::cccJs($this->js_files);
}
}
$this->context->smarty->assign(array('css_files' => $this->css_files, 'js_files' => array(), 'errors' => $this->errors, 'display_header' => $this->display_header, 'display_footer' => $this->display_footer));
$live_edit_content = '';
// Don't use live edit if on mobile theme
if (!$this->useMobileTheme() && $this->checkLiveEditAccess()) {
$live_edit_content = $this->getLiveEditFooter();
}
$layout = $this->getLayout();
if ($layout) {
if ($this->template) {
$this->context->smarty->assign('template', $this->context->smarty->fetch($this->template) . $live_edit_content);
} else {
ob_start();
$this->displayContent();
$template = ob_get_contents();
ob_clean();
$this->context->smarty->assign('template', $template . $live_edit_content);
}
$this->smartyOutputContent($layout);
} else {
Tools::displayAsDeprecated('layout.tpl is missing in your theme directory');
if ($this->display_header) {
$this->smartyOutputContent(_PS_THEME_DIR_ . 'header.tpl');
}
if ($this->template) {
$this->smartyOutputContent($this->template);
} else {
// For retrocompatibility with 1.4 controller
$this->displayContent();
}
if ($this->display_footer) {
$this->smartyOutputContent(_PS_THEME_DIR_ . 'footer.tpl');
}
}
return true;
}