本文整理汇总了PHP中JEventsHTML::getDayName方法的典型用法代码示例。如果您正苦于以下问题:PHP JEventsHTML::getDayName方法的具体用法?PHP JEventsHTML::getDayName怎么用?PHP JEventsHTML::getDayName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JEventsHTML
的用法示例。
在下文中一共展示了JEventsHTML::getDayName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: repeatSummary
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 . ', ' . $this->start_time . ' - ' . $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') . ' ' . $this->start_date . ' - ' . $this->start_time . '<br />' . JText::_('JEV_TO') . ' ' . $this->stop_date . ' - ' . $this->stop_time_midnightFix . '<br/>';
} else {
echo JText::_('JEV_FROM') . ' ' . $this->start_date . '<br />' . JText::_('JEV_TO') . ' ' . $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 . " - " . $this->stop_time_midnightFix . " ";
}
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 . ' ' . JText::_('JEV_EACHOF') . ' ' . $reccur;
} else {
if ($this->reccurtype() == 2) {
$each = JText::_('JEV_EACH') . ' ';
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 ? "," : "") . " ";
}
$weekstring = "";
} else {
$days = explode("|", $this->reccurweekdays());
for ($d = 0; $d < count($days); $d++) {
$daystring .= JEventsHTML::getDayName($days[$d]);
$daystring .= ($d == 0 ? "," : "") . " ";
}
$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') . ' ' . $reccur;
//.........这里部分代码省略.........
示例2: getCalendarData
/**
* Gets calendar data for use in main calendar and module
*
* @param int $year
* @param int $month
* @param int $day
* @param boolean $short - use true for module which only requires knowledge of if dat has an event
* @param boolean $veryshort - use true for module which only requires dates and nothing about events
* @return array - calendar data array
*/
function getCalendarData($year, $month, $day, $short = false, $veryshort = false)
{
$data = array();
$data['year'] = $year;
$data['month'] = $month;
$db =& JFactory::getDBO();
if (!isset($this->myItemid) || is_null($this->myItemid)) {
$Itemid = JEVHelper::getItemid();
$this->myItemid = $Itemid;
}
include_once JPATH_ADMINISTRATOR . "/components/" . JEV_COM_COMPONENT . "/libraries/colorMap.php";
$cfg =& JEVConfig::getInstance();
if (!$veryshort) {
//$rows = $this->queryModel->listEventsByMonthNEW( $year, $month, 'reccurtype ASC,publish_up');
$icalrows = $this->queryModel->listIcalEventsByMonth($year, $month);
// handy for developement in case I comment out part of the above
if (!isset($rows)) {
$rows = array();
}
if (!isset($icalrows)) {
$icalrows = array();
}
$rows = array_merge($icalrows, $rows);
} else {
$rows = array();
}
$rowcount = count($rows);
if (strlen($this->catidsOut) > 0) {
$cat = "&catids={$this->catidsOut}";
} else {
$cat = "";
}
$month = intval($month);
if ($month <= '9') {
$month = '0' . $month;
}
$fieldsetText = "";
$yearNow = date("Y");
$monthNow = date("m");
$dayNow = intval(date("d"));
if (!$short) {
if ($year == $yearNow && $month == $monthNow && $day == $dayNow) {
$fieldsetText = JEventsHTML::getDateFormat($year, $month, $day, 1);
} else {
$fieldsetText = JEventsHTML::getDateFormat($year, $month, "", 3);
}
$data["fieldsetText"] = $fieldsetText;
}
$startday = $cfg->get('com_starday');
if (!$startday || $startday > 1) {
$startday = 0;
}
$data['startday'] = $startday;
if (!$short) {
$data["daynames"] = array();
for ($i = 0; $i < 7; $i++) {
$data["daynames"][$i] = JEventsHTML::getDayName(($i + $startday) % 7, true);
}
}
$data["dates"] = array();
//Start days
$start = (date('w', JevDate::mktime(0, 0, 0, $month, 1, $year)) - $startday + 7) % 7;
$base = date('t', JevDate::mktime(0, 0, 0, $month, 0, $year));
$dayCount = 0;
$priorMonth = $month - 1;
$priorYear = $year;
if ($priorMonth <= 0) {
$priorMonth += 12;
$priorYear -= 1;
}
for ($a = $start; $a > 0; $a--) {
$d = intval($base - $a + 1);
$data["dates"][$dayCount] = array();
$data["dates"][$dayCount]["monthType"] = "prior";
$data["dates"][$dayCount]["month"] = $priorMonth;
$data["dates"][$dayCount]["year"] = $priorYear;
$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, $priorMonth, $d, $priorYear);
//.........这里部分代码省略.........