本文整理汇总了PHP中JEV_CommonFunctions类的典型用法代码示例。如果您正苦于以下问题:PHP JEV_CommonFunctions类的具体用法?PHP JEV_CommonFunctions怎么用?PHP JEV_CommonFunctions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JEV_CommonFunctions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listevents
function listevents()
{
list($year, $month, $day) = JEVHelper::getYMD();
$Itemid = JEVHelper::getItemid();
// get the view
$document =& JFactory::getDocument();
$viewType = $document->getType();
$cfg =& JEVConfig::getInstance();
$theme = JEV_CommonFunctions::getJEventsViewName();
$view = "day";
$this->addViewPath($this->_basePath . DS . "views" . DS . $theme);
$this->view =& $this->getView($view, $viewType, $theme, array('base_path' => $this->_basePath, "template_path" => $this->_basePath . DS . "views" . DS . $theme . DS . $view . DS . 'tmpl', "name" => $theme . DS . $view));
// Set the layout
$this->view->setLayout('listevents');
$this->view->assign("Itemid", $Itemid);
$this->view->assign("month", $month);
$this->view->assign("day", $day);
$this->view->assign("year", $year);
$this->view->assign("task", $this->_task);
// View caching logic -- simple... are we logged in?
$cfg =& JEVConfig::getInstance();
$useCache = intval($cfg->get('com_cache', 0));
$user =& JFactory::getUser();
if ($user->get('id') || !$useCache) {
$this->view->display();
} else {
$cache =& JFactory::getCache(JEV_COM_COMPONENT, 'view');
$cache->get($this->view, 'display');
}
}
示例2: DefaultdateFormattedDateRange
function DefaultdateFormattedDateRange($view)
{
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
if ($params->get("daterangeformat", "") == "") {
$return = JEventsHTML::getDateFormat($view->startyear, $view->startmonth, $view->startday, 1) . " - " . JEventsHTML::getDateFormat($view->endyear, $view->endmonth, $view->endday, 1);
} else {
$return = $params->get("daterangeformat", "");
$startmatches = array();
preg_match_all('|{START(.*?)}|', $return, $startmatches);
if (count($startmatches) == 2 && count($startmatches[1]) == 1) {
$replace = str_replace(array("(", ")"), "", $startmatches[1][0]);
$datestp = JevDate::mktime(0, 0, 0, $view->startmonth, $view->startday, $view->startyear);
$replace = JEV_CommonFunctions::jev_strftime($replace, $datestp);
$return = str_replace($startmatches[0][0], $replace, $return);
}
$endmatches = array();
preg_match_all('|{END(.*?)}|', $return, $endmatches);
if (count($endmatches) == 2 && count($endmatches[1]) == 1) {
$replace = str_replace(array("(", ")"), "", $endmatches[1][0]);
$datestp = JevDate::mktime(0, 0, 0, $view->endmonth, $view->endday, $view->endyear);
$replace = JEV_CommonFunctions::jev_strftime($replace, $datestp);
$return = str_replace($endmatches[0][0], $replace, $return);
}
//$return = $params->get("daterangeformat", "");
}
return $return;
}
示例3: __construct
function __construct($config = null)
{
parent::__construct($config);
jimport('joomla.filesystem.file');
if (JevJoomlaVersion::isCompatible("3.0")) {
JEVHelper::stylesheet('eventsadmin.css', 'components/' . JEV_COM_COMPONENT . '/assets/css/');
} else {
JEVHelper::stylesheet('eventsadminjq.css', 'components/' . JEV_COM_COMPONENT . '/assets/css/');
}
$this->_addPath('template', $this->_basePath . '/' . 'views' . '/' . 'abstract' . '/' . 'tmpl');
// note that the name config variable is ignored in the parent construct!
if (JevJoomlaVersion::isCompatible("2.5")) {
// Ok getTemplate doesn't seem to get the active menu item's template, so lets do it ourselves if it exists
$app = JFactory::getApplication();
// Get current template style ID
$page_template_id = $app->isAdmin() ? "0" : @$app->getMenu()->getActive()->template_style_id;
// Check it's a valid style with simple check
if (!($page_template_id == "" || $page_template_id == "0")) {
// Load the valid style:
$db = JFactory::getDbo();
$query = $db->getQuery(true)->select('template')->from('#__template_styles')->where('id =' . $db->quote($page_template_id) . '');
$db->setQuery($query);
$template = $db->loadResult();
} else {
$template = JFactory::getApplication()->getTemplate();
}
$theme = JEV_CommonFunctions::getJEventsViewName();
$name = $this->getName();
$name = str_replace($theme . "/", "", $name);
$this->addTemplatePath(JPATH_BASE . '/' . 'templates' . '/' . $template . '/' . 'html' . '/' . JEV_COM_COMPONENT . '/' . $theme . '/' . $name);
// or could have used
//$this->addTemplatePath( JPATH_BASE.'/'.'templates'.'/'.JFactory::getApplication()->getTemplate().'/'.'html'.'/'.JEV_COM_COMPONENT.'/'.$config['name'] );
}
}
示例4: getOptions
public function getOptions()
{
// Must load admin language files
$lang = JFactory::getLanguage();
$lang->load("com_jevents", JPATH_ADMINISTRATOR);
$views = array();
include_once JPATH_ADMINISTRATOR . "/components/com_jevents/jevents.defines.php";
$exceptions_values = (string) $this->element['except'] ? (string) $this->element['except'] : "";
$exceptions = array();
$exceptions = explode(',', $exceptions_values);
foreach (JEV_CommonFunctions::getJEventsViewList((string) $this->element["viewtype"]) as $viewfile) {
if (in_array($viewfile, $exceptions)) {
continue;
}
$views[] = JHTML::_('select.option', $viewfile, $viewfile);
}
sort($views);
if ($this->menu != 'hide') {
$task = JRequest::getVar('task');
if ($task == "params.edit") {
unset($views['global']);
} else {
array_unshift($views, JHTML::_('select.option', 'global', JText::_('USE_GLOBAL')));
}
}
return $views;
}
示例5: detail
function detail()
{
// Do we have to be logged in to see this event
$user = JFactory::getUser();
if (JRequest::getInt("login", 0) && $user->id == 0) {
$uri = JURI::getInstance();
$link = $uri->toString();
$comuser = version_compare(JVERSION, '1.6.0', '>=') ? "com_users" : "com_user";
$link = 'index.php?option=' . $comuser . '&view=login&return=' . base64_encode($link);
$link = JRoute::_($link);
$this->setRedirect($link, JText::_('JEV_LOGIN_TO_VIEW_EVENT'));
return;
}
$evid = JRequest::getInt("rp_id", 0);
if ($evid == 0) {
$evid = JRequest::getInt("evid", 0);
// In this case I do not have a repeat id so I
}
// if cancelling from save of copy and edit use the old event id
if ($evid == 0) {
$evid = JRequest::getInt("old_evid", 0);
}
$pop = intval(JRequest::getVar('pop', 0));
list($year, $month, $day) = JEVHelper::getYMD();
$Itemid = JEVHelper::getItemid();
$uid = urldecode(JRequest::getVar('uid', ""));
$document =& JFactory::getDocument();
$viewType = $document->getType();
$cfg =& JEVConfig::getInstance();
$theme = JEV_CommonFunctions::getJEventsViewName();
$view = "icalevent";
$this->addViewPath($this->_basePath . DS . "views" . DS . $theme);
$this->view =& $this->getView($view, $viewType, $theme . "View", array('base_path' => $this->_basePath, "template_path" => $this->_basePath . DS . "views" . DS . $theme . DS . $view . DS . 'tmpl', "name" => $theme . DS . $view));
// Set the layout
$this->view->setLayout("detail");
$this->view->assign("Itemid", $Itemid);
$this->view->assign("month", $month);
$this->view->assign("day", $day);
$this->view->assign("year", $year);
$this->view->assign("task", $this->_task);
$this->view->assign("pop", $pop);
$this->view->assign("evid", $evid);
$this->view->assign("jevtype", "icaldb");
$this->view->assign("uid", $uid);
// View caching logic -- simple... are we logged in?
$cfg =& JEVConfig::getInstance();
$useCache = intval($cfg->get('com_cache', 0));
if ($user->get('id') || !$useCache) {
$this->view->display();
} else {
$cache =& JFactory::getCache(JEV_COM_COMPONENT, 'view');
$cache->get($this->view, 'display');
}
}
示例6: __construct
function __construct($config = null)
{
parent::__construct($config);
$this->_addPath('template', $this->_basePath . DS . 'views' . DS . 'abstract' . DS . 'tmpl');
// note that the name config variable is ignored in the parent construct!
if (JVersion::isCompatible("2.5")) {
$theme = JEV_CommonFunctions::getJEventsViewName();
$this->addTemplatePath(JPATH_BASE . DS . 'templates' . DS . JFactory::getApplication()->getTemplate() . DS . 'html' . DS . JEV_COM_COMPONENT . DS . $theme . DS . $this->getName());
// or could have used
//$this->addTemplatePath( JPATH_BASE.DS.'templates'.DS.JFactory::getApplication()->getTemplate().DS.'html'.DS.JEV_COM_COMPONENT.DS.$config['name'] );
}
}
示例7: getViewClass
function getViewClass($theme, $module, $layout, $params = false)
{
// If we have a specified over ride then use it here
if ($params && strlen($params->get("layout", "")) > 0) {
$speciallayout = strtolower($params->get("layout", ""));
// Build the template and base path for the layout
$tPath = JPATH_SITE . '/' . 'templates' . '/' . JFactory::getApplication()->getTemplate() . '/' . 'html' . '/' . $module . '/' . $theme . '/' . $speciallayout . '.php';
// If the template has a layout override use it
if (file_exists($tPath)) {
$viewclass = "Override" . ucfirst($theme) . "ModCalView" . ucfirst($speciallayout);
require_once $tPath;
if (class_exists($viewclass)) {
return $viewclass;
}
}
}
if ($layout == "" || $layout == "global") {
$layout = JEV_CommonFunctions::getJEventsViewName();
}
// Build the template and base path for the layout
$tPath = JPATH_SITE . '/' . 'templates' . '/' . JFactory::getApplication()->getTemplate() . '/' . 'html' . '/' . $module . '/' . $layout . '.php';
$bPath = JPATH_SITE . '/' . 'modules' . '/' . $module . '/' . 'tmpl' . '/' . $layout . '.php';
jimport('joomla.filesystem.file');
// If the template has a layout override use it
if (JFile::exists($tPath)) {
require_once $tPath;
$viewclass = "Override" . ucfirst($theme) . "ModCalView";
if (class_exists($viewclass)) {
return $viewclass;
} else {
// fall back to badly declared template override!
$viewclass = ucfirst($theme) . "ModCalView";
if (class_exists($viewclass)) {
return $viewclass;
}
}
}
if (JFile::exists($bPath)) {
require_once $bPath;
$viewclass = ucfirst($theme) . "ModCalView";
return $viewclass;
} else {
echo "<strong>" . JText::sprintf("JEV_PLEASE_REINSTALL_LAYOUT", $theme) . "</strong>";
$bPath = JPATH_SITE . '/' . 'modules' . '/' . $module . '/' . 'tmpl' . '/' . 'default' . '/' . 'calendar.php';
require_once $bPath;
$viewclass = "DefaultModCalView";
return $viewclass;
}
}
示例8: getOptions
public function getOptions()
{
// Must load admin language files
$lang =& JFactory::getLanguage();
$lang->load("com_jevents", JPATH_ADMINISTRATOR);
$views = array();
include_once JPATH_ADMINISTRATOR . "/components/com_jevents/jevents.defines.php";
foreach (JEV_CommonFunctions::getJEventsViewList() as $viewfile) {
$views[] = JHTML::_('select.option', $viewfile, $viewfile);
}
sort($views);
if ($this->menu != 'hide') {
array_unshift($views, JHTML::_('select.option', '', JText::_('USE_GLOBAL')));
}
return $views;
}
示例9: __construct
function __construct($config = array())
{
if (!isset($config['base_path'])) {
$config['base_path'] = JEV_PATH;
}
parent::__construct($config);
// TODO get this from config
$this->registerDefaultTask('calendar');
$cfg =& JEVConfig::getInstance();
$theme = ucfirst(JEV_CommonFunctions::getJEventsViewName());
JLoader::register('JEvents' . ucfirst($theme) . 'View', JEV_VIEWS . "/" . $theme . "/abstract/abstract.php");
include_once JEV_LIBS . "/modfunctions.php";
if (!isset($this->_basePath) && JVersion::isCompatible("1.6.0")) {
$this->_basePath = $this->basePath;
$this->_task = $this->task;
}
}
示例10: fetchElement
function fetchElement($name, $value, &$node, $control_name)
{
// Must load admin language files
$lang = JFactory::getLanguage();
$lang->load("com_jevents", JPATH_ADMINISTRATOR);
$views = array();
include_once JPATH_ADMINISTRATOR . "/components/com_jevents/jevents.defines.php";
foreach (JEV_CommonFunctions::getJEventsViewList() as $viewfile) {
$views[] = JHTML::_('select.option', $viewfile, $viewfile);
$load = $lang->load("com_jevents", JPATH_SITE . "/components/com_jevents/views/" . $viewfile . "/assets");
}
sort($views);
if ($node->attributes('menu') != 'hide') {
array_unshift($views, JHTML::_('select.option', '', JText::_('USE_GLOBAL')));
}
return JHTML::_('select.genericlist', $views, '' . $control_name . '[' . $name . ']', '', 'value', 'text', $value, $control_name . $name);
}
示例11: listevents
function listevents()
{
$is_event_editor = JEVHelper::isEventCreator();
$Itemid = JEVHelper::getItemid();
$user = JFactory::getUser();
if (!$is_event_editor) {
$returnlink = JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=month.calendar&Itemid=' . $Itemid, false);
$this->setRedirect($returnlink, html_entity_decode(JText::_('JEV_NOPERMISSION')));
$this->redirect();
return;
}
list($year, $month, $day) = JEVHelper::getYMD();
// Joomla unhelpfully switched limitstart to start when sef is enabled! includes/router.php line 390
$limitstart = intval(JRequest::getVar('start', JRequest::getVar('limitstart', 0)));
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
$limit = intval(JFactory::getApplication()->getUserStateFromRequest('jevlistlimit', 'limit', $params->get("com_calEventListRowsPpg", 15)));
$Itemid = JEVHelper::getItemid();
$task = $this->_task;
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
$adminuser = $params->get("jevadmin", -1);
if (JEVHelper::isAdminUser($user) || $user->id == $adminuser) {
$creator_id = 'ADMIN';
} else {
$creator_id = $user->id;
}
// get the view
$document = JFactory::getDocument();
$viewType = $document->getType();
$cfg = JEVConfig::getInstance();
$theme = JEV_CommonFunctions::getJEventsViewName();
$view = "admin";
$this->addViewPath($this->_basePath . '/' . "views" . '/' . $theme);
$this->view = $this->getView($view, $viewType, $theme . "View", array('base_path' => $this->_basePath, "template_path" => $this->_basePath . '/' . "views" . '/' . $theme . '/' . $view . '/' . 'tmpl', "name" => $theme . '/' . $view));
// Set the layout
$this->view->setLayout('listevents');
$this->view->assign("Itemid", $Itemid);
$this->view->assign("limitstart", $limitstart);
$this->view->assign("limit", $limit);
$this->view->assign("month", $month);
$this->view->assign("day", $day);
$this->view->assign("year", $year);
$this->view->assign("task", $task);
$this->view->assign("creator_id", $creator_id);
$this->view->display();
}
示例12: DefaultEventsLegend
function DefaultEventsLegend($view)
{
$cfg =& JEVConfig::getInstance();
$theme = JEV_CommonFunctions::getJEventsViewName();
$modpath = JModuleHelper::getLayoutPath('mod_jevents_legend', $theme . DS . "legend");
if (!file_exists($modpath)) {
return;
}
// load the helper class
require_once JPATH_SITE . '/modules/mod_jevents_legend/helper.php';
require_once $modpath;
$viewclass = ucfirst($theme) . "ModLegendView";
$module = JModuleHelper::getModule("mod_jevents_legend", false);
$params = new JParameter($module->params);
$modview = new $viewclass($params, $module->id);
echo $modview->displayCalendarLegend("block");
echo "<br style='clear:both'/>";
}
示例13: __construct
function __construct($config = null)
{
parent::__construct($config);
jimport('joomla.filesystem.file');
if (JevJoomlaVersion::isCompatible("3.0")) {
JEVHelper::stylesheet('eventsadmin.css', 'components/' . JEV_COM_COMPONENT . '/assets/css/');
} else {
JEVHelper::stylesheet('eventsadmin16.css', 'components/' . JEV_COM_COMPONENT . '/assets/css/');
}
$this->_addPath('template', $this->_basePath . '/' . 'views' . '/' . 'abstract' . '/' . 'tmpl');
// note that the name config variable is ignored in the parent construct!
if (JevJoomlaVersion::isCompatible("2.5")) {
$theme = JEV_CommonFunctions::getJEventsViewName();
$this->addTemplatePath(JPATH_BASE . '/' . 'templates' . '/' . JFactory::getApplication()->getTemplate() . '/' . 'html' . '/' . JEV_COM_COMPONENT . '/' . $theme . '/' . $this->getName());
// or could have used
//$this->addTemplatePath( JPATH_BASE.'/'.'templates'.'/'.JFactory::getApplication()->getTemplate().'/'.'html'.'/'.JEV_COM_COMPONENT.'/'.$config['name'] );
}
}
示例14: listevents
function listevents()
{
list($year, $month, $day) = JEVHelper::getYMD();
// Joomla unhelpfully switched limitstart to start when sef is enabled! includes/router.php line 390
$limitstart = intval(JRequest::getVar('start', JRequest::getVar('limitstart', 0)));
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
$limit = intval(JFactory::getApplication()->getUserStateFromRequest('jevlistlimit', 'limit', $params->get("com_calEventListRowsPpg", 15)));
// $catid = intval( JRequest::getVar( 'catid', 0 ) );
$catids = JRequest::getVar('catids', "");
$catids = explode("|", $catids);
$Itemid = JEVHelper::getItemid();
// get the view
$document = JFactory::getDocument();
$viewType = $document->getType();
$cfg = JEVConfig::getInstance();
$theme = JEV_CommonFunctions::getJEventsViewName();
$view = "cat";
$this->addViewPath($this->_basePath . '/' . "views" . '/' . $theme);
$this->view = $this->getView($view, $viewType, $theme . "View", array('base_path' => $this->_basePath, "template_path" => $this->_basePath . '/' . "views" . '/' . $theme . '/' . $view . '/' . 'tmpl', "name" => $theme . '/' . $view));
// Set the layout
$this->view->setLayout('listevents');
$this->view->assign("Itemid", $Itemid);
$this->view->assign("limitstart", $limitstart);
$this->view->assign("limit", $limit);
$this->view->assign("catids", $catids);
$this->view->assign("month", $month);
$this->view->assign("day", $day);
$this->view->assign("year", $year);
$this->view->assign("task", $this->_task);
// View caching logic -- simple... are we logged in?
$cfg = JEVConfig::getInstance();
$joomlaconf = JFactory::getConfig();
$useCache = intval($cfg->get('com_cache', 0)) && $joomlaconf->get('caching', 1);
$user = JFactory::getUser();
if ($user->get('id') || !$useCache) {
$this->view->display();
} else {
$cache = JFactory::getCache(JEV_COM_COMPONENT, 'view');
$cache->get($this->view, 'display');
}
}
示例15: results
function results()
{
list($year, $month, $day) = JEVHelper::getYMD();
$Itemid = JEVHelper::getItemid();
$db =& JFactory::getDBO();
$keyword = $db->getEscaped(JRequest::getVar('keyword', ''));
// Joomla unhelpfully switched limitstart to start when sef is enabled! includes/router.php line 390
$limitstart = intval(JRequest::getVar('start', JRequest::getVar('limitstart', 0)));
$params =& JComponentHelper::getParams(JEV_COM_COMPONENT);
$limit = intval(JFactory::getApplication()->getUserStateFromRequest('jevlistlimit', 'limit', $params->getValue("com_calEventListRowsPpg", 15)));
$document =& JFactory::getDocument();
$viewType = $document->getType();
$cfg =& JEVConfig::getInstance();
$theme = JEV_CommonFunctions::getJEventsViewName();
$view = "search";
$this->addViewPath($this->_basePath . DS . "views" . DS . $theme);
$this->view =& $this->getView($view, $viewType, $theme, array('base_path' => $this->_basePath, "template_path" => $this->_basePath . DS . "views" . DS . $theme . DS . $view . DS . 'tmpl', "name" => $theme . DS . $view));
// Set the layout
$this->view->setLayout('results');
$this->view->assign("Itemid", $Itemid);
$this->view->assign("month", $month);
$this->view->assign("day", $day);
$this->view->assign("year", $year);
$this->view->assign("task", $this->_task);
$this->view->assign("keyword", $keyword);
$this->view->assign("limit", $limit);
$this->view->assign("limitstart", $limitstart);
// View caching logic -- simple... are we logged in?
$cfg =& JEVConfig::getInstance();
$useCache = intval($cfg->get('com_cache', 0));
$user =& JFactory::getUser();
if ($user->get('id') || !$useCache) {
$this->view->display();
} else {
$cache =& JFactory::getCache(JEV_COM_COMPONENT, 'view');
$uri = JURI::getInstance();
$url = $uri->toString();
$cache->get($this->view, 'display', base64_encode($keyword . $Itemid . $limit . $limitstart . $month . $day . $year . $url));
}
}