示例#1
0
		/**
		   * This function is used for drawing the html-code out to the templates.
		   * It just returns the code
		   * @param 		string	Optional parameters for the draw-function. There are none supported.
		   * @return		string	HTML-CODE to be written into the template.
		   */
		function draw($param = "") {
			global $cds;
			$variation = value("v");
			if ($variation == "0") $variation = $cds->variation;
			$parser = new NX2HTML($variation);
			$content = $parser->parseText(getDBCell("pgn_text", "CONTENT", "FKID = $this->fkid"));
			return applyFilterPlugins($content);
		}
		/**
		 * returns the data for an event
		 * @param integer ID of the event
		 */
		 function getEventData($eventId) {
			global $db, $cds;
			$variation = value("v");
		    if ($variation == "0") $variation = $cds->variation;
			$sql = "SELECT * FROM pgn_cal_appointment WHERE APID = ".$eventId;
		  	$query = new query($db, $sql);
		  	$parser= new NX2HTML($variation);
		  	while ($query->getrow()) {
		  		$compareDate = date('Y-m-d', strtotime($query->field("STARTDATE")));
			    $date = date('Y-m-d');
			    $over = $compareDate < $date;
		  		$event = array(	"TITLE" => $query->field("TITLE"), 
		  					"DESCRIPTION" => applyFilterPlugins($parser->parseText($query->field("DESCRIPTION"))), 		  					
		  					"STARTDATE" => date('d.m.Y', strtotime($query->field("STARTDATE"))), 
		  					"STARTTIME" => substr($query->field("STARTTIME"),0,5), 
		  					"ENDDATE" => date('d.m.Y', strtotime($query ->field("ENDDATE"))), 
		  					"ENDTIME" =>  substr($query->field("ENDTIME"),0,5), 
		  					"UNIXSTART" => $query->field("STARTDATE") .' '. $query->field("STARTTIME"), 
		  					"UNIXEND" => $query->field("ENDDATE") .' '. $query->field("ENDTIME"), 
		  					"APID" => $query->field("APID"), 
		  					"REPORT" => applyFilterPlugins($parser->parseText($query->field("REPORT"))), 
		  					"GALLERY" => $query->field("GALLERY"), 
		  					"OVER" => $over,
		  					"CATID" => $query->field("CATID"));			  					
			  }
			  			  
			$query->free();
			return $event;
		 }