本文整理汇总了PHP中JEVHelper::getMonthName方法的典型用法代码示例。如果您正苦于以下问题:PHP JEVHelper::getMonthName方法的具体用法?PHP JEVHelper::getMonthName怎么用?PHP JEVHelper::getMonthName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JEVHelper
的用法示例。
在下文中一共展示了JEVHelper::getMonthName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AlternativeBuildMonthSelect
function AlternativeBuildMonthSelect($view, $link, $month, $year)
{
for ($a = -6; $a < 6; $a++) {
$m = $month + $a;
$y = $year;
if ($m <= 0) {
$m += 12;
$y -= 1;
}
if ($m > 12) {
$m -= 12;
$y += 1;
}
$name_of_month = JEVHelper::getMonthName($m) . " {$y}";
$monthslist[] = JHTML::_('select.option', "{$m}|{$y}", $name_of_month);
}
$link = str_replace(array("day.listevents", "week.listevents", "year.listevents", "cat.listevents", "icalrepeat.detail", "icalevent.detail"), "month.calendar", $link);
$tosend = "<script type='text/javascript'>\n";
$tosend .= "/* <![CDATA[ */\n";
$tosend .= " function selectMD(elem) {\n var ym = elem.options[elem.selectedIndex].value.split('|');\n";
$link .= "day=1&month=MMMMmmmm&year=YYYYyyyy";
$link2 = JRoute::_($link, false);
$tosend .= "var link = '{$link2}';\n";
// This is needed in case SEF is not activated
$tosend .= "link = link.replace(/&/g,'&');\n";
$tosend .= "link = link.replace(/MMMMmmmm/g,ym[0]);\n";
$tosend .= "link = link.replace(/YYYYyyyy/g,ym[1]);\n";
$tosend .= "location.replace(link);\n";
$tosend .= "}\n";
$tosend .= "/* ]]> */\n";
$tosend .= "</script>\n";
$tosend .= JHTML::_('select.genericlist', $monthslist, 'monthyear', "onchange=\"selectMD(this);\"", 'value', 'text', "{$month}|{$year}");
$this->result = $tosend;
}
示例2: buildMonthSelect
public static function buildMonthSelect($month, $args)
{
for ($a = 1; $a < 13; $a++) {
$mnh = $a;
if ($mnh <= '9') {
$mnh = '0' . $mnh;
}
$name_of_month = JEVHelper::getMonthName($mnh);
$monthslist[] = JHTML::_('select.option', $mnh, $name_of_month);
}
$tosend = JHTML::_('select.genericlist', $monthslist, 'month', $args, 'value', 'text', $month);
echo $tosend;
}
示例3: _displayCalendarMod
function _displayCalendarMod($time, $startday, $linkString, $day_name, $monthMustHaveEvent = false, $basedate = false)
{
$db =& JFactory::getDBO();
$cfg =& JEVConfig::getInstance();
$option = JEV_COM_COMPONENT;
$cal_year = date("Y", $time);
$cal_month = date("m", $time);
// do not use $cal_day since it's not reliable due to month offset calculation
//$cal_day=date("d",$time);
if (!$basedate) {
$basedate = $time;
}
$base_year = date("Y", $basedate);
$base_month = date("m", $basedate);
$basefirst_of_month = JevDate::mktime(0, 0, 0, $base_month, 1, $base_year);
$requestYear = JRequest::getInt("year", 0);
$requestMonth = JRequest::getInt("month", 0);
// special case when site link set the dates for the mini-calendar in the URL but not in the ajax request
if ($requestMonth && $requestYear && JRequest::getString("task", "") != "modcal.ajax" && $this->modparams->get("minical_usedate", 0)) {
$requestDay = JRequest::getInt("day", 1);
$requestTime = JevDate::mktime(0, 0, 0, $requestMonth, $requestDay, $requestYear);
if ($time - $basedate > 100000) {
$requestTime = JevDate::strtotime("+1 month", $requestTime);
} else {
if ($time - $basedate < -100000) {
$requestTime = JevDate::strtotime("-1 month", $requestTime);
}
}
$cal_year = date("Y", $requestTime);
$cal_month = date("m", $requestTime);
$base_year = $requestYear;
$base_month = $requestMonth;
$basefirst_of_month = JevDate::mktime(0, 0, 0, $requestMonth, $requestDay, $requestYear);
} else {
if ($requestYear && $requestMonth) {
$cal_year = $requestYear;
$cal_month = $requestMonth;
} else {
$cal_year = date("Y", $time);
$cal_month = date("m", $time);
}
}
$reg =& JFactory::getConfig();
$reg->setValue("jev.modparams", $this->modparams);
$data = $this->datamodel->getCalendarData($cal_year, $cal_month, 1, true, $this->modparams->get("noeventcheck", 0));
$reg->setValue("jev.modparams", false);
$month_name = JEVHelper::getMonthName($cal_month);
$first_of_month = JevDate::mktime(0, 0, 0, $cal_month, 1, $cal_year);
//$today = JevDate::mktime(0,0,0,$cal_month, $cal_day, $cal_year);
$today = JevDate::strtotime(date('Y-m-d', $this->timeWithOffset));
$content = '';
if ($this->minical_showlink) {
$content .= "\n" . '<table cellpadding="0" cellspacing="0" align="center" class="mod_events_monthyear" >' . "\n" . '<tr >' . "\n";
if ($this->minical_showlink == 1) {
if ($this->minical_prevyear) {
$content .= $this->monthYearNavigation($basefirst_of_month, "-1 year", '«', JText::_('JEV_CLICK_TOSWITCH_PY'));
}
if ($this->minical_prevmonth) {
$content .= $this->monthYearNavigation($basefirst_of_month, "-1 month", '<', JText::_('JEV_CLICK_TOSWITCH_PM'));
}
if ($this->minical_actmonth == 1) {
// combination of actual month and year: view month
$seflinkActMonth = JRoute::_($this->linkpref . 'month.calendar&month=' . $cal_month . '&year=' . $cal_year);
$content .= '<td align="center">';
$content .= $this->htmlLinkCloaking($seflinkActMonth, $month_name, array('class' => "mod_events_link", 'title' => JText::_('JEV_CLICK_TOSWITCH_MON'))) . " ";
if ($this->minical_actyear < 1) {
$content .= '</td>';
}
} elseif ($this->minical_actmonth == 2) {
$content .= '<td align="center">';
$content .= $month_name . "\n";
if ($this->minical_actyear < 1) {
$content .= '</td>';
}
}
if ($this->minical_actyear == 1) {
// combination of actual month and year: view year
$seflinkActYear = JRoute::_($this->linkpref . 'year.listevents' . '&month=' . $cal_month . '&year=' . $cal_year);
if ($this->minical_actmonth < 1) {
$content .= '<td align="center">';
}
$content .= $this->htmlLinkCloaking($seflinkActYear, $cal_year, array('class' => "mod_events_link", 'title' => JText::_('JEV_CLICK_TOSWITCH_YEAR'))) . " ";
$content .= '</td>';
} elseif ($this->minical_actyear == 2) {
if ($this->minical_actmonth < 1) {
$content .= '<td align="center">';
}
$content .= $cal_year . "\n";
$content .= '</td>';
}
if ($this->minical_nextmonth) {
$content .= $this->monthYearNavigation($basefirst_of_month, "+1 month", '>', JText::_('JEV_CLICK_TOSWITCH_NM'));
}
if ($this->minical_nextyear) {
$content .= $this->monthYearNavigation($basefirst_of_month, "+1 year", '»', JText::_('JEV_CLICK_TOSWITCH_NY'));
}
// combination of actual month and year: view year & month [ mic: not used here ]
// $seflinkActYM = JRoute::_( $link . 'month.calendar' . '&month=' . $cal_month
// . '&year=' . $cal_year );
} else {
//.........这里部分代码省略.........
示例4: jev_strftime
/**
* Support all JevDate::strftime() parameter for Window systems
*
* @param string $format
* @param int $timestamp
* @return string formated string
*/
function jev_strftime($format = '', $timestamp = null)
{
if (!$timestamp) {
$timestamp = time();
}
// Replace names by own translation to get rid of improper os system library
if (strpos($format, '%a') !== false) {
$format = str_replace('%a', JEVHelper::getShortDayName(date('w', $timestamp)), $format);
}
if (strpos($format, '%A') !== false) {
$format = str_replace('%A', JEVHelper::getDayName(date('w', $timestamp)), $format);
}
if (strpos($format, '%b') !== false) {
$format = str_replace('%b', JEVHelper::getShortMonthName(date('n', $timestamp)), $format);
}
if (strpos($format, '%B') !== false) {
$format = str_replace('%B', JEVHelper::getMonthName(date('n', $timestamp)), $format);
}
if (JUtility::isWinOS()) {
if (!class_exists('JEV_CompatWin')) {
require_once dirname(__FILE__) . '/compatwin.php';
}
return JEV_CompatWin::win_strftime($format, $timestamp);
} else {
return JevDate::strftime($format, $timestamp);
}
}
示例5: _displayCalendarMod
function _displayCalendarMod($time, $startday, $linkString, &$day_name, $monthMustHaveEvent = false, $basedate = false)
{
$db = JFactory::getDBO();
$cfg = JEVConfig::getInstance();
$compname = JEV_COM_COMPONENT;
$cal_day = date("d", $time);
//$cal_year=date("Y",$time);
//$cal_month=date("m",$time);
//list($cal_year,$cal_month,$cal_day) = JEVHelper::getYMD();
if (!$basedate) {
$basedate = $time;
}
$base_year = date("Y", $basedate);
$base_month = date("m", $basedate);
$basefirst_of_month = JevDate::mktime(0, 0, 0, $base_month, 1, $base_year);
$requestYear = JRequest::getInt("year", 0);
$requestMonth = JRequest::getInt("month", 0);
// special case when site link set the dates for the mini-calendar in the URL but not in the ajax request
if ($requestMonth && $requestYear && JRequest::getString("task", "") != "modcal.ajax" && $this->modparams->get("minical_usedate", 0)) {
$requestDay = JRequest::getInt("day", 1);
$requestTime = JevDate::mktime(0, 0, 0, $requestMonth, $requestDay, $requestYear);
if ($time - $basedate > 100000) {
$requestTime = JevDate::strtotime("+1 month", $requestTime);
} else {
if ($time - $basedate < -100000) {
$requestTime = JevDate::strtotime("-1 month", $requestTime);
}
}
$cal_year = date("Y", $requestTime);
$cal_month = date("m", $requestTime);
$base_year = $requestYear;
$base_month = $requestMonth;
$basefirst_of_month = JevDate::mktime(0, 0, 0, $requestMonth, $requestDay, $requestYear);
} else {
$cal_year = date("Y", $time);
$cal_month = date("m", $time);
}
$base_prev_month = $base_month - 1;
$base_next_month = $base_month + 1;
$base_next_month_year = $base_year;
$base_prev_month_year = $base_year;
if ($base_prev_month == 0) {
$base_prev_month = 12;
$base_prev_month_year -= 1;
}
if ($base_next_month == 13) {
$base_next_month = 1;
$base_next_month_year += 1;
}
$reg = JFactory::getConfig();
$reg->set("jev.modparams", $this->modparams);
if ($this->modparams->get("showtooltips", 0)) {
$data = $this->datamodel->getCalendarData($cal_year, $cal_month, 1, false, false);
$this->hasTooltips = true;
} else {
$data = $this->datamodel->getCalendarData($cal_year, $cal_month, 1, true, $this->modparams->get("noeventcheck", 0));
}
$reg->set("jev.modparams", false);
$width = $this->modparams->get("mod_cal_width", "135px");
$height = $this->modparams->get("mod_cal_height", "auto");
$rowheight = $this->modparams->get("mod_cal_rowheight", "auto");
$month_name = JEVHelper::getMonthName($cal_month);
$to_day = date("Y-m-d", $this->timeWithOffset);
$today = JevDate::mktime(0, 0, 0, $cal_month, $cal_day, $cal_year);
$cal_prev_month = $cal_month - 1;
$cal_next_month = $cal_month + 1;
$cal_next_month_year = $cal_year;
$cal_prev_month_year = $cal_year;
// additional EBS
if ($cal_prev_month == 0) {
$cal_prev_month = 12;
$cal_prev_month_year -= 1;
}
if ($cal_next_month == 13) {
$cal_next_month = 1;
$cal_next_month_year += 1;
}
$viewname = $this->getTheme();
$viewpath = JURI::root(true) . "/components/{$compname}/views/" . $viewname . "/assets";
$viewimages = $viewpath . "/images";
$linkpref = "index.php?option={$compname}&Itemid=" . $this->myItemid . $this->cat . "&task=";
/*
$linkprevious = $linkpref."month.calendar&day=$cal_day&month=$cal_prev_month&year=$cal_prev_month_year";
$linkprevious = JRoute::_($linkprevious);
$linkprevious = $this->htmlLinkCloaking($linkprevious, '<img border="0" title="' . JText::_("JEV_PREVIOUSMONTH") . '" alt="' . JText::_("JEV_PREVIOUSMONTH") . '" src="'.$viewimages.'/mini_arrowleft.gif"/>' );
*/
$jev_component_name = JEV_COM_COMPONENT;
$this->_navigationJS($this->_modid);
$scriptlinks = "";
if ($this->minical_prevmonth) {
$linkprevious = htmlentities(JURI::base() . "index.php?option={$jev_component_name}&task=modcal.ajax&day=1&month={$base_prev_month}&year={$base_prev_month_year}&modid={$this->_modid}&tmpl=component" . $this->cat);
$scriptlinks .= "linkprevious = '" . $linkprevious . "';\n";
$linkprevious = '<img border="0" title="' . JText::_("JEV_PREVIOUSMONTH") . '" alt="' . JText::_("JEV_LAST_MONTH") . '" class="mod_events_link" src="' . $viewimages . '/mini_arrowleft.gif" onmousedown="callNavigation(\'' . $linkprevious . '\');" />';
} else {
$linkprevious = "";
}
if ($this->minical_actmonth == 1) {
$linkcurrent = $linkpref . "month.calendar&day={$cal_day}&month={$cal_month}&year={$cal_year}";
$linkcurrent = JRoute::_($linkcurrent);
$linkcurrent = $this->htmlLinkCloaking($linkcurrent, $month_name . " " . $cal_year, array("style" => "text-decoration:none;color:inherit;"));
//.........这里部分代码省略.........
示例6: getAdjacentMonth
function getAdjacentMonth($data, $direction = 1)
{
$cfg =& JEVConfig::getInstance();
$monthResult = array();
$d1 = JevDate::mktime(0, 0, 0, intval($data['month']) + $direction, 1, $data['year']);
$monthResult['day1'] = $d1;
$monthResult['lastday'] = date("t", $d1);
$year = JevDate::strftime("%Y", $d1);
$cfg =& JEVConfig::getInstance();
$earliestyear = $cfg->get('com_earliestyear');
$latestyear = $cfg->get('com_latestyear');
if ($year > $latestyear || $year < $earliestyear) {
return false;
}
$monthResult['year'] = $year;
$month = JevDate::strftime("%m", $d1);
$monthResult['month'] = $month;
$monthResult['name'] = JEVHelper::getMonthName($month);
$task = JRequest::getString('jevtask');
$Itemid = JEVHelper::getItemid();
if (isset($Itemid)) {
$item = "&Itemid={$Itemid}";
} else {
$item = "";
}
// URL suffix to preserver catids!
$cat = $this->getCatidsOutLink();
$monthResult['link'] = JRoute::_("index.php?option=" . JEV_COM_COMPONENT . "&task={$task}{$item}&year={$year}&month={$month}" . $cat);
return $monthResult;
}
示例7: list
?>
<tr valign="top" style="height:80px;">
<?php
echo "<td width='2%' class='cal_td_weeklink'>";
list($week, $link) = each($this->data['weeks']);
echo "<a href='" . $link . "'>{$week}</a></td>\n";
for ($d = 0; $d < 7 && $dn < $datacount; $d++) {
$currentDay = $this->data["dates"][$dn];
switch ($currentDay["monthType"]) {
case "prior":
case "following":
?>
<td width="14%" class="cal_td_daysoutofmonth" valign="middle">
<?php
echo JEVHelper::getMonthName($currentDay["month"]);
?>
</td>
<?php
break;
case "current":
$cellclass = $currentDay["today"] ? 'class="cal_td_today"' : 'class="cal_td_daysnoevents"';
// stating the height here is needed for konqueror and safari
?>
<td <?php
echo $cellclass;
?>
width="14%" valign="top" style="height:80px;">
<?php
$this->_datecellAddEvent($this->year, $this->month, $currentDay["d"]);
?>