本文整理汇总了PHP中JEV_CommonFunctions::jev_strftime方法的典型用法代码示例。如果您正苦于以下问题:PHP JEV_CommonFunctions::jev_strftime方法的具体用法?PHP JEV_CommonFunctions::jev_strftime怎么用?PHP JEV_CommonFunctions::jev_strftime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JEV_CommonFunctions
的用法示例。
在下文中一共展示了JEV_CommonFunctions::jev_strftime方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DefaultdateFormattedDateRange
function DefaultdateFormattedDateRange($view)
{
$params = JComponentHelper::getParams(JEV_COM_COMPONENT);
if ($params->get("daterangeformat", "") == "") {
$return = JEventsHTML::getDateFormat($view->startyear, $view->startmonth, $view->startday, 1) . " - " . 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;
}
示例2: ProcessRequest
function ProcessRequest(&$requestObject, $returnData)
{
define("REQUESTOBJECT", serialize($requestObject));
define("RETURNDATA", serialize($returnData));
require_once JPATH_BASE . DS . 'includes' . DS . 'defines.php';
require_once JPATH_BASE . DS . 'includes' . DS . 'framework.php';
$requestObject = unserialize(REQUESTOBJECT);
$returnData = unserialize(RETURNDATA);
$returnData->allclear = 1;
ini_set("display_errors", 0);
global $option;
$client = "site";
if (isset($requestObject->client) && in_array($requestObject->client, array("site", "administrator"))) {
$client = $requestObject->client;
}
$mainframe = JFactory::getApplication($client);
JFactory::getApplication()->initialise();
$option = "com_jevents";
// Not sure why this is needed but it is if (use use $mainframe =& JFactory::getApplication($client); )!!!
// needed for Joomla 1.5 plugins
$GLOBALS['mainframe'] = $mainframe;
$lang =& JFactory::getLanguage();
$lang->load("com_jevents", JPATH_SITE);
$lang->load("com_jevents", JPATH_ADMINISTRATOR);
include_once JPATH_SITE . "/components/com_jevents/jevents.defines.php";
$params =& JComponentHelper::getParams("com_jevents");
if (!$params->get("checkclashes", 0) && !$params->get("noclashes", 0)) {
return $returnData;
}
// Enforce referrer
if (!$params->get("skipreferrer", 0)) {
if (!array_key_exists("HTTP_REFERER", $_SERVER)) {
throwerror("There was an error");
}
$live_site = $_SERVER['HTTP_HOST'];
$ref_parts = parse_url($_SERVER["HTTP_REFERER"]);
if (!isset($ref_parts["host"]) || $ref_parts["host"] . (isset($ref_parts["port"]) ? ':' . $ref_parts["port"] : '') != $live_site) {
throwerror("There was an error - missing host in referrer");
}
}
if ($params->get("icaltimezonelive", "") != "" && is_callable("date_default_timezone_set") && $params->get("icaltimezonelive", "") != "") {
$timezone = date_default_timezone_get();
$tz = $params->get("icaltimezonelive", "");
date_default_timezone_set($tz);
$registry =& JRegistry::getInstance("jevents");
$registry->setValue("jevents.timezone", $timezone);
}
$token = JUtility::getToken();
if (!isset($requestObject->token) || $requestObject->token != $token) {
throwerror("There was an error - bad token. Please refresh the page and try again.");
}
$user = JFactory::getUser();
if (!JEVHelper::isEventCreator()) {
throwerror("There was an error");
}
if (intval($requestObject->formdata->evid) > 0) {
$db = JFactory::getDBO();
$dataModel = new JEventsDataModel("JEventsAdminDBModel");
$queryModel = new JEventsDBModel($dataModel);
$event = $queryModel->getEventById(intval($requestObject->formdata->evid), 1, "icaldb");
//$db->setQuery("SELECT * FROM #__jevents_vevent where ev_id=".intval($requestObject->formdata->evid));
// $event = $db->loadObject();
if (!$event || !JEVHelper::canEditEvent($event)) {
throwerror("There was an error");
}
}
$returnData->overlaps = array();
if ($requestObject->pressbutton == "icalrepeat.apply" || $requestObject->pressbutton == "icalrepeat.save") {
$testrepeat = simulateSaveRepeat($requestObject);
// now we have out event and its repetitions we now check to see for overlapping events
$overlaps = checkRepeatOverlaps($testrepeat, $returnData, intval($requestObject->formdata->evid), $requestObject);
} else {
$testevent = simulateSaveEvent($requestObject);
// now we have out event and its repetitions we now check to see for overlapping events
$overlaps = checkEventOverlaps($testevent, $returnData, intval($requestObject->formdata->evid), $requestObject);
}
if (count($overlaps) > 0) {
$returnData->allclear = 0;
foreach ($overlaps as $olp) {
$overlap = new stdClass();
$overlap->event_id = $olp->eventid;
$overlap->eventdetail_id = $olp->eventdetail_id;
$overlap->summary = $olp->summary;
$overlap->rp_id = $olp->rp_id;
$overlap->startrepeat = $olp->startrepeat;
$overlap->endrepeat = $olp->endrepeat;
list($y, $m, $d, $h, $m, $d) = sscanf($olp->startrepeat, "%d-%d-%d %d:%d:%d");
$tstring = JText::_("JEV_OVERLAP_MESSAGE");
$overlap->conflictMessage = sprintf($tstring, $olp->summary, JEV_CommonFunctions::jev_strftime(JText::_("DATE_FORMAT_4"), JevDate::strtotime($olp->startrepeat)), JEV_CommonFunctions::jev_strftime(JText::_("DATE_FORMAT_4"), JevDate::strtotime($olp->endrepeat)), $olp->conflictCause);
$overlap->conflictMessage = addslashes($overlap->conflictMessage);
$overlap->url = JURI::root() . "index.php?option=com_jevents&task=icalrepeat.detail&evid=" . $olp->rp_id . "&year={$y}&month={$m}&day={$d}";
$overlap->url = str_replace("components/com_jevents/libraries/", "", $overlap->url);
$returnData->overlaps[] = $overlap;
}
}
if ($requestObject->error) {
$returnData->allclear = 0;
return "Error";
}
return $returnData;
//.........这里部分代码省略.........
示例3: count
$hasevents = false;
echo '<fieldset><legend class="ev_fieldset">' . JText::_('JEV_EVENTSFOR') . ' ' . 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";
示例4: ProcessJsonRequest
/**
* @copyright Copyright (C) 2015-2015 GWE Systems Ltd. All rights reserved.
* @license By negoriation with author via http://www.gwesystems.com
*/
function ProcessJsonRequest(&$requestObject, $returnData)
{
//$file4 = JPATH_SITE . '/components/com_jevents/libraries/checkconflict.php';
//if (JFile::exists($file4)) JFile::delete($file4);
$returnData->allclear = 1;
ini_set("display_errors", 0);
$lang = JFactory::getLanguage();
$lang->load("com_jevents", JPATH_SITE);
$lang->load("com_jevents", JPATH_ADMINISTRATOR);
include_once JPATH_SITE . "/components/com_jevents/jevents.defines.php";
$params = JComponentHelper::getParams("com_jevents");
if (!$params->get("checkconflicts", 0)) {
return $returnData;
}
// Do we ignore overlaps
if (JEVHelper::isEventDeletor(true) && isset($requestObject->formdata->overlapoverride) && $requestObject->formdata->overlapoverride == 1) {
return $returnData;
}
// Enforce referrer
if (!$params->get("skipreferrer", 0)) {
if (!array_key_exists("HTTP_REFERER", $_SERVER)) {
PlgSystemGwejson::throwerror("There was an error - no referrer info available");
}
$live_site = $_SERVER['HTTP_HOST'];
$ref_parts = parse_url($_SERVER["HTTP_REFERER"]);
if (!isset($ref_parts["host"]) || $ref_parts["host"] . (isset($ref_parts["port"]) ? ':' . $ref_parts["port"] : '') != $live_site) {
PlgSystemGwejson::throwerror("There was an error - missing host in referrer");
}
}
if ($params->get("icaltimezonelive", "") != "" && is_callable("date_default_timezone_set") && $params->get("icaltimezonelive", "") != "") {
$timezone = date_default_timezone_get();
$tz = $params->get("icaltimezonelive", "");
date_default_timezone_set($tz);
$registry = JRegistry::getInstance("jevents");
$registry->set("jevents.timezone", $timezone);
}
$token = JSession::getFormToken();
if (!isset($requestObject->token) || strcmp($requestObject->token, $token) !== 0) {
PlgSystemGwejson::throwerror("There was an error - bad token. Please refresh the page and try again.");
}
$user = JFactory::getUser();
if (!JEVHelper::isEventCreator()) {
PlgSystemGwejson::throwerror("There was an error - not an event creator");
}
if (intval($requestObject->formdata->evid) > 0) {
$db = JFactory::getDBO();
$dataModel = new JEventsDataModel("JEventsAdminDBModel");
$queryModel = new JEventsDBModel($dataModel);
$event = $queryModel->getEventById(intval($requestObject->formdata->evid), 1, "icaldb");
//$db->setQuery("SELECT * FROM #__jevents_vevent where ev_id=".intval($requestObject->formdata->evid));
// $event = $db->loadObject();
if (!$event || !JEVHelper::canEditEvent($event)) {
PlgSystemGwejson::throwerror("There was an error - cannot edit this event");
}
}
$returnData->overlaps = array();
if ($requestObject->pressbutton == "icalrepeat.apply" || $requestObject->pressbutton == "icalrepeat.save") {
$testrepeat = simulateSaveRepeat($requestObject);
// now we have out event and its repetitions we now check to see for overlapping events
$overlaps = checkRepeatOverlaps($testrepeat, $returnData, intval($requestObject->formdata->evid), $requestObject);
} else {
$testevent = simulateSaveEvent($requestObject);
// now we have out event and its repetitions we now check to see for overlapping events
$overlaps = checkEventOverlaps($testevent, $returnData, intval($requestObject->formdata->evid), $requestObject);
}
if (count($overlaps) > 0) {
$returnData->allclear = 0;
foreach ($overlaps as $olp) {
$overlap = new stdClass();
$overlap->event_id = $olp->eventid;
$overlap->eventdetail_id = $olp->eventdetail_id;
$overlap->summary = $olp->summary;
$overlap->rp_id = $olp->rp_id;
$overlap->startrepeat = $olp->startrepeat;
$overlap->endrepeat = $olp->endrepeat;
list($y, $m, $d, $h, $m, $d) = sscanf($olp->startrepeat, "%d-%d-%d %d:%d:%d");
$tstring = JText::_("JEV_OVERLAP_MESSAGE");
$overlap->conflictMessage = sprintf($tstring, $olp->summary, JEV_CommonFunctions::jev_strftime(JText::_("DATE_FORMAT_4"), JevDate::strtotime($olp->startrepeat)), JEV_CommonFunctions::jev_strftime(JText::_("DATE_FORMAT_4"), JevDate::strtotime($olp->endrepeat)), $olp->conflictCause);
$overlap->conflictMessage = addslashes($overlap->conflictMessage);
$overlap->url = JURI::root() . "index.php?option=com_jevents&task=icalrepeat.detail&evid=" . $olp->rp_id . "&year={$y}&month={$m}&day={$d}";
$overlap->url = str_replace("components/com_jevents/libraries/", "", $overlap->url);
$returnData->overlaps[] = $overlap;
}
}
if ($requestObject->error) {
$returnData->allclear = 0;
return "Error";
}
return $returnData;
}
示例5: getDateFormat
public static function getDateFormat($year, $month, $day, $type)
{
// Transform to translation strings
if (empty($year)) {
$year = 0;
}
if (empty($month)) {
$month = 0;
}
if (empty($day)) {
$day = 1;
}
static $format_type;
if (!isset($format_type)) {
$cfg = JEVConfig::getInstance();
$format_type = $cfg->get('com_dateformat');
}
$datestp = JevDate::mktime(0, 0, 0, $month, $day, $year);
// if date format is from langauge file then do this first
if ($format_type == 3 && is_numeric($type)) {
return JEV_CommonFunctions::jev_strftime(JText::_("DATE_FORMAT_" . $type), $datestp);
}
switch ($type) {
case '0':
if ($format_type == 0) {
return JEV_CommonFunctions::jev_strftime("%A %d %B %Y", $datestp);
// Fr style : Monday 03 Juillet 2003
} elseif ($format_type == 1) {
return JEV_CommonFunctions::jev_strftime("%A, %B %d, %Y", $datestp);
// Us style : Monday, July 03, 2003
} else {
//return JevDate::strftime("%A, %e. %B %Y",$datestp);
// %e not supported by windows
return sprintf(JEV_CommonFunctions::jev_strftime("%A, %%s. %B %Y", $datestp), intval(JEV_CommonFunctions::jev_strftime('%d', $datestp)));
// De style : Montag, 3. Juli 2003
}
break;
case '1':
if ($format_type == 0) {
return JEV_CommonFunctions::jev_strftime("%d %B %Y", $datestp);
// Fr style : 23 Juillet 2003
} elseif ($format_type == 1) {
return JEV_CommonFunctions::jev_strftime("%B %d, %Y", $datestp);
// Us style : July 23, 2003
} else {
return JEV_CommonFunctions::jev_strftime("%d. %B %Y", $datestp);
// De style : 23. Juli 2003
}
break;
case '2':
if ($format_type == 0) {
return JEV_CommonFunctions::jev_strftime("%d %B", $datestp);
// Fr style : 23 Juillet
} elseif ($format_type == 1) {
return JEV_CommonFunctions::jev_strftime("%B %d", $datestp);
// Us style : Juillet 23
} else {
return JEV_CommonFunctions::jev_strftime("%d. %B", $datestp);
// De style : 23. Juli
}
break;
case '3':
if ($format_type == 0) {
return JEV_CommonFunctions::jev_strftime("%B %Y", $datestp);
// Fr style : Juillet 2003
} elseif ($format_type == 1) {
return JEV_CommonFunctions::jev_strftime("%B, %Y", $datestp);
// Us style : Juillet, 2003
} else {
return JEV_CommonFunctions::jev_strftime("%B %Y", $datestp);
// De style : Juli 2003
}
break;
case '4':
if ($format_type == 0) {
return JEV_CommonFunctions::jev_strftime("%d/%m/%Y", $datestp);
// Fr style : 23/07/2003
} elseif ($format_type == 1) {
return JEV_CommonFunctions::jev_strftime("%m/%d/%Y", $datestp);
// Us style : 07/23/2003
} else {
return JEV_CommonFunctions::jev_strftime("%d.%m.%Y", $datestp);
// De style : 23.07.2003
}
break;
case '5':
if ($format_type == 0) {
return JEV_CommonFunctions::jev_strftime("%d/%m", $datestp);
// Fr style : 23/07
} elseif ($format_type == 1) {
return JEV_CommonFunctions::jev_strftime("%m/%d", $datestp);
// Us style : 07/23
} else {
return JEV_CommonFunctions::jev_strftime("%d.%m.", $datestp);
// De style : 23.07.
}
break;
case '6':
if ($format_type == 0) {
return JEV_CommonFunctions::jev_strftime("%m/%Y", $datestp);
//.........这里部分代码省略.........
示例6: getTime
public static function getTime($date, $h = -1, $m = -1)
{
$cfg = JEVConfig::getInstance();
static $format_type;
if (!isset($format_type)) {
$cfg = JEVConfig::getInstance();
$format_type = $cfg->get('com_dateformat');
}
// if date format is from langauge file then do this first
if ($format_type == 3) {
if ($h >= 0 && $m >= 0) {
$time = JevDate::mktime($h, $m);
return JEV_CommonFunctions::jev_strftime(JText::_("TIME_FORMAT"), $time);
} else {
return JEV_CommonFunctions::jev_strftime(JText::_("TIME_FORMAT"), $date);
}
}
if ($cfg->get('com_calUseStdTime') == '0') {
if ($h >= 0 && $m >= 0) {
return sprintf('%02d:%02d', $h, $m);
} else {
return JevDate::strftime("%H:%M", $date);
}
} else {
if (IS_WIN) {
return JevDate::strftime("%#I:%M%p", $date);
} else {
return strtolower(JevDate::strftime("%I:%M%p", $date));
}
}
}
示例7: getCalendarData
//.........这里部分代码省略.........
for ($d = 1; $d <= $end; $d++) {
$data["dates"][$dayCount] = array();
// utility field used to keep track of events displayed in a day!
$data["dates"][$dayCount]['countDisplay'] = 0;
$data["dates"][$dayCount]["monthType"] = "current";
$data["dates"][$dayCount]["month"] = $month;
$data["dates"][$dayCount]["year"] = $year;
if ($short) {
$data["dates"][$dayCount]["events"] = false;
} else {
$data["dates"][$dayCount]["events"] = array();
}
$t_datenow = JEVHelper::getNow();
$now_adjusted = $t_datenow->toUnix(true);
if ($month == JevDate::strftime('%m', $now_adjusted) && $year == JevDate::strftime('%Y', $now_adjusted) && $d == JevDate::strftime('%d', $now_adjusted)) {
$data["dates"][$dayCount]["today"] = true;
} else {
$data["dates"][$dayCount]["today"] = false;
}
if ($d <= '9') {
$do = '0' . $d;
} else {
$do = $d;
}
$data["dates"][$dayCount]['d'] = $d;
$data["dates"][$dayCount]['d0'] = $do;
$link = JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=day.listevents&year=' . $year . '&month=' . $month . '&day=' . $do . $cat . '&Itemid=' . $this->myItemid);
$data["dates"][$dayCount]["link"] = $link;
$cellDate = JevDate::mktime(0, 0, 0, $month, $d, $year);
$data["dates"][$dayCount]['cellDate'] = $cellDate;
//$data["dates"][$dayCount]['events'] = array();
if ($rowcount > 0) {
foreach ($rows as $row) {
if ($row->checkRepeatMonth($cellDate, $year, $month)) {
if ($short) {
$data["dates"][$dayCount]['events'] = true;
// I can skip testing all the events since checkRepeatMonth tests for multiday events to make xure they only appear
// on secondary days if the multiday flag is set to 1
break;
} else {
$i = count($data["dates"][$dayCount]['events']);
$data["dates"][$dayCount]['events'][$i] = $row;
}
}
}
}
// sort events of this day by time
if (is_array($data["dates"][$dayCount]['events'])) {
usort($data["dates"][$dayCount]['events'], array("JEventsDataModel", "_sortEventsByTime"));
}
$dayCount++;
}
$days = (7 - date('w', JevDate::mktime(0, 0, 0, $month + 1, 1, $year)) + $startday) % 7;
$d = 1;
$followMonth = $month + 1;
$followYear = $year;
if ($followMonth > 12) {
$followMonth -= 12;
$followYear += 1;
}
$data["followingMonth"] = array();
for ($d = 1; $d <= $days; $d++) {
$data["dates"][$dayCount] = array();
$data["dates"][$dayCount]["monthType"] = "following";
$data["dates"][$dayCount]["month"] = $followMonth;
$data["dates"][$dayCount]["year"] = $followYear;
$data["dates"][$dayCount]['countDisplay'] = 0;
if ($d <= '9') {
$do = '0' . $d;
} else {
$do = $d;
}
$data["dates"][$dayCount]['d'] = $d;
$data["dates"][$dayCount]['d0'] = $do;
if ($short) {
$data["dates"][$dayCount]["events"] = false;
} else {
$data["dates"][$dayCount]["events"] = array();
}
$cellDate = JevDate::mktime(0, 0, 0, $followMonth, $d, $followYear);
$data["dates"][$dayCount]['cellDate'] = $cellDate;
$data["dates"][$dayCount]["today"] = false;
$link = JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=day.listevents&year=' . $followYear . '&month=' . $followMonth . '&day=' . $do . $cat . '&Itemid=' . $this->myItemid);
$data["dates"][$dayCount]["link"] = $link;
$dayCount++;
}
// Week data and links
$data["weeks"] = array();
for ($w = 0; $w < 6 && $w * 7 < count($data["dates"]); $w++) {
$date = $data["dates"][$w * 7]['cellDate'];
$day = $data["dates"][$w * 7]["d"];
$month = $data["dates"][$w * 7]["month"];
$year = $data["dates"][$w * 7]["year"];
// get week number from second weekday to avoid confusion with week start sunday + 1 day + 3 hours to avoid DST change problems
$week = intval(JEV_CommonFunctions::jev_strftime("%V", $date + 97200));
$link = JRoute::_('index.php?option=' . JEV_COM_COMPONENT . '&task=week.listevents&year=' . $year . '&month=' . $month . '&day=' . $day . $cat . '&Itemid=' . $this->myItemid);
$data["weeks"][$week] = $link;
}
return $data;
}
示例8: __construct
function __construct($view, $today_date, $view_date, $dates, $alts, $option, $task, $Itemid)
{
global $catidsOut;
if (JRequest::getInt('pop', 0)) {
return;
}
$cfg = JEVConfig::getInstance();
$compname = JEV_COM_COMPONENT;
//Lets check if we should show the nav on event details
if ($task == "icalrepeat.detail" && $cfg->get('shownavbar_detail', 1) == 0) {
return;
}
$this->iconstoshow = $cfg->get('iconstoshow', array('byyear', 'bymonth', 'byweek', 'byday', 'search'));
$viewimages = JURI::root() . "components/" . JEV_COM_COMPONENT . "/views/" . $view->getViewName() . "/assets/images";
$cat = "";
$hiddencat = "";
if ($catidsOut != 0) {
$cat = '&catids=' . $catidsOut;
$hiddencat = '<input type="hidden" name="catids" value="' . $catidsOut . '"/>';
}
$link = 'index.php?option=' . $option . '&task=' . $task . $cat . '&Itemid=' . $Itemid . '&';
$month_date = JevDate::mktime(0, 0, 0, $view_date->month, $view_date->day, $view_date->year);
?>
<?php
if ($task == "month.calendar") {
echo "<div class='month_date'><div class='month_title'>" . JEV_CommonFunctions::jev_strftime("%B", $month_date) . ", </div><div class='month_title_year'> " . JEV_CommonFunctions::jev_strftime("%Y", $month_date) . "</div></div>";
}
?>
<div class="new-navigation">
<div class="nav-items">
<?php
if (in_array("byyear", $this->iconstoshow)) {
?>
<div id="nav-year"<?php
if ($task == "year.listevents") {
echo ' class="active"';
}
?>
>
<a href="<?php
echo JRoute::_('index.php?option=' . $option . $cat . '&task=year.listevents&' . $view_date->toDateURL() . '&Itemid=' . $Itemid);
?>
" title="<?php
echo JText::_('JEV_VIEWBYYEAR');
?>
" >
<?php
echo JText::_('JEV_VIEWBYYEAR');
?>
</a>
</div>
<?php
}
?>
<?php
if (in_array("bymonth", $this->iconstoshow)) {
?>
<div id="nav-month"<?php
if ($task == "month.calendar") {
echo ' class="active"';
}
?>
>
<a href="<?php
echo JRoute::_('index.php?option=' . $option . $cat . '&task=month.calendar&' . $view_date->toDateURL() . '&Itemid=' . $Itemid);
?>
" title="<?php
echo JText::_('JEV_VIEWBYMONTH');
?>
" > <?php
echo JText::_('JEV_VIEWBYMONTH');
?>
</a>
</div>
<?php
}
?>
<?php
if (in_array("byweek", $this->iconstoshow)) {
?>
<div id="nav-week"<?php
if ($task == "week.listevents") {
echo ' class="active"';
}
?>
>
<a href="<?php
echo JRoute::_('index.php?option=' . $option . $cat . '&task=week.listevents&' . $view_date->toDateURL() . '&Itemid=' . $Itemid);
?>
" title="<?php
echo JText::_('JEV_VIEWBYWEEK');
?>
" >
<?php
echo JText::_('JEV_VIEWBYWEEK');
?>
</a>
</div>
<?php
}
//.........这里部分代码省略.........
示例9: jevSpecialDateFormatting
function jevSpecialDateFormatting($matches)
{
if (count($matches) == 1 && strpos($matches[0], ";") > 0) {
global $tempreplace, $tempevent, $tempsearch;
$parts = explode(";", $matches[0]);
if (count($parts) == 2) {
$fmt = str_replace("}}", "", $parts[1]);
//return strftime($fmt, strtotime(strip_tags($tempreplace)));
return JEV_CommonFunctions::jev_strftime($fmt, $tempreplace);
} else {
if (count($parts) == 3) {
$fmt = $parts[1];
// Must get this each time otherwise modules can't set their own timezone
$compparams = JComponentHelper::getParams(JEV_COM_COMPONENT);
$jtz = $compparams->get("icaltimezonelive", "");
if ($jtz != "") {
$jtz = new DateTimeZone($jtz);
} else {
$jtz = new DateTimeZone(@date_default_timezone_get());
}
$outputtz = str_replace("}}", "", $parts[2]);
if (strtolower($outputtz) == "user" || strtolower($outputtz) == "usertz") {
$user = JFactory::getUser();
$outputtz = $user->getParam("timezone", $compparams->get("icaltimezonelive", @date_default_timezone_get()));
}
$outputtz = new DateTimeZone($outputtz);
$indate = new DateTime($tempreplace, $jtz);
$offset1 = $indate->getOffset();
// set the new timezone
$indate->setTimezone($outputtz);
$offset2 = $indate->getOffset();
$indate = $indate->getTimestamp() + $offset2 - $offset1;
return JEV_CommonFunctions::jev_strftime($fmt, $indate);
} else {
return $matches[0];
}
}
} else {
if (count($matches) == 1) {
return $matches[0];
}
}
}
示例10: jevSpecialDateFormatting
function jevSpecialDateFormatting($matches)
{
if (count($matches) == 1 && JString::strpos($matches[0], ";") > 0) {
global $tempreplace, $tempevent, $tempsearch, $tempblank;
$parts = explode(";", $matches[0]);
if (count($parts) == 2) {
$fmt = str_replace(array("}}", "}"), "", $parts[1]);
if (strpos($fmt, "#") !== false) {
$fmtparts = explode("#", $fmt);
if ($tempreplace == $tempblank) {
if (count($fmtparts) == 3) {
$fmt = $fmtparts[2];
} else {
return "";
}
} else {
if (count($fmtparts) >= 2) {
$fmt = sprintf($fmtparts[1], $fmtparts[0]);
}
}
}
//return strftime($fmt, strtotime(strip_tags($tempreplace)));
if (!is_int($tempreplace)) {
$tempreplace = strtotime(strip_tags($tempreplace));
}
return JEV_CommonFunctions::jev_strftime($fmt, $tempreplace);
} else {
if (count($parts) == 3) {
$fmt = $parts[1];
// Must get this each time otherwise modules can't set their own timezone
$compparams = JComponentHelper::getParams(JEV_COM_COMPONENT);
$jtz = $compparams->get("icaltimezonelive", "");
if ($jtz != "") {
$jtz = new DateTimeZone($jtz);
} else {
$jtz = new DateTimeZone(@date_default_timezone_get());
}
$outputtz = str_replace(array("}}", "}"), "", $parts[2]);
if (strpos($outputtz, "#") !== false) {
$outputtzparts = explode("#", $outputtz);
$outputtz = $outputtzparts[0];
if ($tempreplace == $tempblank) {
if (count($outputtzparts) == 3) {
$fmt = $outputtzparts[2];
} else {
return "";
}
} else {
if (count($outputtzparts) >= 2) {
$fmt = sprintf($outputtzparts[1], $fmt);
}
}
}
if (strtolower($outputtz) == "user" || strtolower($outputtz) == "usertz") {
$user = JFactory::getUser();
$outputtz = $user->getParam("timezone", $compparams->get("icaltimezonelive", @date_default_timezone_get()));
}
$outputtz = new DateTimeZone($outputtz);
if (is_integer($tempreplace)) {
$tempreplace = JEV_CommonFunctions::jev_strftime("%Y-%m-%d %H:%M:%S", $tempreplace);
}
$indate = new DateTime($tempreplace, $jtz);
$offset1 = $indate->getOffset();
// set the new timezone
$indate->setTimezone($outputtz);
$offset2 = $indate->getOffset();
$indate = $indate->getTimestamp() + $offset2 - $offset1;
return JEV_CommonFunctions::jev_strftime($fmt, intval($indate));
} else {
return $matches[0];
}
}
} else {
if (count($matches) == 1) {
return $matches[0];
}
}
}
示例11:
$week_end = $data['days']['6'];
$starttime = JevDate::mktime(0, 0, 0, $week_start['week_month'], $week_start['week_day'], $week_start['week_year']);
$endtime = JevDate::mktime(0, 0, 0, $week_end['week_month'], $week_end['week_day'], $week_end['week_year']);
if ($week_start['week_month'] == $week_end['week_month']) {
$startformat = "%d";
$endformat = "%d %B, %Y";
} else {
if ($week_start['week_year'] == $week_end['week_year']) {
$startformat = "%d %B";
$endformat = "%d %B, %Y";
} else {
$startformat = "%d. %B %Y";
$endformat = "%d. %B %Y";
}
}
echo JEV_CommonFunctions::jev_strftime($startformat, $starttime) . ' - ' . JEV_CommonFunctions::jev_strftime($endformat, $endtime);
?>
</div>
<div class="nextmonth">
<?php
if ($followingWeek) {
echo "<a href='" . $followingWeek . "' title='" . JText::_("FOLLOWING_Week") . "' >" . JText::_("FOLLOWING_Week") . "</a>";
}
?>
</div>
</div>
</div>
<div id='jev_maincal' class='jev_listview'>
<?php