예제 #1
0
 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'] );
     }
 }
예제 #2
0
 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');
     }
 }
예제 #3
0
 public static function loadJEventsViewLang()
 {
     $jEventsView = JEV_CommonFunctions::getJEventsViewName();
     $lang = JFactory::getLanguage();
     $lang->load(JEV_COM_COMPONENT . "_" . $jEventsView);
     $lang->load("files_jevents" . $jEventsView . "layout");
 }
예제 #4
0
 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');
     }
 }
예제 #5
0
 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'] );
     }
 }
예제 #6
0
파일: helper.php 프로젝트: madcsaba/li-de
 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;
     }
 }
예제 #7
0
 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;
     }
 }
예제 #8
0
파일: admin.php 프로젝트: poorgeek/JEvents
 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();
 }
예제 #9
0
 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'] );
     }
 }
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'/>";
}
예제 #11
0
파일: cat.php 프로젝트: madcsaba/li-de
 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');
     }
 }
예제 #12
0
 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));
     }
 }
예제 #13
0
function DefaultEventsLegend($view)
{
    $cfg = JEVConfig::getInstance();
    if ($cfg->get('com_calShowLegend', 1) == 1) {
        $theme = JEV_CommonFunctions::getJEventsViewName();
        $modpath = JModuleHelper::getLayoutPath('mod_jevents_legend', $theme . '/' . "legend");
        if (!file_exists($modpath) || !file_exists(JPATH_SITE . '/modules/mod_jevents_legend/helper.php')) {
            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 JRegistry($module->params);
        $modview = new $viewclass($params, $module->id);
        echo $modview->displayCalendarLegend("block");
        echo "<br style='clear:both;height:0px;line-height:0px;'/>";
    } else {
        //Do nothing
    }
}
예제 #14
0
파일: day.php 프로젝트: madcsaba/li-de
 function listevents()
 {
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     $fixedDay = $params->get('fixedday', '');
     if ($fixedDay) {
         $year = date('Y', strtotime($fixedDay));
         $month = date('m', strtotime($fixedDay));
         $day = date('d', strtotime($fixedDay));
     } else {
         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 . '/' . "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("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
0
파일: jevent.php 프로젝트: madcsaba/li-de
 function detail()
 {
     $evid = JRequest::getInt("evid", 0);
     $pop = intval(JRequest::getVar('pop', 0));
     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 = "jevent";
     $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("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", "jevent");
     // 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');
     }
 }
예제 #16
0
require_once dirname(__FILE__) . '/' . 'helper.php';
$jevhelper = new modJeventsCalHelper();
JPluginHelper::importPlugin("jevents");
// record what is running - used by the filters
$registry = JRegistry::getInstance("jevents");
$registry->set("jevents.activeprocess", "mod_jevents_cal");
$registry->set("jevents.moduleid", $module->id);
$registry->set("jevents.moduleparams", $params);
// See http://www.php.net/manual/en/timezones.php
$compparams = JComponentHelper::getParams(JEV_COM_COMPONENT);
$tz = $compparams->get("icaltimezonelive", "");
if ($tz != "" && is_callable("date_default_timezone_set")) {
    $timezone = date_default_timezone_get();
    // echo "timezone is ".$timezone."<br/>";
    date_default_timezone_set($tz);
    $registry->set("jevents.timezone", $timezone);
}
$theme = JEV_CommonFunctions::getJEventsViewName();
$modtheme = $params->get("com_calViewName", $theme);
if ($modtheme == "global" || $modtheme == "") {
    $modtheme = $theme;
}
$theme = $modtheme;
$viewclass = $jevhelper->getViewClass($theme, 'mod_jevents_cal', $theme . '/' . "calendar", $params);
$modview = new $viewclass($params, $module->id);
$modview->jevlayout = $theme;
echo $modview->getCal();
// Must reset the timezone back!!
if ($tz && is_callable("date_default_timezone_set")) {
    date_default_timezone_set($timezone);
}
예제 #17
0
파일: icals.php 프로젝트: poorgeek/JEvents
 function importform()
 {
     // Can only do this if can add an event
     // Must be at least an event creator to edit or create events
     $is_event_editor = JEVHelper::isEventCreator();
     if (!$is_event_editor) {
         $user = JFactory::getUser();
         if ($user->id) {
             $this->setRedirect(JURI::root(), JText::_('JEV_NOTAUTH_CREATE_EVENT'));
             $this->redirect();
         } else {
             $comuser = version_compare(JVERSION, '1.6.0', '>=') ? "com_users" : "com_user";
             $this->setRedirect(JRoute::_("index.php?option={$comuser}&view=login"), JText::_('JEV_NOTAUTH_CREATE_EVENT'));
             $this->redirect();
         }
         return;
     }
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     if (!$params->get("feimport", 0)) {
         return;
     }
     $document = JFactory::getDocument();
     $viewType = $document->getType();
     $cfg = JEVConfig::getInstance();
     $theme = JEV_CommonFunctions::getJEventsViewName();
     $view = "icals";
     $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('importform');
     $this->view->assign("task", $this->_task);
     // get all the raw native calendars
     $nativeCals = $this->dataModel->queryModel->getNativeIcalendars();
     // Strip this list down based on user permissions
     $jevuser = JEVHelper::getAuthorisedUser();
     if ($jevuser && $jevuser->calendars != "" && $jevuser->calendars != "all") {
         $cals = array_keys($nativeCals);
         $allowedcals = explode("|", $jevuser->calendars);
         foreach ($cals as $calid) {
             if (!in_array($calid, $allowedcals)) {
                 unset($nativeCals[$calid]);
             }
         }
     }
     $excats = "0";
     if ($jevuser && $jevuser->categories != "" && $jevuser->categories != "all") {
         // Find which categories to exclude
         $db = JFactory::getDBO();
         $catsql = 'SELECT id  FROM #__categories WHERE id NOT IN (' . str_replace("|", ",", $jevuser->categories) . ') AND extension="com_jevents"';
         $db->setQuery($catsql);
         $excats = implode(",", $db->loadColumn());
     }
     // only offer a choice of native calendars if it exists!
     if (count($nativeCals) > 1) {
         $icalList = array();
         $icalList[] = JHTML::_('select.option', '0', JText::_('JEV_EVENT_CHOOSE_ICAL'), 'ics_id', 'label');
         $icalList = array_merge($icalList, $nativeCals);
         $clist = JHTML::_('select.genericlist', $icalList, 'icsid', " onchange='preselectCategory(this);'", 'ics_id', 'label', 0);
         $this->view->assign('clistChoice', true);
         $this->view->assign('defaultCat', 0);
     } else {
         if (count($nativeCals) == 0 || !is_array($nativeCals)) {
             JError::raiseWarning(870, JText::_('INVALID_CALENDAR_STRUCTURE'));
         }
         $icsid = current($nativeCals)->ics_id;
         $clist = '<input type="hidden" name="icsid" value="' . $icsid . '" />';
         $this->view->assign('clistChoice', false);
         $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
         if ($params->get("defaultcat", false)) {
             $this->view->assign('defaultCat', current($nativeCals)->catid);
         } else {
             $this->view->assign('defaultCat', 0);
         }
     }
     $this->view->assign('excats', $excats);
     $this->view->assign('nativeCals', $nativeCals);
     $this->view->assign('clist', $clist);
     // 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');
     }
 }
예제 #18
0
파일: modcal.php 프로젝트: poorgeek/JEvents
 function getViewName()
 {
     $cfg = JEVConfig::getInstance();
     $theme = JEV_CommonFunctions::getJEventsViewName();
     return $theme;
 }
예제 #19
0
 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, false);
         $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
     }
     // special case where loading a direct menu item to an event with nextrepeat specified
     /*
     * This is problematic since it will affect direct links to a specific repeat e.g. from latest events module on this menu item
     		$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     		$Itemid = JRequest::getInt("Itemid");
     		if ($params->get("nextrepeat", 0) && $Itemid>0 )
     		{
     			$menu = JFactory::getApplication()->getMenu();
     			$menuitem = $menu->getItem($Itemid);
     			if (!is_null($menuitem) && isset($menuitem->query["layout"]) && isset($menuitem->query["view"]) && isset($menuitem->query["rp_id"]))
     			{
     				// we put the xml file in the wrong folder - stupid.  Hard to move now!
     				if ($menuitem->query["view"] == "icalrepeat" || $menuitem->query["view"] == "icalevent") {
     					if (intval($menuitem->query["rp_id"]) == $evid ){
     						$this->datamodel  =  new JEventsDataModel();
     						$this->datamodel->setupComponentCatids();
     						list($year,$month,$day) = JEVHelper::getYMD();
     						$uid = urldecode((JRequest::getVar( 'uid', "" )));
     						$eventdata = $this->datamodel->getEventData( $evid, "icaldb", $year, $month, $day, $uid );
     						if ($eventdata && isset($eventdata["row"])){
     							$nextrepeat = $eventdata["row"]->getNextRepeat();
     							if ($nextrepeat){
     								//$evid = $nextrepeat->rp_id();
     							}
     						}
     					}
     				}
     			}			
     		}
     *
     */
     // 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 . '/' . "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("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();
     $joomlaconf = JFactory::getConfig();
     $useCache = intval($cfg->get('com_cache', 0)) && $joomlaconf->get('caching', 1);
     if ($user->get('id') || !$useCache) {
         $this->view->display();
     } else {
         $cache = JFactory::getCache(JEV_COM_COMPONENT, 'view');
         $cache->get($this->view, 'display');
     }
 }
예제 #20
0
 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, false);
         $this->setRedirect($link, JText::_('JEV_LOGIN_TO_VIEW_EVENT'));
         $this->redirect();
         return;
     }
     $evid = JRequest::getInt("rp_id", 0);
     if ($evid == 0) {
         $evid = JRequest::getInt("evid", 0);
         // if cancelling from save of copy and edit use the old event id
         if ($evid == 0) {
             $evid = JRequest::getInt("old_evid", 0);
         }
         // In this case I do not have a repeat id so I find the first one that matches
         $datamodel = new JEventsDataModel("JEventsAdminDBModel");
         $vevent = $datamodel->queryModel->getVEventById($evid);
         $event = new jIcalEventDB($vevent);
         //$repeat = $event->getFirstRepeat();
         $repeat = $event->getNextRepeat();
         if ($repeat) {
             $evid = $repeat->rp_id();
         }
     }
     $pop = intval(JRequest::getVar('pop', 0));
     $uid = urldecode(JRequest::getVar('uid', ""));
     list($year, $month, $day) = JEVHelper::getYMD();
     $Itemid = JEVHelper::getItemid();
     // seth month and year to be used by mini-calendar if needed
     if (isset($repeat)) {
         if (!JRequest::getVar("month", 0)) {
             JRequest::setVar("month", $repeat->mup());
         }
         if (!JRequest::getVar("year", 0)) {
             JRequest::setVar("year", $repeat->yup());
         }
     }
     $document = JFactory::getDocument();
     $viewType = $document->getType();
     $cfg = JEVConfig::getInstance();
     $theme = JEV_CommonFunctions::getJEventsViewName();
     $view = "icalevent";
     $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("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();
     $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');
     }
 }
예제 #21
0
 function rss($tpl = null)
 {
     $modid = intval(JRequest::getVar('modid', 0));
     if ($modid < 0) {
         $modid = 0;
     }
     $cfg =& JEVConfig::getInstance();
     $db =& JFactory::getDBO();
     // setup for all required function and classes
     $file = JPATH_SITE . '/components/com_jevents/mod.defines.php';
     include_once $file;
     // load language constants
     JEVHelper::loadLanguage('modlatest');
     // Check document type
     $doc =& JFactory::getDocument();
     if ($doc->getType() != 'feed') {
         JError::raiseError('E999', 'Fatal error, document type: "' . $doc->getType() . '" not supported.');
     }
     if ($modid > 0) {
         $user = JFactory::getUser();
         $query = "SELECT id, params" . "\n FROM #__modules AS m" . "\n WHERE m.published = 1" . "\n AND m.id = " . $modid . "\n AND m.access  " . (version_compare(JVERSION, '1.6.0', '>=') ? ' IN (' . JEVHelper::getAid($user, 'string') . ')' : ' <=  ' . JEVHelper::getAid($user)) . "\n AND m.client_id != 1";
         $db =& JFactory::getDBO();
         $db->setQuery($query);
         $modules = $db->loadObjectList();
         if (count($modules) <= 0) {
             // fake module parameter
             $params = new JParameter('');
         } else {
             $params = new JParameter($modules[0]->params);
         }
     } else {
         $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     }
     // parameter intialization
     $info['link'] = str_replace('&', '&amp;', JURI::root(true));
     $info['imagelink'] = str_replace('&', '&amp;', JURI::root());
     $info['base'] = str_replace('&', '&amp;', JURI::root());
     $info['cache'] = $cfg->get('com_rss_cache', 1);
     $info['cache_time'] = $cfg->get('com_rss_cache_time', 3600);
     $info['count'] = $cfg->get('com_rss_count', 5);
     $info['title'] = $cfg->get('com_rss_title', 'Powered by JEvents!');
     $info['description'] = $cfg->get('com_rss_description', 'JEvents Syndication for Joomla');
     // get rss title from module param if requested and defined
     $t_title = $params->get('modlatest_rss_title', null);
     if ($params->get('modlatest_useLocalParam', 0) == 1 && !empty($t_title)) {
         $info['title'] = $t_title;
     }
     // get rss description from module param if requested and defined
     $t_description = $params->get('modlatest_rss_description', null);
     if ($params->get('modlatest_useLocalParam', 0) == 1 && !empty($t_description)) {
         $info['description'] = $t_description;
     }
     $info['image_url'] = htmlspecialchars($cfg->get('com_rss_logo', JURI::root() . 'administrator/components/' . JEV_COM_COMPONENT . '/assets/images/logo.gif'));
     if ($info['image_url'] == "") {
         $info['image_url'] = htmlspecialchars(JURI::root() . 'administrator/components/' . JEV_COM_COMPONENT . '/assets/images/logo.gif');
     }
     $info['image_alt'] = $info['title'];
     $info['limit_text'] = $cfg->get('com_rss_limit_text', 1);
     $info['text_length'] = $cfg->get('com_rss_text_length', 20);
     // include the appropraite VIEW - this should be based on config and/or URL?
     $cfg =& JEVConfig::getInstance();
     $theme = JEV_CommonFunctions::getJEventsViewName();
     $viewclass = ucfirst($theme) . "ModLatestView";
     jimport('joomla.application.module.helper');
     require_once JModuleHelper::getLayoutPath('mod_jevents_latest', $theme . DS . "latest");
     $jeventCalObject = new $viewclass($params, $modid);
     $jeventCalObject->getLatestEventsData($info["count"]);
     $this->set("eventsByRelDay", $jeventCalObject->eventsByRelDay);
     $this->set("info", $info);
     $this->set("modparams", $params);
     $this->set("jeventCalObject", $jeventCalObject);
     parent::displaytemplate($tpl);
 }
예제 #22
0
    include_once JEV_LIBS . "/modfunctions.php";
} else {
    die("JEvents Layout Switcher\n<br />This module needs the JEvents component");
}
// record what is running - used by the filters
$registry = JRegistry::getInstance("jevents");
$registry->set("jevents.activeprocess", "mod_jevents_switchview");
$registry->set("jevents.moduleid", $module->id);
$registry->set("jevents.moduleparams", $params);
// load language constants
JEVHelper::loadLanguage('modswitchview');
// existing values
$cfg = JEVConfig::getInstance();
// priority of view setting is url, cookie, config,
$jEventsView = $cfg->get('com_calViewName', "default");
$cur_view = JEV_CommonFunctions::getJEventsViewName();
// paramaters
$preview_height = $params->get('preview_height', 90);
$preview_width = $params->get('preview_width', 140);
$show_preview = $params->get('show_preview', 1);
// get views names from template directory
$darray = array();
foreach (JEV_CommonFunctions::getJEventsViewList() as $viewfile) {
    $darray[] = JHTML::_('select.option', $viewfile, $viewfile);
}
sort($darray);
// Show the preview image
// Set up JavaScript for nd cookie based switching
$onchange = "";
if ($show_preview) {
    $onchange = "showimage();";
예제 #23
0
 function loadJEventsViewLang()
 {
     $jEventsView = JEV_CommonFunctions::getJEventsViewName();
     $lang =& JFactory::getLanguage();
     $lang->load(JEV_COM_COMPONENT . "_" . $jEventsView);
 }
예제 #24
0
 function getTheme()
 {
     $theme = JEV_CommonFunctions::getJEventsViewName();
     return $theme;
 }
예제 #25
0
파일: calendar.php 프로젝트: madcsaba/li-de
 function getTheme()
 {
     $modtheme = $this->modparams->get("com_calViewName", "flat");
     if ($modtheme == "" || $modtheme == "global") {
         $modtheme = JEV_CommonFunctions::getJEventsViewName();
     }
     return $modtheme;
 }