本文整理汇总了PHP中JemHelper::loadCustomCss方法的典型用法代码示例。如果您正苦于以下问题:PHP JemHelper::loadCustomCss方法的具体用法?PHP JemHelper::loadCustomCss怎么用?PHP JemHelper::loadCustomCss使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JemHelper
的用法示例。
在下文中一共展示了JemHelper::loadCustomCss方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Creates the Calendar View
*/
function display($tpl = null)
{
$app = JFactory::getApplication();
//initialize variables
$menu = $app->getMenu();
$menuitem = $menu->getActive();
$jemsettings = JemHelper::config();
$params = $app->getParams();
$settings = JemHelper::globalattribs();
// Load css
JemHelper::loadCss('calendar');
JemHelper::loadCss('jem');
JemHelper::loadCustomCss();
JemHelper::loadCustomTag();
$evlinkcolor = $params->get('eventlinkcolor');
$evbackgroundcolor = $params->get('eventbackgroundcolor');
$currentdaycolor = $params->get('currentdaycolor');
$eventandmorecolor = $params->get('eventandmorecolor');
$style = '
div[id^=\'catz\'] a {color:' . $evlinkcolor . ';}
div[id^=\'catz\'] {background-color:' . $evbackgroundcolor . ';}
.eventcontent {background-color:' . $evbackgroundcolor . ';}
.eventandmore {background-color:' . $eventandmorecolor . ';}
.today .daynum {background-color:' . $currentdaycolor . ';}';
$this->document->addStyleDeclaration($style);
// add javascript (using full path - see issue #590)
JHtml::_('script', 'media/com_jem/js/calendar.js');
$rows = $this->get('Items');
$currentweek = $this->get('Currentweek');
$currentyear = Date("Y");
$showweeknr = $params->get('showweeknr', true);
//Set Page title
$pagetitle = $params->def('page_title', $menuitem->title);
$params->def('page_heading', $pagetitle);
$pageclass_sfx = $params->get('pageclass_sfx');
// Add site name to title if param is set
if ($app->getCfg('sitename_pagetitles', 0) == 1) {
$pagetitle = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $pagetitle);
} elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
$pagetitle = JText::sprintf('JPAGETITLE', $pagetitle, $app->getCfg('sitename'));
}
$this->document->setTitle($pagetitle);
$this->document->setMetaData('title', $pagetitle);
$cal = new activeCalendarWeek($currentyear, 1, 1);
$cal->enableWeekNum(JText::_('COM_JEM_WKCAL_WEEK'), null, '', $showweeknr);
// enables week number column with linkable week numbers
$cal->setFirstWeekDay($params->get('firstweekday', 0));
$this->rows = $rows;
$this->params = $params;
$this->jemsettings = $jemsettings;
$this->settings = $settings;
$this->currentweek = $currentweek;
$this->cal = $cal;
$this->pageclass_sfx = htmlspecialchars($pageclass_sfx);
parent::display($tpl);
}
示例2: _prepareDocument
/**
* Prepares the document
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$pathway = $app->getPathway();
$title = null;
// add css file
JemHelper::loadCss('jem');
JemHelper::loadCustomCss();
JemHelper::loadCustomTag();
if ($this->print) {
JemHelper::loadCss('print');
$this->document->setMetaData('robots', 'noindex, nofollow');
}
/*
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
} else {
$this->params->def('page_heading', JText::_('JGLOBAL_JEM_EVENT'));
}
*/
$title = $this->params->get('page_title', '');
/*
$id = (int) @$menu->query['id'];
// if the menu item does not concern this event
if ($menu && ($menu->query['option'] != 'com_jem' || $menu->query['view'] != 'event' || $id != $this->item->id)) {
// If this is not a single event menu item, set the page title to the event title
if ($this->item->title) {
$title = $this->item->title;
}
$path = array(array('title' => $this->item->title, 'link' => ''));
$category = JCategories::getInstance('JEM2')->get($this->item->catid);
while ($category && ($menu->query['option'] != 'com_jem' || $menu->query['view'] == 'event'
|| $id != $category->id) && $category->id > 1) {
$path[] = array('title' => $category->catname, 'link' => JEMHelperRoute::getCategoryRoute($category->id));
$category = $category->getParent();
}
$path = array_reverse($path);
foreach($path as $item) {
$pathway->addItem($item['title'], $item['link']);
}
}
*/
// Check for empty title and add site name if param is set
if (empty($title)) {
$title = $app->getCfg('sitename');
} elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
} elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
}
if (empty($title)) {
$title = $this->item->title;
}
$this->document->setTitle($title);
if ($this->params->get('robots')) {
$this->document->setMetadata('robots', $this->params->get('robots'));
}
if ($app->getCfg('MetaAuthor') == '1') {
$this->document->setMetaData('author', $this->item->author);
}
$mdata = $this->item->metadata->toArray();
foreach ($mdata as $k => $v) {
if ($v) {
$this->document->setMetadata($k, $v);
}
}
// If there is a pagebreak heading or title, add it to the page title
if (!empty($this->item->page_title)) {
$this->item->title = $this->item->title . ' - ' . $this->item->page_title;
$this->document->setTitle($this->item->page_title . ' - '
. JText::sprintf('PLG_CONTENT_PAGEBREAK_PAGE_NUM', $this->state->get('list.offset') + 1));
}
}
示例3: display
/**
* Creates the Day View
*/
function display($tpl = null)
{
// Initialize variables
$app = JFactory::getApplication();
$jemsettings = JemHelper::config();
$settings = JemHelper::globalattribs();
$menu = $app->getMenu();
$menuitem = $menu->getActive();
$document = JFactory::getDocument();
$params = $app->getParams();
$uri = JFactory::getURI();
$jinput = $app->input;
$task = $jinput->getCmd('task', '');
$print = $jinput->getBool('print', false);
$pathway = $app->getPathWay();
$user = JemFactory::getUser();
$itemid = $jinput->getInt('id', 0) . ':' . $jinput->getInt('Itemid', 0);
// Decide which parameters should take priority
$useMenuItemParams = ($menuitem && $menuitem->query['option'] == 'com_jem'
&& $menuitem->query['view'] == 'day'
&& !isset($menuitem->query['id']));
// Retrieving data
$requestVenueId = $jinput->getInt('locid', 0);
$requestCategoryId = $jinput->getInt('catid', 0);
$requestDate = $jinput->getInt('id', 0);
// Load css
JemHelper::loadCss('jem');
JemHelper::loadCustomCss();
JemHelper::loadCustomTag();
if ($print) {
JemHelper::loadCss('print');
$document->setMetaData('robots', 'noindex, nofollow');
}
// get variables
$filter_order = $app->getUserStateFromRequest('com_jem.day.'.$itemid.'.filter_order', 'filter_order', 'a.dates', 'cmd');
$filter_order_Dir = $app->getUserStateFromRequest('com_jem.day.'.$itemid.'.filter_order_Dir', 'filter_order_Dir', '', 'word');
$filter_type = $app->getUserStateFromRequest('com_jem.day.'.$itemid.'.filter_type', 'filter_type', '', 'int');
$search = $app->getUserStateFromRequest('com_jem.day.'.$itemid.'.filter_search', 'filter_search', '', 'string');
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// Get data from model
$rows = $this->get('Items');
$day = $this->get('Day');
$daydate = JemOutput::formatdate($day);
$showdaydate = true; // show by default
// Are events available?
$noevents = (!$rows) ? 1 : 0;
// Show page heading specified on menu item or TODAY as heading - idea taken from com_content.
if ($useMenuItemParams) {
$pagetitle = $params->get('page_title', $menuitem->title);
$params->def('page_heading', $pagetitle);
$pathway->setItemName(1, $menuitem->title);
} else {
// TODO: If we can integrate $daydate into page_heading we should set $showdaydate to false.
$pagetitle = JText::_('COM_JEM_DEFAULT_PAGE_TITLE_DAY');
$params->set('page_heading', $pagetitle);
$pathway->addItem($pagetitle);
}
$pageclass_sfx = $params->get('pageclass_sfx');
// Add site name to title if param is set
if ($app->getCfg('sitename_pagetitles', 0) == 1) {
$pagetitle = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $pagetitle);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
$pagetitle = JText::sprintf('JPAGETITLE', $pagetitle, $app->getCfg('sitename'));
}
// Set Page title
$document->setTitle($pagetitle);
if ($requestVenueId){
$print_link = JRoute::_('index.php?option=com_jem&view=day&tmpl=component&print=1&locid='.$requestVenueId.'&id='.$requestDate);
}
elseif ($requestCategoryId){
$print_link = JRoute::_('index.php?option=com_jem&view=day&tmpl=component&print=1&catid='.$requestCategoryId.'&id='.$requestDate);
}
else /*(!$requestCategoryId && !$requestVenueId)*/ {
$print_link = JRoute::_('index.php?option=com_jem&view=day&tmpl=component&print=1&id='.$requestDate);
}
// Check if the user has permission to add things
$permissions = new stdClass();
$permissions->canAddEvent = $user->can('add', 'event');
$permissions->canAddVenue = $user->can('add', 'venue');
//.........这里部分代码省略.........