krimske schrieb
Ich wollte in der Monatsansicht nicht die Auflistung von den einzelnen Monaten haben, sondern einen Link für nächten_monat und letzen_monat.
Salut,
ich habe es folgendermassen gelöst. Im Template habe ich alle marker ausser denjenigen fürs nächste und fürs vorhergehende Jahr gelöscht. Zudem habe ich einen neuen Marker für den aktullen Monat kreiert. Danach habe ich im php-code im file class.jw_calendar_pi1_views.php in der Funktion monthView() (Zeilen 112ff) die Berechnung der Marker angepasst und die Berechnung für meinen eigenen Marker eingfügt.
Die ganze Funktion sah dann wie folgt aus:
function monthView(){
$time = time();
//if($this->jwVars['uid']==$this->uid){
if($this->jwVars['time'])
$time = $this->jwVars['time'];
//}
/* Templates */
$monthViewT = $this->cObj->getSubpart($this->templateCode, '###MONTH_VIEW###');
$lastYearT = $this->cObj->getSubpart($monthViewT, '###GO_LAST_YEAR###');
$nextYearT = $this->cObj->getSubpart($monthViewT, '###GO_NEXT_YEAR###');
$submitEvent = $this->cObj->getSubpart($monthViewT, '###SUBMIT_EVENT###');
$thisMonthT = $this->cObj->getSubpart($monthViewT, '###THIS_MONTH###'); //von Philipp Wui
$rems = array(); // Region markers
$sims = array(); // Simple markers
/* create year links */
/*
$lastYear = strtotime('12 / 1 / '.(strftime('%Y', $time) - 1));
$nextYear = strtotime('1 / 1 / '.(strftime('%Y', $time) + 1));
$labelLastYear = strftime('%Y', $lastYear);
$labelNextYear = strftime('%Y', $nextYear);
*/
$lastYear = strtotime((strftime('%m',$time)-1).'/ 1 / '.(strftime('%Y', $time) ));
$nextYear = strtotime((strftime('%m',$time)+1).'/ 1 / '.(strftime('%Y', $time) ));
$labelLastYear = strftime('%B', $lastYear);
$labelNextYear = strftime('%B', $nextYear);
$labelThisMonth = strftime('%B',$time); //von Philipp WUi
$sims = array(); // Region markers
$Vars = array();
$Vars['time']=$lastYear;
$Vars['uid'] = $this->uid;
$Vars['view'] = $this->jwOptions['viewmode'];
$Vars['cat'] = $this->jwVars['cat'];
$sims['###DATA###'] = $this->pi_linkTP($labelLastYear,Array($this->prefixId=>$Vars),$this->caching);
$rems['###GO_LAST_YEAR###'] = $this->cObj->substituteMarkerArrayCached($lastYearT, $sims, array(),array());
$Vars['time']=$nextYear;
$sims['###DATA###'] = $this->pi_linkTP($labelNextYear,Array($this->prefixId=>$Vars),$this->caching);
$rems['###GO_NEXT_YEAR###'] = $this->cObj->substituteMarkerArrayCached($nextYearT, $sims, array(),array());
//n‰chste zwei Zeilen von Philipp
$sims['###DATA###'] = $labelThisMonth;
$rems['###THIS_MONTH###'] = $this->cObj->substituteMarkerArrayCached($thisMonthT, $sims, array(),array());
$sims = array(); // Simple markers
// $sims['###VIEW_TITLE###']= $this->pi_getLL('titleMonthView');
$sims['###VIEW_TITLE###']= $this->pi_getLL('titleMonthView');
$sims['###TIME_INFO###']= strftime('%B %Y', $time);
$rems['###CATEGORYTITLE###'] = '';
if($this->jwOptions['categories']['show']){
$rems['###CATEGORYTITLE###'] = $this->getCategoriesTitle($time).' ';
}
$rems['###CATEGORYTITLE###'] .= $this->getViewModes($time);
$this->access=$this->checkFeEntry();
$rems['###MONTH_NAVI###'] = $this->monthsNavi($time);
$rems['###CALENDAR_TABLE###'] = $this->calendarTable($time);
$rems['###SUBMIT_EVENT###'] = $this->submitForm($submitEvent,$time);
$out = $this->cObj->substituteMarkerArrayCached($monthViewT, array(), $rems, array());
$out = $this->cObj->substituteMarkerArrayCached($out, $sims, array(), array());
//if($access){
// $out = $this->wrap2Form($out);
//}
return $out;
}
Das ganze sieht dann wie folgt aus:
http://www.ventil.ag/?169
lg ph