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 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 dbsetup($tpl = null) { 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/'); } $document = JFactory::getDocument(); $document->setTitle(JText::_('DB_SETUP')); // Set toolbar items for the page JToolBarHelper::title(JText::_('DB_SETUP'), 'jevents'); JToolBarHelper::cancel('cpanel.cpanel'); JEventsHelper::addSubmenu(); }
/** * Configure the Linkbar. * * @param string The name of the active view. */ public static function addSubmenu($vName = "") { $task = JRequest::getCmd("task", "cpanel.cpanel"); $option = JRequest::getCmd("option", "com_categories"); if ($option == 'com_categories') { $doc = JFactory::getDocument(); if (!JevJoomlaVersion::isCompatible("3.0")) { $hide_options = '#toolbar-popup-options {' . 'display:none;' . '}'; } else { $hide_options = '#toolbar-options {' . 'display:none;' . '}'; } $doc->addStyleDeclaration($hide_options); } if ($vName == "") { $vName = $task; } // could be called from categories component JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); if (JevJoomlaVersion::isCompatible("3.0")) { JHtmlSidebar::addEntry(JText::_('CONTROL_PANEL'), 'index.php?option=com_jevents', $vName == 'cpanel.cpanel'); JHtmlSidebar::addEntry(JText::_('JEV_ADMIN_ICAL_EVENTS'), 'index.php?option=com_jevents&task=icalevent.list', $vName == 'icalevent.list'); if (JEVHelper::isAdminUser()) { JHtmlSidebar::addEntry(JText::_('JEV_ADMIN_ICAL_SUBSCRIPTIONS'), 'index.php?option=com_jevents&task=icals.list', $vName == 'icals.list'); } JHtmlSidebar::addEntry(JText::_('JEV_INSTAL_CATS'), "index.php?option=com_categories&extension=com_jevents", $vName == 'categories'); if (JEVHelper::isAdminUser()) { JHtmlSidebar::addEntry(JText::_('JEV_MANAGE_USERS'), 'index.php?option=com_jevents&task=user.list', $vName == 'user.list'); JHtmlSidebar::addEntry(JText::_('JEV_INSTAL_CONFIG'), 'index.php?option=com_jevents&task=params.edit', $vName == 'params.edit'); JHtmlSidebar::addEntry(JText::_('JEV_LAYOUT_DEFAULTS'), 'index.php?option=com_jevents&task=defaults.list', in_array($vName, array('defaults.list', 'defaults.overview'))); //Support & CSS Customs should only be for Admins really. JHtmlSidebar::addEntry(JText::_('SUPPORT_INFO'), 'index.php?option=com_jevents&task=cpanel.support', $vName == 'cpanel.support'); JHtmlSidebar::addEntry(JText::_('JEV_CUSTOM_CSS'), 'index.php?option=com_jevents&task=cpanel.custom_css', $vName == 'cpanel.custom_css'); } } else { JSubMenuHelper::addEntry(JText::_('CONTROL_PANEL'), 'index.php?option=com_jevents', $vName == 'cpanel.cpanel'); JSubMenuHelper::addEntry(JText::_('JEV_ADMIN_ICAL_EVENTS'), 'index.php?option=com_jevents&task=icalevent.list', $vName == 'icalevent.list'); if (JEVHelper::isAdminUser()) { JSubMenuHelper::addEntry(JText::_('JEV_ADMIN_ICAL_SUBSCRIPTIONS'), 'index.php?option=com_jevents&task=icals.list', $vName == 'icals.list'); } JSubMenuHelper::addEntry(JText::_('JEV_INSTAL_CATS'), "index.php?option=com_categories&extension=com_jevents", $vName == 'categories'); if (JEVHelper::isAdminUser()) { JSubMenuHelper::addEntry(JText::_('JEV_MANAGE_USERS'), 'index.php?option=com_jevents&task=user.list', $vName == 'user.list'); JSubMenuHelper::addEntry(JText::_('JEV_INSTAL_CONFIG'), 'index.php?option=com_jevents&task=params.edit', $vName == 'params.edit'); JSubMenuHelper::addEntry(JText::_('JEV_LAYOUT_DEFAULTS'), 'index.php?option=com_jevents&task=defaults.list', in_array($vName, array('defaults.list', 'defaults.overview'))); //Support & CSS customs should only be for Admins really. JSubMenuHelper::addEntry(JText::_('SUPPORT_INFO'), 'index.php?option=com_jevents&task=cpanel.support', $vName == 'cpanel.support'); JSubMenuHelper::addEntry(JText::_('JEV_CUSTOM_CSS'), 'index.php?option=com_jevents&task=cpanel.custom_css', $vName == 'cpanel.custom_css'); } } }
protected function getInput() { JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); if (!defined("JEV_COM_COMPONENT")) { define("JEV_COM_COMPONENT", "com_jevents"); define("JEV_COMPONENT", str_replace("com_", "", JEV_COM_COMPONENT)); } 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/'); } return parent::getInput(); }
/** * Constructor. * * @param string String in a format accepted by JevDate::strtotime(), defaults to "now". * @param mixed Time zone to be used for the date. * @return void * @since 1.5 * * @throws JException */ public function __construct($date = 'now', $tz = null) { // Create the base GMT and server time zone objects. if (empty(self::$gmt)) { //|| empty(self::$stz)) { self::$gmt = new DateTimeZone('GMT'); //self::$stz = new DateTimeZone(@date_default_timezone_get()); } // Must get this each time otherwise modules can't set their own timezone $compparams = JComponentHelper::getParams(JEV_COM_COMPONENT); $jtz = $compparams->get("icaltimezonelive", ""); if ($jtz != "") { self::$stz = new DateTimeZone($jtz); } else { self::$stz = new DateTimeZone(@date_default_timezone_get()); } $this->mytz = self::$stz; // If the time zone object is not set, attempt to build it. if (!$tz instanceof DateTimeZone) { if ($tz === null) { $tz = self::$gmt; } elseif (is_numeric($tz) && !JevJoomlaVersion::isCompatible("3.0")) { // Translate from offset. $tz = new DateTimeZone(self::$offsets[(string) $tz]); } elseif (is_numeric($tz)) { if (!isset($this->offsets)) { $this->offsets = array('-12' => 'Etc/GMT-12', '-11' => 'Pacific/Midway', '-10' => 'Pacific/Honolulu', '-9.5' => 'Pacific/Marquesas', '-9' => 'US/Alaska', '-8' => 'US/Pacific', '-7' => 'US/Mountain', '-6' => 'US/Central', '-5' => 'US/Eastern', '-4.5' => 'America/Caracas', '-4' => 'America/Barbados', '-3.5' => 'Canada/Newfoundland', '-3' => 'America/Buenos_Aires', '-2' => 'Atlantic/South_Georgia', '-1' => 'Atlantic/Azores', '0' => 'Europe/London', '1' => 'Europe/Amsterdam', '2' => 'Europe/Istanbul', '3' => 'Asia/Riyadh', '3.5' => 'Asia/Tehran', '4' => 'Asia/Muscat', '4.5' => 'Asia/Kabul', '5' => 'Asia/Karachi', '5.5' => 'Asia/Calcutta', '5.75' => 'Asia/Katmandu', '6' => 'Asia/Dhaka', '6.5' => 'Indian/Cocos', '7' => 'Asia/Bangkok', '8' => 'Australia/Perth', '8.75' => 'Australia/West', '9' => 'Asia/Tokyo', '9.5' => 'Australia/Adelaide', '10' => 'Australia/Brisbane', '10.5' => 'Australia/Lord_Howe', '11' => 'Pacific/Kosrae', '11.5' => 'Pacific/Norfolk', '12' => 'Pacific/Auckland', '12.75' => 'Pacific/Chatham', '13' => 'Pacific/Tongatapu', '14' => 'Pacific/Kiritimati'); } // Translate from offset. $tz = new DateTimeZone($this->offsets[(string) $tz]); } elseif (is_string($tz)) { $tz = new DateTimeZone($tz); } } // If the date is numeric assume a unix timestamp and convert it. date_default_timezone_set('UTC'); $date = is_numeric($date) ? date('c', $date) : $date; // fix potentiall bad date data if (strpos($date, ":") > 0 && strpos($date, "-") == false) { $date = str_replace(":", "", $date); } // Call the DateTime constructor parent::__construct($date, $tz); // reset the timezone !! date_default_timezone_set(self::$stz->getName()); // Set the timezone object for access later. $this->_tz = $tz; }
function overview($tpl = null) { $document = JFactory::getDocument(); $document->setTitle(JText::_('ICAL_EVENT_REPEATS')); // Set toolbar items for the page JToolBarHelper::title(JText::_('ICAL_EVENT_REPEATS'), 'jevents'); JToolBarHelper::editList('icalrepeat.edit'); JToolBarHelper::deleteList('Delete this repeat?', 'icalrepeat.delete'); JToolBarHelper::cancel('icalevent.list'); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); JEventsHelper::addSubmenu(); JHTML::_('behavior.tooltip'); if (JevJoomlaVersion::isCompatible("3.0")) { $this->sidebar = JHtmlSidebar::render(); } }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { ob_start(); $offerlock = $this->form->jevdata[$this->name]["offerlock"]; $btngroup = JevJoomlaVersion::isCompatible("3.0") ? "btn-group" : ""; $btn = JevJoomlaVersion::isCompatible("3.0") ? "btn" : ""; if ($offerlock) { ?> <div class="radio <?php echo $btngroup; ?> "> <label class="radio <?php echo $btn; ?> " for="lockevent1"> <?php echo JText::_("JEV_YES"); ?> <input type="radio" name="lockevent" id="lockevent1" value="1" <?php echo $this->value ? "checked='checked'" : ""; ?> /> </label> <label class="radio <?php echo $btn; ?> " for="lockevent0"> <?php echo JText::_("JEV_NO"); ?> <input type="radio" name="lockevent" id="lockevent0" value="0" <?php echo !$this->value ? "checked='checked'" : ""; ?> /> </label> </div> <?php } $input = ob_get_clean(); return $input; }
function rss() { JRequest::setVar("tmpl", "component"); // get the view $this->view = $this->getView("modlatest", "feed"); // Set the layout $this->view->setLayout('rss'); // 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(); // Stupid Joomla 3.1 problem where its not possible to use the view cache on RSS feed output! if (JevJoomlaVersion::isCompatible("3.1") || $user->get('id') || !$useCache) { $this->view->rss(); } else { $cache = JFactory::getCache(JEV_COM_COMPONENT, 'view'); $cache->get($this->view, 'rss'); } }
/** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { // Initialize variables. $html = array(); $attr = ''; // Initialize some field attributes. $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : ''; $attr .= (string) $this->element['disabled'] == 'true' ? ' disabled="disabled"' : ''; $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : ''; // Initialize JavaScript field attributes. $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : ''; $html[] = '<input type="text" name="' . $this->name . '" value="' . $this->value . '" id="pick1064797275field"/><br/>'; $html[] = '<div class="clr"></div>'; $html[] = '<iframe id="fred" frameborder="" src="' . JURI::root() . "components/com_jevents/libraries/colours.html?id=fred&j16=1" . '" class="jev_colour_picker_i" ></iframe>'; $conditionparam = $this->form->getName() != "com_config.component" ? '_params' : ''; $html[] = '<div class="clr" id="jform' . $conditionparam . '_jevcolourpicker"></div>'; //$html[] = '<div class="clr"></div>'; // add script to auto open the basic options tab! $doc = JFactory::getDocument(); $script = <<<SCRIPT window.addEvent('load', function() { \tvar basicoptions = document.getElement('#basic-options') \tif (basicoptions && !basicoptions.hasClass('pane-toggler-down')) { \t basicoptions.fireEvent('click', basicoptions, 1000); \t}; }); SCRIPT; $doc->addScriptDeclaration($script); JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); JEVHelper::ConditionalFields($this->element, $this->form->getName()); 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/'); } return implode($html); }
} ?> <div id="jevents"> <?php $file = 'jevcustom.css'; $srcfile = 'jevcustom.css.new'; $filepath = JPATH_ROOT . '/components/com_jevents/assets/css/' . $file; $srcfilepath = JPATH_ROOT . '/components/com_jevents/assets/css/' . $srcfile; if (!JFile::exists($filepath)) { $filepath = $srcfilepath; } $content = ''; $html = ''; ob_start(); $content = JFile::read($filepath); $btnclass = JevJoomlaVersion::isCompatible("3.0") ? "btn btn-success" : ""; $mainspan = 10; $fullspan = 12; ?> <form action="index.php?option=com_jevents" method="post" name="admin" id="adminForm"> <?php echo JHtml::_('form.token'); ?> <div id="j-main-container" class="span<?php echo !empty($this->sidebar) ? $mainspan : $fullspan; ?> "> <textarea style="width:60%;height:550px;" name="content"><?php echo $content; ?>
function edit($tpl = null) { $document = JFactory::getDocument(); include JEV_ADMINLIBS . "editStrings.php"; $document->addScriptDeclaration($editStrings); // WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!! JEVHelper::script('editical.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/'); JEVHelper::script('JevStdRequiredFields.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/'); if ($this->row->title() <= "") { $document->setTitle(JText::_('CREATE_ICAL_EVENT')); // Set toolbar items for the page JToolBarHelper::title(JText::_('CREATE_ICAL_EVENT'), 'jevents'); } else { $document->setTitle(JText::_('EDIT_ICAL_EVENT')); // Set toolbar items for the page JToolBarHelper::title(JText::_('EDIT_ICAL_EVENT'), 'jevents'); } $bar = JToolBar::getInstance('toolbar'); if ($this->id > 0) { if ($this->editCopy) { $this->toolbarConfirmButton("icalevent.apply", JText::_("JEV_SAVE_COPY_WARNING"), 'apply', 'apply', 'JEV_SAVE', false); $this->toolbarConfirmButton("icalevent.save", JText::_("JEV_SAVE_COPY_WARNING"), 'save', 'save', 'JEV_SAVE_CLOSE', false); $this->toolbarConfirmButton("icalevent.savenew", JText::_("JEV_SAVE_COPY_WARNING"), 'save', 'save', 'JEV_SAVE_NEW', false); } else { $this->toolbarConfirmButton("icalevent.apply", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'apply', 'apply', 'JEV_SAVE', false); $this->toolbarConfirmButton("icalevent.save", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'save', 'save', 'JEV_SAVE_CLOSE', false); $this->toolbarConfirmButton("icalevent.savenew", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'save', 'save', 'JEV_SAVE_NEW', false); } } else { if (JEVHelper::isEventEditor()) { JToolBarHelper::apply('icalevent.apply', "JEV_SAVE"); } JToolBarHelper::save('icalevent.save'); JToolBarHelper::save2new('icalevent.savenew', "JEV_SAVE_NEW"); } JToolBarHelper::cancel('icalevent.list'); //JToolBarHelper::help( 'screen.icalevent.edit', true); // TODO move this into JForm field type! $this->setCreatorLookup(); if (JevJoomlaVersion::isCompatible("3.0")) { // load Joomla javascript classes JHTML::_('behavior.core'); $this->setLayout("edit"); } else { $this->setLayout("editjq"); } $this->setupEditForm(); }
function _createfilterHTML() { if (!$this->filterField) { return ""; } // only works on admin list events pages if (JRequest::getCmd("jevtask") != "admin.listevents") { $filterList = array(); $filterList["title"] = ""; $filterList["html"] = ""; return $filterList; } $filterList = array(); $filterList["title"] = JText::_('WITH_INSTANCES'); $filterList["html"] = ""; $options = array(); $options[] = JHTML::_('select.option', '0', JText::_('WHEN')); $options[] = JHTML::_('select.option', '1', JText::_('On_or_after')); $options[] = JHTML::_('select.option', '-1', JText::_('BEFORE')); $filterList["html"] .= JHTML::_('select.genericlist', $options, $this->filterType . '_fvs0', 'onchange="form.submit()" class="inputbox" size="1" ', 'value', 'text', $this->filter_values[0]); //$filterList["html"] .= JHTML::calendar($this->filter_values[1],$this->filterType.'_fvs1', $this->filterType.'_fvs1', '%Y-%m-%d',array('size'=>'12','maxlength'=>'10','onchange'=>'form.submit()')); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); $minyear = JEVHelper::getMinYear(); $maxyear = JEVHelper::getMaxYear(); $document = JFactory::getDocument(); $calendar = JevJoomlaVersion::isCompatible("3.0") ? 'calendar14.js' : 'calendar12.js'; JEVHelper::script($calendar, "components/" . JEV_COM_COMPONENT . "/assets/js/", true); JEVHelper::stylesheet("dashboard.css", "components/" . JEV_COM_COMPONENT . "/assets/css/", true); $document->addScriptDeclaration('window.addEvent(\'domready\', function() { new NewCalendar({ ' . $this->filterType . '_fvs1 : "Y-m-d"},{ direction:0, classes: ["dashboard"], draggable:true, navigation:2, tweak:{x:0,y:-75}, offset:1, range:{min:' . $minyear . ',max:' . $maxyear . '}, months:["' . JText::_("JEV_JANUARY") . '", "' . JText::_("JEV_FEBRUARY") . '", "' . JText::_("JEV_MARCH") . '", "' . JText::_("JEV_APRIL") . '", "' . JText::_("JEV_MAY") . '", "' . JText::_("JEV_JUNE") . '", "' . JText::_("JEV_JULY") . '", "' . JText::_("JEV_AUGUST") . '", "' . JText::_("JEV_SEPTEMBER") . '", "' . JText::_("JEV_OCTOBER") . '", "' . JText::_("JEV_NOVEMBER") . '", "' . JText::_("JEV_DECEMBER") . '" ], days :["' . JText::_("JEV_SUNDAY") . '", "' . JText::_("JEV_MONDAY") . '", "' . JText::_("JEV_TUESDAY") . '", "' . JText::_("JEV_WEDNESDAY") . '", "' . JText::_("JEV_THURSDAY") . '", "' . JText::_("JEV_FRIDAY") . '", "' . JText::_("JEV_SATURDAY") . '" ], onHideComplete : function () { $("' . $this->filterType . '_fvs1").form.submit()}, }); });'); $filterList["html"] .= '<input type="text" name="' . $this->filterType . '_fvs1" id="' . $this->filterType . '_fvs1" value="' . $this->filter_values[1] . '" maxlength="10" size="12" />'; $filterList["html"] .= "<input type='hidden' name='" . $this->filterType . "_fvs2' value='1'/>"; return $filterList; }
function custom_css() { jimport('joomla.html.pane'); $document = JFactory::getDocument(); $document->setTitle(JText::_('JEVENTS') . ' :: ' . JText::_('JEVENTS')); JToolBarHelper::title(JText::_('JEVENTS') . ' :: ' . JText::_('JEVENTS'), 'jevents'); JToolBarHelper::apply('cpanel.custom_css'); JToolBarHelper::cancel('cpanel.cpanel'); // jimport('joomla.form.form'); JEventsHelper::addSubmenu(); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); if (JevJoomlaVersion::isCompatible("3.0")) { $this->sidebar = JHtmlSidebar::render(); } }
/** * Loads all necessary files for and creats popup calendar link * * @static */ public static function loadCalendar($fieldname, $fieldid, $value, $minyear, $maxyear, $onhidestart = "", $onchange = "", $format = 'Y-m-d') { $document = JFactory::getDocument(); $component = "com_jevents"; $params = JComponentHelper::getParams($component); $forcepopupcalendar = $params->get("forcepopupcalendar", 1); $offset = $params->get("com_starday", 1); list($yearpart, $monthpart, $daypart) = explode("-", $value); $value = str_replace(array("Y", "m", "d"), array($yearpart, $monthpart, $daypart), $format); $calendar = JevJoomlaVersion::isCompatible("3.0") ? 'calendar14.js' : 'calendar12.js'; JEVHelper::script($calendar, "components/" . $component . "/assets/js/", true); JEVHelper::stylesheet("dashboard.css", "components/" . $component . "/assets/css/", true); $script = ' var field' . $fieldid . '=false; window.addEvent(\'domready\', function() { if (field' . $fieldid . ') return; field' . $fieldid . '=true; new NewCalendar( { ' . $fieldid . ' : "' . $format . '"}, { direction:0, classes: ["dashboard"], draggable:true, navigation:2, tweak:{x:0,y:-75}, offset:' . $offset . ', range:{min:' . $minyear . ',max:' . $maxyear . '}, readonly:' . $forcepopupcalendar . ', months:["' . JText::_("JEV_JANUARY") . '", "' . JText::_("JEV_FEBRUARY") . '", "' . JText::_("JEV_MARCH") . '", "' . JText::_("JEV_APRIL") . '", "' . JText::_("JEV_MAY") . '", "' . JText::_("JEV_JUNE") . '", "' . JText::_("JEV_JULY") . '", "' . JText::_("JEV_AUGUST") . '", "' . JText::_("JEV_SEPTEMBER") . '", "' . JText::_("JEV_OCTOBER") . '", "' . JText::_("JEV_NOVEMBER") . '", "' . JText::_("JEV_DECEMBER") . '" ], days :["' . JText::_("JEV_SUNDAY") . '", "' . JText::_("JEV_MONDAY") . '", "' . JText::_("JEV_TUESDAY") . '", "' . JText::_("JEV_WEDNESDAY") . '", "' . JText::_("JEV_THURSDAY") . '", "' . JText::_("JEV_FRIDAY") . '", "' . JText::_("JEV_SATURDAY") . '" ] '; if ($onhidestart != "") { $script .= ', onHideStart : function () { ' . $onhidestart . '; }, onHideComplete :function () { ' . $onchange . '; }'; } $script .= '} ); });'; // stop same field script being loaded multiple times static $processedfields = array(); if (!in_array($fieldname, $processedfields)) { $document->addScriptDeclaration($script); } $processedfields[] = $fieldname; if ($onchange != "") { $onchange = 'onchange="' . $onchange . '"'; } echo '<input type="text" name="' . $fieldname . '" id="' . $fieldid . '" value="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '" maxlength="10" ' . $onchange . ' size="12" />'; }
/** * Method to index an item. The item must be a FinderIndexerResult object. * * @param FinderIndexerResult $item The item to index as an FinderIndexerResult object. * @param string $format The item format * * @return void * * @since 2.5 * @throws Exception on database error. */ protected function index(FinderIndexerResult $item, $format = 'html') { // Check if the extension is enabled if (JComponentHelper::isEnabled($this->extension) == false) { return; } // Initialize the item parameters. $registry = new JRegistry(); $registry->loadString($item->params); $item->params = JComponentHelper::getParams('com_jevents', true); $item->params->merge($registry); $registry = new JRegistry(); $registry->loadString($item->metadata); $item->metadata = $registry; // Trigger the onContentPrepare event. $item->summary = FinderIndexerHelper::prepareContent($item->summary, $item->params); $item->body = FinderIndexerHelper::prepareContent($item->body, $item->params); // Build the necessary route and path information. $itemid = $this->params->get("target_itemid", 0); $item->url = "index.php?option=com_jevents&task=icalevent.detail&evid=" . $item->eventid . "&Itemid=" . $itemid; //$this->getURL($item->id, $this->extension, $this->layout); $item->route = "index.php?option=com_jevents&task=icalevent.detail&evid=" . $item->eventid . "&Itemid=" . $itemid; $item->path = FinderIndexerHelper::getContentPath($item->route); // title is already set //$item->title; // Events should only be published if the category is published.etc. - do this later //$item->state; // Add the type taxonomy data. $item->addTaxonomy('Type', 'Event'); // Add the creator taxonomy data. if (!empty($item->creator) || !empty($item->created_by_alias)) { $item->addTaxonomy('Creator', !empty($item->created_by_alias) ? $item->created_by_alias : $item->creator); } // Add the category taxonomy data. - can we do multiple categories? $item->addTaxonomy('Category', $item->category, $item->cat_state, $item->cat_access); // Add the language taxonomy data. //$item->addTaxonomy('Language', $item->language); // Get jevents extras. FinderIndexerHelper::getContentExtras($item); // Index the item. if (JevJoomlaVersion::isCompatible("3.0.0")) { $this->indexer->index($item); } else { FinderIndexer::index($item); } }
public static function script($file, $path = "", $framework = false, $relative = false, $path_only = false, $detect_browser = true, $detect_debug = true) { $includes = null; // load jQuery versions if present if (strpos($file, "JQ.js") == false) { $jqfile = str_replace(".js", "JQ.js", $file); if (JHTML::script($path . $jqfile, false, false, true)) { $file = $jqfile; } } // WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!! //JHTML::script($path . $file); //public static function script($file, $framework = false, $relative = false, $path_only = false, $detect_browser = true, $detect_debug = true) // no need to find browser specific versions $includes = JHTML::script($path . $file, $framework, $relative, true, $detect_browser); if (!$includes) { return; } if (!is_array($includes)) { $includes = array($includes); } $version = JEventsVersion::getInstance(); $release = $version->get("RELEASE", "1.0.0"); $document = JFactory::getDocument(); foreach ($includes as $include) { if (JevJoomlaVersion::isCompatible("3.3")) { $document->addScriptVersion($include, $release); } else { $document->addScript($include . "?" . $release); } } }
function edit($tpl = null) { JEVHelper::script('editical.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/'); $document = JFactory::getDocument(); $document->setTitle(JText::_('EDIT_ICS')); // Set toolbar items for the page JToolBarHelper::title(JText::_('EDIT_ICS'), 'jevents'); //JToolBarHelper::save('icals.save'); $bar = JToolBar::getInstance('toolbar'); if ($this->editItem && isset($this->editItem->ics_id) && $this->editItem->ics_id > 0) { JToolBarHelper::save('icals.savedetails'); } JToolBarHelper::cancel('icals.list'); //JToolBarHelper::help( 'screen.icals.edit', true); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); //$section = $params->get("section",0); $db = JFactory::getDbo(); if ($params->get("authorisedonly", 0)) { // get authorised users $sql = "SELECT u.* FROM #__jev_users as jev LEFT JOIN #__users as u on u.id=jev.user_id where jev.published=1 and jev.cancreate=1"; $db = JFactory::getDBO(); $db->setQuery($sql); $users = $db->loadObjectList(); } else { $rules = JAccess::getAssetRules("com_jevents", true); $creatorgroups = $rules->getData(); // need to merge the arrays because of stupid way Joomla checks super user permissions //$creatorgroups = array_merge($creatorgroups["core.admin"]->getData(), $creatorgroups["core.create"]->getData()); // use union orf arrays sincee getData no longer has string keys in the resultant array //$creatorgroups = $creatorgroups["core.admin"]->getData()+ $creatorgroups["core.create"]->getData(); // use union orf arrays sincee getData no longer has string keys in the resultant array $creatorgroupsdata = $creatorgroups["core.admin"]->getData(); // take the higher permission setting foreach ($creatorgroups["core.create"]->getData() as $creatorgroup => $permission) { if ($permission) { $creatorgroupsdata[$creatorgroup] = $permission; } } $users = array(0); foreach ($creatorgroupsdata 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(); } $userOptions = array(); foreach ($users as $user) { $userOptions[] = JHTML::_('select.option', $user->id, $user->name . " ({$user->username})"); } $jevuser = JFactory::getUser(); if ($this->editItem && isset($this->editItem->ics_id) && $this->editItem->ics_id > 0 && $this->editItem->created_by > 0) { $created_by = $this->editItem->created_by; } else { $created_by = $jevuser->id; } if (count($userOptions) > 0) { $userlist = JHTML::_('select.genericlist', $userOptions, 'created_by', 'class="inputbox" size="1" ', 'value', 'text', $created_by); } else { $userList = ""; } $this->assignRef("users", $userlist); JHTML::_('behavior.tooltip'); if (JevJoomlaVersion::isCompatible("3.0")) { $this->setLayout("edit"); } else { $this->setLayout("edit16"); } }
/** * Method to load the Bootstrap JavaScript framework into the document head * * If debugging mode is on an uncompressed version of Bootstrap is included for easier debugging. * * @param mixed $debug Is debugging mode on? [optional] * * @return void * * @since 3.0 */ public static function framework($debug = null) { // Use Joomla version first if (JevJoomlaVersion::isCompatible("3.0")) { JHtmlBootstrap::framework($debug); return; } // Fall back to JEvents version JLoader::register('JevHtmlBootstrap', JEV_PATH . "libraries/bootstrap.php"); try { JevHtmlBootstrap::framework($debug); return; } catch (Exception $ex) { } // Finally use library version as last resort // Only load once if (!empty(static::$loaded[__METHOD__])) { return; } // Load jQuery JevHtmlJquery::framework(); // If no debugging value is set, use the configuration setting if ($debug === null) { $config = JFactory::getConfig(); $debug = (bool) $config->get('debug'); } JHtml::_('script', 'libraries/jevents/bootstrap/js/bootstrap.min.js', false, false, false, false, $debug); static::$loaded[__METHOD__] = true; return; }
function publish() { $db = JFactory::getDBO(); $cid = JRequest::getVar("cid", array()); if (count($cid) != 1) { $this->setRedirect(JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&task=defaults.overview", false)); $this->redirect(); return; } $name = $cid[0]; // Check if the layout is the same as the default value - if it is then do NOT publish it $sql = "SELECT * FROM #__jev_defaults where id=" . $db->Quote($name); $db->setQuery($sql); $value = $db->loadObject(); $defaultvalue = ""; $componentname = explode(".", $value->name, 2); $componentname = $componentname[0]; if (JevJoomlaVersion::isCompatible("3.0.0")) { if ($defaultvalue == "" && file_exists(JPATH_ADMINISTRATOR . '/components/' . $componentname . '/views/defaults/tmpl/' . $value->name . ".3.html")) { $defaultvalue = file_get_contents(JPATH_ADMINISTRATOR . '/components/' . $componentname . '/views/defaults/tmpl/' . $value->name . ".3.html"); } } if ($defaultvalue == "" && file_exists(JPATH_ADMINISTRATOR . '/components/' . $componentname . '/views/defaults/tmpl/' . $value->name . ".html")) { $defaultvalue = file_get_contents(JPATH_ADMINISTRATOR . '/components/' . $componentname . '/views/defaults/tmpl/' . $value->name . ".html"); } if (str_replace(" ", "", $defaultvalue) == str_replace(" ", "", $value->value) || $value->value == "") { JFactory::getApplication()->enqueueMessage(JText::_("JEV_LAYOUT_IS_DEFAULT_NOT_PUBLISHED", "WARNING")); $this->setRedirect(JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&task=defaults.overview", false)); $this->redirect(); return; } $sql = "UPDATE #__jev_defaults SET state=1 where id=" . $db->Quote($name); $db->setQuery($sql); $db->query(); $this->setRedirect(JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&task=defaults.overview", false)); $this->redirect(); }
function overview($tpl = null) { // Get data from the model $model = $this->getModel(); $document = JFactory::getDocument(); $document->setTitle(JText::_('ICAL_EVENTS')); // Set toolbar items for the page JToolBarHelper::title(JText::_('ICAL_EVENTS'), 'jevents'); JToolBarHelper::addNew('icalevent.edit'); JToolBarHelper::editList('icalevent.edit'); JToolBarHelper::publishList('icalevent.publish'); JToolBarHelper::unpublishList('icalevent.unpublish'); JToolBarHelper::custom('icalevent.editcopy', 'copy.png', 'copy.png', 'JEV_ADMIN_COPYEDIT'); $state = intval(JFactory::getApplication()->getUserStateFromRequest("stateIcalEvents", 'state', 0)); if ($state == -1) { JToolBarHelper::deleteList("JEV_EMPTY_TRASH_DELETE_EVENT_AND_ALL_REPEATS", 'icalevent.emptytrash', "JTOOLBAR_EMPTY_TRASH"); } else { JToolBarHelper::trash('icalevent.delete'); } JToolBarHelper::spacer(); //JToolBarHelper::help( 'screen.ical', true); JEventsHelper::addSubmenu(); $showUnpublishedICS = false; $db = JFactory::getDbo(); JHtmlSidebar::setAction('index.php?option=com_jevents&task=icalevent.list'); // get list of ics Files $query = "SELECT ics.ics_id as value, ics.label as text FROM #__jevents_icsfile as ics "; if (!$showUnpublishedICS) { $query .= " WHERE ics.state=1"; } $query .= " ORDER BY ics.isdefault DESC, ics.label ASC"; $db->setQuery($query); $icsfiles = $db->loadObjectList(); $icsFile = intval(JFactory::getApplication()->getUserStateFromRequest("icsFile", "icsFile", 0)); JHtmlSidebar::addFilter(JText::_('ALL_ICS_FILES'), 'icsFile', JHtml::_('select.options', $icsfiles, 'value', 'text', $icsFile)); $state = intval(JFactory::getApplication()->getUserStateFromRequest("stateIcalEvents", 'state', 3)); $options = array(); $options[] = JHTML::_('select.option', '3', JText::_('JOPTION_SELECT_PUBLISHED')); $options[] = JHTML::_('select.option', '1', JText::_('PUBLISHED')); $options[] = JHTML::_('select.option', '2', JText::_('UNPUBLISHED')); $options[] = JHTML::_('select.option', '-1', JText::_('JTRASH')); JHtmlSidebar::addFilter(JText::_('ALL_EVENTS'), 'state', JHtml::_('select.options', $options, 'value', 'text', $state)); // get list of creators $created_by = JFactory::getApplication()->getUserStateFromRequest("createdbyIcalEvents", 'created_by', ""); $sql = "SELECT distinct u.id, u.* FROM #__jevents_vevent as jev LEFT JOIN #__users as u on u.id=jev.created_by order by u.name "; $db = JFactory::getDBO(); $db->setQuery($sql); $users = $db->loadObjectList(); $userOptions = array(); foreach ($users as $user) { if (!$user->id) { $user->id = 0; } $userOptions[] = JHTML::_('select.option', $user->id, $user->name . " ({$user->username})"); } JHtmlSidebar::addFilter(JText::_('JEV_EVENT_CREATOR'), 'created_by', JHtml::_('select.options', $userOptions, 'value', 'text', $created_by)); $this->sidebar = JHtmlSidebar::render(); $params = JComponentHelper::getParams(JEV_COM_COMPONENT); //$section = $params->get("section",0); JHTML::_('behavior.tooltip'); // Only offer translations in latest version of Joomla if (JevJoomlaVersion::isCompatible("3.4")) { $this->languages = $this->get('Languages'); } else { $this->languages = null; } }
/** * Configure the Linkbar. * * @param string The name of the active view. */ public static function addSubmenu($vName = "") { $task = JRequest::getCmd("task", "cpanel.cpanel"); $option = JRequest::getCmd("option", "com_categories"); if ($option == 'com_categories') { $doc = JFactory::getDocument(); if (!JevJoomlaVersion::isCompatible("3.0")) { $hide_options = '#toolbar-popup-options {' . 'display:none;' . '}'; } else { $hide_options = '#toolbar-options {' . 'display:none;' . '}'; } $doc->addStyleDeclaration($hide_options); // Category styling $style = <<<STYLE #categoryList td.center a { border:none; } STYLE; JFactory::getDbo()->setQuery("SELECT * FROM #__categories WHERE extension='com_jevents'"); $categories = JFactory::getDbo()->loadObjectList('id'); foreach ($categories as $cat) { $catparams = new JRegistry($cat->params); if ($catparams->get("catcolour")) { $style .= "tr[item-id='{$cat->id}'] a { border-left:solid 3px " . $catparams->get("catcolour") . ";padding-left:5px;}\n"; } } $doc->addStyleDeclaration($style); } if ($vName == "") { $vName = $task; } // could be called from categories component JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php"); if (JevJoomlaVersion::isCompatible("3.0")) { JHtmlSidebar::addEntry(JText::_('CONTROL_PANEL'), 'index.php?option=com_jevents', $vName == 'cpanel.cpanel'); JHtmlSidebar::addEntry(JText::_('JEV_ADMIN_ICAL_EVENTS'), 'index.php?option=com_jevents&task=icalevent.list', $vName == 'icalevent.list'); if (JEVHelper::isAdminUser()) { JHtmlSidebar::addEntry(JText::_('JEV_ADMIN_ICAL_SUBSCRIPTIONS'), 'index.php?option=com_jevents&task=icals.list', $vName == 'icals.list'); } JHtmlSidebar::addEntry(JText::_('JEV_INSTAL_CATS'), "index.php?option=com_categories&extension=com_jevents", $vName == 'categories'); if (JEVHelper::isAdminUser()) { JHtmlSidebar::addEntry(JText::_('JEV_MANAGE_USERS'), 'index.php?option=com_jevents&task=user.list', $vName == 'user.list'); JHtmlSidebar::addEntry(JText::_('JEV_INSTAL_CONFIG'), 'index.php?option=com_jevents&task=params.edit', $vName == 'params.edit'); JHtmlSidebar::addEntry(JText::_('JEV_LAYOUT_DEFAULTS'), 'index.php?option=com_jevents&task=defaults.list', in_array($vName, array('defaults.list', 'defaults.overview'))); //Support & CSS Customs should only be for Admins really. JHtmlSidebar::addEntry(JText::_('SUPPORT_INFO'), 'index.php?option=com_jevents&task=cpanel.support', $vName == 'cpanel.support'); JHtmlSidebar::addEntry(JText::_('JEV_CUSTOM_CSS'), 'index.php?option=com_jevents&task=cpanel.custom_css', $vName == 'cpanel.custom_css'); } } else { JSubMenuHelper::addEntry(JText::_('CONTROL_PANEL'), 'index.php?option=com_jevents', $vName == 'cpanel.cpanel'); JSubMenuHelper::addEntry(JText::_('JEV_ADMIN_ICAL_EVENTS'), 'index.php?option=com_jevents&task=icalevent.list', $vName == 'icalevent.list'); if (JEVHelper::isAdminUser()) { JSubMenuHelper::addEntry(JText::_('JEV_ADMIN_ICAL_SUBSCRIPTIONS'), 'index.php?option=com_jevents&task=icals.list', $vName == 'icals.list'); } JSubMenuHelper::addEntry(JText::_('JEV_INSTAL_CATS'), "index.php?option=com_categories&extension=com_jevents", $vName == 'categories'); if (JEVHelper::isAdminUser()) { JSubMenuHelper::addEntry(JText::_('JEV_MANAGE_USERS'), 'index.php?option=com_jevents&task=user.list', $vName == 'user.list'); JSubMenuHelper::addEntry(JText::_('JEV_INSTAL_CONFIG'), 'index.php?option=com_jevents&task=params.edit', $vName == 'params.edit'); JSubMenuHelper::addEntry(JText::_('JEV_LAYOUT_DEFAULTS'), 'index.php?option=com_jevents&task=defaults.list', in_array($vName, array('defaults.list', 'defaults.overview'))); //Support & CSS customs should only be for Admins really. JSubMenuHelper::addEntry(JText::_('SUPPORT_INFO'), 'index.php?option=com_jevents&task=cpanel.support', $vName == 'cpanel.support'); JSubMenuHelper::addEntry(JText::_('JEV_CUSTOM_CSS'), 'index.php?option=com_jevents&task=cpanel.custom_css', $vName == 'cpanel.custom_css'); } } }
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")) { $title = ""; // JFactory::getApplication()->JComponentTitle; } else { $title = JFactory::getApplication()->get('JComponentTitle'); } echo $title; ?> </div> <?php }
protected function getInput() { JEVHelper::ConditionalFields($this->element, $this->form->getName()); // Mkae sure jQuery is loaded if (JevJoomlaVersion::isCompatible("3.0")) { JHtml::_('jquery.framework'); JHtml::_('jquery.ui', array("core", "sortable")); JHtml::_('bootstrap.framework'); JEVHelper::script("components/com_jevents/assets/js/jQnc.js"); // this script should come after all the URL based scripts in Joomla so should be a safe place to know that noConflict has been set JFactory::getDocument()->addScriptDeclaration("checkJQ();"); } else { if (JComponentHelper::getParams(JEV_COM_COMPONENT)->get("fixjquery", 1)) { JFactory::getDocument()->addScript("//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"); JFactory::getDocument()->addScript("//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"); JEVHelper::script("components/com_jevents/assets/js/jQnc.js"); // this script should come after all the URL based scripts in Joomla so should be a safe place to know that noConflict has been set JFactory::getDocument()->addScriptDeclaration("checkJQ();"); } } JEVHelper::script('administrator/components/com_jevents/assets/js/columns.js'); $user = JFactory::getUser(); $collist = array(); $collist[] = array(JText::_("JEV_CORE_DATA", true), "disabled"); $collist[] = array(JText::_("JEV_FIELD_TITLE", true), "TITLE"); $collist[] = array(JText::_("JEV_FIELD_TITLE_LINK", true), "TITLE_LINK"); $collist[] = array(JText::_("JEV_FIELD_REPEATSUMMARY", true), "REPEATSUMMARY"); $collist[] = array(JText::_("JEV_FIELD_STARTDATE", true), "STARTDATE"); $collist[] = array(JText::_("JEV_FIELD_STARTTIME", true), "STARTTIME"); $collist[] = array(JText::_("JEV_FIELD_ISOSTARTTIME", true), "ISOSTART"); $collist[] = array(JText::_("JEV_FIELD_ENDDATE", true), "ENDDATE"); $collist[] = array(JText::_("JEV_FIELD_ENDTIME", true), "ENDTIME"); $collist[] = array(JText::_("JEV_FIELD_ISOENDTIME", true), "ISOEND"); $collist[] = array(JText::_("JEV_FIELD_MULTIENDDATE", true), "MULTIENDDATE"); $collist[] = array(JText::_("JEV_FIELD_DURATION", true), "DURATION"); $collist[] = array(JText::_("JEV_FIELD_PREVIOUSNEXT", true), "PREVIOUSNEXT"); $collist[] = array(JText::_("JEV_FIELD_FIRSTREPEAT", true), "FIRSTREPEAT"); $collist[] = array(JText::_("JEV_FIELD_LASTREPEAT", true), "LASTREPEAT"); $collist[] = array(JText::_("JEV_FIELD_CREATOR_LABEL", true), "CREATOR_LABEL"); $collist[] = array(JText::_("JEV_FIELD_CREATOR", true), "CREATOR"); $collist[] = array(JText::_("JEV_FIELD_HITS", true), "HITS"); $collist[] = array(JText::_("JEV_FIELD_DESCRIPTION", true), "DESCRIPTION"); $collist[] = array(JText::_("JEV_FIELD_LOCATION_LABEL", true), "LOCATION_LABEL"); $collist[] = array(JText::_("JEV_FIELD_LOCATION", true), "LOCATION"); $collist[] = array(JText::_("JEV_FIELD_CONTACT_LABEL", true), "CONTACT_LABEL"); $collist[] = array(JText::_("JEV_FIELD_CONTACT", true), "CONTACT"); $collist[] = array(JText::_("JEV_FIELD_EXTRAINFO", true), "EXTRAINFO"); $collist[] = array(JText::_("JEV_FIELD_CATEGORY", true), "CATEGORY"); $collist[] = array(JText::_("JEV_FIELD_ALL_CATEGORIES", true), "ALLCATEGORIES"); $collist[] = array(JText::_("JEV_FIELD_CATEGORY_LINK", true), "CATEGORYLNK"); $collist[] = array(JText::_("JEV_FIELD_CATEGORY_IMAGE", true), "CATEGORYIMG"); $collist[] = array(JText::_("JEV_FIELD_CATEGORY_IMAGES", true), "CATEGORYIMGS"); $collist[] = array(JText::_("JEV_FIELD_CATEGORY_DESCRIPTION", true), "CATDESC"); $collist[] = array(JText::_("JEV_FIELD_COLOUR", true), "COLOUR"); $collist[] = array(JText::_("JEV_FIELD_CALENDAR", true), "CALENDAR"); $collist[] = array(JText::_("JEV_FIELD_CREATIONDATE", true), "CREATED"); $collist[] = array(JText::_("JEV_FIELD_LINKSTART", true), "LINKSTART"); $collist[] = array(JText::_("JEV_FIELD_LINKEND", true), "LINKEND"); $collist[] = array(JText::_("JEV_FIELD_URL", true), "URL"); $collist[] = array(JText::_("JEV_ACCESS_LEVEL", true), "ACCESS"); $collist[] = array(JText::_("JEV_EVENT_PRIORITY", true), "PRIORITY"); // get list of enabled plugins $jevplugins = JPluginHelper::getPlugin("jevents"); foreach ($jevplugins as $jevplugin) { if (JPluginHelper::importPlugin("jevents", $jevplugin->name)) { $classname = "plgJevents" . ucfirst($jevplugin->name); if (is_callable(array($classname, "fieldNameArray"))) { $lang = JFactory::getLanguage(); $lang->load("plg_jevents_" . $jevplugin->name, JPATH_ADMINISTRATOR); $fieldNameArray = call_user_func(array($classname, "fieldNameArray"), 'list'); if (!isset($fieldNameArray['labels'])) { continue; } $collist[] = array($fieldNameArray["group"], "disabled"); for ($i = 0; $i < count($fieldNameArray['labels']); $i++) { if ($fieldNameArray['labels'][$i] == "" || $fieldNameArray['labels'][$i] == " Label") { continue; } $collist[] = array(str_replace(":", " ", $fieldNameArray['labels'][$i]), $fieldNameArray['values'][$i]); } } } } $invalue = array(); $indexedgroups = array(); if ($this->value != "") { $ingroups = explode("||", $this->value); foreach ($ingroups as $group) { $group = explode("|", $group); if ($group[0] == "") { continue; } $invalue[] = $group[0]; if (count($group) < 3) { $group[2] = $group[0]; } list($id, $fieldlabel, $label) = $group; $col = new stdClass(); $col->fieldlabel = $fieldlabel; $col->id = $id; $col->label = $label; $col->raw = implode("|", $group); $indexedgroups[$id] = $col; } } $input = '<div style="clear:left"></div><table><tr valign="top"> <td><div style="font-weight:bold">' . JText::_("JEV_CLICK_TO_ADD_COLUMN") . '</div> <div id="columnchoices" style="margin-top:10px;padding:5px;min-width:200px;height:150px;border:solid 1px #ccc;overflow-y:auto" >'; foreach ($collist as $col) { if (count($col) < 3) { $col[2] = $col[0]; } list($fieldlabel, $id, $label) = $col; if (!in_array($id, $invalue)) { // we can't handle parameters yet if (strpos($id, ":")) { continue; } if ($id == "disabled") { $input .= '<div><strong>' . $fieldlabel . "</strong></div>\n"; } else { $input .= '<div>' . $fieldlabel . "<span style='display:none'>{$id}</span></div>\n"; } } } $input .= '</div></td> <td><div style="font-weight:bold;margin-left:20px;">' . JText::_("JEV_COLUMNS_DRAG_TO_REORDER_OR_CLICK_TO_REMOVE") . '</div> <div id="columnmatches" style="margin:10px 0px 0px 20px;padding-top:5px;min-width:250px;">'; $invalues = array(); foreach ($invalue as $col) { $input .= '<div id="column' . $col . '" style="clear:left;"><div style="width:200px;display:inline-block;">' . $indexedgroups[$col]->fieldlabel . "</div><input type='text' value='" . $indexedgroups[$col]->label . "' style='margin-left:20px;' /></div>"; $invalues[] = $indexedgroups[$col]->raw; } $invalues = implode("||", $invalues); $input .= '</div></td> </tr></table>'; $input .= '<textarea style="display:block" name="' . $this->name . '" id="jevcolumns">' . $invalues . '</textarea>'; $input .= '<div style="clear:left"></div>'; $input .= '<script type="text/javascript">setupColumnChoices(true);setupColumnLis(true);</script>'; return $input; }
public static function buildWeeksCheck($reccurweeks, $args, $name = "reccurweeks") { $week_name = array('', JText::_('JEV_REP_WEEK') . ' 1 ', JText::_('JEV_REP_WEEK') . ' 2 ', JText::_('JEV_REP_WEEK') . ' 3 ', JText::_('JEV_REP_WEEK') . ' 4 ', JText::_('JEV_REP_WEEK') . ' 5 '); $tosend = ''; $checked = ''; if ($reccurweeks == '') { $split = array(); $countsplit = 0; } else { $split = explode('|', $reccurweeks); $countsplit = count($split); } for ($a = 1; $a < 6; $a++) { $checked = ''; if ($reccurweeks == '') { $checked = ' checked="checked"'; } for ($x = 0; $x < $countsplit; $x++) { if ($split[$x] == $a) { $checked = ' checked="checked"'; } } if (JevJoomlaVersion::isCompatible("3.0") || JComponentHelper::getParams(JEV_COM_COMPONENT)->get("useboostrap", 1)) { // bootstrap version $tosend .= '' . '<input type="checkbox" id="cb_wn' . $a . '" name="' . $name . '[]" value="' . $a . '" ' . $args . $checked . ' onclick="updateRepeatWarning();" />' . '<label for="cb_wn' . $a . '" class="checkbox btn">' . $week_name[$a] . '</label>' . "\n"; } else { $tosend .= '<li class="r' . ($a % 2 + 1) . '" ><input type="checkbox" id="cb_wn' . $a . '" name="' . $name . '[]" value="' . $a . '" ' . $args . $checked . ' onclick="updateRepeatWarning();" /> ' . "\n" . '<label for="cb_wn' . $a . '">' . $week_name[$a] . '</label></li>' . "\n"; } } if (JevJoomlaVersion::isCompatible("3.0") || JComponentHelper::getParams(JEV_COM_COMPONENT)->get("useboostrap", 1)) { echo $tosend; } else { echo "<ul>\n" . $tosend . "\n</ul>\n"; } }
$jevtype = JRequest::getVar("jevtype", false); // FORM for filter submission $tmpCatids = trim($datamodel->catidsOut); if ($form_link == "") { $form_link = 'index.php?option=' . JEV_COM_COMPONENT . '&task=' . JRequest::getVar("jevtask", "cat.listevents") . "&Itemid=" . $myItemid; } $form_link .= "&year={$year}&month={$month}&day={$day}"; // category ID gets picked up by POST results! $form_link = JRoute::_($form_link . ($evid ? '&evid=' . $evid : '') . ($jevtype ? '&jevtype=' . $jevtype : ''), false); $filters = $jevhelper->getFilters(); $option = JRequest::getCmd("option"); if ($params->get("disablenonjeventspages", 0) && $option != "com_jevents" && $option != "com_jevlocations" && $option != "com_jevpeople" && $option != "com_rsvppro" && $option != "com_jevtags") { // display nothing on non-jevents pages - again make this a config option return; } //Check if in event details //We never need filters in an edit page, this could cause user issues, so if there remove to. if ((JRequest::getCmd("task") == "icalrepeat.detail" || JRequest::getCmd("task") == "icalevent.detail") && $params->get('showindetails', 0) == 0 || JRequest::getCmd("task") == "icalevent.edit" || JRequest::getCmd("task") == "icalrepeat.edit" || JRequest::getCmd("task") == "icalevent.edit") { return; } $allowAutoSubmit = true; $filterHTML = $filters->getFilterHTML($allowAutoSubmit); if (JevJoomlaVersion::isCompatible("3.0") && $params->get("bootstrapchosen", 1)) { // Load Bookstrap JHtml::_('bootstrap.framework'); JHtml::_('formbehavior.chosen', '.jevfiltermodule select'); require JModuleHelper::getLayoutPath('mod_jevents_filter', 'default_chosenlayout'); } else { //Check if creating / editing an event require JModuleHelper::getLayoutPath('mod_jevents_filter', 'default_layout'); }
?> </td> <td> <input type="text" name="search" value="<?php echo $this->search; ?> " class="inputbox" onChange="document.adminForm.submit();" /> </td> </tr> </table> <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist table table-striped"> <tr> <th width="20" nowrap="nowrap"> <input type="checkbox" name="toggle" value="" onclick="<?php echo JevJoomlaVersion::isCompatible("3.0") ? "Joomla.checkAll(this)" : "checkAll(" . count($this->rows) . ")"; ?> " /> </th> <th class="title" width="30%" nowrap="nowrap"><?php echo JText::_('JEV_ICAL_SUMMARY'); ?> </th> <th width="10%" nowrap="nowrap"><?php echo JText::_('JEV_ICAL_TYPE'); ?> </th> <th width="10%" nowrap="nowrap"><?php echo JText::_('JEV_CATEGORY_NAME'); ?> </th>
protected function setupEditForm() { $params = JComponentHelper::getParams(JEV_COM_COMPONENT); $this->editor = JFactory::getEditor(); if ($this->editor->get("_name") == "codemirror") { $this->editor = JFactory::getEditor("none"); JFactory::getApplication()->enqueueMessage(JText::_("JEV_CODEMIRROR_NOT_COMPATIBLE_EDITOR", "WARNING")); } // clean any existing cache files $cache = JFactory::getCache(JEV_COM_COMPONENT); $cache->clean(JEV_COM_COMPONENT); /* // Get/Create the model if ($model = $this->getModel("icalevent", "icaleventsModel")) { // Push the model into the view (as default) $this->view->setModel($model, true); } */ // Get the form $this->form = $this->get('Form'); /* * Moved to special model // Prepare the data // Experiment in the use of JForm and template override for forms and fields JForm::addFormPath(JPATH_COMPONENT_ADMINISTRATOR . "/models/forms/"); $template = JFactory::getApplication()->getTemplate(); JForm::addFormPath(JPATH_THEMES."/$template/html/com_jevents/forms"); //JForm::addFieldPath(JPATH_THEMES."/$template/html/com_jevents/fields"); $xpath = false; // leave form control blank since we want the fields as ev_id and not jform[ev_id] $this->form = JForm::getInstance("jevents.edit.icalevent", 'icalevent', array('control' => '', 'load_data' => false), false, $xpath); JForm::addFieldPath(JPATH_THEMES."/$template/html/com_jevents/fields"); */ $rowdata = array(); foreach ($this->row as $k => $v) { if (strpos($k, "_") === 0) { $newk = substr($k, 1); //$this->row->$newk = $v; } else { $newk = $k; } $rowdata[$newk] = $v; } // some variables have fieldnames with camel case names in the form $rowdata["allDayEvent"] = $rowdata["alldayevent"]; $rowdata["contact_info"] = $rowdata["contact"]; $this->form->bind($rowdata); $this->form->setValue("view12Hour", null, $params->get('com_calUseStdTime', 0) ? 1 : 0); $this->catid = $this->row->catid(); if ($this->catid == 0 && $this->defaultCat > 0) { $this->catid = $this->defaultCat; } if ($this->row->catids) { $this->catid = $this->row->catids; } if (!isset($this->ev_id)) { $this->ev_id = $this->row->ev_id(); } if ($this->editCopy) { $this->old_ev_id = $this->ev_id; $this->ev_id = 0; $this->repeatId = 0; $this->rp_id = 0; unset($this->row->_uid); $this->row->id(0); } $native = true; $thisCal = null; if ($this->row->icsid() > 0) { $thisCal = $this->dataModel->queryModel->getIcalByIcsid($this->row->icsid()); if (isset($thisCal) && $thisCal->icaltype == 0) { // note that icaltype = 0 for imported from URL, 1 for imported from file, 2 for created natively $native = false; } else { if (isset($thisCal) && $thisCal->icaltype == 1) { // note that icaltype = 0 for imported from URL, 1 for imported from file, 2 for created natively $native = false; } } } // Event editing buttons $this->form->setValue("jevcontent", null, $this->row->content()); if ($params->get('com_show_editor_buttons')) { $this->form->setFieldAttribute("jevcontent", "hide", $params->get('com_editor_button_exceptions')); } else { $this->form->setFieldAttribute("jevcontent", "buttons", "false"); } // Make data available to the form $this->form->jevdata["catid"]["dataModel"] = $this->dataModel; $this->form->jevdata["catid"]["with_unpublished_cat"] = $this->with_unpublished_cat; $this->form->jevdata["catid"]["repeatId"] = $this->repeatId; $this->form->jevdata["catid"]["excats"] = false; if (JRequest::getCmd("task") == "icalevent.edit" && isset($this->excats)) { $this->form->jevdata["catid"]["excats"] = $this->excats; } $this->form->setValue("catid", null, $this->catid); $this->form->jevdata["creator"]["users"] = false; if ((JRequest::getCmd("task") == "icalevent.edit" || JRequest::getCmd("task") == "icalevent.editcopy" || JRequest::getCmd("jevtask") == "icalevent.edit" || JRequest::getCmd("jevtask") == "icalevent.editcopy") && isset($this->users)) { $this->form->jevdata["creator"]["users"] = $this->users; } $this->form->jevdata["ics_id"]["clist"] = $this->clist; $this->form->jevdata["ics_id"]["clistChoice"] = $this->clistChoice; $this->form->jevdata["ics_id"]["thisCal"] = $thisCal; $this->form->jevdata["ics_id"]["native"] = $native; $this->form->jevdata["ics_id"]["nativeCals"] = $this->nativeCals; $this->form->jevdata["lockevent"]["offerlock"] = isset($this->offerlock) ? 1 : 0; $this->form->jevdata["access"]["glist"] = isset($this->glist) ? $this->glist : false; $this->form->jevdata["state"]["ev_id"] = $this->ev_id; $this->form->jevdata["location"]["event"] = $this->row; $this->form->jevdata["publish_up"]["event"] = $this->row; $this->form->jevdata["publish_down"]["event"] = $this->row; $this->form->jevdata["start_time"]["event"] = $this->row; $this->form->jevdata["end_time"]["event"] = $this->row; //custom requiredfields selected by the user in configuration $requiredFields = $params->get('com_jeveditionrequiredfields', array()); // replacement values $this->searchtags = array(); $this->replacetags = array(); $this->blanktags = array(); $this->requiredtags = array(); $requiredTags['id'] = "title"; $requiredTags['default_value'] = ""; $requiredTags['alert_message'] = JText::_('JEV_ADD_REQUIRED_FIELD', true) . " " . JText::_("JEV_FIELD_TITLE", true); $this->requiredtags[] = $requiredTags; $fields = $this->form->getFieldSet(); foreach ($fields as $key => $field) { $fieldAttribute = $this->form->getFieldAttribute($key, "layoutfield"); if ($fieldAttribute) { $searchtag = '{{' . $this->form->getFieldAttribute($key, "layoutfield") . "_LBL}}"; $this->searchtags[] = $searchtag; $this->replacetags[] = $field->label; $this->blanktags[] = ""; $this->searchtags[] = '{{' . $fieldAttribute . "}}"; $this->replacetags[] = $field->input; $this->blanktags[] = ""; if (in_array($fieldAttribute, $requiredFields)) { $requiredTags['id'] = $key; $requiredTags['default_value'] = $this->form->getFieldAttribute($key, "default"); $requiredTags['alert_message'] = JText::_('JEV_ADD_REQUIRED_FIELD', true) . " " . JText::_("JEV_FIELD_" . $fieldAttribute, true); $this->requiredtags[] = $requiredTags; } } } // Plugins CAN BE LAYERED IN HERE - In Joomla 3.0 we need to call it earlier to get the tab titles // append array to extratabs keys content, title, paneid $this->extraTabs = array(); $dispatcher = JDispatcher::getInstance(); $dispatcher->trigger('onEventEdit', array(&$this->extraTabs, &$this->row, &$params), true); foreach ($this->extraTabs as $extraTab) { $extraTab['title'] = str_replace(" ", "_", strtoupper($extraTab['title'])); $this->searchtags[] = "{{" . $extraTab['title'] . "}}"; $this->replacetags[] = $extraTab['content']; $this->blanktags[] = ""; if (JText::_($extraTab['title']) !== $extraTab['title']) { $this->searchtags[] = "{{" . JText::_($extraTab['title']) . "}}"; $this->replacetags[] = $extraTab['content']; $this->blanktags[] = ""; } if (isset($extraTab['rawtitle'])) { $this->searchtags[] = "{{" . $extraTab['rawtitle'] . "}}"; $this->replacetags[] = $extraTab['content']; $this->blanktags[] = ""; } } // load any custom fields $this->customfields = array(); $res = $dispatcher->trigger('onEditCustom', array(&$this->row, &$this->customfields)); ob_start(); foreach ($this->customfields as $key => $val) { // skip custom fields that are already displayed on other tabs if (isset($val["group"]) && $val["group"] != "default") { continue; } /* static $firstperson = false; if (!$firstperson && strpos($key, "people") && $key!=$people && isset($this->customfields["people"])){ $this->customfields[$key]["input"] = $this->customfields["people"]["label"] . $this->customfields[$key]["input"]; $firstperson = true; } */ // not ideal it creates duplicate ULS - but if we don't duplicate they may not show if (strpos($key, "people") === 0 && $key != "people" && isset($this->customfields["people"])) { //$this->customfields[$key]["input"] = $this->customfields["people"]["input"] . $this->customfields[$key]["input"]; } $this->searchtags[] = '{{' . $key . '}}'; $this->replacetags[] = $this->customfields[$key]["input"]; $this->blanktags[] = ""; $this->searchtags[] = '{{' . $key . '_lbl}}'; $this->replacetags[] = $this->customfields[$key]["label"]; $this->blanktags[] = ""; if (in_array($key, $requiredFields)) { if (isset($this->customfields[$key]["default_value"]) && isset($this->customfields[$key]["id_to_check"])) { $requiredTags['default_value'] = $this->customfields[$key]["default_value"]; $requiredTags['id'] = $this->customfields[$key]["id_to_check"]; $requiredTags['alert_message'] = JText::_('JEV_ADD_REQUIRED_FIELD', true) . " " . $requiredTags['id']; } /* else { if ($key ==="agenda" || $key ==="minutes") { $requiredTags['id'] = "custom_".$key; } else if (preg_match("/image[0-9]{1,2}/", $key) === 1) { $requiredTags['id'] = "custom_upload_" . $key; } else { $requiredTags['id'] = $key; } $requiredTags['default_value'] = ""; }*/ $requiredTags['label'] = $this->customfields[$key]["label"]; $this->requiredtags[] = $requiredTags; } if (JevJoomlaVersion::isCompatible("3.0")) { ?> <div class="control-group jevplugin_<?php echo $key; ?> "> <label class="control-label "><?php echo $this->customfields[$key]["label"]; ?> </label> <div class="controls" > <?php echo $this->customfields[$key]["input"]; ?> </div> </div> <?php } else { ?> <tr class="jevplugin_<?php echo $key; ?> "> <td valign="top" width="130" align="left"> <?php echo $this->customfields[$key]["label"]; ?> </td> <td colspan="3"> <?php echo $this->customfields[$key]["input"]; ?> </td> </tr> <?php } } $this->searchtags[] = "{{CUSTOMFIELDS}}"; $output = ob_get_clean(); $this->replacetags[] = $output; $this->blanktags[] = ""; }
</td> <?php } ?> <td><?php echo JText::_('JEV_SEARCH'); ?> </td> <td> <input type="text" name="search" value="<?php echo $this->search; ?> " class="inputbox" onChange="document.adminForm.submit();" /> </td> <?php if (JevJoomlaVersion::isCompatible("3.0")) { ?> <td align="right"> <label for="limit" class="element-invisible"><?php echo JText::_('JFIELD_PLG_SEARCH_SEARCHLIMIT_DESC'); ?> </label> <?php echo $this->pageNav->getLimitBox(); ?> </td> <?php } ?> </tr> </table>
/** * Method to load the Bootstrap JavaScript framework into the document head * * If debugging mode is on an uncompressed version of Bootstrap is included for easier debugging. * * @param mixed $debug Is debugging mode on? [optional] * * @return void * * @since 3.0 */ public static function framework($debug = null) { if (JevJoomlaVersion::isCompatible("3.0")) { JHtmlBootstrap::framework($debug); return; } // Only load once if (!empty(static::$loaded[__METHOD__])) { return; } // If no debugging value is set, use the configuration setting if ($debug === null) { $config = JFactory::getConfig(); $debug = (bool) $config->get('debug'); } /* if(!JHtml::_('script', 'jui/jquery.min.js', false, true, true, false, $debug)) { JHtml::_('script', 'libraries/jevents/bootstrap/js/jquery.min.js', false, true, false, false, $debug); } else { JHtml::_('script', 'jui/jquery.min.js', false, true, false, false, $debug); } */ // Make loading this conditional on config option ?? JFactory::getDocument()->addScript("//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"); //JHtml::_('script', 'com_jevents/jquery.min.js', false, true, false, false, $debug); // use bootstrap from CDN instead of our copy of it - problem though that target elements disappear when popover appears in Joomla 2.5 //JFactory::getDocument()->addScript("//maxcdn.bootstrapcdn.com/bootstrap/2.3.2/js/bootstrap.js"); JEVHelper::script("bootstrap.js", "com_jevents/", false, true); static::$loaded[__METHOD__] = true; return; }