コード例 #1
0
function DefaultViewEventCatRowNew($view, $row, $args = "")
{
    // I choost not to use $row->fgcolor()
    $fgcolor = "inherit";
    $router = JRouter::getInstance("site");
    $vars = $router->getVars();
    $vars["catids"] = $row->catid();
    if (array_key_exists("Itemid", $vars) && is_null($vars["Itemid"])) {
        $vars["Itemid"] = JRequest::getInt("Itemid", 0);
    }
    $eventlink = "index.php?";
    foreach ($vars as $key => $val) {
        $eventlink .= $key . "=" . $val . "&";
    }
    $eventlink = substr($eventlink, 0, strlen($eventlink) - 1);
    $eventlink = JRoute::_($eventlink);
    ?>
		<a class="ev_link_cat" href="<?php 
    echo $eventlink;
    ?>
"  style="color:<?php 
    echo $fgcolor;
    ?>
;" title="<?php 
    echo JEventsHTML::special($row->catname());
    ?>
"><?php 
    echo $row->catname();
    ?>
</a>
		<?php 
}
コード例 #2
0
function DefaultdateFormattedDateRange($view)
{
    $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
    if ($params->get("daterangeformat", "") == "") {
        $return = JEventsHTML::getDateFormat($view->startyear, $view->startmonth, $view->startday, 1) . "&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;" . JEventsHTML::getDateFormat($view->endyear, $view->endmonth, $view->endday, 1);
    } else {
        $return = $params->get("daterangeformat", "");
        $startmatches = array();
        preg_match_all('|{START(.*?)}|', $return, $startmatches);
        if (count($startmatches) == 2 && count($startmatches[1]) == 1) {
            $replace = str_replace(array("(", ")"), "", $startmatches[1][0]);
            $datestp = JevDate::mktime(0, 0, 0, $view->startmonth, $view->startday, $view->startyear);
            $replace = JEV_CommonFunctions::jev_strftime($replace, $datestp);
            $return = str_replace($startmatches[0][0], $replace, $return);
        }
        $endmatches = array();
        preg_match_all('|{END(.*?)}|', $return, $endmatches);
        if (count($endmatches) == 2 && count($endmatches[1]) == 1) {
            $replace = str_replace(array("(", ")"), "", $endmatches[1][0]);
            $datestp = JevDate::mktime(0, 0, 0, $view->endmonth, $view->endday, $view->endyear);
            $replace = JEV_CommonFunctions::jev_strftime($replace, $datestp);
            $return = str_replace($endmatches[0][0], $replace, $return);
        }
        //$return = $params->get("daterangeformat", "");
    }
    return $return;
}
コード例 #3
0
ファイル: Multicategory.php プロジェクト: madseller/coperio
 function _createfilterHTML()
 {
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     $separator = $params->get("catseparator", "|");
     $catidsIn = JRequest::getVar('catids', 'NONE');
     $catidsIn = explode($separator, $catidsIn);
     JArrayHelper::toInteger($catidsIn);
     $filterList = array();
     $filterList["title"] = JText::_("Select_Category");
     //$filterList["html"] = JEventsHTML::buildCategorySelect( $filter_value, 'multiple="multiple" size="5" onchange="if ($(\'catidsfv\')) $(\'catidsfv\').value=this.value;submit(this.form)" ',$this->allAccessibleCategories,false,false,0,$this->filterType.'_fv' );
     // Not auto submitting
     $content = '<script type="text/javascript">';
     $content .= "function setmulticatfilter(){\n\t\t\t\tvar selects = \$('multicatfilter');\n\t\t\t\tvar catids = \$('multicatcatids');\n\t\t\t\tcatids.value  = '';\n\t\t\t\t\$A(selects.options).each(function(opt) {\n\t\t\t\t\tif (opt.selected) {\n\t\t\t\t\t\tif (catids.value  == ''){\n\t\t\t\t\t\t\tcatids.value  = opt.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tcatids.value  += '{$separator}'+opt.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}";
     $content .= '</script>';
     $filterList["html"] = JEventsHTML::buildCategorySelect($catidsIn, 'multiple="multiple" size="5" id="multicatfilter" onchange="setmulticatfilter()" ', $this->allAccessibleCategories, false, false, 0, $this->filterType . '_fv[]');
     $filterList["html"] .= '<br/><input type="text" name="catids" id="multicatcatids" value="' . implode($separator, $catidsIn) . '" />';
     $filterList["html"] .= $content;
     //$script = "function reset".$this->filterType."_fvs(){document.getElements('option',\$('".$this->filterType."_fv')).each(function(item){item.selected=(item.value==0)?true:false;})};\n";
     //$script .= "try {JeventsFilters.filters.push({action:'reset".$this->filterType."_fvs()',id:'".$this->filterType."_fv',value:".$this->filterNullValue."});} catch (e) {}\n";
     // try/catch  incase this is called without a filter module!
     $script = "try {JeventsFilters.filters.push({id:'" . $this->filterType . "_fv',value:0});} catch (e) {}\n";
     $document = JFactory::getDocument();
     $document->addScriptDeclaration($script);
     return $filterList;
 }
コード例 #4
0
ファイル: jeveventcategory.php プロジェクト: madcsaba/li-de
 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     if ($this->form->jevdata[$this->name]["repeatId"] == 0) {
         if (!isset($this->form->jevdata[$this->name]["excats"])) {
             $this->form->jevdata[$this->name]["excats"] = false;
         }
         $input = JEventsHTML::buildCategorySelect($this->value, 'id="catid" ', $this->form->jevdata[$this->name]["dataModel"]->accessibleCategoryList(), $this->form->jevdata[$this->name]["with_unpublished_cat"], true, 0, 'catid', JEV_COM_COMPONENT, $this->form->jevdata[$this->name]["excats"], "ordering", true);
     } else {
         $input = "";
     }
     JLoader::register('JEVHelper', JPATH_SITE . "/components/com_jevents/libraries/helper.php");
     JEVHelper::ConditionalFields($this->element, $this->form->getName());
     return $input;
 }
コード例 #5
0
ファイル: jeventshtml.php プロジェクト: hriggs/cs-website
 public static function buildReccurDaySelect($reccurday, $tag_name, $args)
 {
     // get array
     $day_name = JEVHelper::getWeekdayLetter(null, 1);
     $day_name[0] = '<span class="sunday">' . $day_name[0] . '</span>';
     $day_name[6] = '<span class="saturday">' . $day_name[6] . '</span>';
     $daynamelist[] = JHTML::_('select.option', '-1', '&nbsp;' . JText::_('JEV_BYDAYNUMBER') . '<br />');
     for ($a = 0; $a < 7; $a++) {
         $name_of_day = '&nbsp;' . $day_name[$a];
         //getDayName($a);
         $daynamelist[] = JHTML::_('select.option', $a, $name_of_day);
     }
     $tosend = JEventsHTML::buildRadioOption($daynamelist, $tag_name, $args, 'value', 'text', $reccurday);
     echo $tosend;
 }
コード例 #6
0
 /**
  * Creates javascript session memory reset action
  *
  */
 function _createfilterHTML()
 {
     if (!$this->filterField) {
         return "";
     }
     $filterList = array();
     $filterList["title"] = JText::_("Select_Category");
     $filterList["html"] = JEventsHTML::buildCategorySelect($this->filter_value, 'onchange="submit(this.form)" style="font-size:10px;"', $this->allAccessibleCategories, false, false, 0, $this->filterType . '_fv');
     //$script = "function reset".$this->filterType."_fvs(){document.getElements('option',\$('".$this->filterType."_fv')).each(function(item){item.selected=(item.value==0)?true:false;})};\n";
     //$script .= "try {JeventsFilters.filters.push({action:'reset".$this->filterType."_fvs()',id:'".$this->filterType."_fv',value:".$this->filterNullValue."});} catch (e) {}\n";
     // try/catch  incase this is called without a filter module!
     $script = "try {JeventsFilters.filters.push({id:'" . $this->filterType . "_fv',value:0});} catch (e) {}\n";
     $document = JFactory::getDocument();
     $document->addScriptDeclaration($script);
     return $filterList;
 }
コード例 #7
0
ファイル: calendar_cell.php プロジェクト: pguilford/vcomcc
 function calendarCell(&$currentDay, $year, $month, $i, $slot = "")
 {
     $cfg = JEVConfig::getInstance();
     // define start and end
     $cellStart = '<div';
     $cellClass = 'p0 ';
     $cellEnd = '</div>' . "\n";
     // add the event color as the column background color
     $cellStyle = ' background-color:' . $this->event->bgcolor() . ';color:' . $this->event->fgcolor() . ';';
     // MSIE ignores "inherit" color for links - stupid Microsoft!!!
     $linkStyle = 'style="color:' . $this->event->fgcolor() . ';"';
     // The title is printed as a link to the event's detail page
     $link = $this->event->viewDetailLink($year, $month, $currentDay['d0'], false);
     $link = JRoute::_($link . $this->_datamodel->getCatidsOutLink());
     $title = $this->event->title();
     // [mic] if title is too long, cut 'em for display
     $tmpTitle = $title;
     // set truncated title
     if (!isset($this->event->truncatedtitle)) {
         if (JString::strlen($title) >= $cfg->get('com_calCutTitle', 50)) {
             $tmpTitle = JString::substr($title, 0, $cfg->get('com_calCutTitle', 50)) . ' ...';
         }
         $tmpTitle = JEventsHTML::special($tmpTitle);
         $this->event->truncatedtitle = $tmpTitle;
     } else {
         $tmpTitle = $this->event->truncatedtitle;
     }
     // [new mic] if amount of displaing events greater than defined, show only a scmall coloured icon
     // instead of full text - the image could also be "recurring dependig", which means
     // for each kind of event (one day, multi day, last day) another icon
     // in this case the dfinition must moved down to be more flexible!
     // [tstahl] add a graphic symbol for all day events?
     $tmp_start_time = $this->start_time == $this->stop_time && !$this->event->noendtime() || $this->event->alldayevent() ? '' : $this->start_time;
     $templatedcell = false;
     if ($currentDay['countDisplay'] < $cfg->get('com_calMaxDisplay', 5)) {
         ob_start();
         $templatedcell = $this->loadedFromTemplate('month.calendar_cell', $this->event, 0);
         $res = ob_get_clean();
         if ($templatedcell) {
             $templatedcell = $res;
         } else {
             if ($this->_view) {
                 $this->_view->assignRef("link", $link);
                 $this->_view->assignRef("linkStyle", $linkStyle);
                 $this->_view->assignRef("tmp_start_time", $tmp_start_time);
                 $this->_view->assignRef("tmpTitle", $tmpTitle);
             }
             $title_event_link = $this->loadOverride("cellcontent");
             // allow fallback to old method
             if ($title_event_link == "") {
                 $title_event_link = '<a class="cal_titlelink" href="' . $link . '" ' . $linkStyle . '>' . ($cfg->get('com_calDisplayStarttime') ? $tmp_start_time : '') . ' ' . $tmpTitle . '</a>' . "\n";
             }
             $cellClass .= 'w100';
         }
     } else {
         $eventIMG = '<img align="left" class="b1sw" src="' . JURI::root() . 'components/' . JEV_COM_COMPONENT . '/images/event.png" class="h12px w8px" alt=""' . ' />';
         $title_event_link = '<a class="cal_titlelink" href="' . $link . '">' . $eventIMG . '</a>' . "\n";
         $cellClass .= ' fleft w10px';
     }
     $cellString = '';
     // allow template overrides for cell popups
     // only try override if we have a view reference
     if ($this->_view) {
         $this->_view->assignRef("ecc", $this);
         $this->_view->assignRef("cellDate", $currentDay["cellDate"]);
     }
     if ($cfg->get("com_enableToolTip", 1)) {
         if ($cfg->get("tooltiptype", 'joomla') == 'overlib') {
             $tooltip = $this->loadOverride("overlib");
             // allow fallback to old method
             if ($tooltip == "") {
                 $tooltip = $this->calendarCell_popup($currentDay["cellDate"]);
             }
             $cellString .= $tooltip;
         } else {
             JevHtmlBootstrap::popover('.hasjevtip', array("trigger" => "hover focus", "placement" => "top", "container" => "#jevents_body", "delay" => array("hide" => 150)));
             //$toolTipArray = array('className' => 'jevtip');
             //JHTML::_('behavior.tooltip', '.hasjevtip', $toolTipArray);
             $tooltip = $this->loadOverride("tooltip");
             // allow fallback to old method
             if ($tooltip == "") {
                 $tooltip = $this->calendarCell_tooltip($currentDay["cellDate"]);
             }
             $tooltip = $this->correctTooltipLanguage($tooltip);
             if (strpos($tooltip, "templated") === 0) {
                 $title = substr($tooltip, 9);
                 $cellString = "";
             } else {
                 // TT background
                 if ($cfg->get('com_calTTBackground', 1) == '1') {
                     $bground = $this->event->bgcolor();
                     $fground = $this->event->fgcolor();
                 } else {
                     $bground = "#000000";
                     $fground = "#ffffff";
                 }
                 $cellString .= '<div class="jevtt_text" >' . $tooltip . '</div>';
                 $title = '<div class="jevtt_title" style = "color:' . $fground . ';background-color:' . $bground . '">' . $this->title . '</div>';
             }
             if ($templatedcell) {
                 $templatedcell = str_replace("[[TOOLTIP]]", htmlspecialchars($title . $cellString, ENT_QUOTES), $templatedcell);
                 $templatedcell = str_replace("[[TOOLTIPTITLE]]", htmlspecialchars($title, ENT_QUOTES), $templatedcell);
                 $templatedcell = str_replace("[[TOOLTIPCONTENT]]", htmlspecialchars($cellString, ENT_QUOTES), $templatedcell);
                 $time = $cfg->get('com_calDisplayStarttime') ? $tmp_start_time : "";
                 $templatedcell = str_replace("[[EVTTIME]]", $time, $templatedcell);
                 return $templatedcell;
             }
             $html = $cellStart . ' class="' . $cellClass . '" style="' . $cellStyle . '">' . $this->tooltip($title, $cellString, $title_event_link) . $cellEnd;
             return $html;
         }
     }
     if ($templatedcell) {
         $templatedcell = str_replace("[[TOOLTIP]]", htmlspecialchars($title . $cellString, ENT_QUOTES), $templatedcell);
         $templatedcell = str_replace("[[TOOLTIPTITLE]]", htmlspecialchars($title, ENT_QUOTES), $templatedcell);
         $templatedcell = str_replace("[[TOOLTIPCONTENT]]", htmlspecialchars($cellString, ENT_QUOTES), $templatedcell);
         $time = $cfg->get('com_calDisplayStarttime') ? $tmp_start_time : "";
         $templatedcell = str_replace("[[EVTTIME]]", $time, $templatedcell);
         return $templatedcell;
     }
     // return the whole thing
     return $cellStart . ' class="' . $cellClass . '" style="' . $cellStyle . '" ' . $cellString . ">\n" . $title_event_link . $cellEnd;
 }
コード例 #8
0
?>
<table align="center" width="90%" cellspacing="0" cellpadding="0" class="ev_table">
    <tr valign="top">
        <td colspan="2"  align="center" class="cal_td_daysnames">
           <!-- <div class="cal_daysnames"> -->
            <?php 
echo $data["year"];
?>
            <!-- </div> -->
        </td>
    </tr>
<?php 
for ($month = 1; $month <= 12; $month++) {
    $num_events = count($data["months"][$month]["rows"]);
    if ($num_events > 0) {
        echo "<tr><td class='ev_td_left'>" . JEventsHTML::getDateFormat($this->year, $month, '', 3) . "</td>\n";
        echo "<td class='ev_td_right'>\n";
        echo "<ul class='ev_ul'>\n";
        for ($r = 0; $r < $num_events; $r++) {
            if (!isset($data["months"][$month]["rows"][$r])) {
                continue;
            }
            $row =& $data["months"][$month]["rows"][$r];
            $listyle = 'style="border-color:' . $row->bgcolor() . ';"';
            echo "<li class='ev_td_li' {$listyle}>\n";
            if (!$this->loadedFromTemplate('icalevent.list_row', $row, 0)) {
                $this->viewEventRowNEW($row);
                echo "&nbsp;::&nbsp;";
                $this->viewEventCatRowNEW($row);
            }
            echo "</li>\n";
コード例 #9
0
    function _viewHiddenJumpto($this_date)
    {
        $cfg =& JEVConfig::getInstance();
        $hiddencat = "";
        if ($this->view->datamodel->catidsOut != 0) {
            $hiddencat = '<input type="hidden" name="catids" value="' . $this->view->datamodel->catidsOut . '"/>';
        }
        ?>
		<tr align="center" valign="top">
			<?php 
        if ($cfg->get('com_calUseIconic', 1) != 2) {
            ?>
	    	<td colspan="10" align="center" valign="top">
	    	<?php 
        } else {
            ?>
	    	<td colspan="6" align="center" valign="top">
	    	<?php 
        }
        $index = JRoute::_("index.php");
        ?>
	    	<div id="jumpto"  style="display:none">
			<form name="BarNav" action="<?php 
        echo $index;
        ?>
" method="get">
				<input type="hidden" name="option" value="<?php 
        echo JEV_COM_COMPONENT;
        ?>
" />
				<input type="hidden" name="task" value="month.calendar" />
				<?php 
        echo $hiddencat;
        /*Day Select*/
        // JEventsHTML::buildDaySelect( $this_date->getYear(1), $this_date->getMonth(1), $this_date->getDay(1), ' style="font-size:10px;"' );
        /*Month Select*/
        JEventsHTML::buildMonthSelect($this_date->getMonth(1), 'style="font-size:10px;"');
        /*Year Select*/
        JEventsHTML::buildYearSelect($this_date->getYear(1), 'style="font-size:10px;"');
        ?>
				<button onclick="submit(this.form)"><?php 
        echo JText::_('JEV_JUMPTO');
        ?>
</button>
				<input type="hidden" name="Itemid" value="<?php 
        echo $this->Itemid;
        ?>
" />
			</form>
			</div>
			</td>
	    </tr>
		<?php 
    }
コード例 #10
0
ファイル: icalrepeat.php プロジェクト: pguilford/vcomcc
 function edit($key = NULL, $urlVar = NULL)
 {
     // get the view
     $this->view = $this->getView("icalrepeat", "html");
     // Get/Create the model
     if ($model = $this->getModel("icalevent", "icaleventsModel")) {
         // Push the model into the view (as default)
         $this->view->setModel($model, true);
     }
     $db = JFactory::getDBO();
     $cid = JRequest::getVar('cid', array(0));
     JArrayHelper::toInteger($cid);
     if (is_array($cid) && count($cid) > 0) {
         $id = $cid[0];
     } else {
         $id = $cid;
     }
     if (!JEVHelper::isEventCreator()) {
         throw new Exception(JText::_('ALERTNOTAUTH'), 403);
         return false;
     }
     // front end passes the id as evid
     if ($id == 0) {
         $id = JRequest::getInt("evid", 0);
     }
     $db = JFactory::getDBO();
     $query = "SELECT rpt.eventid" . "\n FROM (#__jevents_vevent as ev, #__jevents_icsfile as icsf)" . "\n LEFT JOIN #__jevents_repetition as rpt ON rpt.eventid = ev.ev_id" . "\n LEFT JOIN #__jevents_vevdetail as det ON det.evdet_id = rpt.eventdetail_id" . "\n LEFT JOIN #__jevents_rrule as rr ON rr.eventid = ev.ev_id" . "\n WHERE rpt.rp_id=" . $id . "\n AND icsf.ics_id=ev.icsid AND icsf.state=1";
     $db->setQuery($query);
     $ev_id = $db->loadResult();
     if ($ev_id == 0 || $id == 0) {
         $this->setRedirect('index.php?option=' . JEV_COM_COMPONENT . '&task=icalrepeat.list&cid[]=' . $ev_id, "ICal repeat does not exist");
         $this->redirect();
     }
     $repeatId = $id;
     $row = $this->queryModel->listEventsById($repeatId, true, "icaldb");
     if (!JEVHelper::canEditEvent($row)) {
         throw new Exception(JText::_('ALERTNOTAUTH'), 403);
         return false;
     }
     /*
      $db = JFactory::getDBO();
      // get list of groups
      $query = "SELECT id AS value, name AS text"
      . "\n FROM #__groups"
      . "\n ORDER BY id"	;
      $db->setQuery( $query );
      $groups = $db->loadObjectList();
     
      // build the html select list
      $glist = JHTML::_('select.genericlist', $groups, 'access', 'class="inputbox" size="1"',
      'value', 'text', intval( $row->access() ) );
     */
     $glist = JEventsHTML::buildAccessSelect(intval($row->access()), 'class="inputbox" size="1"');
     // For repeats don't offer choice of ical or category
     // get all the raw native calendars
     $nativeCals = $this->dataModel->queryModel->getNativeIcalendars();
     $icsid = $row->icsid() > 0 ? $row->icsid() : current($nativeCals)->ics_id;
     $clist = '<input type="hidden" name="ics_id" value="' . $icsid . '" />';
     $this->view->assign('clistChoice', false);
     $this->view->assign('defaultCat', 0);
     // Set the layout
     $this->view->setLayout('edit');
     $this->view->assign('ev_id', $ev_id);
     $this->view->assign('rp_id', $repeatId);
     $this->view->assign('row', $row);
     $this->view->assign('nativeCals', $nativeCals);
     $this->view->assign('clist', $clist);
     $this->view->assign('repeatId', $repeatId);
     $this->view->assign('glist', $glist);
     $this->view->assignRef('dataModel', $this->dataModel);
     $this->view->assign('editCopy', false);
     // only those who can publish globally can set priority field
     if (JEVHelper::isEventPublisher(true)) {
         $list = array();
         for ($i = 0; $i < 10; $i++) {
             $list[] = JHTML::_('select.option', $i, $i, 'val', 'text');
         }
         $priorities = JHTML::_('select.genericlist', $list, 'priority', "", 'val', 'text', $row->priority());
         $this->view->assign('setPriority', true);
         $this->view->assign('priority', $priorities);
     } else {
         $this->view->assign('setPriority', false);
     }
     // for Admin interface only
     $this->view->assign('with_unpublished_cat', JFactory::getApplication()->isAdmin());
     $this->view->display();
 }
コード例 #11
0
ファイル: listevents_body.php プロジェクト: madcsaba/li-de
<div class="jev_clear"></div>
<div id='jev_maincal' class='jev_listview'>

	<?php 
$num_events = count($data['rows']);
$chdate = "";
if ($num_events > 0) {
    $hasevents = true;
    for ($r = 0; $r < $num_events; $r++) {
        $row = $data['rows'][$r];
        $event_day_month_year = $row->dup() . $row->mup() . $row->yup();
        // Ensure we reflect multiday setting
        if (!$row->eventOnDate(JevDate::mktime(0, 0, 0, $row->mup(), $row->dup(), $row->yup()))) {
            continue;
        }
        $date = JEventsHTML::getDateFormat($row->yup(), $row->mup(), $row->dup(), 1);
        ?>
			<div class="jev_listrow">
		<ul class='ev_ul'>

					<?php 
        $listyle = 'style="border-color:' . $row->bgcolor() . ';"';
        echo "<li class='ev_td_li' {$listyle}>\n";
        if (!$this->loadedFromTemplate('icalevent.list_row', $row, 0)) {
            $this->viewEventRowNEW($row);
            echo "&nbsp;::&nbsp;";
            $this->viewEventCatRowNEW($row);
        }
        echo "</li>";
        ?>
	
コード例 #12
0
ファイル: calendar_cell.php プロジェクト: poorgeek/JEvents
 function calendarCell(&$currentDay, $year, $month, $i, $slot = "")
 {
     // pass $data by reference in order to update countdisplay
     $cfg = JEVConfig::getInstance();
     $Itemid = JEVHelper::getItemid();
     $event_day = $this->event->dup();
     $event_month = $this->event->mup();
     $id = $this->event->id();
     // this file controls the events component month calendar display cell output.  It is separated from the
     // showCalendar function in the events.php file to allow users to customize this portion of the code easier.
     // The event information to be displayed within a month day on the calendar can be modified, as well as any
     // overlay window information printed with a javascript mouseover event.  Each event prints as a separate table
     // row with a single column, within the month table's cell.
     // define start and end
     $cellStart = '<div';
     $cellStyle = 'padding:0;';
     $cellEnd = '</div>' . "\n";
     $linkStyle = "";
     // The title is printed as a link to the event's detail page
     $link = $this->event->viewDetailLink($year, $month, $currentDay['d0'], false);
     $link = JRoute::_($link . $this->_datamodel->getCatidsOutLink());
     $title = $this->event->title();
     // [mic] if title is too long, cut 'em for display
     $tmpTitle = $title;
     // set truncated title
     if (!isset($this->event->truncatedtitle)) {
         if (JString::strlen($title) >= $cfg->get('com_calCutTitle', 50)) {
             $tmpTitle = JString::substr($title, 0, $cfg->get('com_calCutTitle', 50)) . ' ...';
         }
         $tmpTitle = JEventsHTML::special($tmpTitle);
         $this->event->truncatedtitle = $tmpTitle;
     } else {
         $tmpTitle = $this->event->truncatedtitle;
     }
     // [new mic] if amount of displaing events greater than defined, show only a scmall coloured icon
     // instead of full text - the image could also be "recurring dependig", which means
     // for each kind of event (one day, multi day, last day) another icon
     // in this case the dfinition must moved down to be more flexible!
     // [tstahl] add a graphic symbol for all day events?
     $tmp_start_time = $this->start_time == $this->stop_time && !$this->event->noendtime() || $this->event->alldayevent() ? '' : $this->start_time;
     $templatedcell = false;
     // set truncated title
     if (!isset($this->event->truncatedtitle)) {
         $this->event->_title = $tmpTitle;
         $this->event->truncatedtitle = true;
     }
     if ($currentDay['countDisplay'] < $cfg->get('com_calMaxDisplay', 5)) {
         ob_start();
         $templatedcell = $this->loadedFromTemplate('month.calendar_cell', $this->event, 0);
         $res = ob_get_clean();
         if ($templatedcell) {
             $templatedcell = $res;
         } else {
             if ($this->_view) {
                 $this->_view->assignRef("link", $link);
                 $this->_view->assignRef("linkStyle", $linkStyle);
                 $this->_view->assignRef("tmp_start_time", $tmp_start_time);
                 $this->_view->assignRef("tmpTitle", $tmpTitle);
             }
             $title_event_link = $this->loadOverride("cellcontent");
             // allow fallback to old method
             if ($title_event_link == "") {
                 $title_event_link = "\n" . '<a class="cal_titlelink" href="' . $link . '" ' . $linkStyle . '>' . ($cfg->get('com_calDisplayStarttime') ? $tmp_start_time : '') . ' ' . $tmpTitle . '</a>' . "\n";
             }
             $cellStyle .= "border-left:8px solid " . $this->event->bgcolor() . ";padding-left:2px;";
         }
     } else {
         $eventIMG = '<img align="left" src="' . JURI::root() . 'components/' . JEV_COM_COMPONENT . '/images/event.png" alt="" style="height:12px;width:8px;border:1px solid white;background-color:' . $this->event->bgcolor() . '" />';
         $title_event_link = "\n" . '<a class="cal_titlelink" href="' . $link . '">' . $eventIMG . '</a>' . "\n";
         $cellStyle .= ' float:left;width:10px;';
     }
     $cellString = '';
     // allow template overrides for cell popups
     // only try override if we have a view reference
     if ($this->_view) {
         $this->_view->assignRef("ecc", $this);
         $this->_view->assignRef("cellDate", $currentDay["cellDate"]);
     }
     if ($cfg->get("com_enableToolTip", 1)) {
         if ($cfg->get("tooltiptype", 'overlib') == 'overlib') {
             $tooltip = $this->loadOverride("overlib");
             // allow fallback to old method
             if ($tooltip == "") {
                 $tooltip = $this->calendarCell_popup($currentDay["cellDate"]);
             }
             $cellString .= $tooltip;
         } else {
             // TT background
             if ($cfg->get('com_calTTBackground', 1) == '1') {
                 $bground = $this->event->bgcolor();
                 $fground = $this->event->fgcolor();
             } else {
                 $bground = "#000000";
                 $fground = "#ffffff";
             }
             JevHtmlBootstrap::popover('.hasjevtip', array("trigger" => "hover focus", "placement" => "top", "container" => "#jevents_body", "delay" => array("hide" => 150)));
             //$toolTipArray = array('className' => 'jevtip');
             //JHTML::_('behavior.tooltip', '.hasjevtip', $toolTipArray);
             $tooltip = $this->loadOverride("tooltip");
             // allow fallback to old method
             if ($tooltip == "") {
                 $tooltip = $this->calendarCell_tooltip($currentDay["cellDate"]);
             }
             if (strpos($tooltip, "templated") === 0) {
                 $title = JString::substr($tooltip, 9);
                 $cellString = "";
             } else {
                 $cellString .= '<div class="jevtt_text" >' . $tooltip . '</div>';
                 $title = '<div class="jevtt_title" style = "color:' . $fground . ';background-color:' . $bground . '">' . $this->title . '</div>';
             }
             if ($templatedcell) {
                 $templatedcell = str_replace("[[TOOLTIP]]", htmlspecialchars($title . $cellString, ENT_QUOTES), $templatedcell);
                 $templatedcell = str_replace("[[TOOLTIPTITLE]]", htmlspecialchars($title, ENT_QUOTES), $templatedcell);
                 $templatedcell = str_replace("[[TOOLTIPCONTENT]]", htmlspecialchars($cellString, ENT_QUOTES), $templatedcell);
                 $time = $cfg->get('com_calDisplayStarttime') ? $tmp_start_time : "";
                 $templatedcell = str_replace("[[EVTTIME]]", $time, $templatedcell);
                 return $templatedcell;
             }
             $html = $cellStart . ' style="' . $cellStyle . '">' . $this->tooltip($title, $cellString, $title_event_link) . $cellEnd;
             return $html;
         }
     }
     if ($templatedcell) {
         $templatedcell = str_replace("[[TOOLTIP]]", htmlspecialchars($title . $cellString, ENT_QUOTES), $templatedcell);
         $templatedcell = str_replace("[[TOOLTIPTITLE]]", htmlspecialchars($title, ENT_QUOTES), $templatedcell);
         $templatedcell = str_replace("[[TOOLTIPCONTENT]]", htmlspecialchars($cellString, ENT_QUOTES), $templatedcell);
         $time = $cfg->get('com_calDisplayStarttime') ? $tmp_start_time : "";
         $templatedcell = str_replace("[[EVTTIME]]", $time, $templatedcell);
         return $templatedcell;
     }
     // return the whole thing
     return $cellStart . ' style="' . $cellStyle . '" ' . $cellString . ">\n" . $title_event_link . $cellEnd;
 }
コード例 #13
0
 /**
  * List Icals
  *
  */
 function overview()
 {
     // get the view
     $this->view =& $this->getView("icals", "html");
     $this->_checkValidCategories();
     $option = JEV_COM_COMPONENT;
     $db =& JFactory::getDBO();
     $catid = intval(JFactory::getApplication()->getUserStateFromRequest("catid{$option}", 'catid', 0));
     $limit = intval(JFactory::getApplication()->getUserStateFromRequest("viewlistlimit", 'limit', 10));
     $limitstart = intval(JFactory::getApplication()->getUserStateFromRequest("view{$option}limitstart", 'limitstart', 0));
     $search = JFactory::getApplication()->getUserStateFromRequest("search{$option}", 'search', '');
     $search = $db->getEscaped(trim(strtolower($search)));
     $where = array();
     if ($search) {
         $where[] = "LOWER(icsf.label) LIKE '%{$search}%'";
     }
     if ($catid > 0) {
         $where[] = "catid = {$catid}";
     }
     // get the total number of records
     $query = "SELECT count(*)" . "\n FROM #__jevents_icsfile AS icsf" . (count($where) ? "\n WHERE " . implode(' AND ', $where) : '');
     $db->setQuery($query);
     $total = $db->loadResult();
     echo $db->getErrorMsg();
     if ($limitstart > $total) {
         $limitstart = 0;
     }
     if (JVersion::isCompatible("1.6.0")) {
         $query = "SELECT icsf.*, a.title as _groupname" . "\n FROM #__jevents_icsfile as icsf " . "\n LEFT JOIN #__viewlevels AS a ON a.id = icsf.access" . (count($where) ? "\n WHERE " . implode(' AND ', $where) : '');
     } else {
         $query = "SELECT icsf.*, g.name AS _groupname" . "\n FROM #__jevents_icsfile as icsf " . "\n LEFT JOIN #__groups AS g ON g.id = icsf.access" . (count($where) ? "\n WHERE " . implode(' AND ', $where) : '');
     }
     $query .= "\n ORDER BY icsf.isdefault DESC, icsf.label ASC";
     if ($limit > 0) {
         $query .= "\n LIMIT {$limitstart}, {$limit}";
     }
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     $catData = JEV_CommonFunctions::getCategoryData();
     for ($s = 0; $s < count($rows); $s++) {
         $row =& $rows[$s];
         if (array_key_exists($row->catid, $catData)) {
             $row->category = $catData[$row->catid]->name;
         } else {
             $row->category = "?";
         }
     }
     if ($this->_debug) {
         echo '[DEBUG]<br />';
         echo 'query:';
         echo '<pre>';
         echo $query;
         echo '-----------<br />';
         echo 'option "' . $option . '"<br />';
         echo '</pre>';
         //die( 'userbreak - mic ' );
     }
     if ($db->getErrorNum()) {
         echo $db->stderr();
         return false;
     }
     // get list of categories
     $attribs = 'class="inputbox" size="1" onchange="document.adminForm.submit();"';
     $clist = JEventsHTML::buildCategorySelect($catid, $attribs, null, true, false, 0, 'catid');
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     // Set the layout
     $this->view->setLayout('overview');
     $this->view->assign('option', JEV_COM_COMPONENT);
     $this->view->assign('rows', $rows);
     $this->view->assign('clist', $clist);
     $this->view->assign('search', $search);
     $this->view->assign('pageNav', $pageNav);
     $this->view->display();
 }
コード例 #14
0
ファイル: listevents_body.php プロジェクト: madcsaba/li-de
			
		</div>
	</div>
    <div class="jev_clear" ></div>
    <div id='jev_maincal' class='jev_listview'>

<?php 
$hasevents = false;
for ($month = 1; $month <= 12; $month++) {
    $num_events = count($data["months"][$month]["rows"]);
    if ($num_events > 0) {
        $hasevents = true;
        ?>
		<div class="jev_daysnames">
	    <?php 
        echo JEventsHTML::getDateFormat($this->year, $month, '', 3);
        ?>
		</div>
		<div class="jev_listrow">
		<?php 
        echo "<ul class='ev_ul'>\n";
        for ($r = 0; $r < $num_events; $r++) {
            if (!isset($data["months"][$month]["rows"][$r])) {
                continue;
            }
            $row =& $data["months"][$month]["rows"][$r];
            $listyle = 'style="border-color:' . $row->bgcolor() . ';"';
            echo "<li class='ev_td_li' {$listyle}>\n";
            if (!$this->loadedFromTemplate('icalevent.list_row', $row, 0)) {
                $this->viewEventRowNEW($row);
                echo "&nbsp;::&nbsp;";
コード例 #15
0
    	<td style="font-weight:bold">        <?php 
echo JText::_("JEV_CALENDAR_OWNER");
?>
</td>
        <td><?php 
echo $this->users;
?>
        </td>
	</tr>
	<tr>
    	<td style="font-weight:bold" >        <?php 
echo JText::_("Select_Default_Category");
?>
</td>
        <td><?php 
echo JEventsHTML::buildCategorySelect($catid, "", null, $this->with_unpublished_cat, true, 0, 'catid');
?>
        </td>
	</tr>
	<tr>
    	<td style="font-weight:bold"><?php 
echo JText::_('JEV_EVENT_ACCESSLEVEL');
?>
</td>
    	<td><?php 
echo $glist;
?>
</td>
	</tr>
	<?php 
if (!isset($this->editItem->ignoreembedcat) || $this->editItem->ignoreembedcat == 0) {
コード例 #16
0
    function DefaultViewNavTableBar($view, $today_date, $view_date, $dates, $alts, $option, $task, $Itemid)
    {
        $cfg =& JEVConfig::getInstance();
        $this->view = $view;
        $this->transparentGif = JURI::root() . "components/" . JEV_COM_COMPONENT . "/views/" . $this->view->getViewName() . "/assets/images/transp.gif";
        $this->Itemid = JEVHelper::getItemid();
        $this->cat = $this->view->datamodel->getCatidsOutLink();
        $this->task = $task;
        if (JRequest::getInt('pop', 0)) {
            return;
        }
        list($year, $month, $day) = JEVHelper::getYMD();
        $iconstoshow = $cfg->get('iconstoshow', array('byyear', 'bymonth', 'byweek', 'byday', 'search'));
        ?>
		<div class="ev_navigation" style="width:100%">
			<table width="300" border="0" align="center" >
				<tr align="center" valign="top">
					<td height="1" width="100" align="right" valign="top">
						<a href="<?php 
        echo JRoute::_('index.php?option=' . JEV_COM_COMPONENT . $this->cat . '&task=day.listevents&' . $today_date->toDateURL() . '&Itemid=' . $this->Itemid);
        ?>
" title="<?php 
        echo JText::_('JEV_VIEWTODAY');
        ?>
"><?php 
        echo JText::_('JEV_VIEWTODAY');
        ?>
</a>
					</td>
					<td height="1" align="center" valign="bottom">
						<form name="ViewSelect" action="<?php 
        echo JURI::root() . "index.php";
        ?>
" method="get">
							<input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
							<input type="hidden" name="option" value="<?php 
        echo JEV_COM_COMPONENT;
        ?>
" />
							<input type="hidden" name="year" value="<?php 
        echo $year;
        ?>
" />
							<input type="hidden" name="month" value="<?php 
        echo $month;
        ?>
" />
							<input type="hidden" name="day" value="<?php 
        echo $day;
        ?>
" />
							<select name="task" id="task" onchange="submit(this.form);">
								<?php 
        if (in_array("byday", $iconstoshow)) {
            ?>
									<option value="day.listevents"><?php 
            echo JText::_('JEV_VIEWBYDAY');
            ?>
</option>
									<?php 
        }
        if (in_array("byweek", $iconstoshow)) {
            ?>
									<option value="week.listevents"><?php 
            echo JText::_('JEV_VIEWBYWEEK');
            ?>
</option>
									<?php 
        }
        if (in_array("bymonth", $iconstoshow)) {
            ?>
									<option value="month.calendar"><?php 
            echo JText::_('JEV_VIEWBYMONTH');
            ?>
</option>
									<?php 
        }
        if (in_array("byyear", $iconstoshow)) {
            ?>
									<option value="year.listevents"><?php 
            echo JText::_('JEV_VIEWBYYEAR');
            ?>
</option>
									<?php 
        }
        if (in_array("search", $iconstoshow)) {
            ?>
									<option value="search.form"><?php 
            echo JText::_('JEV_SEARCH_TITLE');
            ?>
</option>
									<?php 
        }
        if (in_array("bycat", $iconstoshow)) {
            ?>
									<option value="cat.listevents"><?php 
            echo JText::_('JEV_VIEWBYCAT');
            ?>
</option>
									<?php 
        }
        ?>
							</select>
						</form>
					</td>
					<td height="1" width="100" align="left" valign="top">
						<a href="<?php 
        echo JRoute::_('index.php?option=' . JEV_COM_COMPONENT . $this->cat . '&task=month.calendar&' . $today_date->toDateURL() . '&Itemid=' . $this->Itemid);
        ?>
" title="<?php 
        echo JText::_('JEV_VIEWTOCOME');
        ?>
">
							<?php 
        echo JText::_('JEV_VIEWTOCOME');
        ?>
						</a>
					</td>
				</tr>
			</table>
			<table width="300" border="0" align="center">
				<tr valign="top">
					<?php 
        if (in_array("byyear", $iconstoshow)) {
            echo $this->_lastYearIcon($dates, $alts);
        }
        if (in_array("bymonth", $iconstoshow)) {
            echo $this->_lastMonthIcon($dates, $alts);
        }
        ?>
					<td align="center" valign="top">
						<form name="BarNav" action="index.php" method="get">
							<input type="hidden" name="option" value="<?php 
        echo JEV_COM_COMPONENT;
        ?>
" />
							<input type="hidden" name="task" value="<?php 
        echo $this->task;
        ?>
" />
							<?php 
        /* Day Select */
        JEventsHTML::buildDaySelect($year, $month, $day, ' style="font-size:10px;" onchange="submit(this.form)"');
        /* Month Select */
        JEventsHTML::buildMonthSelect($month, 'style="font-size:10px;" onchange="submit(this.form)"');
        /* Year Select */
        JEventsHTML::buildYearSelect($year, 'style="font-size:10px;" onchange="submit(this.form)"');
        ?>
							<input type="hidden" name="Itemid" value="<?php 
        echo $this->Itemid;
        ?>
" />
						</form>
					</td>
					<?php 
        if (in_array("bymonth", $iconstoshow)) {
            echo $this->_nextMonthIcon($dates, $alts);
        }
        if (in_array("byyear", $iconstoshow)) {
            echo $this->_nextYearIcon($dates, $alts);
        }
        ?>
				</tr>
			</table>

		</div>
		<?php 
    }
コード例 #17
0
    function _viewHiddenJumpto($this_date, $view, $Itemid)
    {
        $cfg = JEVConfig::getInstance();
        $hiddencat = "";
        if ($view->datamodel->catidsOut != 0) {
            $hiddencat = '<input type="hidden" name="catids" value="' . $view->datamodel->catidsOut . '"/>';
        }
        $index = JRoute::_("index.php");
        ?>
        <div id="jumpto"  class="jev_none">
            <form name="BarNav" action="<?php 
        echo $index;
        ?>
" method="get">
                <input type="hidden" name="option" value="<?php 
        echo JEV_COM_COMPONENT;
        ?>
" />
                <input type="hidden" name="task" value="month.calendar" />
        <?php 
        echo $hiddencat;
        /* Day Select */
        // JEventsHTML::buildDaySelect( $this_date->getYear(1), $this_date->getMonth(1), $this_date->getDay(1), ' style="font-size:10px;"' );
        /* Month Select */
        JEventsHTML::buildMonthSelect($this_date->getMonth(1), '');
        /* Year Select */
        JEventsHTML::buildYearSelect($this_date->getYear(1), '');
        ?>
                <button onclick="submit(this.form)"><?php 
        echo JText::_('JEV_JUMPTO');
        ?>
</button>
                <input type="hidden" name="Itemid" value="<?php 
        echo $Itemid;
        ?>
" />
            </form>
        </div>
        <?php 
    }
コード例 #18
0
<?php

defined('_JEXEC') or die('Restricted access');
$data = $this->data;
$Itemid = JEVHelper::getItemid();
$num_events = count($data['rows']);
if ($num_events > 0) {
    for ($r = 0; $r < $num_events; $r++) {
        $row = $data['rows'][$r];
        $rowlink = $row->viewDetailLink($row->yup(), $row->mup(), $row->dup(), true);
        ?>
		<a class="ev_link_row" href="<?php 
        echo $rowlink;
        ?>
"  title="<?php 
        echo JEventsHTML::special($row->title());
        ?>
"><?php 
        echo $row->title();
        ?>
</a>
		<br/>
		<?php 
    }
}
// Create the pagination object
if ($data["total"] > $data["limit"]) {
    $this->paginationForm($data["total"], $data["limitstart"], $data["limit"]);
}
コード例 #19
0
 function repeatSummary()
 {
     $sum = "";
     $cfg =& JEVConfig::getInstance();
     // i.e. 1 = follow english word order by default
     $grammar = intval(JText::_('JEV_REPEAT_GRAMMAR'));
     if (!isset($this->start_date)) {
         $event_up = new JEventDate($this->publish_up());
         $this->start_date = JEventsHTML::getDateFormat($event_up->year, $event_up->month, $event_up->day, 0);
         $this->start_time = JEVHelper::getTime($this->getUnixStartTime());
         $event_down = new JEventDate($this->publish_down());
         $this->stop_date = JEventsHTML::getDateFormat($event_down->year, $event_down->month, $event_down->day, 0);
         $this->stop_time = JEVHelper::getTime($this->getUnixEndTime());
         $this->stop_time_midnightFix = $this->stop_time;
         $this->stop_date_midnightFix = $this->stop_date;
         if ($event_down->second == 59) {
             $this->stop_time_midnightFix = JEVHelper::getTime($this->getUnixEndTime() + 1);
             $this->stop_date_midnightFix = JEventsHTML::getDateFormat($event_down->year, $event_down->month, $event_down->day + 1, 0);
         }
     }
     if ($this->alldayevent()) {
         if ($this->start_date == $this->stop_date) {
             $sum .= $this->start_date;
         } else {
             $sum .= JText::_('JEV_FROM') . '&nbsp;' . $this->start_date . '<br />' . JText::_('JEV_TO') . '&nbsp;' . $this->stop_date . '<br/>';
         }
     } else {
         if ($this->start_date == $this->stop_date) {
             if ($this->noendtime()) {
                 $sum .= $this->start_date . ',&nbsp;' . $this->start_time . '<br/>';
             } else {
                 if ($this->start_time != $this->stop_time && !$this->alldayevent()) {
                     $sum .= $this->start_date . ',&nbsp;' . $this->start_time . '&nbsp;-&nbsp;' . $this->stop_time_midnightFix . '<br/>';
                 } else {
                     if ($this->start_time == $this->stop_time && !$this->alldayevent()) {
                         $sum .= $this->start_date . ',&nbsp;' . $this->start_time . '<br/>';
                     } else {
                         $sum .= $this->start_date . '<br/>';
                     }
                 }
             }
         } else {
             // recurring events should have time related to recurrance not range of dates
             if ($this->noendtime() && !($this->reccurtype() > 0)) {
                 $sum .= $this->start_date . ',&nbsp;' . $this->start_time . '<br/>' . JText::_('JEV_TO') . '&nbsp;' . $this->stop_date . '<br/>';
             } else {
                 if ($this->start_time != $this->stop_time && !($this->reccurtype() > 0)) {
                     $sum .= JText::_('JEV_FROM') . '&nbsp;' . $this->start_date . '&nbsp;-&nbsp; ' . $this->start_time . '<br />' . JText::_('JEV_TO') . '&nbsp;' . $this->stop_date . '&nbsp;-&nbsp;' . $this->stop_time_midnightFix . '<br/>';
                 } else {
                     $sum .= JText::_('JEV_FROM') . '&nbsp;' . $this->start_date . '<br />' . JText::_('JEV_TO') . '&nbsp;' . $this->stop_date . '<br/>';
                 }
             }
         }
     }
     if ($this->_freq == "none") {
         return $sum;
     }
     return $sum;
     // TODO consider finishing this later - it is VERY COMPLICATED
     if ($this->_interval > 0) {
         if ($this->_interval == 1) {
             switch ($this->_freq) {
                 case 'DAILY':
                     $reccur = JText::_('JEV_ALLDAYS');
                     break;
                 case 'WEEKLY':
                     $reccur = JText::_('JEV_EACHWEEK');
                     break;
                 case 'MONTHLY':
                     $reccur = JText::_('JEV_EACHMONTH');
                     break;
                 case 'YEARLY':
                     $reccur = JText::_('JEV_EACHYEAR');
                     break;
             }
         } else {
             switch ($this->_freq) {
                 case 'DAILY':
                     $reccur = JText::_('JEV_EVERY_N_DAYS');
                     break;
                 case 'WEEKLY':
                     $reccur = JText::_('JEV_EVERY_N_WEEKS');
                     break;
                 case 'MONTHLY':
                     $reccur = JText::_('JEV_EVERY_N_MONTHS');
                     break;
                 case 'YEARLY':
                     $reccur = JText::_('JEV_EVERY_N_YEARS');
                     break;
             }
             $reccur = sprintf($reccur, $this->_interval);
         }
         if ($this->_count == 99999) {
             list($y, $m, $d) = explode(":", JevDate::strftime("%Y:%m:%d", $this->until()));
             $extra = JText::_('JEV_UNTIL') . "&nbsp;" . JEventsHTML::getDateFormat($y, $m, $d, 1);
         } else {
             $extra = sprintf(JText::_('JEV_COUNTREPEATS'), $this->_count);
         }
         $sum .= $reccur . "&nbsp;" . $extra;
     }
     return $sum;
 }
コード例 #20
0
ファイル: listevents_body.php プロジェクト: madcsaba/li-de
$hasevents = false;
echo '<fieldset><legend class="ev_fieldset">' . JText::_('JEV_EVENTSFOR') . '&nbsp;' . JText::_('JEV_WEEK') . ' : </legend><br />' . "\n";
echo '<table align="center" width="90%" cellspacing="0" cellpadding="5" class="ev_table">' . "\n";
?>
    <tr valign="top">
        <td colspan="2"  align="center" class="cal_td_daysnames">
           <!-- <div class="cal_daysnames"> -->
            <?php 
echo $data['startdate'] . ' - ' . $data['enddate'];
?>
            <!-- </div> -->
        </td>
    </tr>
<?php 
for ($d = 0; $d < 7; $d++) {
    $day_link = '<a class="ev_link_weekday" href="' . $data['days'][$d]['link'] . '" title="' . JText::_('JEV_CLICK_TOSWITCH_DAY') . '">' . JEV_CommonFunctions::jev_strftime("%A", JevDate::mktime(3, 0, 0, $data['days'][$d]['week_month'], $data['days'][$d]['week_day'], $data['days'][$d]['week_year'])) . "<br/>" . JEventsHTML::getDateFormat($data['days'][$d]['week_year'], $data['days'][$d]['week_month'], $data['days'][$d]['week_day'], 2) . '</a>' . "\n";
    if ($data['days'][$d]['today']) {
        $bg = 'class="ev_td_today"';
    } else {
        $bg = 'class="ev_td_left"';
    }
    echo '<tr><td ' . $bg . '>' . $day_link . '</td>' . "\n";
    echo '<td class="ev_td_right">' . "\n";
    $num_events = count($data['days'][$d]['rows']);
    if ($num_events > 0) {
        $hasevents = true;
        echo "<ul class='ev_ul'>\n";
        for ($r = 0; $r < $num_events; $r++) {
            $row = $data['days'][$d]['rows'][$r];
            $listyle = 'style="border-color:' . $row->bgcolor() . ';"';
            echo "<li class='ev_td_li' {$listyle}>\n";
コード例 #21
0
ファイル: legend.php プロジェクト: poorgeek/JEvents
 function blockKids($row, $itm, $tsk, $availableCatsIds, $activeParent = false, $activeSubCat = 0)
 {
     $catclass = "";
     if ($row->parent_id > 0) {
         $catclass = "childcat";
     }
     if ($row->parent_id > 0 && isset($row->activeBranch)) {
         $catclass = "activechildcat";
     }
     if ($row->parent_id > 0 && $activeParent) {
         $catclass = "activechildcat";
     }
     if ($row->parent_id > 0 && $activeSubCat > 0 && $row->id != $activeSubCat && !isset($row->activeNode)) {
         $catclass = "childcat";
     }
     $cat = $row->id > 0 ? "&catids={$row->id}" : "";
     //$rowparams = new JRegistry(isset($row->params)?$row->params:null);
     //$image = $rowparams->get("image",false);
     //$image = $image? "<img src = '".JURI::root().$image."' class='catimage'  alt='categoryimage' />" : "";
     $content = '<div class="event_legend_item ' . $catclass . '" style="border-color:' . $row->color . '">';
     $content .= '<div class="event_legend_name" style="border-color:' . $row->color . '">' . '<a href="' . JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "{$cat}{$itm}{$tsk}") . '" title="' . JEventsHTML::special($row->name) . '">' . JEventsHTML::special($row->name) . '</a>';
     $content .= '</div>' . "\n";
     if (JString::strlen($row->description) > 0) {
         $content .= '<div class="event_legend_desc"  style="border-color:' . $row->color . '">' . $row->description . '</div>';
     }
     $content .= '</div>' . "\n";
     if (isset($row->activeBranch) && isset($row->subcats)) {
         $activeSubCat = 0;
         foreach ($row->subcats as $subcatid => $subcat) {
             if (isset($subcat->activeBranch)) {
                 $activeSubCat = $subcatid;
             }
         }
         foreach ($row->subcats as $subcatid => $subcat) {
             $content .= $this->blockKids($subcat, $itm, $tsk, $availableCatsIds, isset($row->activeNode), $activeSubCat);
         }
     }
     return $content;
 }
コード例 #22
0
ファイル: calendar_cell.php プロジェクト: poorgeek/JEvents
 function calendarCell(&$currentDay, $year, $month, $i, $slot = "")
 {
     $cfg = JEVConfig::getInstance();
     $event = $currentDay["events"][$i];
     // Event publication infomation
     $event_up = new JEventDate($event->startDate());
     $event_down = new JEventDate($event->endDate());
     // BAR COLOR GENERATION
     $bgeventcolor = JEV_CommonFunctions::setColor($event);
     $start_publish = JevDate::mktime(0, 0, 0, $event->mup(), $event->dup(), $event->yup());
     $stop_publish = JevDate::mktime(0, 0, 0, $event->mdn(), $event->ddn(), $event->ydn());
     // this file controls the events component month calendar display cell output.  It is separated from the
     // showCalendar function in the events.php file to allow users to customize this portion of the code easier.
     // The event information to be displayed within a month day on the calendar can be modified, as well as any
     // overlay window information printed with a javascript mouseover event.  Each event prints as a separate table
     // row with a single column, within the month table's cell.
     // On mouse over date formats
     // Note that the date formats for the events can be easily changed by modifying the sprintf formatting
     // string below.  These are used for the default overlay window.  As well, the JevDate::strftime() function could
     // also be used instead to provide more powerful date formatting which supports locales if php function
     // set_locale() is being used.
     // define start and end
     $cellStart = '<div class="eventfull"><div class="eventstyle" ';
     $cellStyle = '';
     $cellEnd = '</div></div>' . "\n";
     // add the event color as the column background color
     include_once JPATH_ADMINISTRATOR . "/components/" . JEV_COM_COMPONENT . "/libraries/colorMap.php";
     //$colStyle .= $bgeventcolor ? ' background-color:' . $bgeventcolor . ';' : '';
     //$colStyle .= $bgeventcolor ? 'color:'.JevMapColor($bgeventcolor) . ';' : '';
     // MSIE ignores "inherit" color for links - stupid Microsoft!!!
     //$linkStyle = $bgeventcolor ? 'style="color:'.JevMapColor($bgeventcolor) . ';"' : '';
     $linkStyle = "";
     // The title is printed as a link to the event's detail page
     $link = $this->event->viewDetailLink($year, $month, $currentDay['d0'], false);
     $link = JRoute::_($link . $this->_datamodel->getCatidsOutLink());
     $title = $event->title();
     // [mic] if title is too long, cut 'em for display
     $tmpTitle = $title;
     // set truncated title
     if (!isset($this->event->truncatedtitle)) {
         if (JString::strlen($title) >= $cfg->get('com_calCutTitle', 50)) {
             $tmpTitle = JString::substr($title, 0, $cfg->get('com_calCutTitle', 50)) . ' ...';
         }
         $tmpTitle = JEventsHTML::special($tmpTitle);
         $this->event->truncatedtitle = $tmpTitle;
     } else {
         $tmpTitle = $this->event->truncatedtitle;
     }
     // [new mic] if amount of displaing events greater than defined, show only a scmall coloured icon
     // instead of full text - the image could also be "recurring dependig", which means
     // for each kind of event (one day, multi day, last day) another icon
     // in this case the dfinition must moved down to be more flexible!
     // [tstahl] add a graphic symbol for all day events?
     $tmp_start_time = $this->start_time == $this->stop_time && !$this->event->noendtime() || $this->event->alldayevent() ? '' : $this->start_time;
     $templatedcell = false;
     if ($currentDay['countDisplay'] < $cfg->get('com_calMaxDisplay', 5)) {
         ob_start();
         $templatedcell = $this->loadedFromTemplate('month.calendar_cell', $this->event, 0);
         $res = ob_get_clean();
         if ($templatedcell) {
             $templatedcell = $res;
         } else {
             if ($this->_view) {
                 $this->_view->assignRef("link", $link);
                 $this->_view->assignRef("linkStyle", $linkStyle);
                 $this->_view->assignRef("tmp_start_time", $tmp_start_time);
                 $this->_view->assignRef("tmpTitle", $tmpTitle);
             }
             $title_event_link = $this->loadOverride("cellcontent");
             // allow fallback to old method
             if ($title_event_link == "") {
                 $title_event_link = "\n" . '<a class="cal_titlelink" href="' . $link . '" ' . $linkStyle . '>' . ($cfg->get('com_calDisplayStarttime') ? $tmp_start_time : '') . ' ' . $tmpTitle . '</a>' . "\n";
             }
             $cellStyle .= "border-width:0px 0px 1px 8px;border-color:{$bgeventcolor};padding:0px 0px 1px 2px;";
         }
     } else {
         $eventIMG = '<img align="left" src="' . JURI::root() . 'components/' . JEV_COM_COMPONENT . '/images/event.png" alt="" style="height:12px;width:8px;border:1px solid white;background-color:' . $bgeventcolor . '" />';
         $title_event_link = "\n" . '<a class="cal_titlelink" href="' . $link . '">' . $eventIMG . '</a>' . "\n";
         $cellStyle .= ' float:left;width:10px;';
     }
     $cellString = '';
     // allow template overrides for cell popups
     // only try override if we have a view reference
     if ($this->_view) {
         $this->_view->assignRef("ecc", $this);
         $this->_view->assignRef("cellDate", $currentDay["cellDate"]);
     }
     if ($cfg->get("com_enableToolTip", 1)) {
         if ($cfg->get("tooltiptype", 'joomla') == 'overlib') {
             $tooltip = $this->loadOverride("overlib");
             // allow fallback to old method
             if ($tooltip == "") {
                 $tooltip = $this->calendarCell_popup($currentDay["cellDate"]);
             }
             $cellString .= $tooltip;
         } else {
             // TT background
             if ($cfg->get('com_calTTBackground', 1) == '1') {
                 $bground = $this->event->bgcolor();
                 $fground = $this->event->fgcolor();
             } else {
                 $bground = "#000000";
                 $fground = "#ffffff";
             }
             JevHtmlBootstrap::popover('.hasjevtip', array("trigger" => "hover focus", "placement" => "top", "container" => "#jevents_body", "delay" => array("hide" => 150)));
             //$toolTipArray = array('className'=>'jevtip');
             //JHTML::_('behavior.tooltip', '.hasjevtip', $toolTipArray);
             $tooltip = $this->loadOverride("tooltip");
             // allow fallback to old method
             if ($tooltip == "") {
                 $tooltip = $this->calendarCell_tooltip($currentDay["cellDate"]);
             }
             if (strpos($tooltip, "templated") === 0) {
                 $title = JString::substr($tooltip, 9);
                 $cellString = "";
             } else {
                 $cellString .= '<div class="jevtt_text" >' . $tooltip . '</div>';
                 $title = '<div class="jevtt_title" style = "color:' . $fground . ';background-color:' . $bground . '">' . $this->title . '</div>';
             }
             if ($templatedcell) {
                 $templatedcell = str_replace("[[TOOLTIP]]", htmlspecialchars($title . $cellString, ENT_QUOTES), $templatedcell);
                 $templatedcell = str_replace("[[TOOLTIPTITLE]]", htmlspecialchars($title, ENT_QUOTES), $templatedcell);
                 $templatedcell = str_replace("[[TOOLTIPCONTENT]]", htmlspecialchars($cellString, ENT_QUOTES), $templatedcell);
                 $time = $cfg->get('com_calDisplayStarttime') ? $tmp_start_time : "";
                 $templatedcell = str_replace("[[EVTTIME]]", $time, $templatedcell);
                 return $templatedcell;
             }
             $html = $cellStart . ' style="' . $cellStyle . '">' . $this->tooltip($title, $cellString, $title_event_link) . $cellEnd;
             return $html;
         }
     }
     if ($templatedcell) {
         $templatedcell = str_replace("[[TOOLTIP]]", htmlspecialchars($title . $cellString, ENT_QUOTES), $templatedcell);
         $templatedcell = str_replace("[[TOOLTIPTITLE]]", htmlspecialchars($title, ENT_QUOTES), $templatedcell);
         $templatedcell = str_replace("[[TOOLTIPCONTENT]]", htmlspecialchars($cellString, ENT_QUOTES), $templatedcell);
         $time = $cfg->get('com_calDisplayStarttime') ? $tmp_start_time : "";
         $templatedcell = str_replace("[[EVTTIME]]", $time, $templatedcell);
         return $templatedcell;
     }
     // return the whole thing
     return $cellStart . ' style="' . $cellStyle . '" ' . $cellString . ">\n" . $title_event_link . $cellEnd;
 }
コード例 #23
0
 function edit()
 {
     // get the view
     $this->view =& $this->getView("icalevent", "html");
     $cid = JRequest::getVar('cid', array(0));
     JArrayHelper::toInteger($cid);
     if (is_array($cid) && count($cid) > 0) {
         $id = $cid[0];
     } else {
         $id = 0;
     }
     // front end passes the id as evid
     if ($id == 0) {
         $id = JRequest::getInt("evid", 0);
     }
     if (!JEVHelper::isEventCreator()) {
         JError::raiseError(403, JText::_('ALERTNOTAUTH'));
     }
     $repeatId = 0;
     $db = JFactory::getDBO();
     // iCal agid uses GUID or UUID as identifier
     if ($id > 0) {
         if ($repeatId == 0) {
             // this version gives us a repeat not an event so
             //$row = $this->queryModel->getEventById($id, true, "icaldb");
             $vevent = $this->dataModel->queryModel->getVEventById($id);
             if (!$vevent) {
                 $Itemid = JRequest::getInt("Itemid");
                 JFactory::getApplication()->redirect(JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&Itemid={$Itemid}", false), JText::_("JEV_SORRY_UPDATED"));
             }
             $row = new jIcalEventDB($vevent);
             $row->fixDtstart();
         } else {
             $row = $this->queryModel->listEventsById($repeatId, true, "icaldb");
         }
         if (!JEVHelper::canEditEvent($row)) {
             JError::raiseError(403, JText::_('ALERTNOTAUTH'));
         }
     } else {
         $vevent = new iCalEvent($db);
         $vevent->set("freq", "DAILY");
         $vevent->set("description", "");
         $vevent->set("summary", "");
         list($year, $month, $day) = JEVHelper::getYMD();
         $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
         $defaultstarttime = $params->get("defaultstarttime", "08:00");
         $defaultendtime = $params->get("defaultendtime", "17:00");
         list($starthour, $startmin) = explode(":", $defaultstarttime);
         list($endhour, $endmin) = explode(":", $defaultendtime);
         $vevent->set("dtstart", JevDate::mktime($starthour, $startmin, 0, $month, $day, $year));
         $vevent->set("dtend", JevDate::mktime($endhour, $endmin, 0, $month, $day, $year));
         $row = new jIcalEventDB($vevent);
         // TODO - move this to class!!
         // populate with meaningful initial values
         $row->starttime($defaultstarttime);
         $row->endtime($defaultendtime);
     }
     /*
     $db =& JFactory::getDBO();
     // get list of groups
     $query = "SELECT id AS value, name AS text"
     . "\n FROM #__groups"
     . "\n ORDER BY id"	;
     $db->setQuery( $query );
     $groups = $db->loadObjectList();
     
     // build the html select list
     $glist = JHTML::_('select.genericlist', $groups, 'access', 'class="inputbox" size="1"',	'value', 'text', intval( $row->access() ) );
     */
     $glist = JEventsHTML::buildAccessSelect(intval($row->access()), 'class="inputbox" size="1"');
     // get all the raw native calendars
     $nativeCals = $this->dataModel->queryModel->getNativeIcalendars();
     // Strip this list down based on user permissions
     $jevuser =& JEVHelper::getAuthorisedUser();
     if ($jevuser && $jevuser->calendars != "" && $jevuser->calendars != "all") {
         $cals = array_keys($nativeCals);
         $allowedcals = explode("|", $jevuser->calendars);
         foreach ($cals as $calid) {
             if (!in_array($calid, $allowedcals)) {
                 unset($nativeCals[$calid]);
             }
         }
     }
     // Are we allowed to edit events within a URL based iCal
     $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
     if ($params->get("allowedit", 0) && $row->icsid() > 0) {
         $calsql = 'SELECT * FROM #__jevents_icsfile WHERE ics_id=' . intval($row->icsid());
         $db->setQuery($calsql);
         $cal = $db->loadObject();
         if ($cal && $cal->icaltype == 0) {
             $nativeCals[$cal->ics_id] = $cal;
             $this->view->assign("offerlock", 1);
         }
     }
     $excats = "0";
     if ($jevuser && $jevuser->categories != "" && $jevuser->categories != "all") {
         // Find which categories to exclude
         if (JVersion::isCompatible("1.6.0")) {
             $catsql = 'SELECT id  FROM #__categories WHERE id NOT IN (' . str_replace("|", ",", $jevuser->categories) . ') AND extension="com_jevents"';
         } else {
             $catsql = 'SELECT id  FROM #__categories WHERE id NOT IN (' . str_replace("|", ",", $jevuser->categories) . ') AND section="com_jevents"';
         }
         $db->setQuery($catsql);
         $excats = implode(",", $db->loadResultArray());
     }
     // only offer a choice of native calendars if it exists!
     if (count($nativeCals) > 1) {
         $icalList = array();
         $icalList[] = JHTML::_('select.option', '0', JText::_('JEV_EVENT_CHOOSE_ICAL'), 'ics_id', 'label');
         $icalList = array_merge($icalList, $nativeCals);
         $clist = JHTML::_('select.genericlist', $icalList, 'ics_id', " onchange='preselectCategory(this);'", 'ics_id', 'label', $row->icsid());
         $this->view->assign('clistChoice', true);
         $this->view->assign('defaultCat', 0);
     } else {
         if (count($nativeCals) == 0 || !is_array($nativeCals)) {
             JError::raiseWarning(870, JText::_('INVALID_CALENDAR_STRUCTURE'));
         }
         $icsid = $row->icsid() > 0 ? $row->icsid() : current($nativeCals)->ics_id;
         $clist = '<input type="hidden" name="ics_id" value="' . $icsid . '" />';
         $this->view->assign('clistChoice', false);
         $params = JComponentHelper::getParams(JEV_COM_COMPONENT);
         if ($params->get("defaultcat", false)) {
             $this->view->assign('defaultCat', current($nativeCals)->catid);
         } else {
             $this->view->assign('defaultCat', 0);
         }
     }
     // Set the layout
     $this->view->setLayout('edit');
     $this->view->assign('editCopy', $this->editCopy);
     $this->view->assign('id', $id);
     $this->view->assign('row', $row);
     $this->view->assign('excats', $excats);
     $this->view->assign('nativeCals', $nativeCals);
     $this->view->assign('clist', $clist);
     $this->view->assign('repeatId', $repeatId);
     $this->view->assign('glist', $glist);
     // only those who can publish globally can set priority field
     if (JEVHelper::isEventPublisher(true)) {
         $list = array();
         for ($i = 0; $i < 10; $i++) {
             $list[] = JHTML::_('select.option', $i, $i, 'val', 'text');
         }
         $priorities = JHTML::_('select.genericlist', $list, 'priority', "", 'val', 'text', $row->priority());
         $this->view->assign('setPriority', true);
         $this->view->assign('priority', $priorities);
     } else {
         $this->view->assign('setPriority', false);
     }
     $this->view->assignRef('dataModel', $this->dataModel);
     // for Admin interface only
     $this->view->assign('with_unpublished_cat', JFactory::getApplication()->isAdmin());
     $this->view->display();
 }
コード例 #24
0
 function getDataForAdmin($creator_id, $limit, $limitstart, $showrepeats = false, $orderby = "")
 {
     $data = array();
     $is_event_editor = JEVHelper::isEventCreator();
     $user =& JFactory::getUser();
     $Itemid = JEVHelper::getItemid();
     $user =& JFactory::getUser();
     $db =& JFactory::getDBO();
     $cfg =& JEVConfig::getInstance();
     include_once JPATH_ADMINISTRATOR . "/components/" . JEV_COM_COMPONENT . "/libraries/colorMap.php";
     // Note that these are the vevents not the repeats
     if (!$showrepeats) {
         $total = $this->queryModel->countIcalEventsByCreator($creator_id);
     } else {
         $total = $this->queryModel->countIcalEventRepeatsByCreator($creator_id);
     }
     $data['total'] = $total;
     $data['limit'] = $limit;
     if ($data["total"] <= $data["limit"]) {
         $limitstart = 0;
     }
     $data["limitstart"] = $limitstart;
     // Note that these are the vevents not the repeats
     if (!$showrepeats) {
         $rows = $this->queryModel->listIcalEventsByCreator($creator_id, $limitstart, $limit, $orderby);
     } else {
         $rows = $this->queryModel->listIcalEventRepeatsByCreator($creator_id, $limitstart, $limit, $orderby);
     }
     $adminView = true;
     $num_events = count($rows);
     if ($num_events > 0) {
         for ($r = 0; $r < $num_events; $r++) {
             $row =& $rows[$r];
             $row->catname($row->getCategoryName());
             $row->contactlink(JEventsHTML::getUserMailtoLink($row->id(), $row->created_by(), true));
             $row->bgcolor = JEV_CommonFunctions::setColor($row);
             $row->fgcolor = JevMapColor($row->bgcolor);
         }
     }
     $data['rows'] = $rows;
     return $data;
 }
コード例 #25
0
ファイル: edit16_keep.php プロジェクト: site4com/prometheus
    echo "<td>" . JText::_("JEV_LOCK_EVENT") . "</td>";
    echo "<td colspan='3'><label>" . JText::_("JEV_YES") . "<input type=\"radio\" name=\"lockevent\" value=\"1\" " . ($this->row->lockevent() ? "checked=\"checked\"" : "") . " /></label><label>" . JText::_("JEV_NO") . "<input type=\"radio\" name=\"lockevent\" value=\"0\" " . (!$this->row->lockevent() ? "checked=\"checked\"" : "") . " /></label></td>";
    echo "</tr>\n";
}
?>
					<tr>
					<?php 
if ($this->repeatId == 0) {
    ?>
							<td valign="top" align="left" class="jevcategory"><?php 
    echo JText::_('JEV_EVENT_CATEGORY');
    ?>
</td>
							<td style="width:200px"  class="jevcategory">
						<?php 
    echo JEventsHTML::buildCategorySelect($catid, 'id="catid" ', $this->dataModel->accessibleCategoryList(), $this->with_unpublished_cat, true, 0, 'catid', JEV_COM_COMPONENT, $this->excats, "ordering", true);
    ?>
							</td>
						<?php 
}
if (isset($this->glist)) {
    ?>
							<td align="left" class="accesslevel"><?php 
    echo JText::_('JEV_EVENT_ACCESSLEVEL');
    ?>
</td>
							<td class="accesslevel"><?php 
    echo $this->glist;
    ?>
</td>
								<?php 
コード例 #26
0
ファイル: latest.php プロジェクト: pguilford/vcomcc
 protected function processMatch(&$content, $match, $dayEvent, $dateParm, $relDay)
 {
     $datenow = JEVHelper::getNow();
     $dispatcher = JDispatcher::getInstance();
     // get the title and start time
     $startDate = JevDate::strtotime($dayEvent->publish_up());
     if ($relDay > 0) {
         $eventDate = JevDate::strtotime($datenow->toFormat('%Y-%m-%d ') . JevDate::strftime('%H:%M', $startDate) . " +{$relDay} days");
     } else {
         $eventDate = JevDate::strtotime($datenow->toFormat('%Y-%m-%d ') . JevDate::strftime('%H:%M', $startDate) . " {$relDay} days");
     }
     $endDate = JevDate::strtotime($dayEvent->publish_down());
     list($st_year, $st_month, $st_day) = explode('-', JevDate::strftime('%Y-%m-%d', $startDate));
     list($ev_year, $ev_month, $ev_day) = explode('-', JevDate::strftime('%Y-%m-%d', $startDate));
     $task_events = 'icalrepeat.detail';
     switch ($match) {
         case 'endDate':
         case 'startDate':
         case 'eventDate':
             // Note we need to examine the date specifiers used to determine if language translation will be
             // necessary.  Do this later when script is debugged.
             if (!$this->disableDateStyle) {
                 $content .= '<span class="mod_events_latest_date">';
             }
             if (!$dayEvent->alldayevent() && $match == "endDate" && ($dayEvent->noendtime() && $dayEvent->getUnixStartDate() == $dayEvent->getUnixEndDate() || $dayEvent->getUnixStartTime() == $dayEvent->getUnixEndTime())) {
                 $time_fmt = "";
             } else {
                 if (!isset($dateParm) || $dateParm == '') {
                     if ($this->com_calUseStdTime) {
                         $time_fmt = $dayEvent->alldayevent() ? '' : IS_WIN ? ' @%I:%M%p' : ' @%l:%M%p';
                     } else {
                         $time_fmt = $dayEvent->alldayevent() ? '' : ' @%H:%M';
                     }
                     $dateFormat = $this->displayYear ? '%a %b %d, %Y' . $time_fmt : '%a %b %d' . $time_fmt;
                     $jmatch = new JevDate(${$match});
                     $content .= $jmatch->toFormat($dateFormat);
                     //$content .= JEV_CommonFunctions::jev_strftime($dateFormat, $$match);
                 } else {
                     // format endDate when midnight to show midnight!
                     if ($match == "endDate" && $dayEvent->sdn() == 59) {
                         $tempEndDate = $endDate + 1;
                         if ($dayEvent->alldayevent()) {
                             // if an all day event then we don't want to roll to the next day
                             $tempEndDate -= 86400;
                         }
                         $match = "tempEndDate";
                     }
                     // if a '%' sign detected in date format string, we assume JevDate::strftime() is to be used,
                     if (preg_match("/\\%/", $dateParm)) {
                         $jmatch = new JevDate(${$match});
                         $content .= $jmatch->toFormat($dateParm);
                     } else {
                         $content .= date($dateParm, ${$match});
                     }
                     if ($match == "tempDndDate") {
                         $match = "endDate";
                     }
                 }
             }
             if (!$this->disableDateStyle) {
                 $content .= "</span>";
             }
             break;
         case 'title':
             $title = $dayEvent->title();
             if (!empty($dateParm)) {
                 $parts = explode("|", $dateParm);
                 if (count($parts) > 0 && strlen($title) > intval($parts[0])) {
                     $title = substr($title, 0, intval($parts[0]));
                     if (count($parts) > 1) {
                         $title .= $parts[1];
                     }
                 }
             }
             if (!$this->disableTitleStyle) {
                 $content .= '<span class="mod_events_latest_content">';
             }
             if ($this->displayLinks) {
                 $link = $dayEvent->viewDetailLink($ev_year, $ev_month, $ev_day, false, $this->myItemid);
                 if ($this->modparams->get("ignorefiltermodule", 0)) {
                     $link = JRoute::_($link . $this->datamodel->getCatidsOutLink() . "&filter_reset=1");
                 } else {
                     $link = JRoute::_($link . $this->datamodel->getCatidsOutLink());
                 }
                 $content .= $this->_htmlLinkCloaking($link, JEventsHTML::special($title));
             } else {
                 $content .= JEventsHTML::special($title);
             }
             if (!$this->disableTitleStyle) {
                 $content .= '</span>';
             }
             break;
         case 'category':
             $catobj = $dayEvent->getCategoryName();
             $content .= JEventsHTML::special($catobj);
             break;
         case 'categoryimage':
             $catobj = $dayEvent->getCategoryImage();
             $content .= $catobj;
             break;
         case 'calendar':
             $catobj = $dayEvent->getCalendarName();
             $content .= JEventsHTML::special($catobj);
             break;
         case 'contact':
             // Also want to cloak contact details so
             $this->modparams->set("image", 1);
             $dayEvent->text = $dayEvent->contact_info();
             $dispatcher->trigger('onContentPrepare', array('com_jevents', &$dayEvent, &$this->modparams, 0));
             $dayEvent->contact_info($dayEvent->text);
             $content .= $dayEvent->contact_info();
             break;
         case 'content':
             // Added by Kaz McCoy 1-10-2004
             $this->modparams->set("image", 1);
             $dayEvent->data->text = $dayEvent->content();
             $dispatcher->trigger('onContentPrepare', array('com_jevents', &$dayEvent->data, &$this->modparams, 0));
             if (!empty($dateParm)) {
                 $parts = explode("|", $dateParm);
                 if (count($parts) > 0 && strlen(strip_tags($dayEvent->data->text)) > intval($parts[0])) {
                     $dayEvent->data->text = substr(strip_tags($dayEvent->data->text), 0, intval($parts[0]));
                     if (count($parts) > 1) {
                         $dayEvent->data->text .= $parts[1];
                     }
                 }
             }
             $dayEvent->content($dayEvent->data->text);
             //$content .= substr($dayEvent->content, 0, 150);
             $content .= $dayEvent->content();
             break;
         case 'addressInfo':
         case 'location':
             $this->modparams->set("image", 0);
             $dayEvent->data->text = $dayEvent->location();
             $dispatcher->trigger('onContentPrepare', array('com_jevents', &$dayEvent->data, &$this->modparams, 0));
             $dayEvent->location($dayEvent->data->text);
             $content .= $dayEvent->location();
             break;
         case 'duration':
             $timedelta = $dayEvent->noendtime() || $dayEvent->alldayevent() ? "" : $dayEvent->getUnixEndTime() - $dayEvent->getUnixStartTime();
             if ($timedelta == "") {
                 break;
             }
             $fieldval = isset($dateParm) && $dateParm != '' ? $dateParm : 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("%wd", $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);
             }
             $content .= $fieldval;
             break;
         case 'extraInfo':
             $this->modparams->set("image", 0);
             $dayEvent->data->text = $dayEvent->extra_info();
             $dispatcher->trigger('onContentPrepare', array('com_jevents', &$dayEvent->data, &$this->modparams, 0));
             $dayEvent->extra_info($dayEvent->data->text);
             $content .= $dayEvent->extra_info();
             break;
         case 'countdown':
             $timedelta = $dayEvent->getUnixStartTime() - JevDate::mktime();
             $eventPassed = !($timedelta >= 0);
             $fieldval = $dateParm;
             $shownsign = false;
             if (stripos($fieldval, "%nopast") !== false) {
                 if (!$eventPassed) {
                     $fieldval = str_ireplace("%nopast", "", $fieldval);
                 } else {
                     $fieldval = JText::_('JEV_EVENT_FINISHED');
                 }
             }
             if (stripos($fieldval, "%d") !== false) {
                 $days = intval($timedelta / (60 * 60 * 24));
                 $timedelta -= $days * 60 * 60 * 24;
                 $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);
             }
             $content .= $fieldval;
             break;
         case 'createdByAlias':
             $content .= $dayEvent->created_by_alias();
             break;
         case 'createdByUserName':
             $catobj = JEVHelper::getUser($dayEvent->created_by());
             $content .= isset($catobj->username) ? $catobj->username : "";
             break;
         case 'createdByUserEmail':
             // Note that users email address will NOT be available if they don't want to receive email
             $catobj = JEVHelper::getUser($dayEvent->created_by());
             $content .= $catobj->sendEmail ? $catobj->email : '';
             break;
         case 'createdByUserEmailLink':
             // Note that users email address will NOT be available if they don't want to receive email
             $content .= JRoute::_("index.php?option=" . $compname . "&task=" . $task_events . "&agid=" . $dayEvent->id() . "&year=" . $st_year . "&month=" . $st_month . "&day=" . $st_day . "&Itemid=" . $this->myItemid . $this->catout);
             break;
         case 'color':
             $content .= $dayEvent->bgcolor();
             break;
         case 'eventDetailLink':
             $link = $dayEvent->viewDetailLink($st_year, $st_month, $st_day, false, $this->myItemid);
             $link = JRoute::_($link . $this->datamodel->getCatidsOutLink());
             $content .= $link;
             /*
              $content .= JRoute::_("index.php?option="
              . $compname
              . "&task=".$task_events
              . "&agid=".$dayEvent->id()
              . "&year=".$st_year
              . "&month=".$st_month
              . "&day=".$st_day
              . "&Itemid=".$this->myItemid . $this->catout);
             */
             break;
         default:
             try {
                 if (strpos($match, '${') !== false) {
                     $parts = explode('${', $match);
                     $tempstr = "";
                     foreach ($parts as $part) {
                         if (strpos($part, "}") !== false) {
                             // limit to 2 because we may be using joomla content plugins
                             $subparts = explode("}", $part, 2);
                             if (strpos($subparts[0], "#") > 0) {
                                 $formattedparts = explode("#", $subparts[0]);
                                 $subparts[0] = $formattedparts[0];
                             } else {
                                 $formattedparts = array($subparts[0], "%s", "");
                             }
                             $subpart = "_" . $subparts[0];
                             if (isset($dayEvent->{$subpart})) {
                                 $temp = $dayEvent->{$subpart};
                                 if ($temp != "") {
                                     $tempstr .= str_replace("%s", $temp, $formattedparts[1]);
                                 } else {
                                     if (isset($formattedparts[2])) {
                                         $tempstr .= str_replace("%s", $temp, $formattedparts[2]);
                                     }
                                 }
                             } else {
                                 if (isset($dayEvent->customfields[$subparts[0]]['value'])) {
                                     $temp = $dayEvent->customfields[$subparts[0]]['value'];
                                     if ($temp != "") {
                                         $tempstr .= str_replace("%s", $temp, $formattedparts[1]);
                                     } else {
                                         if (isset($formattedparts[2])) {
                                             $tempstr .= str_replace("%s", $temp, $formattedparts[2]);
                                         }
                                     }
                                 } else {
                                     $matchedByPlugin = false;
                                     $layout = "list";
                                     static $fieldNameArrays = array();
                                     $jevplugins = JPluginHelper::getPlugin("jevents");
                                     foreach ($jevplugins as $jevplugin) {
                                         $classname = "plgJevents" . ucfirst($jevplugin->name);
                                         if (is_callable(array($classname, "substitutefield"))) {
                                             if (!isset($fieldNameArrays[$classname])) {
                                                 $fieldNameArrays[$classname] = call_user_func(array($classname, "fieldNameArray"), $layout);
                                             }
                                             if (isset($fieldNameArrays[$classname]["values"])) {
                                                 if (in_array($subparts[0], $fieldNameArrays[$classname]["values"])) {
                                                     $matchedByPlugin = true;
                                                     // is the event detail hidden - if so then hide any custom fields too!
                                                     if (!isset($event->_privateevent) || $event->_privateevent != 3) {
                                                         $temp = call_user_func(array($classname, "substitutefield"), $dayEvent, $subparts[0]);
                                                         if ($temp != "") {
                                                             $tempstr .= str_replace("%s", $temp, $formattedparts[1]);
                                                         } else {
                                                             if (isset($formattedparts[2])) {
                                                                 $tempstr .= str_replace("%s", $temp, $formattedparts[2]);
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                     if (!$matchedByPlugin) {
                                         // Layout editor code
                                         include_once JEV_PATH . "/views/default/helpers/defaultloadedfromtemplate.php";
                                         ob_start();
                                         // false at the end to stop it running through the plugins
                                         $part = "{{Dummy Label:" . implode("#", $formattedparts) . "}}";
                                         DefaultLoadedFromTemplate(false, false, $dayEvent, 0, $part, false);
                                         $newpart = ob_get_clean();
                                         if ($newpart != $part) {
                                             $tempstr .= $newpart;
                                             $matchedByPlugin = true;
                                         }
                                     }
                                     // none of the plugins has replaced the output so we now replace the blank formatted part!
                                     if (!$matchedByPlugin && isset($formattedparts[2])) {
                                         $tempstr .= str_replace("%s", "", $formattedparts[2]);
                                     }
                                     //$dispatcher->trigger( 'onLatestEventsField', array( &$dayEvent, $subparts[0], &$tempstr));
                                 }
                             }
                             $tempstr .= $subparts[1];
                         } else {
                             $tempstr .= $part;
                         }
                     }
                     $content .= $tempstr;
                 } else {
                     if ($match) {
                         $content .= $match;
                     }
                 }
             } catch (Exception $e) {
                 if ($match) {
                     $content .= $match;
                 }
             }
             break;
     }
     // end of switch
 }
コード例 #27
0
ファイル: listevents_body.php プロジェクト: madseller/coperio
<!-- BEGIN previous_month_link_row -->
      	<?php 
if ($precedingDay) {
    echo "<a href='" . $precedingDay . "' title='" . JText::_("PRECEEDING_Day") . "' >";
    ?>
      	<?php 
    echo JText::_("PRECEEDING_Day") . "</a>";
}
?>
      	

<!-- END previous_month_link_row -->
			</td>
			<td  class="currentmonth" style="background-color: rgb(208, 230, 246);" align="center" height="22" nowrap="nowrap" valign="middle">
				<?php 
echo JEventsHTML::getDateFormat($this->year, $this->month, $this->day, 0);
?>
			</td>
			<td  class="nextmonth" align="center" height="22" nowrap="nowrap" valign="middle"  width="33%">
      	<?php 
if ($followingDay) {
    echo "<a href='" . $followingDay . "' title='" . JText::_("FOLLOWING_Day") . "' >";
    ?>
      	<?php 
    echo JText::_("FOLLOWING_Day") . "</a>";
    ?>
      	<?php 
    echo "</a>";
}
?>
コード例 #28
0
ファイル: listevents_body.php プロジェクト: madcsaba/li-de
foreach ($filterHTML as $filter) {
    echo "<div class='jev_adminfilter'>" . $filter["title"] . "<br/>" . $filter["html"] . "</div>";
}
?>
</form>
<?php 
echo '<table align="center" width="90%" cellspacing="0" cellpadding="5" class="ev_table">' . "\n";
if ($num_events > 0) {
    for ($r = 0; $r < $num_events; $r++) {
        $row = $data['rows'][$r];
        $event_month_year = $row->mup() . $row->yup();
        if ($event_month_year != $chdate && $chdate != "") {
            echo '</ul></td></tr>' . "\n";
        }
        if ($event_month_year != $chdate) {
            echo '<tr><td class="ev_td_left">' . "\n" . JEventsHTML::getDateFormat($row->yup(), $row->mup(), '', 3) . '</td>' . "\n";
            echo '<td class="ev_td_right"><ul class="ev_ul">' . "\n";
        }
        $this->viewEventRowAdmin($row);
        $chdate = $event_month_year;
    }
    echo '</ul></td>' . "\n";
} else {
    echo '<tr>' . "\n";
    echo '<td align="left" valign="top" class="ev_td_right">' . "\n";
    echo JText::_('JEV_NO_EVENTS');
}
echo '</tr></table><br />' . "\n";
echo '</fieldset><br /><br />' . "\n";
// Create the pagination object
if ($data["total"] > $data["limit"]) {
コード例 #29
0
ファイル: jeventcal.php プロジェクト: poorgeek/JEvents
 function repeatSummary()
 {
     $cfg = JEVConfig::getInstance();
     // i.e. 1 = follow english word order by default
     $grammar = intval(JText::_('JEV_REPEAT_GRAMMAR'));
     // if starttime and end time the same then show no times!
     if ($this->start_date == $this->stop_date) {
         if ($this->start_time != $this->stop_time && !$this->alldayevent()) {
             echo $this->start_date . ',&nbsp;' . $this->start_time . '&nbsp;-&nbsp;' . $this->stop_time_midnightFix;
         } else {
             echo $this->start_date;
         }
     } else {
         // recurring events should have time related to recurrance not range of dates
         if ($this->start_time != $this->stop_time && !($this->reccurtype() > 0)) {
             echo JText::_('JEV_FROM') . '&nbsp;' . $this->start_date . '&nbsp;-&nbsp; ' . $this->start_time . '<br />' . JText::_('JEV_TO') . '&nbsp;' . $this->stop_date . '&nbsp;-&nbsp;' . $this->stop_time_midnightFix . '<br/>';
         } else {
             echo JText::_('JEV_FROM') . '&nbsp;' . $this->start_date . '<br />' . JText::_('JEV_TO') . '&nbsp;' . $this->stop_date . '<br/>';
         }
     }
     if ($this->reccurtype() > 0) {
         switch ($this->reccurtype()) {
             case '1':
                 $reccur = JText::_('JEV_REP_WEEK');
                 break;
             case '2':
                 $reccur = JText::_('JEV_REP_WEEK');
                 break;
             case '3':
                 $reccur = JText::_('JEV_REP_MONTH');
                 break;
             case '4':
                 $reccur = JText::_('JEV_REP_MONTH');
                 break;
             case '5':
                 $reccur = JText::_('JEV_REP_YEAR');
                 break;
         }
         if ($this->reccurday() >= 0 || ($this->reccurtype() == 1 || $this->reccurtype() == 2)) {
             $timeString = "";
             if ($this->start_time != $this->stop_time) {
                 $timeString = $this->start_time . "&nbsp;-&nbsp;" . $this->stop_time_midnightFix . "&nbsp;";
             }
             echo $timeString;
             if (intval($this->reccurday()) < 0) {
                 $event_start_date = JevDate::strtotime($this->startDate());
                 $reccurday = intval(date('w', $event_start_date));
             } else {
                 $reccurday = $this->reccurday();
             }
             if ($this->reccurtype() == 1) {
                 $dayname = JEventsHTML::getDayName($reccurday);
                 echo $dayname . '&nbsp;' . JText::_('JEV_EACHOF') . '&nbsp;' . $reccur;
             } else {
                 if ($this->reccurtype() == 2) {
                     $each = JText::_('JEV_EACH') . '&nbsp;';
                     if ($grammar == 1) {
                         $each = strtolower($each);
                     }
                     $daystring = "";
                     if (JString::strlen($this->reccurweeks()) == 0) {
                         $days = explode("|", $this->reccurweekdays());
                         for ($d = 0; $d < count($days); $d++) {
                             $daystring .= JEventsHTML::getDayName($days[$d]);
                             $daystring .= ($d == 0 ? "," : "") . "&nbsp;";
                         }
                         $weekstring = "";
                     } else {
                         $days = explode("|", $this->reccurweekdays());
                         for ($d = 0; $d < count($days); $d++) {
                             $daystring .= JEventsHTML::getDayName($days[$d]);
                             $daystring .= ($d == 0 ? "," : "") . "&nbsp;";
                         }
                         $weekstring = $this->reccurweeks() == 'pair' ? JText::_('JEV_REP_WEEKPAIR') : ($this->reccurweeks() == 'impair' ? JText::_('JEV_REP_WEEKIMPAIR') : "");
                         if ($weekstring == "") {
                             switch ($grammar) {
                                 case 1:
                                     $weekstring = "- " . JText::_('JEV_REP_WEEK') . " ";
                                     $weekstring .= str_replace("|", ", ", $this->reccurweeks()) . " ";
                                     $weekstring .= strtolower(JText::_('JEV_EACHMONTH'));
                                     break;
                                 default:
                                     $weekstring = str_replace("|", ", ", $this->reccurweeks()) . " ";
                                     $weekstring .= $reccur;
                                     $weekstring .= JText::_('JEV_EACHMONTH');
                                     break;
                             }
                         }
                     }
                     $firstword = true;
                     switch ($grammar) {
                         case 1:
                             echo $daystring . $weekstring;
                             break;
                         default:
                             echo $each . $daystring . $weekstring;
                             break;
                     }
                 } else {
                     echo JText::_('JEV_EACH') . '&nbsp;' . $reccur;
                 }
             }
         } else {
             echo JText::_('JEV_EACH') . '&nbsp;' . $reccur;
         }
     } else {
         if ($this->start_date != $this->stop_date) {
             echo JText::_('JEV_ALLDAYS');
         }
     }
 }
コード例 #30
0
ファイル: listevents_body.php プロジェクト: ForAEdesWeb/AEW1
<?php

defined('_JEXEC') or die('Restricted access');
$cfg = JEVConfig::getInstance();
$this->data = $data = $this->datamodel->getDayData($this->year, $this->month, $this->day);
$this->Redirectdetail();
$cfg = JEVConfig::getInstance();
$Itemid = JEVHelper::getItemid();
$hasevents = false;
echo '<fieldset><legend class="ev_fieldset">' . JText::_('JEV_EVENTSFORTHE') . ': ' . JEventsHTML::getDateFormat($this->year, $this->month, $this->day, 0) . '</legend><br />' . "\n";
echo '<div class="ja-events-list row equal-height equal-height-child">' . "\n";
// Timeless Events First
if (count($data['hours']['timeless']['events']) > 0) {
    $start_time = JText::_('TIMELESS');
    $hasevents = true;
    foreach ($data['hours']['timeless']['events'] as $row) {
        $class = $datenow->toFormat('%Y-%m-%d') > $row->startDate() ? "pastevent" : "";
        $link = $row->viewDetailLink($row->yup(), $row->mup(), $row->dup(), $Itemid);
        $listyle = 'style="background-color:' . $row->bgcolor() . ';"';
        echo "<div class='col-sm-6 col-md-6 col-lg-4 col " . $class . "'><div class='inner'>\n";
        if ($row->get('imageimg1')) {
            ?>
      <div class="item-image">
          <div class="img-intro-left">
              <a href="<?php 
            echo $link;
            ?>
" title="<?php 
            echo $row->title();
            ?>
" class="item-link">