| Server IP : 180.180.241.3 / Your IP : 216.73.216.35 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /AppServ/www/news/components/com_jevents/views/alternative/helpers/ |
Upload File : |
<?php
defined('_JEXEC') or die('Restricted access');
class AlternativeBuildMonthSelect {
var $view = null;
var $result = "";
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 );
}
$tosend = "<script type='text/javascript'>\n";
$tosend .= "/* <![CDATA[ */\n";
$tosend .= " function selectMD(elem) {
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;
}
}