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 
    }
}
Exemplo n.º 2
0
 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');
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
 function edit($tpl = null)
 {
     $document =& JFactory::getDocument();
     include JEV_LIBS . "editStrings.php";
     $document->addScriptDeclaration($editStrings);
     // WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!!
     JEVHelper::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');
     JEVHelper::script('editical.js', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/js/');
     $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.save", JText::_("save_copy_warning"), 'save', 'save', 'Save', false);
             $this->toolbarConfirmButton("icalevent.apply", JText::_("save_copy_warning"), 'apply', 'apply', 'Jev_Apply', false);
         } else {
             $this->toolbarConfirmButton("icalevent.save", JText::_("save_icalevent_warning"), 'save', 'save', 'Save', false);
             $this->toolbarConfirmButton("icalevent.apply", JText::_("save_icalevent_warning"), 'apply', 'apply', 'JEV_Apply', false);
         }
     } else {
         JToolBarHelper::save('icalevent.save');
         if (JEVHelper::isEventEditor()) {
             JToolBarHelper::apply('icalevent.apply', "JEV_Apply");
         }
         //$bar->appendButton( 'Apply',  'apply', "Apply",'icalevent.apply', false, false );
     }
     JToolBarHelper::cancel('icalevent.list');
     //JToolBarHelper::help( 'screen.icalevent.edit', true);
     $this->_hideSubmenu();
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     //$section = $params->getValue("section",0);
     JHTML::_('behavior.tooltip');
     $this->setCreatorLookup();
 }
Exemplo n.º 5
0
 /**
  * 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;
 }
Exemplo n.º 6
0
 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();
 }
Exemplo n.º 7
0
 function edit($tpl = null)
 {
     $document =& JFactory::getDocument();
     include JEV_ADMINLIBS . "/editStrings.php";
     $document->addScriptDeclaration($editStrings);
     // WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!!
     if (JVersion::isCompatible("1.6.0")) {
         JEVHelper::stylesheet('eventsadmin16.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('toolbarfix.js','components/'.JEV_COM_COMPONENT.'/assets/js/');
     $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.save", JText::_("save_copy_warning"), 'save', 'save', 'Save', false);
             if (JEVHelper::isEventEditor()) {
                 $this->toolbarConfirmButton("icalevent.apply", JText::_("save_copy_warning"), 'apply', 'apply', 'Apply', false);
             }
         } else {
             $this->toolbarConfirmButton("icalevent.save", JText::_("save_icalevent_warning"), 'save', 'save', 'Save', false);
             if (JEVHelper::isEventEditor()) {
                 $this->toolbarConfirmButton("icalevent.apply", JText::_("save_icalevent_warning"), 'apply', 'apply', 'Apply', false);
             }
         }
     } else {
         $this->toolbarButton("icalevent.save", 'save', 'save', 'Save', false);
         if (JEVHelper::isEventEditor()) {
             $this->toolbarButton("icalevent.apply", 'apply', 'apply', 'Apply', false);
         }
     }
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     if ($params->get("editpopup", 0)) {
         $document->addStyleDeclaration("div#toolbar-box{margin:10px 10px 0px 10px;} div#jevents {margin:0px 10px 10px 10px;} ");
         $this->toolbarButton("icalevent.close", 'cancel', 'cancel', 'Cancel', false);
         JRequest::setVar('tmpl', 'component');
         //force the component template
     } else {
         if ($this->id > 0) {
             $this->toolbarButton("icalevent.detail", 'cancel', 'cancel', 'Cancel', false);
         } else {
             $this->toolbarLinkButton("day.listevents", 'cancel', 'cancel', 'Cancel', false);
         }
     }
     JHTML::_('behavior.tooltip');
     // I pass in the rp_id so that I can return to the repeat I was viewing before editing
     $this->assign("rp_id", JRequest::getInt("rp_id", 0));
     $this->setCreatorLookup();
     $this->_adminStart();
     parent::displaytemplate($tpl);
     $this->_adminEnd();
 }
Exemplo n.º 8
0
 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');
     $bar = JToolBar::getInstance('toolbar');
     $this->toolbarConfirmButton("icalrepeat.save", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'save', 'save', 'Save', false);
     if (JEVHelper::isEventEditor()) {
         $this->toolbarConfirmButton("icalrepeat.apply", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'apply', 'apply', 'jev_Apply', false);
     }
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
         $document->addStyleDeclaration("div#toolbar-box{margin:10px 10px 0px 10px;} div#jevents {margin:0px 10px 10px 10px;} ");
         $this->toolbarButton("icalevent.close", 'cancel', 'cancel', 'Cancel', false);
         JRequest::setVar('tmpl', 'component');
         //force the component template
     } else {
         $this->toolbarButton("icalevent.detail", 'cancel', 'cancel', 'Cancel', false);
     }
     //JToolBarHelper::help( 'screen.icalrepeat.edit', true);
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     JHTML::_('behavior.tooltip');
     $this->_adminStart();
     if (JevJoomlaVersion::isCompatible("3.0")) {
         // load Joomla javascript classes
         JHTML::_('behavior.core');
         $this->setLayout("edit");
     } else {
         $this->setLayout("edit16");
     }
     $this->setupEditForm();
     JEVHelper::componentStylesheet($this, "editextra.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/');
     }
     parent::displaytemplate($tpl);
     $this->_adminEnd();
 }
function DefaultEventManagementButton($view, $row)
{
    JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . "/assets/js/");
    ?>
	<a href="#my-modal" data-toggle="modal"  data-target="#action_dialogJQ<?php 
    echo $row->rp_id();
    ?>
"  title="<?php 
    echo JText::_('JEV_E_EDIT', true);
    ?>
">
		<?php 
    echo JEVHelper::imagesite('edit.png', JText::_('JEV_E_EDIT'));
    ?>
	</a>
	<?php 
}
Exemplo n.º 10
0
 function edit($tpl = null)
 {
     $this->_hideSubmenu();
     include_once JPATH_ADMINISTRATOR . DS . "includes" . DS . "toolbar.php";
     // TODO find the active admin template
     if (!JVersion::isCompatible("1.6.0")) {
         JEVHelper::stylesheet("template.css", JURI::root() . "administrator/templates/khepri/css/");
     }
     // WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!!
     if (JVersion::isCompatible("1.6.0")) {
         JEVHelper::stylesheet('eventsadmin16.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');
     } else {
         JEVHelper::stylesheet('eventsadmin.css', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/css/');
     }
     JEVHelper::script('editdefaults.js', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/js/');
     $document =& JFactory::getDocument();
     $document->setTitle(JText::_('JEV_LAYOUT_DEFAULT_EDIT'));
     // Set toolbar items for the page
     JToolBarHelper::title(JText::_('JEV_LAYOUT_DEFAULT_EDIT'), 'jevents');
     JToolBarHelper::save("defaults.save");
     JToolBarHelper::cancel("defaults.cancel");
     JSubMenuHelper::addEntry(JText::_('DEFAULTS'), 'index.php?option=' . JEV_COM_COMPONENT, true);
     JHTML::_('behavior.tooltip');
     $db =& JFactory::getDBO();
     $uri =& JFactory::getURI();
     // Get data from the model
     $model =& $this->getModel();
     $item =& $this->get('Data');
     if (strpos($item->name, "com_") === 0) {
         $parts = explode(".", $item->name);
         // special numbered case e.g. managed people
         if (count($parts) == 4) {
             $iname = str_replace(".{$parts['2']}.", ".", $item->name);
         } else {
             $iname = $item->name;
         }
         $this->_addPath('template', JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl");
         if ($item->value == "" && file_exists(JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl/" . $iname . ".html")) {
             $item->value = file_get_contents(JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl/" . $iname . ".html");
         }
     }
     $this->assignRef('item', $item);
     parent::displaytemplate($tpl);
 }
Exemplo n.º 11
0
 function ical($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->getCalendarData($this->year, $this->month, $this->day);
     // for adding events in day cell
     $this->popup = false;
     if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
         JevHtmlBootstrap::modal();
         JEVHelper::script('editpopup.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
         $this->popup = true;
         $this->popupw = $params->get("popupw", 800);
         $this->popuph = $params->get("popuph", 600);
     }
     $this->is_event_creator = JEVHelper::isEventCreator();
 }
Exemplo n.º 12
0
 function edit($tpl = null)
 {
     include_once JPATH_ADMINISTRATOR . '/' . "includes" . '/' . "toolbar.php";
     // WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!!
     JEVHelper::script('editdefaults.js', 'administrator/components/' . JEV_COM_COMPONENT . '/assets/js/');
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('JEV_LAYOUT_DEFAULT_EDIT'));
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     $requiredfields = $params->get("com_jeveditionrequiredfields", "");
     if (!empty($requiredfields)) {
         $requiredfields = "'" . implode("','", $requiredfields) . "'";
     }
     // Set toolbar items for the page
     JToolBarHelper::title(JText::_('JEV_LAYOUT_DEFAULT_EDIT'), 'jevents');
     JToolBarHelper::apply("defaults.apply");
     JToolBarHelper::save("defaults.save");
     JToolBarHelper::cancel("defaults.cancel");
     JEventsHelper::addSubmenu();
     JHTML::_('behavior.tooltip');
     $db = JFactory::getDBO();
     $uri = JFactory::getURI();
     // Get data from the model
     $model = $this->getModel();
     $item = $this->get('Data');
     if (strpos($item->name, "com_") === 0) {
         $parts = explode(".", $item->name);
         // special numbered case e.g. managed people
         if (count($parts) == 4) {
             $iname = str_replace(".{$parts['2']}.", ".", $item->name);
         } else {
             $iname = $item->name;
         }
         $this->_addPath('template', JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl");
         if ($item->value == "" && file_exists(JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl/" . $iname . ".html")) {
             $item->value = file_get_contents(JPATH_ADMINISTRATOR . "/components/" . $parts[0] . "/views/defaults/tmpl/" . $iname . ".html");
         }
     }
     $this->assignRef('item', $item);
     $this->assignRef('requiredfields', $requiredfields);
     parent::displaytemplate($tpl);
 }
Exemplo n.º 13
0
function DefaultEventIcalButton($view, $row)
{
    JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . "/assets/js/");
    ?>
	<a href="#myical-modal" data-target="#ical_dialogJQ<?php 
    echo $row->rp_id();
    ?>
" data-toggle="modal" title="<?php 
    echo JText::_('JEV_SAVEICAL');
    ?>
">
		<img src="<?php 
    echo JURI::root() . 'components/' . JEV_COM_COMPONENT . '/assets/images/jevents_event_sml.png';
    ?>
" align="middle" name="image"  alt="<?php 
    echo JText::_('JEV_SAVEICAL');
    ?>
" class="h24px jev_ev_sml nothumb"/>
	</a>
	<?php 
}
Exemplo n.º 14
0
 function edit($tpl = null)
 {
     $document =& JFactory::getDocument();
     include JEV_ADMINLIBS . "/editStrings.php";
     $document->addScriptDeclaration($editStrings);
     // WHY THE HELL DO THEY BREAK PUBLIC FUNCTIONS !!!
     if (JVersion::isCompatible("1.6.0")) {
         JEVHelper::stylesheet('eventsadmin16.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');
     //JToolBarHelper::save('icalrepeat.save');
     //$this->addSaveToolBarButton();
     $submitbutton = JVersion::isCompatible("1.6.0") ? "Joomla.submitbutton" : "submitbutton";
     $toolbar =& JToolBar::getInstance('toolbar');
     $html = '<a class="toolbar" onclick="javascript: ' . $submitbutton . '(\'icalrepeat.save\');return false;" href="#"><span class="icon-32-save" title="Save"> </span>' . JText::_('SAVE') . '</a>';
     $toolbar->appendButton('Custom', $html, "customsave");
     $html = '<a class="toolbar" onclick="javascript: ' . $submitbutton . '(\'icalrepeat.apply\');return false;" href="#"><span class="icon-32-apply" title="Save"> </span>' . JText::_('JEV_APPLY') . '</a>';
     $toolbar->appendButton('Custom', $html, "customapply");
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     if ($params->get("editpopup", 0)) {
         $document->addStyleDeclaration("div#toolbar-box{margin:10px 10px 0px 10px;} div#jevents {margin:0px 10px 10px 10px;} ");
         JToolBarHelper::custom("icalevent.close", 'cancel', 'cancel', 'Cancel', false);
         JRequest::setVar('tmpl', 'component');
         //force the component template
     } else {
         $this->addCancelToolBarButton();
     }
     //JToolBarHelper::help( 'screen.icalrepeat.edit', true);
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     JHTML::_('behavior.tooltip');
     $this->_adminStart();
     parent::displaytemplate($tpl);
     $this->_adminEnd();
 }
Exemplo n.º 15
0
function DefaultViewEventRowAdmin($view, $row, $manage = false)
{
    $popup = false;
    $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
    if ($params->get("editpopup", 0)) {
        JHTML::_('behavior.modal');
        JEVHelper::script('editpopup.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
        $popup = true;
        $popupw = $params->get("popupw", 800);
        $popuph = $params->get("popuph", 600);
    }
    $editLink = $row->editLink(true);
    $editLink = $popup ? "javascript:jevEditPopup('" . $editLink . "',{$popupw}, {$popuph});" : $editLink;
    $modifylink = "";
    if (!$manage && JEVHelper::canEditEvent($row)) {
        $modifylink = '<a href="' . $row->editlink(true) . '" title="' . JText::_('JEV_MODIFY') . '"><b>' . JText::_('JEV_MODIFY') . "</b></a>\n";
        $modifylink = '<a href="' . $editLink . '" title="' . JText::_('JEV_MODIFY') . '"><b>' . JText::_('JEV_MODIFY') . "</b></a>\n";
    }
    $deletelink = "";
    if (!$manage && JEVHelper::canDeleteEvent($row)) {
        $deletelink = '<a href="' . $row->deletelink(false) . "&rettask=admin.listevents" . '" title="' . JText::_('JEV_DELETE') . '"><b>' . JText::_('JEV_DELETE') . "</b></a>\n";
    }
    if (!$manage && JEVHelper::canPublishEvent($row)) {
        if ($row->published()) {
            $publishlink = '<a href="' . $row->unpublishlink(false) . "&rettask=admin.listevents" . '" title="' . JText::_('UNPUBLISH') . '"><b>' . JText::_('UNPUBLISH') . "</b></a>\n";
        } else {
            $publishlink = '<a href="' . $row->publishlink(false) . "&rettask=admin.listevents" . '" title="' . JText::_('PUBLISH') . '"><b>' . JText::_('PUBLISH') . "</b></a>\n";
        }
    } else {
        $publishlink = "";
    }
    $eventlink = $row->viewDetailLink($row->yup(), $row->mup(), $row->dup(), false);
    $eventlink = JRoute::_($eventlink . $view->datamodel->getCatidsOutLink());
    $border = "border-color:" . $row->bgcolor() . ";";
    ?>
		
		<li class="ev_td_li" style="<?php 
    echo $border;
    ?>
">
			<a class="<?php 
    echo $row->state() ? 'ev_link_row' : 'ev_link_unpublished';
    ?>
" href="<?php 
    echo $eventlink;
    ?>
" title="<?php 
    echo JEventsHTML::special($row->title()) . ($row->state() ? '' : JText::_('JEV_UNPUBLISHED'));
    ?>
"><?php 
    echo $row->title() . ($row->state() ? '' : JText::_('JEV_UNPUBLISHED'));
    ?>
</a>
			&nbsp;<?php 
    echo JText::_('JEV_BY');
    ?>
			&nbsp;<i><?php 
    echo $row->contactlink('', true);
    ?>
</i>
			&nbsp;&nbsp;<?php 
    echo $deletelink;
    ?>
			&nbsp;&nbsp;<?php 
    echo $modifylink;
    ?>
			&nbsp;&nbsp;<?php 
    echo $publishlink;
    ?>
		</li>
		<?php 
}
Exemplo n.º 16
0
 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('JevStdRequiredFieldsJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
     if ($this->row->title() <= "") {
         // Set toolbar items for the page
         JToolBarHelper::title(JText::_('CREATE_ICAL_EVENT'), 'jevents');
         $document->setTitle(JText::_('CREATE_ICAL_EVENT'));
     } else {
         // Set toolbar items for the page
         JToolBarHelper::title(JText::_('EDIT_ICAL_EVENT'), 'jevents');
         $document->setTitle(JText::_('EDIT_ICAL_EVENT'));
     }
     $bar = JToolBar::getInstance('toolbar');
     if ($this->id > 0) {
         if ($this->editCopy) {
             if (JEVHelper::isEventEditor() || JEVHelper::canEditEvent($this->row)) {
                 $this->toolbarConfirmButton("icalevent.apply", JText::_("JEV_SAVE_COPY_WARNING"), 'apply', 'apply', 'JEV_SAVE', false);
             }
             //$this->toolbarConfirmButton("icalevent.savenew", JText::_("JEV_SAVE_COPY_WARNING"), 'save', 'save', 'JEV_SAVE_NEW', false);
             $this->toolbarConfirmButton("icalevent.save", JText::_("JEV_SAVE_COPY_WARNING"), 'save', 'save', 'JEV_SAVE_CLOSE', false);
         } else {
             if (JEVHelper::isEventEditor() || JEVHelper::canEditEvent($this->row)) {
                 $this->toolbarConfirmButton("icalevent.apply", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'apply', 'apply', 'JEV_SAVE', false);
             }
             //$this->toolbarConfirmButton("icalevent.savenew", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'save', 'save', 'JEV_SAVE_NEW', false);
             $this->toolbarConfirmButton("icalevent.save", JText::_("JEV_SAVE_ICALEVENT_WARNING"), 'save', 'save', 'JEV_SAVE_CLOSE', false);
         }
     } else {
         $canEditOwn = false;
         $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
         if (!$params->get("authorisedonly", 0)) {
             $juser = JFactory::getUser();
             $canEditOwn = $juser->authorise('core.edit.own', 'com_jevents');
         }
         if (JEVHelper::isEventEditor() || $canEditOwn) {
             $this->toolbarButton("icalevent.apply", 'apply', 'apply', 'JEV_SAVE', false);
         }
         //JToolBarHelper::save('icalevent.savenew', "JEV_Save_New");
         $this->toolbarButton("icalevent.save", 'save', 'save', 'JEV_SAVE_CLOSE', false);
     }
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     $evedrd = $params->get("editreturnto", "day.listevents");
     if ($params->get("editpopup", 0)) {
         $document->addStyleDeclaration("div#toolbar-box{margin:10px 10px 0px 10px;} div#jevents {margin:0px 10px 10px 10px;} ");
         $this->toolbarButton("icalevent.close", 'cancel', 'cancel', 'Cancel', false);
         JRequest::setVar('tmpl', 'component');
         //force the component template
     } else {
         if ($this->id > 0) {
             $this->toolbarButton("icalrepeat.detail", 'cancel', 'cancel', 'Cancel', false);
         } else {
             $this->toolbarButton($evedrd, 'cancel', 'cancel', 'Cancel', false);
         }
     }
     // I pass in the rp_id so that I can return to the repeat I was viewing before editing
     $this->assign("rp_id", JRequest::getInt("rp_id", 0));
     $this->_adminStart();
     // load Joomla javascript classes
     JHTML::_('behavior.core');
     $this->setLayout("edit");
     JEVHelper::componentStylesheet($this, "editextra.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/');
     }
     $this->setupEditForm();
     parent::displaytemplate($tpl);
     $this->_adminEnd();
 }
Exemplo n.º 17
0
    /**
     * 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"  />';
    }
Exemplo n.º 18
0
    protected function translationLinks($row)
    {
        if ($this->languages) {
            JevHtmlBootstrap::modal();
            JEVHelper::script('editpopupJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
            // Any existing translations ?
            $db = JFactory::getDbo();
            $db->setQuery("SELECT language FROM #__jevents_translation where evdet_id= " . $row->evdet_id);
            $translations = $db->loadColumn();
            // test styling for existing translation
            //$translations[] = "cy-GB";
            ?>
			<ul class="item-associations">
			<?php 
            foreach ($this->languages as $id => $item) {
                $text = strtoupper($item->sef);
                $url = JRoute::_('index.php?option=com_jevents&task=icalevent.translate&evdet_id=' . $row->evdet_id . '&ev_id=' . $row->ev_id . '&pop=1&tmpl=component&lang=' . $item->lang_code);
                $img = JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->title, array('title' => $item->title), true);
                $url = "javascript:jevEditTranslation('" . $url . "', '" . JText::sprintf("JEV_TRANSLATE_EVENT_TO", addslashes($item->title), array('jsSafe' => true)) . "'); ";
                $tooltipParts = array($img, $item->title);
                $item->link = JHtml::_('tooltip', implode(' ', $tooltipParts), null, null, $text, $url, null, 'hasTooltip label label-association label-' . $item->sef . (in_array($item->lang_code, $translations) ? " hastranslation" : ""));
                ?>
				<li>
				<?php 
                echo $item->link;
                ?>
				</li>
			<?php 
            }
            ?>
			</ul>
		<?php 
        }
    }
Exemplo n.º 19
0
function DefaultLoadedFromTemplate($view, $template_name, $event, $mask, $template_value = false)
{
    $db = JFactory::getDBO();
    // find published template
    static $templates;
    static $fieldNameArray;
    if (!isset($templates)) {
        $templates = array();
        $fieldNameArray = array();
        $rawtemplates = array();
    }
    $specialmodules = false;
    if (!$template_value) {
        if (!array_key_exists($template_name, $templates)) {
            $db->setQuery("SELECT * FROM #__jev_defaults WHERE state=1 AND name= " . $db->Quote($template_name) . " AND " . 'language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')');
            $rawtemplates = $db->loadObjectList();
            $templates[$template_name] = array();
            if ($rawtemplates) {
                foreach ($rawtemplates as $rt) {
                    if (!isset($templates[$template_name][$rt->language])) {
                        $templates[$template_name][$rt->language] = array();
                    }
                    $templates[$template_name][$rt->language][$rt->catid] = $rt;
                }
            }
            if (count($templates[$template_name]) == 0) {
                $templates[$template_name] = null;
                return false;
            }
            if (isset($templates[$template_name][JFactory::getLanguage()->getTag()])) {
                $templateArray = $templates[$template_name][JFactory::getLanguage()->getTag()];
                // We have the most specific by language now fill in the gaps
                if (isset($templates[$template_name]["*"])) {
                    foreach ($templates[$template_name]["*"] as $cat => $cattemplates) {
                        if (!isset($templateArray[$cat])) {
                            $templateArray[$cat] = $cattemplates;
                        }
                    }
                }
                $templates[$template_name] = $templateArray;
            } else {
                if (isset($templates[$template_name]["*"])) {
                    $templates[$template_name] = $templates[$template_name]["*"];
                } else {
                    if (is_array($templates[$template_name]) && count($templates[$template_name]) == 0) {
                        $templates[$template_name] = null;
                    } else {
                        if (is_array($templates[$template_name]) && count($templates[$template_name]) > 0) {
                            $templates[$template_name] = current($templates[$template_name]);
                        } else {
                            $templates[$template_name] = null;
                        }
                    }
                }
            }
            $matched = false;
            foreach (array_keys($templates[$template_name]) as $catid) {
                if ($templates[$template_name][$catid]->value != "") {
                    if (isset($templates[$template_name][$catid]->params)) {
                        $templates[$template_name][$catid]->params = new JRegistry($templates[$template_name][$catid]->params);
                        $specialmodules = $templates[$template_name][$catid]->params;
                    }
                    // Adjust template_value to include dynamic module output then strip it out afterwards
                    if ($specialmodules) {
                        $modids = $specialmodules->get("modid", array());
                        if (count($modids) > 0) {
                            $modvals = $specialmodules->get("modval", array());
                            // not sure how this can arise :(
                            if (is_object($modvals)) {
                                $modvals = get_object_vars($modvals);
                            }
                            for ($count = 0; $count < count($modids) && $count < count($modvals) && trim($modids[$count]) != ""; $count++) {
                                $templates[$template_name][$catid]->value .= "{{module start:MODULESTART#" . $modids[$count] . "}}";
                                // cleaned later!
                                //$templates[$template_name][$catid]->value .= preg_replace_callback('|{{.*?}}|', 'cleanLabels', $modvals[$count]);
                                $templates[$template_name][$catid]->value .= $modvals[$count];
                                $templates[$template_name][$catid]->value .= "{{module end:MODULEEND}}";
                            }
                        }
                    }
                    // strip carriage returns other wise the preg replace doesn;y work - needed because wysiwyg editor may add the carriage return in the template field
                    $templates[$template_name][$catid]->value = str_replace("\r", '', $templates[$template_name][$catid]->value);
                    $templates[$template_name][$catid]->value = str_replace("\n", '', $templates[$template_name][$catid]->value);
                    // non greedy replacement - because of the ?
                    $templates[$template_name][$catid]->value = preg_replace_callback('|{{.*?}}|', 'cleanLabels', $templates[$template_name][$catid]->value);
                    $matchesarray = array();
                    preg_match_all('|{{.*?}}|', $templates[$template_name][$catid]->value, $matchesarray);
                    $templates[$template_name][$catid]->matchesarray = $matchesarray;
                }
            }
        }
        if (is_null($templates[$template_name])) {
            return false;
        }
        $catids = $event->catids() && count($event->catids()) ? $event->catids() : array($event->catid());
        $catids[] = 0;
        // find the overlap
        $catids = array_intersect($catids, array_keys($templates[$template_name]));
        // At present must be an EXACT category match - no inheriting allowed!
        if (count($catids) == 0) {
            if (!isset($templates[$template_name][0]) || $templates[$template_name][0]->value == "") {
                return false;
            }
        }
        $template = false;
        foreach ($catids as $catid) {
            // use the first matching non-empty layout
            if ($templates[$template_name][$catid]->value != "") {
                $template = $templates[$template_name][$catid];
                break;
            }
        }
        if (!$template) {
            return false;
        }
        $template_value = $template->value;
        $specialmodules = $template->params;
        $matchesarray = $template->matchesarray;
    } else {
        // This is a special scenario where we call this function externally e.g. from RSVP Pro messages
        // In this scenario we have not gone through the displaycustomfields plugin
        static $pluginscalled = array();
        if (!isset($pluginscalled[$event->rp_id()])) {
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin("jevents");
            $customresults = $dispatcher->trigger('onDisplayCustomFields', array(&$event));
            $pluginscalled[$event->rp_id()] = $event;
        } else {
            $event = $pluginscalled[$event->rp_id()];
        }
        // Adjust template_value to include dynamic module output then strip it out afterwards
        if ($specialmodules) {
            $modids = $specialmodules->get("modid", array());
            if (count($modids) > 0) {
                $modvals = $specialmodules->get("modval", array());
                // not sure how this can arise :(
                if (is_object($modvals)) {
                    $modvals = get_object_vars($modvals);
                }
                for ($count = 0; $count < count($modids) && $count < count($modvals) && trim($modids[$count]) != ""; $count++) {
                    $template_value .= "{{module start:MODULESTART#" . $modids[$count] . "}}";
                    // cleaned later!
                    //$template_value .= preg_replace_callback('|{{.*?}}|', 'cleanLabels', $modvals[$count]);
                    $template_value .= $modvals[$count];
                    $template_value .= "{{module end:MODULEEND}}";
                }
            }
        }
        // strip carriage returns other wise the preg replace doesn;y work - needed because wysiwyg editor may add the carriage return in the template field
        $template_value = str_replace("\r", '', $template_value);
        $template_value = str_replace("\n", '', $template_value);
        // non greedy replacement - because of the ?
        $template_value = preg_replace_callback('|{{.*?}}|', 'cleanLabels', $template_value);
        $matchesarray = array();
        preg_match_all('|{{.*?}}|', $template_value, $matchesarray);
    }
    if ($template_value == "") {
        return;
    }
    if (count($matchesarray) == 0) {
        return;
    }
    // now replace the fields
    $search = array();
    $replace = array();
    $blank = array();
    $rawreplace = array();
    $jevparams = JComponentHelper::getParams(JEV_COM_COMPONENT);
    for ($i = 0; $i < count($matchesarray[0]); $i++) {
        $strippedmatch = preg_replace('/(#|:|;)+[^}]*/', '', $matchesarray[0][$i]);
        if (in_array($strippedmatch, $search)) {
            continue;
        }
        // translation string
        if (strpos($strippedmatch, "{{_") === 0 && strpos($strippedmatch, " ") === false) {
            $search[] = $strippedmatch;
            $strippedmatch = substr($strippedmatch, 3, strlen($strippedmatch) - 5);
            $replace[] = JText::_($strippedmatch);
            $blank[] = "";
            continue;
        }
        // Built in fields
        switch ($strippedmatch) {
            case "{{TITLE}}":
                $search[] = "{{TITLE}}";
                $replace[] = $event->title();
                $blank[] = "";
                break;
            case "{{PRIORITY}}":
                $search[] = "{{PRIORITY}}";
                $replace[] = $event->priority();
                $blank[] = "";
                break;
            case "{{LINK}}":
            case "{{LINKSTART}}":
            case "{{LINKEND}}":
            case "{{TITLE_LINK}}":
                if ($view) {
                    // Title link
                    $rowlink = $event->viewDetailLink($event->yup(), $event->mup(), $event->dup(), false);
                    $rowlink = JRoute::_($rowlink . $view->datamodel->getCatidsOutLink());
                    ob_start();
                    ?>
					<a class="ev_link_row" href="<?php 
                    echo $rowlink;
                    ?>
" title="<?php 
                    echo JEventsHTML::special($event->title());
                    ?>
">
						<?php 
                    $linkstart = ob_get_clean();
                } else {
                    $rowlink = $linkstart = "";
                }
                $search[] = "{{LINK}}";
                $replace[] = $rowlink;
                $blank[] = "";
                $search[] = "{{LINKSTART}}";
                $replace[] = $linkstart;
                $blank[] = "";
                $search[] = "{{LINKEND}}";
                $replace[] = "</a>";
                $blank[] = "";
                $fulllink = $linkstart . $event->title() . '</a>';
                $search[] = "{{TITLE_LINK}}";
                $replace[] = $fulllink;
                $blank[] = "";
                break;
            case "{{TRUNCTITLE}}":
                // for month calendar cell only
                if (isset($event->truncatedtitle)) {
                    $search[] = "{{TRUNCTITLE}}";
                    $replace[] = $event->truncatedtitle;
                    $blank[] = "";
                } else {
                    $search[] = "{{TRUNCTITLE}}";
                    $replace[] = $event->title();
                    $blank[] = "";
                }
                break;
            case "{{URL}}":
                $search[] = "{{URL}}";
                $replace[] = $event->url();
                $blank[] = "";
                break;
            case "{{TRUNCATED_DESC}}":
                $search[] = "{{TRUNCATED_DESC:.*?}}";
                $replace[] = $event->content();
                $blank[] = "";
                //	$search[]="|{{TRUNCATED_DESC:(.*)}}|";$replace[]=$event->content();
                break;
            case "{{DESCRIPTION}}":
                $search[] = "{{DESCRIPTION}}";
                $replace[] = $event->content();
                $blank[] = "";
                break;
            case "{{MANAGEMENT}}":
                $search[] = "{{MANAGEMENT}}";
                if ($view) {
                    ob_start();
                    $view->_viewNavAdminPanel();
                    $replace[] = ob_get_clean();
                } else {
                    $replace[] = "";
                }
                $blank[] = "";
                break;
            case "{{CATEGORY}}":
                $search[] = "{{CATEGORY}}";
                $replace[] = $event->catname();
                $blank[] = "";
                break;
            case "{{ALLCATEGORIES}}":
                $search[] = "{{ALLCATEGORIES}}";
                static $allcat_catids;
                if (!isset($allcat_catids)) {
                    $db = JFactory::getDBO();
                    $arr_catids = array();
                    $catsql = "SELECT cat.id, cat.title as name FROM #__categories  as cat WHERE cat.extension='com_jevents' ";
                    $db->setQuery($catsql);
                    $allcat_catids = $db->loadObjectList('id');
                }
                $db = JFactory::getDbo();
                $db->setQuery("Select catid from #__jevents_catmap  WHERE evid = " . $event->ev_id());
                $allcat_eventcats = $db->loadColumn();
                $allcats = array();
                foreach ($allcat_eventcats as $catid) {
                    if (isset($allcat_catids[$catid])) {
                        $allcats[] = $allcat_catids[$catid]->name;
                    }
                }
                $replace[] = implode(", ", $allcats);
                $blank[] = "";
                break;
            case "{{CALENDAR}}":
                $search[] = "{{CALENDAR}}";
                $replace[] = $event->getCalendarName();
                $blank[] = "";
                break;
            case "{{COLOUR}}":
            case "{{colour}}":
                $bgcolor = $event->bgcolor();
                $search[] = $strippedmatch;
                $replace[] = $bgcolor == "" ? "#ffffff" : $bgcolor;
                $blank[] = "";
                break;
            case "{{FGCOLOUR}}":
                $search[] = "{{FGCOLOUR}}";
                $replace[] = $event->fgcolor();
                $blank[] = "";
                break;
            case "{{TTTIME}}":
                $search[] = "{{TTTIME}}";
                $replace[] = "[[TTTIME]]";
                $blank[] = "";
                break;
            case "{{EVTTIME}}":
                $search[] = "{{EVTTIME}}";
                $replace[] = "[[EVTTIME]]";
                $blank[] = "";
                break;
            case "{{TOOLTIP}}":
                $search[] = "{{TOOLTIP}}";
                $replace[] = "[[TOOLTIP]]";
                $blank[] = "";
                break;
            case "{{CATEGORYLNK}}":
                $router = JRouter::getInstance("site");
                $catlinks = array();
                if ($jevparams->get("multicategory", 0)) {
                    $catids = $event->catids();
                    $catdata = $event->getCategoryData();
                } else {
                    $catids = array($event->catid());
                    $catdata = array($event->getCategoryData());
                }
                $vars = $router->getVars();
                foreach ($catids as $cat) {
                    $vars["catids"] = $cat;
                    $catname = "xxx";
                    foreach ($catdata as $cg) {
                        if ($cat == $cg->id) {
                            $catname = $cg->name;
                            break;
                        }
                    }
                    $eventlink = "index.php?";
                    foreach ($vars as $key => $val) {
                        // this is only used in the latest events module so do not perpetuate it here
                        if ($key == "filter_reset") {
                            continue;
                        }
                        if ($key == "task" && ($val == "icalrepeat.detail" || $val == "icalevent.detail")) {
                            $val = "week.listevents";
                        }
                        $eventlink .= $key . "=" . $val . "&";
                    }
                    $eventlink = substr($eventlink, 0, strlen($eventlink) - 1);
                    $eventlink = JRoute::_($eventlink);
                    $catlinks[] = '<a class="ev_link_cat" href="' . $eventlink . '"  title="' . JEventsHTML::special($catname) . '">' . $catname . '</a>';
                }
                $search[] = "{{CATEGORYLNK}}";
                $replace[] = implode(", ", $catlinks);
                $blank[] = "";
                break;
            case "{{CATEGORYIMG}}":
                $search[] = "{{CATEGORYIMG}}";
                $replace[] = $event->getCategoryImage();
                $blank[] = "";
                break;
            case "{{CATEGORYIMGS}}":
                $search[] = "{{CATEGORYIMGS}}";
                $replace[] = $event->getCategoryImage(true);
                $blank[] = "";
                break;
            case "{{CATDESC}}":
                $search[] = "{{CATDESC}}";
                $replace[] = $event->getCategoryDescription();
                $blank[] = "";
                break;
            case "{{CATID}}":
                $search[] = "{{CATID}}";
                $replace[] = $event->catid();
                $blank[] = "";
                break;
            case "{{PARENT_CATEGORY}}":
                $search[] = "{{PARENT_CATEGORY}}";
                $replace[] = $event->getParentCategory();
                $blank[] = "";
                break;
            case "{{ICALDIALOG}}":
            case "{{ICALBUTTON}}":
            case "{{EDITDIALOG}}":
            case "{{EDITBUTTON}}":
                static $styledone = false;
                if (!$styledone) {
                    $document = JFactory::getDocument();
                    $document->addStyleDeclaration("div.jevdialogs {position:relative;margin-top:35px;text-align:left;}\n div.jevdialogs img{float:none!important;margin:0px}");
                    $styledone = true;
                }
                if ($jevparams->get("showicalicon", 0) && !$jevparams->get("disableicalexport", 0)) {
                    JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . "/assets/js/");
                    $cssloaded = true;
                    ob_start();
                    ?>
						<a href="javascript:void(0)" onclick='clickIcalButton()' title="<?php 
                    echo JText::_('JEV_SAVEICAL');
                    ?>
">
							<img src="<?php 
                    echo JURI::root() . 'components/' . JEV_COM_COMPONENT . '/assets/images/jevents_event_sml.png';
                    ?>
" name="image"  alt="<?php 
                    echo JText::_('JEV_SAVEICAL');
                    ?>
" class="jev_ev_sml nothumb"/>
						</a>
						<div class="jevdialogs">
						<?php 
                    $search[] = "{{ICALDIALOG}}";
                    if ($view) {
                        ob_start();
                        $view->eventIcalDialog($event, $mask);
                        $dialog = ob_get_clean();
                        $replace[] = $dialog;
                    } else {
                        $replace[] = "";
                    }
                    $blank[] = "";
                    echo $dialog;
                    ?>
						</div>

						<?php 
                    $search[] = "{{ICALBUTTON}}";
                    $replace[] = ob_get_clean();
                    $blank[] = "";
                } else {
                    $search[] = "{{ICALBUTTON}}";
                    $replace[] = "";
                    $blank[] = "";
                    $search[] = "{{ICALDIALOG}}";
                    $replace[] = "";
                    $blank[] = "";
                }
                if (JEVHelper::canEditEvent($event) || JEVHelper::canPublishEvent($event) || JEVHelper::canDeleteEvent($event)) {
                    JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . "/assets/js/");
                    ob_start();
                    ?>
						<a href="javascript:void(0)" onclick='clickEditButton()' title="<?php 
                    echo JText::_('JEV_E_EDIT');
                    ?>
">
							<?php 
                    echo JEVHelper::imagesite('edit.png', JText::_('JEV_E_EDIT'));
                    ?>
						</a>
						<div class="jevdialogs">
						<?php 
                    $search[] = "{{EDITDIALOG}}";
                    if ($view) {
                        ob_start();
                        $view->eventManagementDialog($event, $mask);
                        $dialog = ob_get_clean();
                        $replace[] = $dialog;
                    } else {
                        $replace[] = "";
                    }
                    $blank[] = "";
                    echo $dialog;
                    ?>
						</div>

						<?php 
                    $search[] = "{{EDITBUTTON}}";
                    $replace[] = ob_get_clean();
                    $blank[] = "";
                } else {
                    $search[] = "{{EDITBUTTON}}";
                    $replace[] = "";
                    $blank[] = "";
                    $search[] = "{{EDITDIALOG}}";
                    $replace[] = "";
                    $blank[] = "";
                }
                break;
            case "{{CREATED}}":
                $compparams = JComponentHelper::getParams(JEV_COM_COMPONENT);
                $jtz = $compparams->get("icaltimezonelive", "");
                if ($jtz == "") {
                    $jtz = null;
                }
                $created = JevDate::getDate($event->created(), $jtz);
                $search[] = "{{CREATED}}";
                $replace[] = $created->toFormat(JText::_("DATE_FORMAT_CREATED"));
                $blank[] = "";
                break;
            case "{{ACCESS}}":
                $search[] = "{{ACCESS}}";
                $replace[] = $event->getAccessName();
                $blank[] = "";
                break;
            case "{{REPEATSUMMARY}}":
            case "{{STARTDATE}}":
            case "{{ENDDATE}}":
            case "{{STARTTIME}}":
            case "{{ENDTIME}}":
            case "{{STARTTZ}}":
            case "{{ENDTZ}}":
            case "{{ISOSTART}}":
            case "{{ISOEND}}":
            case "{{DURATION}}":
            case "{{MULTIENDDATE}}":
                if ($template_name == "icalevent.detail_body") {
                    $search[] = "{{REPEATSUMMARY}}";
                    $repeatsummary = $view->repeatSummary($event);
                    if (!$repeatsummary) {
                        $repeatsummary = $event->repeatSummary();
                    }
                    $replace[] = $repeatsummary;
                    //$replace[] = $event->repeatSummary();
                    $blank[] = "";
                    $row = $event;
                    $start_date = JEventsHTML::getDateFormat($row->yup(), $row->mup(), $row->dup(), 0);
                    $start_time = JEVHelper::getTime($row->getUnixStartTime(), $row->hup(), $row->minup());
                    $stop_date = JEventsHTML::getDateFormat($row->ydn(), $row->mdn(), $row->ddn(), 0);
                    $stop_time = JEVHelper::getTime($row->getUnixEndTime(), $row->hdn(), $row->mindn());
                    $stop_time_midnightFix = $stop_time;
                    $stop_date_midnightFix = $stop_date;
                    if ($row->sdn() == 59 && $row->mindn() == 59) {
                        $stop_time_midnightFix = JEVHelper::getTime($row->getUnixEndTime() + 1, 0, 0);
                        $stop_date_midnightFix = JEventsHTML::getDateFormat($row->ydn(), $row->mdn(), $row->ddn() + 1, 0);
                    }
                    $search[] = "{{STARTDATE}}";
                    $replace[] = $start_date;
                    $blank[] = "";
                    $search[] = "{{ENDDATE}}";
                    $replace[] = $stop_date;
                    $blank[] = "";
                    $search[] = "{{STARTTIME}}";
                    $replace[] = $row->alldayevent() ? "" : $start_time;
                    $blank[] = "";
                    $search[] = "{{ENDTIME}}";
                    $replace[] = $row->noendtime() || $row->alldayevent() ? "" : $stop_time_midnightFix;
                    $blank[] = "";
                    $search[] = "{{STARTTZ}}";
                    $replace[] = $row->alldayevent() ? "" : $start_time;
                    $blank[] = "";
                    $search[] = "{{ENDTZ}}";
                    $replace[] = $row->noendtime() || $row->alldayevent() ? "" : $stop_time_midnightFix;
                    $blank[] = "";
                    $rawreplace["{{STARTDATE}}"] = $row->getUnixStartDate();
                    $rawreplace["{{ENDDATE}}"] = $row->getUnixEndDate();
                    $rawreplace["{{STARTTIME}}"] = $row->getUnixStartTime();
                    $rawreplace["{{ENDTIME}}"] = $row->getUnixEndTime();
                    $rawreplace["{{STARTTZ}}"] = $row->yup() . "-" . $row->mup() . "-" . $row->dup() . " " . $row->hup() . ":" . $row->minup() . ":" . $row->sup();
                    $rawreplace["{{ENDTZ}}"] = $row->ydn() . "-" . $row->mdn() . "-" . $row->ddn() . " " . $row->hdn() . ":" . $row->mindn() . ":" . $row->sdn();
                    $rawreplace["{{MULTIENDDATE}}"] = $row->endDate() > $row->startDate() ? $stop_date : "";
                    $search[] = "{{ISOSTART}}";
                    $replace[] = JEventsHTML::getDateFormat($row->yup(), $row->mup(), $row->dup(), "%Y-%m-%d") . "T" . sprintf('%02d:%02d:00', $row->hup(), $row->minup());
                    $blank[] = "";
                    $search[] = "{{ISOEND}}";
                    $replace[] = JEventsHTML::getDateFormat($row->ydn(), $row->mdn(), $row->ddn(), "%Y-%m-%d") . "T" . sprintf('%02d:%02d:00', $row->hdn(), $row->mindn());
                    $blank[] = "";
                    $search[] = "{{MULTIENDDATE}}";
                    $replace[] = $row->endDate() > $row->startDate() ? $row->getUnixEndDate() : "";
                    $blank[] = "";
                } else {
                    $row = $event;
                    $start_date = JEventsHTML::getDateFormat($row->yup(), $row->mup(), $row->dup(), 0);
                    $start_time = JEVHelper::getTime($row->getUnixStartTime(), $row->hup(), $row->minup());
                    $stop_date = JEventsHTML::getDateFormat($row->ydn(), $row->mdn(), $row->ddn(), 0);
                    $stop_time = JEVHelper::getTime($row->getUnixEndTime(), $row->hdn(), $row->mindn());
                    $stop_time_midnightFix = $stop_time;
                    $stop_date_midnightFix = $stop_date;
                    if ($row->sdn() == 59 && $row->mindn() == 59) {
                        $stop_time_midnightFix = JEVHelper::getTime($row->getUnixEndTime() + 1, 0, 0);
                        $stop_date_midnightFix = JEventsHTML::getDateFormat($row->ydn(), $row->mdn(), $row->ddn() + 1, 0);
                    }
                    $search[] = "{{STARTDATE}}";
                    $replace[] = $start_date;
                    $blank[] = "";
                    $search[] = "{{ENDDATE}}";
                    $replace[] = $stop_date;
                    $blank[] = "";
                    $search[] = "{{STARTTIME}}";
                    $replace[] = $row->alldayevent() ? "" : $start_time;
                    $blank[] = "";
                    $search[] = "{{ENDTIME}}";
                    $replace[] = $row->noendtime() || $row->alldayevent() ? "" : $stop_time_midnightFix;
                    $blank[] = "";
                    $search[] = "{{MULTIENDDATE}}";
                    $replace[] = $row->endDate() > $row->startDate() ? $stop_date : "";
                    $blank[] = "";
                    $search[] = "{{STARTTZ}}";
                    $replace[] = $row->alldayevent() ? "" : $start_time;
                    $blank[] = "";
                    $search[] = "{{ENDTZ}}";
                    $replace[] = $row->noendtime() || $row->alldayevent() ? "" : $stop_time_midnightFix;
                    $blank[] = "";
                    $rawreplace["{{STARTDATE}}"] = $row->getUnixStartDate();
                    $rawreplace["{{ENDDATE}}"] = $row->getUnixEndDate();
                    $rawreplace["{{STARTTIME}}"] = $row->getUnixStartTime();
                    $rawreplace["{{ENDTIME}}"] = $row->getUnixEndTime();
                    $rawreplace["{{STARTTZ}}"] = $row->yup() . "-" . $row->mup() . "-" . $row->dup() . " " . $row->hup() . ":" . $row->minup() . ":" . $row->sup();
                    $rawreplace["{{ENDTZ}}"] = $row->ydn() . "-" . $row->mdn() . "-" . $row->ddn() . " " . $row->hdn() . ":" . $row->mindn() . ":" . $row->sdn();
                    $rawreplace["{{MULTIENDDATE}}"] = $row->endDate() > $row->startDate() ? $row->getUnixEndDate() : "";
                    if (strpos($template_value, "{{ISOSTART}}") !== false || strpos($template_value, "{{ISOEND}}") !== false) {
                        $search[] = "{{ISOSTART}}";
                        $replace[] = JEventsHTML::getDateFormat($row->yup(), $row->mup(), $row->dup(), "%Y-%m-%d") . "T" . sprintf('%02d:%02d:00', $row->hup(), $row->minup());
                        $blank[] = "";
                        $search[] = "{{ISOEND}}";
                        $replace[] = JEventsHTML::getDateFormat($row->ydn(), $row->mdn(), $row->ddn(), "%Y-%m-%d") . "T" . sprintf('%02d:%02d:00', $row->hdn(), $row->mindn());
                        $blank[] = "";
                    }
                    // these would slow things down if not needed in the list
                    $dorepeatsummary = strpos($template_value, "{{REPEATSUMMARY}}") !== false;
                    if ($dorepeatsummary) {
                        $cfg = JEVConfig::getInstance();
                        $jevtask = JRequest::getString("jevtask");
                        $jevtask = str_replace(".listevents", "", $jevtask);
                        $showyeardate = $cfg->get("showyeardate", 0);
                        $row = $event;
                        $times = "";
                        if ($showyeardate && $jevtask == "year" || $jevtask == "search.results" || $jevtask == "month.calendar" || $jevtask == "cat" || $jevtask == "range") {
                            $start_publish = $row->getUnixStartDate();
                            $stop_publish = $row->getUnixEndDate();
                            if ($stop_publish == $start_publish) {
                                if ($row->noendtime()) {
                                    $times = $start_time;
                                } else {
                                    if ($row->alldayevent()) {
                                        $times = "";
                                    } else {
                                        if ($start_time != $stop_time) {
                                            $times = $start_time . ' - ' . $stop_time_midnightFix;
                                        } else {
                                            $times = $start_time;
                                        }
                                    }
                                }
                                $times = $start_date . " " . $times . "<br/>";
                            } else {
                                if ($row->noendtime()) {
                                    $times = $start_time;
                                } else {
                                    if ($row->alldayevent()) {
                                        $times = "";
                                    } else {
                                        if ($start_time != $stop_time && !$row->alldayevent()) {
                                            $times = $start_time . '&nbsp;-&nbsp;' . $stop_time_midnightFix;
                                        }
                                    }
                                }
                                $times = $start_date . ' - ' . $stop_date . " " . $times . "<br/>";
                            }
                        } else {
                            if (($jevtask == "day" || $jevtask == "week") && $row->starttime() != $row->endtime() && !$row->alldayevent()) {
                                if ($row->noendtime()) {
                                    if ($showyeardate && $jevtask == "year") {
                                        $times = $start_time . '&nbsp;-&nbsp;' . $stop_time_midnightFix . '&nbsp;';
                                    } else {
                                        $times = $start_time . '&nbsp;';
                                    }
                                } else {
                                    if ($row->alldayevent()) {
                                        $times = "";
                                    } else {
                                        $times = $start_time . '&nbsp;-&nbsp;' . $stop_time_midnightFix . '&nbsp;';
                                    }
                                }
                            }
                        }
                        $search[] = "{{REPEATSUMMARY}}";
                        $replace[] = $times;
                        $blank[] = "";
                    }
                }
                $search[] = "{{DURATION}}";
                $timedelta = $row->noendtime() ? "" : $row->getUnixEndTime() - $row->getUnixStartTime();
                if ($row->alldayevent()) {
                    $timedelta = $row->getUnixEndDate() - $row->getUnixStartDate() + 60 * 60 * 24;
                }
                $fieldval = JText::_("JEV_DURATION_FORMAT");
                $shownsign = false;
                // whole days!
                if (stripos($fieldval, "%wd") !== false) {
                    $days = intval($timedelta / (60 * 60 * 24));
                    $timedelta -= $days * 60 * 60 * 24;
                    if ($timedelta > 3610) {
                        //if more than 1 hour and 10 seconds over a day then round up the day output
                        $days += 1;
                    }
                    $fieldval = str_ireplace("%d", $days, $fieldval);
                    $shownsign = true;
                }
                if (stripos($fieldval, "%d") !== false) {
                    $days = intval($timedelta / (60 * 60 * 24));
                    $timedelta -= $days * 60 * 60 * 24;
                    /*
                     if ($timedelta>3610){
                     //if more than 1 hour and 10 seconds over a day then round up the day output
                     $days +=1;
                     }
                    */
                    $fieldval = str_ireplace("%d", $days, $fieldval);
                    $shownsign = true;
                }
                if (stripos($fieldval, "%h") !== false) {
                    $hours = intval($timedelta / (60 * 60));
                    $timedelta -= $hours * 60 * 60;
                    if ($shownsign) {
                        $hours = abs($hours);
                    }
                    $hours = sprintf("%02d", $hours);
                    $fieldval = str_ireplace("%h", $hours, $fieldval);
                    $shownsign = true;
                }
                if (stripos($fieldval, "%m") !== false) {
                    $mins = intval($timedelta / 60);
                    $timedelta -= $hours * 60;
                    if ($mins) {
                        $mins = abs($mins);
                    }
                    $mins = sprintf("%02d", $mins);
                    $fieldval = str_ireplace("%m", $mins, $fieldval);
                }
                $replace[] = $fieldval;
                $blank[] = "";
                break;
            case "{{PREVIOUSNEXT}}":
                static $doprevnext;
                if (!isset($doprevnext)) {
                    $doprevnext = strpos($template_value, "{{PREVIOUSNEXT}}") !== false;
                }
                if ($doprevnext) {
                    $search[] = "{{PREVIOUSNEXT}}";
                    $replace[] = $event->previousnextLinks();
                    $blank[] = "";
                }
                break;
            case "{{PREVIOUSNEXTEVENT}}":
                static $doprevnextevent;
                if (!isset($doprevnextevent)) {
                    $doprevnextevent = strpos($template_value, "{{PREVIOUSNEXTEVENT}}") !== false;
                }
                if ($doprevnextevent) {
                    $search[] = "{{PREVIOUSNEXTEVENT}}";
                    $replace[] = $event->previousnextEventLinks();
                    $blank[] = "";
                }
                break;
            case "{{FIRSTREPEAT}}":
            case "{{FIRSTREPEATSTART}}":
                static $dofirstrepeat;
                if (!isset($dofirstrepeat)) {
                    $dofirstrepeat = strpos($template_value, "{{FIRSTREPEAT}}") !== false || strpos($template_value, "{{FIRSTREPEATSTART}}") !== false;
                }
                if ($dofirstrepeat) {
                    $search[] = "{{FIRSTREPEAT}}";
                    $firstrepeat = $event->getFirstRepeat();
                    if ($firstrepeat->rp_id() == $event->rp_id()) {
                        $replace[] = "";
                    } else {
                        $replace[] = "<a class='ev_firstrepeat' href='" . $firstrepeat->viewDetailLink($firstrepeat->yup(), $firstrepeat->mup(), $firstrepeat->dup(), true) . "' title='" . JText::_('JEV_FIRSTREPEAT') . "' >" . JText::_('JEV_FIRSTREPEAT') . "</a>";
                    }
                    $blank[] = "";
                    $search[] = "{{FIRSTREPEATSTART}}";
                    if ($firstrepeat->rp_id() == $event->rp_id()) {
                        $replace[] = "";
                    } else {
                        $replace[] = JEventsHTML::getDateFormat($firstrepeat->yup(), $firstrepeat->mup(), $firstrepeat->dup(), 0);
                        $rawreplace[] = $firstrepeat->yup() . "-" . $firstrepeat->mup() . "-" . $firstrepeat->dup() . " " . $firstrepeat->hup() . ":" . $firstrepeat->minup() . ":" . $firstrepeat->sup();
                    }
                    $blank[] = "";
                }
                break;
            case "{{LASTREPEAT}}":
            case "{{LASTREPEATEND}}":
                static $dolastrepeat;
                if (!isset($dolastrepeat)) {
                    $dolastrepeat = strpos($template_value, "{{LASTREPEAT}}") !== false || strpos($template_value, "{{LASTREPEATEND}}") !== false;
                }
                if ($dolastrepeat) {
                    $search[] = "{{LASTREPEAT}}";
                    $lastrepeat = $event->getLastRepeat();
                    if ($lastrepeat->rp_id() == $event->rp_id()) {
                        $replace[] = "";
                    } else {
                        $replace[] = "<a class='ev_lastrepeat' href='" . $lastrepeat->viewDetailLink($lastrepeat->yup(), $lastrepeat->mup(), $lastrepeat->dup(), true) . "' title='" . JText::_('JEV_LASTREPEAT') . "' >" . JText::_('JEV_LASTREPEAT') . "</a>";
                    }
                    $blank[] = "";
                    $search[] = "{{LASTREPEATEND}}";
                    if ($lastrepeat->rp_id() != $event->rp_id()) {
                        $replace[] = JEventsHTML::getDateFormat($lastrepeat->ydn(), $lastrepeat->mdn(), $lastrepeat->ddn(), 0);
                        $rawreplace[] = $lastrepeat->ydn() . "-" . $lastrepeat->mdn() . "-" . $lastrepeat->ddn() . " " . $lastrepeat->hdn() . ":" . $lastrepeat->mindn() . ":" . $lastrepeat->sdn();
                    } else {
                        $replace[] = "";
                    }
                    $blank[] = "";
                }
                break;
            case "{{CREATOR_LABEL}}":
                $search[] = "{{CREATOR_LABEL}}";
                $replace[] = JText::_('JEV_BY');
                $blank[] = "";
                break;
            case "{{CREATOR}}":
                $search[] = "{{CREATOR}}";
                $replace[] = $event->contactlink();
                $blank[] = "";
                break;
            case "{{HITS}}":
                $search[] = "{{HITS}}";
                $replace[] = "<span class='hitslabel'>" . JText::_('JEV_EVENT_HITS') . '</span> : ' . $event->hits();
                $blank[] = "";
                break;
            case "{{LOCATION_LABEL}}":
            case "{{LOCATION}}":
                if ($event->hasLocation()) {
                    $search[] = "{{LOCATION_LABEL}}";
                    $replace[] = JText::_('JEV_EVENT_ADRESSE') . "&nbsp;";
                    $blank[] = "";
                    $search[] = "{{LOCATION}}";
                    $replace[] = $event->location();
                    $blank[] = "";
                } else {
                    $search[] = "{{LOCATION_LABEL}}";
                    $replace[] = "";
                    $blank[] = "";
                    $search[] = "{{LOCATION}}";
                    $replace[] = "";
                    $blank[] = "";
                }
                break;
            case "{{CONTACT_LABEL}}":
            case "{{CONTACT}}":
                if ($event->hasContactInfo()) {
                    if (strpos($event->contact_info(), '<script') === false) {
                        $dispatcher = JDispatcher::getInstance();
                        JPluginHelper::importPlugin('content');
                        //Contact
                        $pattern = '[a-zA-Z0-9&?_.,=%\\-\\/]';
                        if (strpos($event->contact_info(), '<a href=') === false && $event->contact_info() != "") {
                            $event->contact_info(preg_replace('@(https?://)(' . $pattern . '*)@i', '<a href="\\1\\2">\\1\\2</a>', $event->contact_info()));
                        }
                        // NO need to call conContentPrepate since its called on the template value below here
                    }
                    $search[] = "{{CONTACT_LABEL}}";
                    $replace[] = JText::_('JEV_EVENT_CONTACT') . "&nbsp;";
                    $blank[] = "";
                    $search[] = "{{CONTACT}}";
                    $replace[] = $event->contact_info();
                    $blank[] = "";
                } else {
                    $search[] = "{{CONTACT_LABEL}}";
                    $replace[] = "";
                    $blank[] = "";
                    $search[] = "{{CONTACT}}";
                    $replace[] = "";
                    $blank[] = "";
                }
                break;
            case "{{EXTRAINFO}}":
                //Extra
                if (strpos($event->extra_info(), '<script') === false && $event->extra_info() != "") {
                    $dispatcher = JDispatcher::getInstance();
                    JPluginHelper::importPlugin('content');
                    $pattern = '[a-zA-Z0-9&?_.,=%\\-\\/#]';
                    if (strpos($event->extra_info(), '<a href=') === false) {
                        $event->extra_info(preg_replace('@(https?://)(' . $pattern . '*)@i', '<a href="\\1\\2">\\1\\2</a>', $event->extra_info()));
                    }
                    //$row->extra_info(eregi_replace('[^(href=|href="|href=\')](((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)','\\1', $row->extra_info()));
                    // NO need to call conContentPrepate since its called on the template value below here
                }
                $search[] = "{{EXTRAINFO}}";
                $replace[] = $event->extra_info();
                $blank[] = "";
                break;
            case "{{RPID}}":
                $search[] = "{{RPID}}";
                $replace[] = $event->rp_id();
                $blank[] = "";
                break;
            default:
                $strippedmatch = str_replace(array("{", "}"), "", $strippedmatch);
                if (is_callable(array($event, $strippedmatch))) {
                    $search[] = "{{" . $strippedmatch . "}}";
                    $replace[] = $event->{$strippedmatch}();
                    $blank[] = "";
                }
                break;
        }
    }
    // Now do the plugins
    // get list of enabled plugins
    $layout = $template_name == "icalevent.list_row" || $template_name == "month.calendar_cell" || $template_name == "month.calendar_tip" ? "list" : "detail";
    $jevplugins = JPluginHelper::getPlugin("jevents");
    foreach ($jevplugins as $jevplugin) {
        $classname = "plgJevents" . ucfirst($jevplugin->name);
        if (is_callable(array($classname, "substitutefield"))) {
            if (!isset($fieldNameArray[$classname])) {
                $fieldNameArray[$classname] = array();
            }
            if (!isset($fieldNameArray[$classname][$layout])) {
                //list($usec, $sec) = explode(" ", microtime());
                //$starttime = (float) $usec + (float) $sec;
                $fieldNameArray[$classname][$layout] = call_user_func(array($classname, "fieldNameArray"), $layout);
                //list ($usec, $sec) = explode(" ", microtime());
                //$time_end = (float) $usec + (float) $sec;
                //echo  "$classname::fieldNameArray = ".round($time_end - $starttime, 4)."<br/>";
            }
            if (isset($fieldNameArray[$classname][$layout]["values"])) {
                foreach ($fieldNameArray[$classname][$layout]["values"] as $fieldname) {
                    if (!strpos($template_value, $fieldname) !== false) {
                        continue;
                    }
                    $search[] = "{{" . $fieldname . "}}";
                    // is the event detail hidden - if so then hide any custom fields too!
                    if (!isset($event->_privateevent) || $event->_privateevent != 3) {
                        $replace[] = call_user_func(array($classname, "substitutefield"), $event, $fieldname);
                        if (is_callable(array($classname, "blankfield"))) {
                            $blank[] = call_user_func(array($classname, "blankfield"), $event, $fieldname);
                        } else {
                            $blank[] = "";
                        }
                    } else {
                        $blank[] = "";
                        $replace[] = "";
                    }
                }
            }
        }
    }
    // word counts etc.
    for ($s = 0; $s < count($search); $s++) {
        if (strpos($search[$s], "TRUNCATED_DESC:") > 0) {
            global $tempreplace, $tempevent, $tempsearch;
            $tempreplace = $replace[$s];
            $tempsearch = $search[$s];
            $tempevent = $event;
            $template_value = preg_replace_callback("|{$tempsearch}|", 'jevSpecialHandling', $template_value);
        }
    }
    // Date/time formats etc.
    for ($s = 0; $s < count($search); $s++) {
        if (strpos($search[$s], "STARTDATE") > 0 || strpos($search[$s], "STARTTIME") > 0 || strpos($search[$s], "ENDDATE") > 0 || strpos($search[$s], "ENDTIME") > 0 || strpos($search[$s], "ENDTZ") > 0 || strpos($search[$s], "STARTTZ") > 0 || strpos($search[$s], "MULTIENDDATE") > 0 || strpos($search[$s], "FIRSTREPEATSTART") > 0 || strpos($search[$s], "LASTREPEATEND") > 0) {
            if (!isset($rawreplace[$search[$s]]) || !$rawreplace[$search[$s]]) {
                continue;
            }
            global $tempreplace, $tempevent, $tempsearch;
            $tempreplace = $rawreplace[$search[$s]];
            $tempsearch = str_replace("}}", ";.*?}}", $search[$s]);
            $tempevent = $event;
            $template_value = preg_replace_callback("|{$tempsearch}|", 'jevSpecialDateFormatting', $template_value);
        }
    }
    for ($s = 0; $s < count($search); $s++) {
        global $tempreplace, $tempevent, $tempsearch, $tempblank;
        $tempreplace = $replace[$s];
        $tempblank = $blank[$s];
        $tempsearch = str_replace("}}", "#", $search[$s]);
        $tempevent = $event;
        $template_value = preg_replace_callback("|{$tempsearch}(.+?)}}|", 'jevSpecialHandling2', $template_value);
    }
    $template_value = str_replace($search, $replace, $template_value);
    if ($specialmodules) {
        $reg = JRegistry::getInstance("com_jevents");
        $parts = explode("{{MODULESTART#", $template_value);
        $dynamicmodules = array();
        foreach ($parts as $part) {
            $currentdynamicmodules = $reg->get("dynamicmodules", false);
            if (strpos($part, "{{MODULEEND}}") === false) {
                // strip out BAD HTML tags left by WYSIWYG editors
                if (substr($part, strlen($part) - 3) == "<p>") {
                    $template_value = substr($part, 0, strlen($part) - 3);
                } else {
                    $template_value = $part;
                }
                continue;
            }
            // start with module name
            $modname = substr($part, 0, strpos($part, "}}"));
            $modulecontent = substr($part, strpos($part, "}}") + 2);
            $modulecontent = substr($modulecontent, 0, strpos($modulecontent, "{{MODULEEND}}"));
            // strip out BAD HTML tags left by WYSIWYG editors
            if (strpos($modulecontent, "</p>") === 0) {
                $modulecontent = "<p>x@#" . $modulecontent;
            }
            if (substr($modulecontent, strlen($modulecontent) - 3) == "<p>") {
                $modulecontent .= "x@#</p>";
            }
            $modulecontent = str_replace("<p>x@#</p>", "", $modulecontent);
            if (isset($currentdynamicmodules[$modname])) {
                if (!is_array($currentdynamicmodules[$modname])) {
                    $currentdynamicmodules[$modname] = array($currentdynamicmodules[$modname]);
                }
                $currentdynamicmodules[$modname][] = $modulecontent;
                $dynamicmodules[$modname] = $currentdynamicmodules[$modname];
            } else {
                $dynamicmodules[$modname] = $modulecontent;
            }
        }
        $reg->set("dynamicmodules", $dynamicmodules);
    }
    // non greedy replacement - because of the ?
    $template_value = preg_replace_callback('|{{.*?}}|', 'cleanUnpublished', $template_value);
    // replace [[ with { to that other content plugins can work ok - but not for calendar cell or tooltip since we use [[ there already!
    if ($template_name != "month.calendar_cell" && $template_name != "month.calendar_tip") {
        $template_value = str_replace(array("[[", "]]"), array("{", "}"), $template_value);
    }
    //We add new line characters again to avoid being marked as SPAM when using tempalte in emails
    // do this before content plugins incase they insert javascript etc.
    $template_value = preg_replace("@(<\\s*(br)*\\s*\\/\\s*(p|td|tr|table|div|ul|li|ol|dd|dl|dt)*\\s*>)+?@i", "\$1\n", $template_value);
    // Call content plugins - BUT because emailcloak doesn't identify emails in input fields to a text substitution
    $template_value = str_replace("@", "@£@", $template_value);
    $params = new JRegistry(null);
    $tmprow = new stdClass();
    $tmprow->text = $template_value;
    $tmprow->event = $event;
    $dispatcher = JDispatcher::getInstance();
    JPluginHelper::importPlugin('content');
    $dispatcher->trigger('onContentPrepare', array('com_jevents', &$tmprow, &$params, 0));
    $template_value = $tmprow->text;
    $template_value = str_replace("@£@", "@", $template_value);
    echo $template_value;
    return true;
}
Exemplo n.º 20
0
 /**
  * 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;
 }
Exemplo n.º 21
0
 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");
     }
 }
function DefaultViewHelperViewNavAdminPanel($view)
{
    $cfg = JEVConfig::getInstance();
    if ($cfg->get('show_adminpanel', 1) == 1) {
        $is_event_editor = JEVHelper::isEventCreator();
        $user = JFactory::getUser();
        JEVHelper::script('view_detailJQ.js', 'components/' . JEV_COM_COMPONENT . "/assets/js/");
        JLoader::register('jevFilterProcessing', JEV_PATH . "/libraries/filters.php");
        $pluginsDir = JPATH_ROOT . '/' . 'plugins' . '/' . 'jevents';
        $filters = jevFilterProcessing::getInstance(array("published", "justmine", "category", "reset"));
        $cfg = JEVConfig::getInstance();
        if (JRequest::getInt('pop', 0)) {
            return;
        }
        if ($is_event_editor) {
            if ($cfg->get("bootstrapchosen", 1)) {
                // Load Bootstrap
                JevHtmlBootstrap::framework();
                JHtml::_('formbehavior.chosen', '#jevents select:not(.notchosen)');
            }
            if ($cfg->get("bootstrapcss", 1) == 1) {
                // This version of bootstrap has maximum compatability with JEvents due to enhanced namespacing
                JHTML::stylesheet("com_jevents/bootstrap.css", array(), true);
            } else {
                if ($cfg->get("bootstrapcss", 1) == 2) {
                    JHtmlBootstrap::loadCss();
                }
            }
            // Load event adding language string
            JText::script('JEV_ADD_EVENT');
            JText::script('JEV_IMPORT_ICALEVENT');
            ?>
			<div class="ev_adminpanel">
				<div align="left" class="nav_bar_cell">
					<?php 
            $editLink = JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=icalevent.edit' . '&year=' . $view->year . '&month=' . $view->month . '&day=' . $view->day . '&Itemid=' . $view->Itemid, true);
            $popup = false;
            $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
            if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
                //JevHtmlBootstrap::modal();
                JEVHelper::script('editpopupJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
                $popup = true;
            }
            $eventlinkadd = $popup ? "javascript:jevEditPopup('" . $editLink . "');" : $editLink;
            ?>
					<a href="<?php 
            echo $eventlinkadd;
            ?>
" title="<?php 
            echo JText::_('JEV_ADDEVENT');
            ?>
">
						<b><?php 
            echo JText::_('JEV_ADDEVENT');
            ?>
</b>
					</a>
					<?php 
            // offer frontend import ?
            if ($params->get("feimport", 0)) {
                $importLink = JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=icals.importform&tmpl=component&Itemid=' . $view->Itemid, true);
                //JevHtmlBootstrap::modal();
                JEVHelper::script('editpopupJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
                $eventimport = "javascript:jevImportPopup('" . $importLink . "');";
                ?>
						<br/><a href="<?php 
                echo $eventimport;
                ?>
" title="<?php 
                echo JText::_('JEV_IMPORT_ICALEVENT', true);
                ?>
">
							<b><?php 
                echo JText::_('JEV_IMPORT_ICALEVENT');
                ?>
</b>
						</a>
						<?php 
            }
            if ($user->id > 0) {
                $datamodel = new JEventsDataModel();
                // find appropriate Itemid and setup catids for datamodel
                $myItemid = JEVHelper::getItemid();
                $datamodel->setupComponentCatids();
                list($year, $month, $day) = JEVHelper::getYMD();
                $evid = JRequest::getVar("evid", false);
                $jevtype = JRequest::getVar("jevtype", false);
                // FORM for filter submission
                $form_link = JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=' . JRequest::getVar("jevtask", "month.calendar") . ($evid ? '&evid=' . $evid : '') . ($jevtype ? '&jevtype=' . $jevtype : '') . ($year ? '&year=' . $year : '') . ($month ? '&month=' . $month : '') . ($day ? '&day=' . $day : '') . "&Itemid=" . $myItemid, false);
                ?>
						<form action="<?php 
                echo $form_link;
                ?>
"  method="post">
							<?php 
                $filterHTML = $filters->getFilterHTML();
                $Itemid = JEVHelper::getItemid();
                foreach ($filterHTML as $filter) {
                    echo "<div>" . $filter["title"] . " " . $filter["html"] . "</div>";
                }
                /*
                 $eventmylinks = JRoute::_( 'index.php?option=' . JEV_COM_COMPONENT . '&task=admin.listevents'
                 . '&year=' . $view->year . '&month=' . $view->month . '&day=' . $view->day
                 . '&Itemid=' . $view->Itemid ); ?>
                 <a href="<?php echo $eventmylinks; ?>" title="<?php echo JText::_('JEV_MYEVENTS'); ?>">
                 <b><?php echo JText::_('JEV_MYEVENTS'); ?></b>
                 </a>
                 <?php
                */
                ?>
						</form>
					<?php 
            }
            ?>
				</div>
			</div>
		<?php 
        }
    }
}
function DefaultEventManagementDialog16($view, $row, $mask, $bootstrap = false)
{
    $user = JFactory::getUser();
    if ($user->get("id") == 0) {
        return "";
    }
    if ((JEVHelper::canEditEvent($row) || JEVHelper::canPublishEvent($row) || JEVHelper::canDeleteEvent($row)) && !($mask & MASK_POPUP)) {
        $popup = false;
        $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
        if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
            JEVHelper::script('editpopup.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
            $popup = true;
            $popupw = $params->get("popupw", 800);
            $popuph = $params->get("popuph", 600);
        }
        $hasrepeat = false;
        $pathIMG = JURI::root() . 'components/' . JEV_COM_COMPONENT . '/assets/images';
        $editImg = $pathIMG . "/edit_f2.png";
        $editLink = $row->editLink();
        $editLink = $popup ? "javascript:jevEditPopup('" . $editLink . "',{$popupw}, {$popuph});" : $editLink;
        $editCopyImg = $pathIMG . "/copy_f2.png";
        $editCopyLink = $row->editCopyLink();
        $editCopyLink = $popup ? "javascript:jevEditPopup('" . $editCopyLink . "',{$popupw}, {$popuph});" : $editCopyLink;
        $deleteImg = $pathIMG . "/delete_f2.png";
        $deleteLink = $row->deleteLink();
        if ($row->until() != $row->dtstart() || $row->count() > 1) {
            $hasrepeat = true;
            $editRepeatImg = $pathIMG . "/edit_f2.png";
            $editRepeatLink = $row->editRepeatLink();
            $editRepeatLink = $popup ? "javascript:jevEditPopup('" . $editRepeatLink . "',{$popupw}, {$popuph});" : $editRepeatLink;
            $deleteRepeatImg = $pathIMG . "/delete_f2.png";
            $deleteRepeatLink = $row->deleteRepeatLink();
            $deleteFutureImg = $pathIMG . "/delete_f2.png";
            $deleteFutureLink = $row->deleteFutureLink();
        } else {
            $editRepeatLink = "";
            $deleteRepeatLink = "";
            $deleteFutureLink = "";
        }
        if (!JEVHelper::canEditEvent($row)) {
            $editLink = "";
            $editRepeatLink = "";
            $editCopyLink = "";
        }
        if (!JEVHelper::canDeleteEvent($row)) {
            $deleteLink = "";
            $deleteRepeatLink = "";
            $deleteFutureLink = "";
        }
        $publishLink = "";
        if (JEVHelper::canPublishEvent($row)) {
            if ($row->published() > 0) {
                $publishImg = $pathIMG . "/publish_r.png";
                $publishLink = $row->unpublishLink();
                $publishText = JText::_('UNPUBLISH_EVENT');
            } else {
                $publishImg = $pathIMG . "/publish_g.png";
                $publishLink = $row->publishLink();
                $publishText = JText::_('PUBLISH_EVENT');
            }
        }
        if ($publishLink . $editRepeatLink . $editLink . $deleteRepeatLink . $deleteLink . $deleteFutureLink == "") {
            return false;
        }
        ?>
            <div id="action_dialog" >
            	<div class="close_dialog" >
            		<a href="javascript:void(0)" onclick="closedialog()" >x</a>
            	</div>
                 <?php 
        if ($publishLink != "") {
            ?>
                 <a href="<?php 
            echo $publishLink;
            ?>
" id="publish_reccur"  title="<?php 
            echo $publishText;
            ?>
" ><img src="<?php 
            echo $publishImg;
            ?>
" alt="" /><?php 
            echo $publishText;
            ?>
</a><br/>
                 <?php 
        }
        ?>
                 <?php 
        if ($editRepeatLink != "") {
            ?>
                 <a href="<?php 
            echo $editRepeatLink;
            ?>
" id="edit_reccur"  title="edit event" ><img src="<?php 
            echo $editRepeatImg;
            ?>
" alt="" /><?php 
            echo JText::_('EDIT_REPEAT');
            ?>
</a><br/>
                 <?php 
        }
        if ($editLink != "") {
            ?>
            	<a href="<?php 
            echo $editLink;
            ?>
" id="edit_event" title="edit event" ><img src="<?php 
            echo $editImg;
            ?>
" alt="" /><?php 
            echo JText::_('EDIT_EVENT');
            ?>
</a><br/>
            	<a href="<?php 
            echo $editCopyLink;
            ?>
" id="edit_eventcopy" title="edit event" ><img src="<?php 
            echo $editCopyImg;
            ?>
" alt="" /><?php 
            echo JText::_('COPY_AND_EDIT_EVENT');
            ?>
</a><br/>
                 <?php 
        }
        if ($deleteRepeatLink != "") {
            ?>
                 <a href="<?php 
            echo $deleteRepeatLink;
            ?>
" onclick="return confirm('<?php 
            echo JText::_('ARE_YOU_SURE_YOU_WANT_TO_DELETE_THIS_RECURRENCE', true);
            ?>
')" id="delete_repeat"  title="delete repeat" ><img src="<?php 
            echo $deleteRepeatImg;
            ?>
" alt="" /><?php 
            echo JText::_('DELETE_THIS_REPEAT');
            ?>
</a><br/>
                 <?php 
        }
        if ($deleteLink != "") {
            ?>
                 <a href="<?php 
            echo $deleteLink;
            ?>
" onclick="return confirm('<?php 
            echo JText::_($hasrepeat ? 'ARE_YOU_SURE_YOU_WISH_TO_DELETE_THIS_EVENT_AND_ALL_ITS_REPEAT' : 'ARE_YOU_SURE_YOU_WISH_TO_DELETE_THIS_EVENT', true);
            ?>
')" id="delete_event"  title="delete event" ><img src="<?php 
            echo $deleteImg;
            ?>
" alt="" /><?php 
            echo JText::_($hasrepeat ? "DELETE_ALL_REPEATS" : "DELETE_EVENT");
            ?>
</a><br/>
            	<?php 
        }
        if ($deleteFutureLink != "") {
            ?>
                 <a href="<?php 
            echo $deleteFutureLink;
            ?>
" onclick="return confirm('<?php 
            echo JText::_('ARE_YOU_SURE_YOU_WITH_TO_DELETE_THIS_EVENT_AND_ALL_FUTURE_REPEATS', true);
            ?>
')" id="delete_eventfuture"  title="delete event" ><img src="<?php 
            echo $deleteFutureImg;
            ?>
" alt="" /><?php 
            echo JText::_('JEV_DELETE_FUTURE_REPEATS');
            ?>
</a><br/>
            <?php 
        }
        ?>
	        </div>
	        <?php 
        return true;
    } else {
        return false;
    }
}
/**
 * Creates mini event dialog for view detail page etc.
 * note this must be contained in a position:relative block element in order to work
 *
 * @param Jevent or descendent $row
 */
function DefaultEventManagementDialog($view, $row, $mask, $bootstrap = false)
{
    JevHtmlBootstrap::modal("action_dialogJQ" . $row->rp_id());
    $user = JFactory::getUser();
    if ($user->get("id") == 0) {
        return "";
    }
    if (JEVHelper::canEditEvent($row) || JEVHelper::canPublishEvent($row) || JEVHelper::canDeleteEvent($row)) {
        $popup = false;
        $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
        if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
            JevHtmlBootstrap::modal();
            JEVHelper::script('editpopupJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
            $popup = true;
            $popupw = $params->get("popupw", 800);
            $popuph = $params->get("popuph", 600);
        }
        if (JRequest::getInt("pop", 0)) {
            // do not call the modal scripts if already in a popup window!
            $popup = false;
        }
        $hasrepeat = false;
        $pathIMG = JURI::root() . 'components/' . JEV_COM_COMPONENT . '/assets/images';
        $editImg = JHtml::image('com_jevents/icons-32/edit.png', JText::_("EDIT_EVENT"), null, true);
        $editLink = $row->editLink();
        $editLink = $popup ? "javascript:jevEditPopupNoHeader('" . $editLink . "');" : $editLink;
        $editCopyImg = JHtml::image('com_jevents/icons-32/copy.png', JText::_("COPY_AND_EDIT_EVENT"), null, true);
        $editCopyLink = $row->editCopyLink();
        $editCopyLink = $popup ? "javascript:jevEditPopupNoHeader('" . $editCopyLink . "');" : $editCopyLink;
        $deleteImg = JHtml::image('com_jevents/icons-32/discard.png', JText::_("DELETE_EVENT"), null, true);
        $deleteLink = $row->deleteLink();
        if ($row->until() != $row->dtstart() || $row->count() > 1) {
            $hasrepeat = true;
            $editRepeatImg = JHtml::image('com_jevents/icons-32/edit.png', JText::_("EDIT_REPEAT"), null, true);
            $editRepeatLink = $row->editRepeatLink();
            $editRepeatLink = $popup ? "javascript:jevEditPopupNoHeader('" . $editRepeatLink . "');" : $editRepeatLink;
            $deleteRepeatImg = JHtml::image('com_jevents/icons-32/discard.png', JText::_("DELETE_THIS_REPEAT"), null, true);
            $deleteRepeatLink = $row->deleteRepeatLink();
            $deleteFutureImg = JHtml::image('com_jevents/icons-32/discards.png', JText::_("JEV_DELETE_FUTURE_REPEATS"), null, true);
            $deleteFutureLink = $row->deleteFutureLink();
            $deleteImg = JHtml::image('com_jevents/icons-32/discards.png', JText::_("DELETE_ALL_REPEATS"), null, true);
        } else {
            $editRepeatLink = "";
            $deleteRepeatLink = "";
            $deleteFutureLink = "";
        }
        if (!JEVHelper::canEditEvent($row)) {
            $editLink = "";
            $editRepeatLink = "";
            $editCopyLink = "";
        }
        if (!JEVHelper::canDeleteEvent($row)) {
            $deleteLink = "";
            $deleteRepeatLink = "";
            $deleteFutureLink = "";
        }
        $publishLink = "";
        if (JEVHelper::canPublishEvent($row)) {
            if ($row->published() > 0) {
                $publishImg = JHtml::image('com_jevents/icons-32/cancel.png', JText::_("UNPUBLISH_EVENT"), null, true);
                $publishLink = $row->unpublishLink();
                $publishText = JText::_('UNPUBLISH_EVENT');
            } else {
                $publishImg = JHtml::image('com_jevents/icons-32/accept.png', JText::_("PUBLISH_EVENT"), null, true);
                $publishLink = $row->publishLink();
                $publishText = JText::_('PUBLISH_EVENT');
            }
        }
        if ($publishLink . $editRepeatLink . $editLink . $deleteRepeatLink . $deleteLink . $deleteFutureLink == "") {
            return false;
        }
        ?>
		<div id="action_dialogJQ<?php 
        echo $row->rp_id();
        ?>
" class="action_dialogJQ modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			<div class="modal-dialog modal-sm">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
						<h4 class="modal-title" id="myModalLabel"><?php 
        echo JText::_("JEV_MANAGE_EVENT");
        ?>
</h4>
					</div>
					<div class="modal-body">
						<?php 
        if ($publishLink != "") {
            ?>
						<a href="<?php 
            echo $publishLink;
            ?>
" id="publish_reccur"  title="<?php 
            echo $publishText;
            ?>
" ><?php 
            echo $publishImg;
            echo $publishText;
            ?>
</a><br/>
						<?php 
        }
        ?>
						<?php 
        if ($editRepeatLink != "") {
            ?>
						<a href="<?php 
            echo $editRepeatLink;
            ?>
" id="edit_reccur"  title="edit event" ><?php 
            echo $editRepeatImg;
            echo JText::_('EDIT_REPEAT');
            ?>
</a><br/>
						<?php 
        }
        if ($editLink != "") {
            ?>
					   <a href="<?php 
            echo $editLink;
            ?>
"  id="edit_event" title="edit event" ><?php 
            echo $editImg;
            echo JText::_('EDIT_EVENT');
            ?>
</a><br/>
					   <a href="<?php 
            echo $editCopyLink;
            ?>
" id="edit_eventcopy" title="edit event" ><?php 
            echo $editCopyImg;
            echo JText::_('COPY_AND_EDIT_EVENT');
            ?>
</a><br/>
						<?php 
        }
        if ($deleteRepeatLink != "") {
            ?>
						<a href="<?php 
            echo $deleteRepeatLink;
            ?>
"  onclick="return confirm('<?php 
            echo JText::_('ARE_YOU_SURE_YOU_WANT_TO_DELETE_THIS_RECURRENCE', true);
            ?>
')" id="delete_repeat"  title="delete repeat" ><?php 
            echo $deleteRepeatImg;
            echo JText::_('DELETE_THIS_REPEAT');
            ?>
</a><br/>
						<?php 
        }
        if ($deleteLink != "") {
            ?>
						<a href="<?php 
            echo $deleteLink;
            ?>
"  onclick="return confirm('<?php 
            echo JText::_($hasrepeat ? 'ARE_YOU_SURE_YOU_WISH_TO_DELETE_THIS_EVENT_AND_ALL_ITS_REPEAT' : 'ARE_YOU_SURE_YOU_WISH_TO_DELETE_THIS_EVENT', true);
            ?>
')" id="delete_event"  title="delete event" ><?php 
            echo $deleteImg;
            echo JText::_($hasrepeat ? "DELETE_ALL_REPEATS" : "DELETE_EVENT");
            ?>
</a><br/>
					   <?php 
        }
        if ($deleteFutureLink != "") {
            ?>
						<a href="<?php 
            echo $deleteFutureLink;
            ?>
"  onclick="return confirm('<?php 
            echo JText::_('ARE_YOU_SURE_YOU_WITH_TO_DELETE_THIS_EVENT_AND_ALL_FUTURE_REPEATS', true);
            ?>
')" id="delete_eventfuture"  title="delete event" ><?php 
            echo $deleteFutureImg;
            echo JText::_('JEV_DELETE_FUTURE_REPEATS');
            ?>
</a><br/>
				   <?php 
        }
        ?>
					</div>
					<div class="modal-footer">
						 <button type="button" class="btn btn-default" data-dismiss="modal"><?php 
        echo JText::_("JEV_CLOSE");
        ?>
</button>
					</div>
				</div>
			</div>
		</div>

	        <?php 
        return true;
    } else {
        return false;
    }
}
Exemplo n.º 25
0
    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;
    }
Exemplo n.º 26
0
<?php

/**
 * JEvents Component for Joomla 1.5.x
 *
 * @version     $Id: default_layout.php 3323 2012-03-08 13:37:46Z geraintedwards $
 * @package     JEvents
 * @subpackage  Module JEvents Filter
 * @copyright   Copyright (C) 2008-2015 GWE Systems Ltd
 * @license     GNU/GPLv2, see http://www.gnu.org/licenses/gpl-2.0.html
 * @link        http://www.gwesystems.com
 */
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die;
if (count($filterHTML) > 0) {
    JEVHelper::script("mod_jevents_filter.js", "modules/mod_jevents_filter/", true);
    ?>
	<form action="<?php 
    echo $form_link;
    ?>
" id="jeventspost" name="jeventspost<?php 
    echo $module->id;
    ?>
" method="post" class="jevfiltermodule" >
		<input type='hidden' name='catids' id='catidsfv' value='<?php 
    echo trim($datamodel->catidsOut);
    ?>
' />
		<?php 
    // This forces category settings in URL to reset too since they could be set by SEF
    $script = "try {JeventsFilters.filters.push({id:'catidsfv',value:0});} catch (e) {}\n";
Exemplo n.º 27
0
include_once JPATH_COMPONENT_ADMINISTRATOR . '/' . JEV_COMPONENT . ".defines.php";
if (JevJoomlaVersion::isCompatible("3.0")) {
    JHtml::_('jquery.framework');
    JHtml::_('behavior.framework', true);
    JHtml::_('bootstrap.framework');
    if (JComponentHelper::getParams(JEV_COM_COMPONENT)->get("fixjquery", 1)) {
        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)) {
        // Make loading this conditional on config option
        JFactory::getDocument()->addScript("//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js");
        //JFactory::getDocument()->addScript("//www.google.com/jsapi");
        JEVHelper::script("components/com_jevents/assets/js/jQnc.js");
        //JEVHelper::script("components/com_jevents/assets/js/bootstrap.min.js");
        //JHTML::stylesheet("components/com_jevents/assets/css/bootstrap.css");
        // 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();");
    }
}
$registry = JRegistry::getInstance("jevents");
/*
 * frontend only!
// In Joomla 1.6 JComponentHelper::getParams(JEV_COM_COMPONENT) is a clone so the menu params do not propagate so we force this here!
if (JevJoomlaVersion::isCompatible("1.6.0")){
	$newparams	= JFactory::getApplication()->getParams();
	$component = JComponentHelper::getComponent(JEV_COM_COMPONENT);
	$component->params =& $newparams;
}
Exemplo n.º 28
0
    function __construct($view, $today_date, $view_date, $dates, $alts, $option, $task, $Itemid)
    {
        global $catidsOut;
        if (JRequest::getInt('pop', 0)) {
            return;
        }
        $cfg = JEVConfig::getInstance();
        $compname = JEV_COM_COMPONENT;
        //Lets check if we should show the nav on event details
        if ($task == "icalrepeat.detail" && $cfg->get('shownavbar_detail', 1) == 0) {
            return;
        }
        $this->iconstoshow = $cfg->get('iconstoshow', array('byyear', 'bymonth', 'byweek', 'byday', 'search'));
        $viewimages = JURI::root() . "components/" . JEV_COM_COMPONENT . "/views/" . $view->getViewName() . "/assets/images";
        $cat = "";
        $hiddencat = "";
        if ($catidsOut != 0) {
            $cat = '&catids=' . $catidsOut;
            $hiddencat = '<input type="hidden" name="catids" value="' . $catidsOut . '"/>';
        }
        // for popup editing
        $view->popup = false;
        $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
        if ($params->get("editpopup", 0) && JEVHelper::isEventCreator()) {
            JevHtmlBootstrap::modal();
            JEVHelper::script('editpopup.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');
            $view->popup = true;
            $view->popupw = $params->get("popupw", 800);
            $view->popuph = $params->get("popuph", 600);
        }
        $link = 'index.php?option=' . $option . '&task=' . $task . $cat . '&Itemid=' . $Itemid . '&';
        ?>
		<table class="ev_navigation" bgcolor="#ffffff" border="0" cellpadding="10" cellspacing="0" width="100%" >
			<tr>
				<td class="tableh1" align="center">
					<table border="0" cellpadding="0" cellspacing="0">
						<tr>
							<!-- BEGIN add_event -->
							<!--//
							<?php 
        if (JEVHelper::isEventCreator()) {
            list($year, $month, $day) = JEVHelper::getYMD();
            $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 . "');" : $editLink;
            ?>
										<td><img name="spacer" src="<?php 
            echo $viewimages;
            ?>
/spacer.gif"  alt="" border="0" height="25" width="10"/></td>
										<td class="buttontext" align="center" nowrap="nowrap" valign="middle">
											<a href="<?php 
            echo $eventlinkadd;
            ?>
" title="Add Event" class="buttontext">
												<img src="<?php 
            echo $viewimages;
            ?>
/icon-addevent.gif" alt="Add Event" border="0"/><br/>
										<?php 
            echo JText::_('JEV_ADD_EVENT');
            ?>
</a>
										</td>
							<?php 
        }
        ?>
								//-->
							<!-- END add_event -->
		<?php 
        if (in_array("byyear", $this->iconstoshow)) {
            ?>
								<td><img name="spacer" src="<?php 
            echo $viewimages;
            ?>
/spacer.gif"  alt="" border="0" height="25" width="10"/></td>
								<td class="buttontext" align="center" nowrap="nowrap" valign="middle">
									<a href="<?php 
            echo JRoute::_('index.php?option=' . $option . $cat . '&task=year.listevents&' . $view_date->toDateURL() . '&Itemid=' . $Itemid);
            ?>
" title="<?php 
            echo JText::_('JEV_VIEWBYYEAR');
            ?>
"  class="buttontext">
										<img src="<?php 
            echo $viewimages;
            ?>
/icon-flyer.gif" alt="Flat View" border="0"/><br/>
								<?php 
            echo JText::_('JEV_VIEWBYYEAR');
            ?>
</a>
								</td>
		<?php 
        }
        ?>
		<?php 
        if (in_array("bymonth", $this->iconstoshow)) {
            ?>
								<td><img name="spacer" src="<?php 
            echo $viewimages;
            ?>
/spacer.gif"  alt="" border="0" height="25" width="10"/></td>
								<td class="buttontext" align="center" nowrap="nowrap" valign="middle">
									<a href="<?php 
            echo JRoute::_('index.php?option=' . $option . $cat . '&task=month.calendar&' . $view_date->toDateURL() . '&Itemid=' . $Itemid);
            ?>
" title="<?php 
            echo JText::_('JEV_VIEWBYMONTH');
            ?>
" class="buttontext">
										<img src="<?php 
            echo $viewimages;
            ?>
/icon-calendarview.gif" alt="<?php 
            echo JText::_('MONTHLY_VIEW');
            ?>
" border="0"/><br/>
			<?php 
            echo JText::_('JEV_VIEWBYMONTH');
            ?>
</a>
								</td>
		<?php 
        }
        ?>
									<?php 
        if (in_array("byweek", $this->iconstoshow)) {
            ?>
								<td><img name="spacer" src="<?php 
            echo $viewimages;
            ?>
/spacer.gif"  alt="" border="0" height="25" width="10"/></td>
								<td class="buttontext" align="center" nowrap="nowrap" valign="middle">
									<a href="<?php 
            echo JRoute::_('index.php?option=' . $option . $cat . '&task=week.listevents&' . $view_date->toDateURL() . '&Itemid=' . $Itemid);
            ?>
" title="<?php 
            echo JText::_('JEV_VIEWBYWEEK');
            ?>
" class="buttontext">
										<img src="<?php 
            echo $viewimages;
            ?>
/icon-weekly.gif" alt="Weekly View" border="0"/><br/>
								<?php 
            echo JText::_('JEV_VIEWBYWEEK');
            ?>
</a>
								</td>
		<?php 
        }
        ?>
		<?php 
        if (in_array("byday", $this->iconstoshow)) {
            ?>
								<td><img name="spacer" src="<?php 
            echo $viewimages;
            ?>
/spacer.gif"  alt="" border="0" height="25" width="10"/></td>
								<td class="buttontext" align="center" nowrap="nowrap" valign="middle">
									<a href="<?php 
            echo JRoute::_('index.php?option=' . $option . $cat . '&task=day.listevents&' . $today_date->toDateURL() . '&Itemid=' . $Itemid);
            ?>
" title="<?php 
            echo JText::_('JEV_VIEWTODAY');
            ?>
" class="buttontext">
										<img src="<?php 
            echo $viewimages;
            ?>
/icon-daily.gif" alt="Daily View" border="0"/><br/>
								<?php 
            echo JText::_('JEV_VIEWTODAY');
            ?>
</a>
								</td>
		<?php 
        }
        ?>

									<?php 
        if ($cfg->get('com_hideshowbycats', 0) == '0') {
            ?>
								<?php 
            if (in_array("bycat", $this->iconstoshow)) {
                ?>
									<td><img name="spacer" src="<?php 
                echo $viewimages;
                ?>
/spacer.gif"  alt="" border="0" height="25" width="10"/></td>
									<td class="buttontext" align="center" nowrap="nowrap" valign="middle">
										<a href="<?php 
                echo JRoute::_('index.php?option=' . $option . $cat . '&task=cat.listevents&' . $view_date->toDateURL() . '&Itemid=' . $Itemid);
                ?>
" title="<?php 
                echo JText::_('JEV_VIEWBYCAT');
                ?>
" class="buttontext">
											<img src="<?php 
                echo $viewimages;
                ?>
/icon-cats.gif" alt="Categories" border="0"/><br/>
				<?php 
                echo JText::_('JEV_VIEWBYCAT');
                ?>
</a>
									</td>
			<?php 
            }
            ?>
		<?php 
        }
        ?>
		<?php 
        if (in_array("search", $this->iconstoshow)) {
            ?>
								<td><img name="spacer" src="<?php 
            echo $viewimages;
            ?>
/spacer.gif"  alt="" border="0" height="25" width="10"/></td>
								<td class="buttontext" align="center" nowrap="nowrap" valign="middle">
									<a href="<?php 
            echo JRoute::_('index.php?option=' . $option . $cat . '&task=search.form&' . $view_date->toDateURL() . '&Itemid=' . $Itemid);
            ?>
" title="<?php 
            echo JText::_('JEV_SEARCH_TITLE');
            ?>
" class="buttontext">
										<img src="<?php 
            echo $viewimages;
            ?>
/icon-search.gif" alt="Search" border="0"/><br/>
			<?php 
            echo JText::_('JEV_SEARCH_TITLE');
            ?>
</a>
								</td>
		<?php 
        }
        ?>

						</tr>
					</table>

		        </td>
			</tr></table>
		<?php 
    }
Exemplo n.º 29
0
    protected function getInput()
    {
        jimport('joomla.filesystem.folder');
        $invalue = str_replace(" ", "", $this->value);
        $invalue = explode(",", $invalue);
        $pluginsDir = JPATH_ROOT . '/plugins/jevents';
        $filterpath = $pluginsDir . "/filters";
        $this->filterpath = array();
        if (JFolder::exists($filterpath)) {
            $this->filterpath[] = $filterpath;
        }
        $this->filterpath[] = JPATH_SITE . "/components/com_jevents/libraries/filters";
        if (JFolder::exists(JPATH_SITE . "/plugins/jevents")) {
            $others = JFolder::folders(JPATH_SITE . "/plugins/jevents", 'filters', true, true);
            if (is_array($others)) {
                $this->filterpath = array_merge($this->filterpath, $others);
            }
        }
        $filters = array();
        include_once JPATH_SITE . "/components/com_jevents/libraries/filters.php";
        foreach ($this->filterpath as $path) {
            foreach (JFolder::files($path, ".php") as $filtername) {
                if (!array_key_exists($filtername, $filters)) {
                    if (strpos($filtername, "-") > 0 || strpos($filtername, ".zip") > 0 || strpos($filtername, ".php") != strlen($filtername) - 4) {
                        continue;
                    }
                    $filterpath = $path . "/" . $filtername;
                    $filtername = substr($filtername, 0, strlen($filtername) - 4);
                    // skip special function filters
                    if ($filtername == "startdate" || $filtername == "Startdate") {
                        continue;
                    }
                    $filter = "jev" . ucfirst($filtername) . "Filter";
                    if (!class_exists($filter)) {
                        include_once $filterpath;
                    }
                    if (!class_exists($filter)) {
                        continue;
                    }
                    $filters[$filtername] = $path . "/" . $filter;
                }
            }
        }
        $validvalues = array();
        $input = '<div style="clear:left"></div><table><tr valign="top">
			<td><div style="font-weight:bold">' . JText::_("JEV_CLICK_TO_ADD_FILTER") . '</div>
			<div id="filterchoices" style="width:150px;margin-top:10px;height:100px;;border:solid 1px #ccc;overflow-y:auto" >';
        foreach ($filters as $filter => $filterpath) {
            if (!in_array($filter, $invalue) && !in_array(strtolower($filter), $invalue)) {
                $input .= '<div>' . $filter . "<span style='display:none'>{$filter}</span></div>";
                $validvalues[] = $filter;
            }
        }
        $validvalue = implode(",", $validvalues);
        $input .= '</div></td>
		<td><div  style="font-weight:bold">' . JText::_("JEV_FILTER_CLICK_TO_REMOVE") . '</div>
			<div id="filtermatches" style="margin:10px 0px 0px 10px;">';
        $invalues = array();
        foreach ($invalue as $filter) {
            if (array_key_exists($filter, $filters) || array_key_exists(ucfirst($filter), $filters)) {
                $filter = ucfirst($filter);
                $input .= '<div id="filter' . $filter . '">' . $filter . "</div>";
                $invalues[] = $filter;
            }
        }
        $invalues = implode(",", $invalues);
        $input .= '</div></td>
			</tr></table>';
        // load core and extra mootools
        JHTML::_('behavior.framework');
        JHtmlBehavior::framework();
        JHtmlBehavior::framework(true);
        JEVHelper::script('modules/mod_jevents_filter/fields/filterSelect.js');
        // Initialize some field attributes.
        $size = $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
        $maxLength = $this->element['maxlength'] ? ' maxlength="' . (int) $this->element['maxlength'] . '"' : '';
        $class = $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
        $readonly = (string) $this->element['readonly'] == 'true' ? ' readonly="readonly"' : '';
        $disabled = (string) $this->element['disabled'] == 'true' ? ' disabled="disabled"' : '';
        // Initialize JavaScript field attributes.
        $onchange = $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
        return $input . '<input type="hidden" name="' . $this->name . '" id="' . $this->id . '"' . ' value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' . $class . $size . $disabled . $readonly . $onchange . $maxLength . '/>';
    }
Exemplo n.º 30
0
                echo JText::_('JEV_SAVEICAL');
                ?>
">
							<img src="<?php 
                echo JURI::root() . 'administrator/components/' . JEV_COM_COMPONENT . '/assets/images/jevents_event_sml.png';
                ?>
" align="middle" name="image"  alt="<?php 
                echo JText::_('JEV_SAVEICAL');
                ?>
" style="height:24px;"/>
						</a>
					</td>
					<?php 
            }
            if ($row->canUserEdit() && !($mask & MASK_POPUP)) {
                JEVHelper::script('view_detail.js', 'components/' . JEV_COM_COMPONENT . "/assets/js/");
                ?>
                            <td  width="20" class="buttonheading" align="right">
                            <a href="javascript:void(0)" onclick='clickEditButton()' title="<?php 
                echo JText::_('JEV_E_EDIT');
                ?>
">
                            	<?php 
                echo JEVHelper::imagesite('edit.png', JText::_('JEV_E_EDIT'));
                ?>
                            </a>
                            </td>
                            <?php 
            }
            ?>
                </tr>