本文整理汇总了PHP中JemHelper::loadCss方法的典型用法代码示例。如果您正苦于以下问题:PHP JemHelper::loadCss方法的具体用法?PHP JemHelper::loadCss怎么用?PHP JemHelper::loadCss使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JemHelper
的用法示例。
在下文中一共展示了JemHelper::loadCss方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareDocument
/**
* Prepares the document.
*/
protected function prepareDocument() {
$app = JFactory::getApplication();
$menus = $app->getMenu();
$menu = $menus->getActive();
$print = $app->input->getBool('print', false);
if ($print) {
JemHelper::loadCss('print');
$this->document->setMetaData('robots', 'noindex, nofollow');
}
if ($menu) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
} else {
// TODO
$this->params->def('page_heading', JText::_('COM_JEM_DEFAULT_PAGE_TITLE_DAY'));
}
$title = $this->params->get('page_title', '');
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'));
}
$this->document->setTitle($title);
// TODO: Metadata
$this->document->setMetadata('keywords', $this->params->get('page_title'));
}
示例2: display
public function display($tpl = null)
{
$document = JFactory::getDocument();
$db = JFactory::getDBO();
$app = JFactory::getApplication();
$jinput = JFactory::getApplication()->input;
$itemid = $jinput->getInt('id', 0) . ':' . $jinput->getInt('Itemid', 0);
$filter_order = $app->getUserStateFromRequest('com_jem.categoryelement.filter_order', 'filter_order', 'c.ordering', 'cmd');
$filter_order_Dir = $app->getUserStateFromRequest('com_jem.categoryelement.filter_order_Dir', 'filter_order_Dir', '', 'word');
$filter_state = $app->getUserStateFromRequest('com_jem.categoryelement.' . $itemid . '.filter_state', 'filter_state', '', 'string');
$search = $app->getUserStateFromRequest('com_jem.categoryelement.' . $itemid . '.filter_search', 'filter_search', '', 'string');
$search = $db->escape(trim(JString::strtolower($search)));
// prepare document
$document->setTitle(JText::_('COM_JEM_SELECT_CATEGORY'));
// Load css
JemHelper::loadCss('backend');
// Get data from the model
$rows = $this->get('Data');
$pagination = $this->get('Pagination');
// publish/unpublished filter
$lists['state'] = JHtml::_('grid.state', $filter_state);
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// search filter
$lists['search'] = $search;
// assign data to template
$this->lists = $lists;
$this->filter_state = $filter_state;
$this->rows = $rows;
$this->pagination = $pagination;
parent::display($tpl);
}
示例3: 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);
}
示例4: display
/**
* Calendar-View
*/
function display($tpl = null)
{
$app = JFactory::getApplication();
// Load tooltips behavior
JHtml::_('behavior.tooltip');
JHtml::_('behavior.framework');
// initialize variables
$document = JFactory::getDocument();
$menu = $app->getMenu();
$menuitem = $menu->getActive();
$jemsettings = JemHelper::config();
$user = JemFactory::getUser();
$params = $app->getParams();
$top_category = (int)$params->get('top_category', 0);
$jinput = $app->input;
$print = $jinput->getBool('print', false);
$this->param_topcat = $top_category > 0 ? ('&topcat='.$top_category) : '';
// Load css
JemHelper::loadCss('jem');
JemHelper::loadCss('calendar');
JemHelper::loadCustomCss();
JemHelper::loadCustomTag();
if ($print) {
JemHelper::loadCss('print');
$document->setMetaData('robots', 'noindex, nofollow');
}
$evlinkcolor = $params->get('eventlinkcolor');
$evbackgroundcolor = $params->get('eventbackgroundcolor');
$currentdaycolor = $params->get('currentdaycolor');
$eventandmorecolor = $params->get('eventandmorecolor');
$style = '
div#jem .eventcontentinner a,
div#jem .eventandmore a {
color:' . $evlinkcolor . ';
}
.eventcontentinner {
background-color:'.$evbackgroundcolor .';
}
.eventandmore {
background-color:'.$eventandmorecolor .';
}
.today .daynum {
background-color:'.$currentdaycolor.';
}';
$document->addStyleDeclaration($style);
// add javascript (using full path - see issue #590)
JHtml::_('script', 'media/com_jem/js/calendar.js');
$year = (int)$jinput->getInt('yearID', strftime("%Y"));
$month = (int)$jinput->getInt('monthID', strftime("%m"));
// get data from model and set the month
$model = $this->getModel();
$model->setDate(mktime(0, 0, 1, $month, 1, $year));
$rows = $this->get('Items');
// 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'));
}
$document->setTitle($pagetitle);
$document->setMetaData('title', $pagetitle);
// Check if the user has permission to add things
$permissions = new stdClass();
$catIds = $model->getCategories('all');
$permissions->canAddEvent = $user->can('add', 'event', false, false, $catIds);
$permissions->canAddVenue = $user->can('add', 'venue', false, false, $catIds);
$itemid = $jinput->getInt('Itemid', 0);
$partItemid = ($itemid > 0) ? '&Itemid=' . $itemid : '';
$partDate = ($year ? ('&yearID=' . $year) : '') . ($month ? ('&monthID=' . $month) : '');
$url_base = 'index.php?option=com_jem&view=calendar' . $partItemid;
$print_link = JRoute::_($url_base . $partDate . '&print=1&tmpl=component');
// init calendar
//.........这里部分代码省略.........
示例5: _displayprint
/**
* Prepares the print screen
*
* @param $tpl
*/
protected function _displayprint($tpl = null)
{
$document = JFactory::getDocument();
$app = JFactory::getApplication();
$params = $app->getParams();
$settings = JEMHelper::globalattribs();
// Load css
JemHelper::loadCss('backend');
JemHelper::loadCss('jem');
JemHelper::loadCss('print');
JemHelper::loadCustomTag();
$document->setMetaData('robots', 'noindex, nofollow');
// Emailaddress
$enableemailaddress = $params->get('enableemailaddress', 0);
$rows = $this->get('Data');
$event = $this->get('Event');
//assign data to template
$this->rows = $rows;
$this->event = $event;
$this->enableemailaddress = $enableemailaddress;
$this->settings = $settings;
parent::display($tpl);
}
示例6: mapicon
/**
* Creates the map button
*
* @param obj $data
*/
static function mapicon($data, $view = false, $params)
{
$global = JemHelper::globalattribs();
//stop if disabled
if (!$data->map) {
return;
}
if ($view == 'event') {
$tld = 'event_tld';
$lg = 'event_lg';
$mapserv = $params->get('event_show_mapserv');
} else if ($view == 'venues') {
$tld = 'global_tld';
$lg = 'global_lg';
$mapserv = $params->get('global_show_mapserv');
if ($mapserv == 3) {
$mapserv = 0;
}
} else {
$tld = 'global_tld';
$lg = 'global_lg';
$mapserv = $params->get('global_show_mapserv');
}
//Link to map
$mapimage = JHtml::_('image', 'com_jem/map_icon.png', JText::_('COM_JEM_MAP'), NULL, true);
//set var
$output = null;
$attributes = null;
$data->country = JString::strtoupper($data->country);
if ($data->latitude == 0.000000) {
$data->latitude = null;
}
if ($data->longitude == 0.000000) {
$data->longitude = null;
}
$url = 'http://maps.google.'.$params->get($tld,'com').'/maps?hl='.$params->get($lg,'com').'&q='.urlencode($data->street.', '.$data->postalCode.' '.$data->city.', '.$data->country.'+ ('.$data->venue.')').'&ie=UTF8&z=15&iwloc=B&output=embed" ';
// google map link or include
switch ($mapserv)
{
case 1:
// link
if($data->latitude && $data->longitude) {
$url = 'http://maps.google.'.$params->get($tld).'/maps?hl='.$params->get($lg).'&q=loc:'.$data->latitude.',+'.$data->longitude.'&ie=UTF8&z=15&iwloc=B&output=embed';
}
$message = JText::_('COM_JEM_MAP').':';
$attributes = ' rel="{handler: \'iframe\', size: {x: 800, y: 500}}" latitude="" longitude=""';
$output = '<dt class="venue_mapicon">'.$message.'</dt><dd class="venue_mapicon"><a class="flyermodal mapicon" title="'.JText::_('COM_JEM_MAP').'" target="_blank" href="'.$url.'"'.$attributes.'>'.$mapimage.'</a></dd>';
break;
case 2:
// include iframe
if($data->latitude && $data->longitude) {
$url = 'https://maps.google.com/maps?q=loc:'.$data->latitude.',+'.$data->longitude.'&ie=UTF8&t=m&z=14&iwloc=B&output=embed';
}
$output = '<div style="border: 1px solid #000;width:500px;"><iframe width="500" height="250" src="'.$url.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" ></iframe></div>';
break;
case 3:
// include - Google API3
# https://developers.google.com/maps/documentation/javascript/tutorial
$api = trim($params->get('global_googleapi'));
$clientid = trim($params->get('global_googleclientid'));
$document = JFactory::getDocument();
# do we have a client-ID?
if ($clientid) {
$document->addScript('http://maps.googleapis.com/maps/api/js?client='.$clientid.'&sensor=false&v=3.15');
} else {
# do we have an api-key?
if ($api) {
$document->addScript('https://maps.googleapis.com/maps/api/js?key='.$api.'&sensor=false');
} else {
$document->addScript('https://maps.googleapis.com/maps/api/js?sensor=false');
}
}
JemHelper::loadCss('googlemap');
JHtml::_('script', 'com_jem/infobox.js', false, true);
JHtml::_('script', 'com_jem/googlemap.js', false, true);
$output = '<div id="map-canvas" class="map_canvas"/></div>';
break;
}
//.........这里部分代码省略.........
示例7: _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));
}
}
示例8: _displaychoosecontact
/**
* Creates the output for the contact select listing
*/
protected function _displaychoosecontact($tpl)
{
$app = JFactory::getApplication();
$jinput = JFactory::getApplication()->input;
$jemsettings = JemHelper::config();
$db = JFactory::getDBO();
$document = JFactory::getDocument();
$itemid = $jinput->getInt('id', 0) . ':' . $jinput->getInt('Itemid', 0);
$filter_order = $app->getUserStateFromRequest('com_jem.selectcontact.' . $itemid . '.filter_order', 'filter_order', 'con.name', 'cmd');
$filter_order_Dir = $app->getUserStateFromRequest('com_jem.selectcontact.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', '', 'word');
$filter_type = $app->getUserStateFromRequest('com_jem.selectcontact.' . $itemid . '.filter_type', 'filter_type', '', 'int');
$search = $app->getUserStateFromRequest('com_jem.selectcontact.' . $itemid . '.filter_search', 'filter_search', '', 'string');
$search = $db->escape(trim(JString::strtolower($search)));
// Load css
JemHelper::loadCss('jem');
$document->setTitle(JText::_('COM_JEM_SELECT_CONTACT'));
// Get/Create the model
$rows = $this->get('Contacts');
$pagination = $this->get('ContactsPagination');
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
//Build search filter
$filters = array();
$filters[] = JHtml::_('select.option', '1', JText::_('COM_JEM_NAME'));
/* $filters[] = JHtml::_('select.option', '2', JText::_('COM_JEM_ADDRESS')); */
// data security
$filters[] = JHtml::_('select.option', '3', JText::_('COM_JEM_CITY'));
$filters[] = JHtml::_('select.option', '4', JText::_('COM_JEM_STATE'));
$searchfilter = JHtml::_('select.genericlist', $filters, 'filter_type', array('size' => '1', 'class' => 'inputbox'), 'value', 'text', $filter_type);
// search filter
$lists['search'] = $search;
//assign data to template
$this->searchfilter = $searchfilter;
$this->lists = $lists;
$this->rows = $rows;
$this->pagination = $pagination;
parent::display($tpl);
}