getStamp($params); $date_start=date('Y-m-d'); //if($_GET['date']) $date_start=$_GET['date']; // if(isset($_GET['date'])) $date_start=$_GET['date']; $dateget=JRequest::getVar('date'); if(isset($dateget)) $date_start=$dateget; $nav=$cal->getNav($date_start); //$params->get('numero'); $template=$params->get('template'); $mouseover=$params->get('mouseover'); $position=$params->get('position'); $posmiddle=$params->get('posmiddle'); $mon=$params->get('mon'); $tue=$params->get('tue'); $wed=$params->get('wed'); $thu=$params->get('thu'); $fri=$params->get('fri'); $sat=$params->get('sat'); $sun=$params->get('sun'); $firstday=$params->get('firstday'); if ($firstday == NULL) { $firstday = '1'; } if ($firstday == '0') { $na=7;$nb=1;$nc=2;$nd=3;$ne=4;$nf=5;$ng=6; } if ($firstday == '1') { $na=1;$nb=2;$nc=3;$nd=4;$ne=5;$nf=6;$ng=7; } if(!file_exists("components/com_icagenda/template/".$template."/".$template."_calendar.php")){ $template='default'; } $t_calendar = "components/com_icagenda/template/".$template."/".$template."_calendar.php"; $t_day = "components/com_icagenda/template/".$template."/".$template."_day.php"; //JHTML::_('stylesheet', $template.'_style.css', 'components/com_icagenda/template/'.$template.'/css/'); JHTML::_('stylesheet', $template.'_style.css', 'modules/mod_iccalendar/templates/'.$template.'/css/'); JHTML::_('behavior.mootools'); $document = JFactory::getDocument(); // load jQuery, if not loaded before (NEW VERSION IN 1.2.6) $scripts = array_keys($document->_scripts); $scriptFound = false; $noconflictscriptFound = false; for ($i = 0; $i < count($scripts); $i++) { if (stripos($scripts[$i], 'jquery.min.js') !== false) { $scriptFound = true; } // load jQuery, if not loaded before as jquery - added in 1.2.7 if (stripos($scripts[$i], 'jquery.js') !== false) { $scriptFound = true; } // load jQuery noConflict js, if not loaded before - added in 1.2.6 if (stripos($scripts[$i], 'jquery.noconflict.js') !== false) { $noconflictscriptFound = true; } } // jQuery Library Loader if (!$scriptFound) { // load jQuery, if not loaded before if (!JFactory::getApplication()->get('jquery')) { JFactory::getApplication()->set('jquery', true); // add jQuery $document->addScript("https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"); } } if (!$noconflictscriptFound) { $document->addScript("modules/mod_iccalendar/js/jquery.noconflict.js"); } // OLD, in 1.2.5 // load jQuery, if not loaded before // if (!JFactory::getApplication()->get('jquery')) { // JFactory::getApplication()->set('jquery', true); // add jQuery // } // else { // $document->addScript( "https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" ); // } // $document->addScript( "modules/mod_iccalendar/js/jquery.noconflict.js" ); //old $document->addScript( "components/com_icagenda/template/".$template."/js/".$template."_function.js" ); if ($position == 'center') { $document->addScript( "modules/mod_iccalendar/js/".$posmiddle.$position."_function.js" ); } if ($position != 'center') { $document->addScript( "modules/mod_iccalendar/js/".$position."_function.js" ); } $document->addScript( "modules/mod_iccalendar/js/function.js" ); //old $document->addScriptDeclaration('jQuery.noConflict()'); if ($mouseover == 'mouseover') { JText::script('mouseover'); } if ($posmiddle == 'top') { JText::script('$top'); } $stamp = new cal($data, $t_day, $nav, $mon, $tue, $wed, $thu, $fri, $sat, $sun, $firstday,$na,$nb,$nc,$nd,$ne,$nf,$ng); require_once $t_calendar; $lang = JFactory::getLanguage(); $locale = $lang->getlocale() ; setlocale( LC_TIME, $locale[0] ) ; $date=strftime("%Y %B %d"); function activeColor($color){ #convert hexadecimal to RGB if(!is_array($color) && preg_match("/^[#]([0-9a-fA-F]{6})$/",$color)){ $hex_R = substr($color,1,2); $hex_G = substr($color,3,2); $hex_B = substr($color,5,2); $RGB = hexdec($hex_R).",".hexdec($hex_G).",".hexdec($hex_B); return $RGB; } } class cal { public $data; public $t_day; public $nav; function __construct ($data, $t_day, $nav, $mon, $tue, $wed, $thu, $fri, $sat, $sun, $firstday,$na,$nb,$nc,$nd,$ne,$nf,$ng) { $this->data=$data; $this->t_day=$t_day; $this->nav=$nav; $this->mon=$mon; $this->tue=$tue; $this->wed=$wed; $this->thu=$thu; $this->fri=$fri; $this->sat=$sat; $this->sun=$sun; $this->na=$na; $this->nb=$nb; $this->nc=$nc; $this->nd=$nd; $this->ne=$ne; $this->nf=$nf; $this->ng=$ng; $this->firstday=$firstday; } function days () { if ($this->firstday=='0') { echo '
'.$this->nav.' '; } if ($this->firstday=='1') { echo '
'.$this->nav.'
'.JText::_('SUN').' '.JText::_('MON').' '.JText::_('TUE').' '.JText::_('WED').' '.JText::_('THU').' '.JText::_('FRI').' '.JText::_('SAT').'
'; } switch ($this->data[1]['week']){ case $this->na: break; default: echo ''; break; } foreach ($this->data as $d){ $stamp= new day($d); if ($this->firstday=='0') { switch($stamp->week){ case $this->na: echo ''; break; default: echo ''; break; } } switch ($stamp->week){ case $this->ng: break; default: echo ''; break; } echo '
'.JText::_('MON').' '.JText::_('TUE').' '.JText::_('WED').' '.JText::_('THU').' '.JText::_('FRI').' '.JText::_('SAT').' '.JText::_('SUN').'
'; break; case $this->nb: echo ''; break; case $this->nc: echo ''; break; case $this->nd: echo ''; break; case $this->ne: echo ''; break; case $this->nf: echo ''; break; case $this->ng: echo ''; break; default: echo ''; break; } } if ($this->firstday=='1') { switch($stamp->week){ case $this->na: echo '
'; break; case $this->nb: echo ''; break; case $this->nc: echo ''; break; case $this->nd: echo ''; break; case $this->ne: echo ''; break; case $this->nf: echo ''; break; case $this->ng: echo ''; break; default: echo ''; break; } } require $this->t_day; switch('week'){ case $this->ng: echo '
'; } } class day { public $date; public $week; public $day; public $month; public $year; public $events; function __construct ($day) { foreach ($day as $k=>$v){ $this->$k=$v; } } } //require JModuleHelper::getLayoutPath('mod_iccalendar');