protected function getInput() { JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); $params = JComponentHelper::getParams("com_jevents"); $value = (int) $this->value; if ($value == -1) { if (version_compare(JVERSION, '3.0.0', "<")) { $default25 = (string) $this->element["default25"]; if ($default25 != "") { $this->value = $this->default = intval($default25); } } else { if (version_compare(JVERSION, '3.0.0', ">=")) { $default30 = (string) $this->element["default30"]; if ($default30 != "") { $this->value = $this->default = intval($default30); } } } } if (!$params->get("bootstrapchosen", 1)) { $x = 1; } return parent::getInput(); }
protected function getInput() { if (!JevJoomlaVersion::isCompatible("3.4")) { return ""; } JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); $layouttype = $this->getAttribute("layouttype"); $target = $this->getAttribute("target"); $csstarget = $this->getAttribute("csstarget"); JHtml::script("https://www.jevents.net/jevlayouts/LatestEvents.js"); $html = "<script>jQuery(document).ready(function (\$){loadJevPreview('{$target}', '{$csstarget}');});</script>"; $id = $this->id; $html .= <<<DROPDOWN <div class="dropdown btn-group" id="{$id}"> <button class="btn btn-default dropdown-toggle" type="button" id="dropdown{$target}" data-toggle="dropdown" aria-expanded="false"> Select Layout <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdown{$target}" id="dropdownUL_{$target}" role="menu"> <li role="presentation"><a role="menuitem" class="dropdownpopover" href="#" data-title="Current Customised Value" data-content="Custom Format String customised by you">Current Value</a></li> </ul> </div> DROPDOWN; return $html; }
function AlternativeBuildMonthSelect($view, $link, $month, $year) { for ($a = -6; $a < 6; $a++) { $m = $month + $a; $y = $year; if ($m <= 0) { $m += 12; $y -= 1; } if ($m > 12) { $m -= 12; $y += 1; } $name_of_month = JEVHelper::getMonthName($m) . " {$y}"; $monthslist[] = JHTML::_('select.option', "{$m}|{$y}", $name_of_month); } $link = str_replace(array("day.listevents", "week.listevents", "year.listevents", "cat.listevents", "icalrepeat.detail", "icalevent.detail"), "month.calendar", $link); $tosend = "<script type='text/javascript'>\n"; $tosend .= "/* <![CDATA[ */\n"; $tosend .= " function selectMD(elem) {\n var ym = elem.options[elem.selectedIndex].value.split('|');\n"; $link .= "day=1&month=MMMMmmmm&year=YYYYyyyy"; $link2 = JRoute::_($link, false); $tosend .= "var link = '{$link2}';\n"; // This is needed in case SEF is not activated $tosend .= "link = link.replace(/&/g,'&');\n"; $tosend .= "link = link.replace(/MMMMmmmm/g,ym[0]);\n"; $tosend .= "link = link.replace(/YYYYyyyy/g,ym[1]);\n"; $tosend .= "location.replace(link);\n"; $tosend .= "}\n"; $tosend .= "/* ]]> */\n"; $tosend .= "</script>\n"; $tosend .= JHTML::_('select.genericlist', $monthslist, 'monthyear', "onchange=\"selectMD(this);\"", 'value', 'text', "{$month}|{$year}"); $this->result = $tosend; }
function getAdjacentYear($year, $month, $day, $direction = 1) { $d1 = JevDate::mktime(0, 0, 0, $month, $day, $year + $direction); $day = JevDate::strftime("%d", $d1); $year = JevDate::strftime("%Y", $d1); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); $cfg = JEVConfig::getInstance(); if (method_exists("JEVHelper", "getMinYear")) { $earliestyear = JEVHelper::getMinYear(); $latestyear = JEVHelper::getMaxYear(); } else { $earliestyear = $params->get("com_earliestyear", 1970); $latestyear = $params->get("com_latestyear", 2150); } if ($year > $latestyear || $year < $earliestyear) { return false; } $month = JevDate::strftime("%m", $d1); $task = JRequest::getString('jevtask'); $Itemid = JEVHelper::getItemid(); if (isset($Itemid)) { $item = "&Itemid={$Itemid}"; } else { $item = ""; } return JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&task={$task}{$item}&year={$year}&month={$month}&day={$day}"); }
protected function getInput() { JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); if (class_exists("DateTimeZone")) { $zones = DateTimeZone::listIdentifiers(); static $options; if (!isset($options)) { $options = array(); $options[] = JHTML::_('select.option', '', '- ' . JText::_('SELECT_TIMEZONE') . ' -'); foreach ($zones as $zone) { if (strpos($zone, "/") === false && strpos($zone, "UTC") === false) { continue; } if (strpos($zone, "Etc") === 0) { continue; } $options[] = JHTML::_('select.option', $zone, $zone); } } return JHTML::_('select.genericlist', $options, $this->name, 'class="inputbox"', 'value', 'text', $this->value, $this->id); } else { /* * Required to avoid a cycle of encoding & * html_entity_decode was used in place of htmlspecialchars_decode because * htmlspecialchars_decode is not compatible with PHP 4 */ $value = htmlspecialchars(html_entity_decode($value, ENT_QUOTES), ENT_QUOTES); return '<input type="text" name="' . $this->name . '" id="' . $this->id . '" value="' . $this->value . '" />'; } }
function __construct($event, $datamodel, $view = false) { $cfg = JEVConfig::getInstance(); $this->event = $event; $this->_datamodel = $datamodel; $this->_view = $view; $this->start_publish = $this->event->getUnixStartDate(); $this->stop_publish = $this->event->getUnixEndDate(); $this->title = $this->event->title(); // On mouse over date formats $this->start_date = JEventsHTML::getDateFormat($this->event->yup(), $this->event->mup(), $this->event->dup(), 0); //$this->start_time = $this->event->startTime() ; $this->start_time = JEVHelper::getTime($this->event->getUnixStartTime(), $this->event->hup(), $this->event->minup()); $this->stop_date = JEventsHTML::getDateFormat($this->event->ydn(), $this->event->mdn(), $this->event->ddn(), 0); //$this->stop_time = $this->event->endTime() ; $this->stop_time = JEVHelper::getTime($this->event->getUnixEndTime(), $this->event->hdn(), $this->event->mindn()); $this->stop_time_midnightFix = $this->stop_time; $this->stop_date_midnightFix = $this->stop_date; if ($this->event->sdn() == 59 && $this->event->mindn() == 59) { $this->stop_time_midnightFix = JEVHelper::getTime($this->event->getUnixEndTime() + 1, 0, 0); $this->stop_date_midnightFix = JEventsHTML::getDateFormat($this->event->ydn(), $this->event->mdn(), $this->event->ddn() + 1, 0); } // we only need the one helper so stick to default layout here! $this->jevlayout = "default"; $this->addHelperPath(JEV_VIEWS . "/default/helpers"); $this->addHelperPath(JPATH_BASE . '/' . 'templates' . '/' . JFactory::getApplication()->getTemplate() . '/' . 'html' . '/' . JEV_COM_COMPONENT . '/' . "helpers"); // attach data model $reg = JevRegistry::getInstance("jevents"); $this->datamodel = $reg->getReference("jevents.datamodel"); }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { ob_start(); $event = $this->form->jevdata[$this->name]["event"]; $eventfield = $this->name == "publish_up" ? "startDate" : "endDate"; $params = JComponentHelper::getParams(JEV_COM_COMPONENT); $minyear = JEVHelper::getMinYear(); $maxyear = JEVHelper::getMaxYear(); $inputdateformat = $params->get("com_editdateformat", "d.m.Y"); static $firsttime; if (!defined($firsttime)) { $document = JFactory::getDocument(); $js = "\neventEditDateFormat='{$inputdateformat}';//Date.defineParser(eventEditDateFormat.replace('d','%d').replace('m','%m').replace('Y','%Y'));"; $document->addScriptDeclaration($js); $firsttime = false; } $cal = JEVHelper::loadCalendar($this->name, $this->name, $event->{$eventfield}(), $minyear, $maxyear, 'var elem =jevjq(this);' . $this->element['onhidestart'], "var elem = jevjq(this);" . $this->element['onchange'], $inputdateformat); echo $cal; ?> <input type="hidden" name="<?php echo $this->name; ?> 2" id="<?php echo $this->name; ?> 2" value="" /> <?php $html = ob_get_clean(); JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); return $html; }
function edit($tpl = null) { $document = JFactory::getDocument(); include JEV_ADMINLIBS . "editStrings.php"; $document->addScriptDeclaration($editStrings); JEVHelper::script('editicalJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/'); JEVHelper::script('view_detailJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/'); JEVHelper::script('JevStdRequiredFieldsJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/'); $document->setTitle(JText::_('EDIT_ICAL_REPEAT')); // Set toolbar items for the page JToolBarHelper::title(JText::_('EDIT_ICAL_REPEAT'), 'jevents'); JToolBarHelper::apply('icalrepeat.apply', "JEV_SAVE"); JToolBarHelper::apply('icalrepeat.save', "JEV_SAVE_CLOSE"); // We will need this when we offer to change one or more repeats on save! //$this->addSaveToolBarButton(); JToolBarHelper::cancel('icalrepeat.list'); //JToolBarHelper::help( 'screen.icalrepeat.edit', true); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); //$section = $params->get("section",0); JHTML::_('behavior.tooltip'); // load Joomla javascript classes JHTML::_('behavior.core'); $this->setLayout("edit"); $this->setupEditForm(); }
function DefaultViewDatecellAddEvent($view, $year, $month, $day) { if (JEVHelper::isEventCreator()) { JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . "/assets/js/"); // no events on Saturday or Sunday! //if (date("N",mktime(0,0,0,$month,$day, $year))>5) return; $editLink = JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=icalevent.edit' . '&year=' . $year . '&month=' . $month . '&day=' . $day . '&Itemid=' . $view->Itemid, true); $eventlinkadd = $view->popup ? "javascript:jevEditPopup('" . $editLink . "',{$view->popupw}, {$view->popuph});" : $editLink; $transparentGif = JURI::root() . "components/" . JEV_COM_COMPONENT . "/views/" . $view->getViewName() . "/assets/images/transp.gif"; ?> <a href="<?php echo $eventlinkadd; ?> " title="<?php echo JText::_('JEV_ADDEVENT'); ?> " class="addjevent"> <img src="<?php echo $transparentGif; ?> " alt="<?php echo JText::_('JEV_ADDEVENT'); ?> "/> </a> <?php } }
protected function getLabel() { if (JFactory::getApplication()->isAdmin() || JEVHelper::isEventPublisher()) { return parent::getLabel(); } return ""; }
function detail($tpl = null) { JEVHelper::componentStylesheet($this); $document = JFactory::getDocument(); // TODO do this properly //$document->setTitle(JText::_( 'BROWSER_TITLE' )); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); //$this->assign("introduction", $params->get("intro","")); $this->data = $this->datamodel->getEventData($this->evid, $this->jevtype, $this->year, $this->month, $this->day); // Dynamic pathway if (isset($this->data['row'])) { $pathway = JFactory::getApplication()->getPathway(); $pathway->addItem($this->data['row']->title(), ""); // Set date in view for use in navigation icons $this->year = $this->data['row']->yup(); $this->month = $this->data['row']->mup(); $this->day = $this->data['row']->dup(); // seth month and year to be used by mini-calendar if needed if (!JRequest::getVar("month", 0)) { JRequest::setVar("month", $this->month); } if (!JRequest::getVar("year", 0)) { JRequest::setVar("year", $this->year); } } }
function edit() { JEVHelper::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/'); $document =& JFactory::getDocument(); $document->setTitle(JText::_('COM_JEVENTS_CONFIGURATION')); // Set toolbar items for the page JToolBarHelper::title(JText::_('COM_JEVENTS_CONFIGURATION'), 'jevents'); //APPLY BUTTON BY PRAKASH. JToolBarHelper::apply('params.apply'); //APPLY BUTTON JToolBarHelper::save('params.save'); JToolBarHelper::cancel('cpanel.cpanel'); $model = $this->getModel(); $this->params =& $model->getParams(); $component = JComponentHelper::getComponent(JEV_COM_COMPONENT); JHTML::_('behavior.tooltip'); if (JVersion::isCompatible("1.6.0")) { // Get the actions for the asset. $actions = JAccess::getActions(JEV_COM_COMPONENT, "component"); jimport('joomla.form.form'); // Add the search path for the admin component config.xml file. JForm::addFormPath(JPATH_ADMINISTRATOR . '/components/' . JEV_COM_COMPONENT); // Get the form. $modelForm = $model->getForm(); $this->assignRef("form", $modelForm); } }
function edit($tpl = null) { $document = JFactory::getDocument(); include JEV_ADMINLIBS . "editStrings.php"; $document->addScriptDeclaration($editStrings); JEVHelper::script('editical.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/'); JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/'); JEVHelper::script('JevStdRequiredFields.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/'); $document->setTitle(JText::_('EDIT_ICAL_REPEAT')); // Set toolbar items for the page JToolBarHelper::title(JText::_('EDIT_ICAL_REPEAT'), 'jevents'); JToolBarHelper::apply('icalrepeat.apply', "JEV_SAVE"); $this->addSaveToolBarButton(); //$this->addCancelToolBarButton(); JToolBarHelper::cancel('icalrepeat.list'); //JToolBarHelper::help( 'screen.icalrepeat.edit', true); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); //$section = $params->get("section",0); JHTML::_('behavior.tooltip'); if (JevJoomlaVersion::isCompatible("3.0")) { $this->setLayout("edit"); } else { $this->setLayout("edit16"); } $this->setupEditForm(); }
function _adminStart() { $dispatcher = JEventDispatcher::getInstance(); list($this->year, $this->month, $this->day) = JEVHelper::getYMD(); $this->Itemid = JEVHelper::getItemid(); $this->datamodel = new JEventsDataModel(); $dispatcher->trigger('onJEventsHeader', array($this)); ?> <div style="clear:both" <?php $mainframe = JFactory::getApplication(); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); echo !JFactory::getApplication()->isAdmin() && $params->get("darktemplate", 0) ? "class='jeventsdark'" : "class='jeventslight'"; ?> > <div id="toolbar-box" > <?php $bar = JToolBar::getInstance('toolbar'); $barhtml = $bar->render(); //$barhtml = str_replace('href="#"','href="javascript void();"',$barhtml); //$barhtml = str_replace('submitbutton','return submitbutton',$barhtml); echo $barhtml; if (JevJoomlaVersion::isCompatible("3.0")) { // JFactory::getApplication()->JComponentTitle; $title = ""; } else { $title = JFactory::getApplication()->get('JComponentTitle'); } echo $title; ?> </div> <?php $dispatcher = JEventDispatcher::getInstance(); $dispatcher->trigger('onJEventsFooter', array($this)); }
function DefaultViewHelperFooter16($view) { if (JRequest::getInt('pop', 0)) { ?> <div class="ev_noprint"><p align="center"> <a href="#close" onclick="if (window.parent==window){self.close();} else {try {window.parent.jQuery('#myEditModal').modal('hide');}catch (e){}try {window.parent.SqueezeBox.close(); return false;} catch(e) {self.close();return false;}}" title="<?php echo JText::_('JEV_CLOSE'); ?> "><?php echo JText::_('JEV_CLOSE'); ?> </a> </p></div> <?php } $view->loadHelper("JevViewCopyright"); JevViewCopyright(); ?> </div> </div> <!-- close #jevents //--> <?php $dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onJEventsFooter'); $task = JRequest::getString("jevtask"); $view->loadModules("jevpostjevents"); $view->loadModules("jevpostjevents_" . $task); JEVHelper::componentStylesheet($view, "extra.css"); jimport('joomla.filesystem.file'); // Lets check if we have editted before! if not... rename the custom file. if (JFile::exists(JPATH_SITE . "/components/com_jevents/assets/css/jevcustom.css")) { // It is definitely now created, lets load it! JEVHelper::stylesheet('jevcustom.css', 'components/' . JEV_COM_COMPONENT . '/assets/css/'); } }
/** * Method to load the Chosen JavaScript framework and supporting CSS into the document head * * If debugging mode is on an uncompressed version of Chosen is included for easier debugging. * * @param string $selector Class for Chosen elements. * @param mixed $debug Is debugging mode on? [optional] * @param array $options the possible Chosen options as name => value [optional] * * @return void * * @since 3.0 */ public static function chosen($selector = '.advancedSelect', $debug = null, $options = array()) { if (isset(static::$loaded[__METHOD__][$selector])) { return; } // Include jQuery //JHtml::_('jquery.framework'); // If no debugging value is set, use the configuration setting if ($debug === null) { $config = JFactory::getConfig(); $debug = (bool) $config->get('debug'); } // Default settings $options['disable_search_threshold'] = isset($options['disable_search_threshold']) ? $options['disable_search_threshold'] : 10; $options['allow_single_deselect'] = isset($options['allow_single_deselect']) ? $options['allow_single_deselect'] : true; $options['placeholder_text_multiple'] = isset($options['placeholder_text_multiple']) ? $options['placeholder_text_multiple'] : JText::_('JGLOBAL_SELECT_SOME_OPTIONS'); $options['placeholder_text_single'] = isset($options['placeholder_text_single']) ? $options['placeholder_text_single'] : JText::_('JGLOBAL_SELECT_AN_OPTION'); $options['no_results_text'] = isset($options['no_results_text']) ? $options['no_results_text'] : JText::_('JGLOBAL_SELECT_NO_RESULTS_MATCH'); // Options array to json options string $options_str = json_encode($options, $debug && defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : false); JEVHelper::script("components/com_jevents/assets/js/chosen.jquery.js"); JHTML::stylesheet("components/com_jevents/assets/css/chosen.css"); //JHtml::_('script', 'jui/chosen.jquery.min.js', false, true, false, false, $debug); //JHtml::_('stylesheet', 'jui/chosen.css', false, true); JFactory::getDocument()->addScriptDeclaration("\n\t\t\t\tjQuery(document).ready(function (){\n\t\t\t\t\tjQuery('" . $selector . "').chosen(" . $options_str . ");\n\t\t\t\t});\n\t\t\t"); static::$loaded[__METHOD__][$selector] = true; return; }
function edit($tpl = null) { $document =& JFactory::getDocument(); include JEV_LIBS . "editStrings.php"; $document->addScriptDeclaration($editStrings); // WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!! if (JVersion::isCompatible("1.6.0")) { JEVHelper::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/'); } else { JEVHelper::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/'); } JEVHelper::script('editical.js', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/js/'); JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/'); $document->setTitle(JText::_('EDIT_ICAL_REPEAT')); // Set toolbar items for the page JToolBarHelper::title(JText::_('EDIT_ICAL_REPEAT'), 'jevents'); $this->addSaveToolBarButton(); JToolBarHelper::apply('icalrepeat.apply', "Apply"); //$this->addCancelToolBarButton(); JToolBarHelper::cancel('icalrepeat.list'); //JToolBarHelper::help( 'screen.icalrepeat.edit', true); $this->_hideSubmenu(); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); //$section = $params->getValue("section",0); JHTML::_('behavior.tooltip'); }
function __construct($config = null) { parent::__construct($config); $this->jevlayout = "flat"; $this->addHelperPath(dirname(__FILE__) . "/../helpers/"); $this->addHelperPath(JPATH_BASE . '/' . 'templates' . '/' . JFactory::getApplication()->getTemplate() . '/' . 'html' . '/' . JEV_COM_COMPONENT . '/' . "helpers"); $document = JFactory::getDocument(); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); if ($params->get("flatscalable", "1") == "1" || $params->get("flatwidth", 905) == "scalable") { jimport('joomla.environment.browser'); $browser = JBrowser::getInstance(); $browserType = $browser->getBrowser(); $browserVersion = $browser->getMajor(); if ($browserType == 'msie' && $browserVersion < 9) { JEVHelper::componentStylesheet($this, "scalable_ie8.css"); } else { JEVHelper::componentStylesheet($this, "scalable.css"); } JEVHelper::componentStylesheet($this); } else { JEVHelper::componentStylesheet($this); JEVHelper::componentStylesheet($this, "w" . $params->get("flatwidth", 905) . ".css"); } if ($params->get("darktemplate", 0)) { JEVHelper::componentStylesheet($this, "dark.css"); } $stylelink = '<!--[if lte IE 6]>' . "\n"; $stylelink .= '<link rel="stylesheet" href="' . JURI::root() . 'components/com_jevents/views/flat/assets/css/ie6.css" />' . "\n"; $stylelink .= '<![endif]-->' . "\n"; $document->addCustomTag($stylelink); $this->colourscheme = $params->get("flatcolourscheme", "red"); if ($this->colourscheme == "gray") { //$this->colourscheme = ""; } }
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'); } }
function fetchElement($name, $value, &$node, $control_name) { // Must load admin language files $lang = JFactory::getLanguage(); $lang->load("com_jevents", JPATH_ADMINISTRATOR); $help = $node->attributes('help'); // RSH 10/5/10 Added this for J!1.6 - $help is now an JXMLElement if (!is_null($help) && version_compare(JVERSION, '1.6.0', ">=")) { if (is_object($help)) { $help = $help->data(); } $help = isset($help) && strlen($help) <= 0 ? null : $help; } if (!is_null($help)) { $parts = explode(",", $value); $helps = explode(",", $help); foreach ($parts as $key => $valuepart) { $help = $helps[$key]; list($helpfile, $varname, $part) = explode("::", $help); JEVHelper::loadOverlib(); $lang = JFactory::getLanguage(); $langtag = $lang->getTag(); if (file_exists(JPATH_COMPONENT_ADMINISTRATOR . '/help/' . $langtag . '/' . $helpfile)) { $jeventHelpPopup = JPATH_COMPONENT_ADMINISTRATOR . '/help/' . $langtag . '/' . $helpfile; } else { $jeventHelpPopup = JPATH_COMPONENT_ADMINISTRATOR . '/help/en-GB/' . $helpfile; } include $jeventHelpPopup; $help = $this->help(${$varname}, $part); $parts[$key] = JText::_($valuepart) . $help; } $value = implode(", ", $parts); } return "<strong style='color:#993300'>" . JText::_($value) . "</strong>"; }
protected function getInput() { JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); $input = parent::getInput(); return $input; }
function _createFilter($prefix = "") { if (!$this->filterField) { return "ev.state=1"; } // The default is only to show published events if ($this->filter_value == 0) { return "ev.state=1"; } // only show published events to non-logged in users $user = JFactory::getUser(); if ($user->get('id') == 0) { return "ev.state=1"; } if (JEVHelper::isEventPublisher(true) || JEVHelper::isEventEditor()) { if ($this->filter_value == -1) { return ""; } return "ev.state=0"; } else { if (JEVHelper::isEventCreator()) { $user = JFactory::getUser(); if ($this->filter_value == -1) { return "(ev.state=1 OR ev.created_by=" . $user->id . ")"; } return "ev.state=0 && ev.created_by=" . $user->id; } } return "ev.state=1"; }
function overview($tpl = null) { $this->state = $this->get('State'); $this->items = $this->get('Items'); $this->pagination = $this->get('Pagination'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseError(500, implode("\n", $errors)); return false; } // WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!! JEVHelper::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/'); $document =& JFactory::getDocument(); $document->setTitle(JText::_('CATEGORIES')); // Set toolbar items for the page JToolBarHelper::title(JText::_('CATEGORIES'), 'jevents'); JToolBarHelper::publishList('categories.publish'); JToolBarHelper::unpublishList('categories.unpublish'); JToolBarHelper::addNew('categories.add'); JToolBarHelper::editList('categories.edit'); JToolBarHelper::deleteList("delete category", 'categories.delete'); JToolBarHelper::spacer(); JToolBarHelper::custom('cpanel.cpanel', 'default.png', 'default.png', 'JEV_ADMIN_CPANEL', false); //JToolBarHelper::help( 'screen.categories', true); JSubMenuHelper::addEntry(JText::_('CONTROL_PANEL'), 'index.php?option=' . JEV_COM_COMPONENT, true); JHTML::_('behavior.tooltip'); // Preprocess the list of items to find ordering divisions. // RSH 9/28/10 Added check for empty list - if no items were created. if (count($this->items) > 0) { foreach ($this->items as &$item) { $this->ordering[$item->parent_id][] = $item->id; } } }
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'] ); } }
protected function getInput() { $this->value = str_replace('<br />', "\n", strpos($this->value, " ") > 0 ? $this->value : JText::_($this->value)); JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); return parent::getInput(); }
protected function getInput() { JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); if ($this->fieldname == "rp_id") { // The active event id field. if (0 == (int) $this->value) { $value = ''; } else { $value = (int) $this->value; } return '<input type="text" id="selectedrepeat" name="' . $this->name . '" value="' . $value . '" />'; } // Load the modal behavior script. JevHtmlBootstrap::modal('a.modal'); $js = "\n\t\tfunction jSelectEvent_" . $this->id . "(link, title, Itemid, evid, rpid) {\n\t\t\t\$('selectedeventtitle').value = title;\n\t\t\t\$('selectedevent').value = evid;\n\t\t\t\$('selectedrepeat').value = rpid;\n\t\t\tSqueezeBox.close();\n\t\t\treturn false;\n\t\t}"; // Add the script to the document head. JFactory::getDocument()->addScriptDeclaration($js); // Setup variables for display. $html = array(); $link = 'index.php?option=com_jevents&task=icalevent.select&tmpl=component&' . JSession::getFormToken() . '=1&nomenu=1&function=jSelectEvent_' . $this->id; // get the repeat id $rpidfield = $this->form->getField("rp_id", "request"); $rp_id = $rpidfield->value; $db = JFactory::getDBO(); $db->setQuery('SELECT det.summary as title' . ' FROM #__jevents_vevdetail as det ' . ' LEFT JOIN #__jevents_repetition as rep ON rep.eventdetail_id = det.evdet_id' . ' WHERE rep.rp_id = ' . (int) $rp_id); $title = $db->loadResult(); echo $db->getErrorMsg(); if ($error = $db->getErrorMsg()) { JError::raiseWarning(500, $error); } if (empty($title)) { $title = JText::_('COM_JEVENTS_FIELD_SELECT_EVENT_LABEL'); } $title = htmlspecialchars($title, ENT_QUOTES, 'UTF-8'); // The current user display field. $html[] = '<div class="fltlft">'; $html[] = ' <input type="text" id="selectedeventtitle" value="' . $title . '" disabled="disabled" size="35" />'; $html[] = '</div>'; // The user select button. $html[] = '<div class="button2-left">'; $html[] = ' <div class="blank">'; $html[] = ' <a class="modal" title="' . JText::_('COM_JEVENTS_CHANGE_EVENT') . '" href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">' . JText::_('COM_JEVENTS_CHANGE_EVENT_BUTTON') . '</a>'; $html[] = ' </div>'; $html[] = '</div>'; // The active event id field. if (0 == (int) $this->value) { $value = ''; } else { $value = (int) $this->value; } // class='required' for client side validation $class = ''; if ($this->required) { $class = ' class="required modal-value"'; } $html[] = '<input type="hidden" id="selectedevent" ' . $class . ' name="' . $this->name . '" value="' . $value . '" />'; return implode("\n", $html); }
/** * Controler for the Control Panel * @param array configuration */ function __construct($config = array()) { parent::__construct($config); if (!JEVHelper::isAdminUser()) { JFactory::getApplication()->redirect("index.php?option=" . JEV_COM_COMPONENT . "&task=cpanel.cpanel", "Not Authorised - must be admin"); return; } $this->registerTask('list', 'overview'); $this->registerTask('new', 'edit'); $this->registerDefaultTask("overview"); // Make sure DB is up to date $db = JFactory::getDBO(); $db->setQuery("SELECT * FROM #__jev_defaults"); $defaults = $db->loadObjectList("name"); if (!isset($defaults['icalevent.detail_body'])) { $db->setQuery("INSERT INTO #__jev_defaults set name='icalevent.detail_body',\n\t\t\t\t\t\ttitle=" . $db->Quote(JText::_("JEV_EVENT_DETAIL_PAGE")) . ",\n\t\t\t\t\t\tsubject='',\n\t\t\t\t\t\tvalue='',\n\t\t\t\t\t\tstate=0"); $db->query(); } else { $db->setQuery("UPDATE #__jev_defaults set title=" . $db->Quote(JText::_("JEV_EVENT_DETAIL_PAGE")) . " WHERE name='icalevent.detail_body'"); $db->query(); } if (!isset($defaults['icalevent.list_row'])) { $db->setQuery("INSERT INTO #__jev_defaults set name='icalevent.list_row',\n\t\t\t\t\t\ttitle=" . $db->Quote(JText::_("JEV_EVENT_LIST_ROW")) . ",\n\t\t\t\t\t\tsubject='',\n\t\t\t\t\t\tvalue='',\n\t\t\t\t\t\tstate=0"); $db->query(); } else { $db->setQuery("UPDATE #__jev_defaults set title=" . $db->Quote(JText::_("JEV_EVENT_LIST_ROW")) . " WHERE name='icalevent.list_row'"); $db->query(); } if (!isset($defaults['month.calendar_cell'])) { $db->setQuery("INSERT INTO #__jev_defaults set name='month.calendar_cell',\n\t\t\t\t\t\ttitle=" . $db->Quote(JText::_("JEV_EVENT_MONTH_CALENDAR_CELL")) . ",\n\t\t\t\t\t\tsubject='',\n\t\t\t\t\t\tvalue='',\n\t\t\t\t\t\tstate=0"); $db->query(); } else { $db->setQuery("UPDATE #__jev_defaults set title=" . $db->Quote(JText::_("JEV_EVENT_MONTH_CALENDAR_CELL")) . " WHERE name='month.calendar_cell'"); $db->query(); } if (!isset($defaults['month.calendar_tip'])) { $db->setQuery("INSERT INTO #__jev_defaults set name='month.calendar_tip',\n\t\t\t\t\t\ttitle=" . $db->Quote(JText::_("JEV_EVENT_MONTH_CALENDAR_TIP")) . ",\n\t\t\t\t\t\tsubject='',\n\t\t\t\t\t\tvalue='',\n\t\t\t\t\t\tstate=0"); $db->query(); } else { $db->setQuery("UPDATE #__jev_defaults set title=" . $db->Quote(JText::_("JEV_EVENT_MONTH_CALENDAR_TIP")) . " WHERE name='month.calendar_tip'"); $db->query(); } /* * Edit Page config must wait for plugins to be updated! if (!isset($defaults['icalevent.edit_page'])){ $db->setQuery("INSERT INTO #__jev_defaults set name='icalevent.edit_page', title=".$db->Quote(JText::_("JEV_EVENT_EDIT_PAGE")).", subject='', value='', state=0"); $db->query(); } else { $db->setQuery("UPDATE #__jev_defaults set title=".$db->Quote(JText::_("JEV_EVENT_EDIT_PAGE"))." WHERE name='icalevent.edit_page'"); $db->query(); } */ }
function edit($tpl = null) { $document =& JFactory::getDocument(); // this already includes administrator $livesite = JURI::base(); if (JVersion::isCompatible("1.6.0")) { JEVHelper::stylesheet('eventsadmin16.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/'); } else { $document->addStyleSheet($livesite . 'components/' . JEV_COM_COMPONENT . '/assets/css/eventsadmin.css'); } $document->setTitle(JText::_('JEVENTS') . ' :: ' . JText::_('JEVENTS')); // Set toolbar items for the page JToolBarHelper::title(JText::_('JEV_EDIT_USER'), 'jevents'); JToolBarHelper::save("user.save"); JToolBarHelper::cancel("user.overview"); //JToolBarHelper::help( 'edit.user', true); $option = JRequest::getCmd('option', JEV_COM_COMPONENT); $db =& JFactory::getDBO(); $params =& JComponentHelper::getParams(JEV_COM_COMPONENT); if (JVersion::isCompatible("1.6.0")) { $rules = JAccess::getAssetRules("com_jevents", true); $creatorgroups = $rules->getData(); $creatorgroups = array_merge($creatorgroups["core.admin"]->getData(), $creatorgroups["core.create"]->getData()); $users = array(0); foreach ($creatorgroups as $creatorgroup => $permission) { if ($permission == 1) { $users = array_merge(JAccess::getUsersByGroup($creatorgroup, true), $users); } } $sql = "SELECT * FROM #__users where id IN (" . implode(",", array_values($users)) . ") ORDER BY name asc"; $db->setQuery($sql); $users = $db->loadObjectList(); } else { $minaccess = $params->getValue("jevcreator_level", 19); // get users AUTHORS and above $sql = "SELECT * FROM #__users where gid>=" . $minaccess; $db->setQuery($sql); $users = $db->loadObjectList(); } $userOptions[] = JHTML::_('select.option', '-1', 'Select User'); foreach ($users as $user) { $userOptions[] = JHTML::_('select.option', $user->id, $user->name . " ({$user->username})"); } $jevuser =& $this->get('user'); $userlist = JHTML::_('select.genericlist', $userOptions, 'user_id', 'class="inputbox" size="1" ', 'value', 'text', $jevuser->user_id); JLoader::register('JEventsCategory', JEV_ADMINPATH . "/libraries/categoryClass.php"); $categories = JEventsCategory::categoriesTree(); $lists['categories'] = JHTML::_('select.genericlist', $categories, 'categories[]', 'multiple="multiple" size="15"', 'value', 'text', explode("|", $jevuser->categories)); // get calendars $sql = "SELECT label as text, ics_id as value FROM #__jevents_icsfile where icaltype=2"; $db->setQuery($sql); $calendars = $db->loadObjectList(); $lists['calendars'] = JHTML::_('select.genericlist', $calendars, 'calendars[]', 'multiple="multiple" size="15"', 'value', 'text', explode("|", $jevuser->calendars)); $this->assignRef('lists', $lists); $this->assignRef("users", $userlist); $this->assignRef('jevuser', $jevuser); JHTML::_('behavior.tooltip'); }
protected function getInput() { if (is_string($this->value)) { $this->value = explode(",", $this->value); } JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); return parent::getInput(); }
function results($tpl = null) { JEVHelper::componentStylesheet($this); $document =& JFactory::getDocument(); // TODO do this properly //$document->setTitle(JText::_( 'BROWSER_TITLE' )); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); //$this->assign("introduction", $params->get("intro","")); }