本文整理汇总了PHP中JemHelper::viewSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP JemHelper::viewSettings方法的具体用法?PHP JemHelper::viewSettings怎么用?PHP JemHelper::viewSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JemHelper
的用法示例。
在下文中一共展示了JemHelper::viewSettings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Creates the Venuesview
*/
function display($tpl = null)
{
$app = JFactory::getApplication();
$jinput = $app->input;
$document = JFactory::getDocument();
$jemsettings = JemHelper::config();
$settings = JemHelper::globalattribs();
$vsettings = JemHelper::viewSettings('vvenues');
$user = JFactory::getUser();
$print = $jinput->getBool('print');
//get menu information
$menu = $app->getMenu();
$menuitem = $menu->getActive();
$params = $app->getParams();
// Load css
JemHelper::loadCss('jem');
JemHelper::loadCustomCss();
JemHelper::loadCustomTag();
if ($print) {
JemHelper::loadCss('print');
$document->setMetaData('robots', 'noindex, nofollow');
}
// Request variables
$task = $jinput->getCmd('task');
$rows = $this->get('Items');
$pagetitle = $params->def('page_title', $menuitem->title);
$pageheading = $params->def('page_heading', $params->get('page_title'));
$pageclass_sfx = $params->get('pageclass_sfx');
//pathway
$pathway = $app->getPathWay();
if ($menuitem) {
$pathway->setItemName(1, $menuitem->title);
}
if ($task == 'archive') {
$pathway->addItem(JText::_('COM_JEM_ARCHIVE'), JRoute::_('index.php?view=venues&task=archive'));
$print_link = JRoute::_('index.php?view=venues&task=archive&print=1&tmpl=component');
$pagetitle .= ' - ' . JText::_('COM_JEM_ARCHIVE');
$pageheading .= ' - ' . JText::_('COM_JEM_ARCHIVE');
$params->set('page_heading', $pageheading);
} else {
$print_link = JRoute::_('index.php?view=venues&print=1&tmpl=component');
}
// 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);
$document->setMetadata('title', $pagetitle);
$document->setMetadata('keywords', $pagetitle);
// Check if the user has access to the add-eventform
$maintainer = JemUser::ismaintainer('add');
$genaccess = JemUser::validate_user($jemsettings->evdelrec, $jemsettings->delivereventsyes);
if ($maintainer || $genaccess || $user->authorise('core.create', 'com_jem')) {
$addeventlink = 1;
} else {
$addeventlink = 0;
}
//Check if the user has access to the add-venueform
$maintainer2 = JemUser::venuegroups('add');
$genaccess2 = JemUser::validate_user($jemsettings->locdelrec, $jemsettings->deliverlocsyes);
if ($maintainer2 || $genaccess2) {
$addvenuelink = 1;
} else {
$addvenuelink = 0;
}
// Create the pagination object
$pagination = $this->get('Pagination');
$this->rows = $rows;
$this->print_link = $print_link;
$this->params = $params;
$this->addvenuelink = $addvenuelink;
$this->addeventlink = $addeventlink;
$this->pagination = $pagination;
$this->item = $menuitem;
$this->jemsettings = $jemsettings;
$this->settings = $settings;
$this->vsettings = $vsettings;
$this->task = $task;
$this->pagetitle = $pagetitle;
$this->pageclass_sfx = htmlspecialchars($pageclass_sfx);
$this->print = $print;
$this->app = $app;
parent::display($tpl);
}
示例2: buildQueryVenues
/**
* venues-query
*/
function buildQueryVenues()
{
$app = JFactory::getApplication();
$params = JemHelper::globalattribs();
$vsettings = JemHelper::viewSettings('veditevent');
$jinput = $app->input;
$itemid = $jinput->getInt('id', 0) . ':' . $jinput->getInt('Itemid', 0);
$filter_order = $app->getUserStateFromRequest('com_jem.selectvenue.' . $itemid . '.filter_order', 'filter_order', 'l.venue', 'cmd');
$filter_order_Dir = $app->getUserStateFromRequest('com_jem.selectvenue.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', 'ASC', 'word');
$filter_order = JFilterInput::getinstance()->clean($filter_order, 'cmd');
$filter_order_Dir = JFilterInput::getinstance()->clean($filter_order_Dir, 'word');
$filter_type = $app->getUserStateFromRequest('com_jem.selectvenue.' . $itemid . '.filter_type', 'filter_type', '', 'int');
$search = $app->getUserStateFromRequest('com_jem.selectvenue.' . $itemid . '.filter_search', 'filter_search', '', 'string');
$search = $this->_db->escape(trim(JString::strtolower($search)));
// Query
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select(array('l.id', 'l.state', 'l.city', 'l.country', 'l.published', 'l.venue', 'l.ordering'));
$query->from('#__jem_venues as l');
// where
$where = array();
$where[] = 'l.published = 1';
/* something to search for? (we like to search for "0" too) */
if ($search || $search === "0") {
switch ($filter_type) {
case 1:
/* Search venues */
$where[] = 'LOWER(l.venue) LIKE "%' . $search . '%"';
break;
case 2:
// Search city
$where[] = 'LOWER(l.city) LIKE "%' . $search . '%"';
break;
case 3:
// Search state
$where[] = 'LOWER(l.state) LIKE "%' . $search . '%"';
}
}
if ($vsettings->get('global_show_ownedvenuesonly', 1)) {
$user = JFactory::getUser();
$userid = $user->get('id');
$where[] = ' created_by = ' . (int) $userid;
}
$query->where($where);
if (strtoupper($filter_order_Dir) !== 'DESC') {
$filter_order_Dir = 'ASC';
}
// ordering
if ($filter_order && $filter_order_Dir) {
$orderby = $filter_order . ' ' . $filter_order_Dir;
} else {
$orderby = array('l.venue ASC', 'l.ordering ASC');
}
$query->order($orderby);
return $query;
}
示例3: save
/**
* Method to save the form data.
*
* @param $data array
*/
public function save($data)
{
$date = JFactory::getDate();
$app = JFactory::getApplication();
$jinput = $app->input;
$user = JFactory::getUser();
$jemsettings = JEMHelper::config();
$settings = JemHelper::globalattribs();
$veditevent = JemHelper::viewSettings('veditevent');
$fileFilter = new JInput($_FILES);
$table = $this->getTable();
# Check if we're in the front or back
if ($app->isAdmin()) {
$backend = true;
} else {
$backend = false;
}
$cats = $data['cats'];
$data['author_ip'] = $jinput->getString('author_ip');
## Recurrence - check option ##
# if the option to hide the recurrence/other tab has been set (front) then
# we should ignore the recurrence variables.
$option_othertab = $veditevent->get('editevent_show_othertab');
if ($option_othertab) {
$hide_othertab = false;
} else {
$hide_othertab = true;
}
if ($backend || $hide_othertab == false) {
##############
## HOLIDAYS ##
##############
if (isset($data['activated'])) {
if ($data['activated'] == null) {
$holidays = array();
} else {
$holidays = $data['activated'];
}
} else {
$holidays = array();
}
$countryholiday = $jinput->getInt('recurrence_country_holidays', '');
################
## RECURRENCE ##
################
# check if a startdate has been set
if (isset($data['dates'])) {
if ($data['dates'] == null) {
$dateSet = false;
} else {
$dateSet = true;
}
} else {
$dateSet = false;
}
if (!isset($data['recurrence_freq'])) {
$data['recurrence_freq'] = 0;
}
# implode weekday values
# @todo implement check to see if days have been selected in case of freq week
if (isset($data['recurrence_weekday'])) {
$data['recurrence_weekday'] = implode(',', $data['recurrence_weekday']);
}
# blank recurrence-fields
#
# if we don't have a startdate or a recurrence-type then
# the recurrence-fields within the event-table will be blanked.
#
# but the recurrence_group field will stay filled as it's not removed by the user.
if (empty($data['dates']) || $data['recurrence_freq'] == '0') {
$data['recurrence_count'] = '';
$data['recurrence_freq'] = '';
$data['recurrence_interval'] = '';
$data['recurrence_until'] = '';
$data['recurrence_weekday'] = '';
$data['recurrence_exdates'] = '';
}
# the exdates are not stored in the event-table but they are trown in an variable
if (isset($data['recurrence_exdates'])) {
$exdates = $data['recurrence_exdates'];
} else {
$exdates = false;
}
}
# parent-Save
if (parent::save($data)) {
// At this point we do have an id.
$pk = $this->getState($this->getName() . '.id');
if (isset($data['featured'])) {
$this->featured($pk, $data['featured']);
}
$checkAttachName = $jinput->post->get('attach-name', '', 'array');
if ($checkAttachName) {
# attachments, new ones first
$attachments = array();
//.........这里部分代码省略.........