Kann mir jemand sagen warum die searchBox und broseresults nichts anzeigen? Bitte! Ich verzweifle total! #angry#
<?php
/***************************************************************
* Copyright notice
*
* (c) 2006 Pfusterschmied Jürgen <j.pfusterschmied@sbg.ac.at>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require_once(PATH_tslib.'class.tslib_pibase.php');
/**
* Plugin 'Submissions' for the 'submission' extension.
*
* @author Pfusterschmied Jürgen <j.pfusterschmied@sbg.ac.at>
* @package TYPO3
* @subpackage tx_submission
*/
class tx_submission_pi1 extends tslib_pibase {
var $prefixId = 'tx_submission_pi1'; // Same as class name
var $scriptRelPath = 'pi1/class.tx_submission_pi1.php'; // Path to this script relative to the extension dir.
var $extKey = 'submission'; // The extension key.
var $pi_checkCHash = TRUE;
/**
* The main method of the PlugIn
*
* @param string $content: The PlugIn content
* @param array $conf: The PlugIn configuration
* @return The content that is displayed on the website
*/
function main($content,$conf){
// Besorge die lokale Konfiguration
$this->conf = $conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
// Lade das Template-File.
$this->templateCode = $this->cObj->fileResource($this->conf["templateFile"]);
if ($this->templateCode=="") {
return "<h3>Submission: Kein HTML-Template gefunden:</h3>".$this->conf["templateFile"];
}
$content.= $this->displayDetailView();
return $this->pi_wrapInBaseClass($content);
}
/**
* This display the DETAIL LIST VIEW
*
* @param string $content: The PlugIn content
* @param array $conf: The PlugIn configuration
* @return The content that is displayed on the website
*/
function displayDetailView(){
// Lösche $content und lade die lokale Konfiguration für displayDetailView
$content = "";
$lconf = $this->conf["displayDetailView."];
// Initializing the query parameters:
list($this->internal['orderBy'],$this->internal['descFlag']) = explode(':',$this->piVars['sort']);
$this->internal['results_at_a_time']=t3lib_div::intInRange($lConf['results_at_a_time'],0,1000,3); // Number of results to show in a listing.
$this->internal['maxPages']=t3lib_div::intInRange($lConf['maxPages'],0,1000,2);; // The maximum number of "pages" in the browse-box: "Page 1", "Page 2", etc.
$this->internal['searchFieldList']='uid,last_name,first_name';
$this->internal['orderByList']='uid,last_name,first_name';
// Get number of records:
$res = $this->pi_exec_query('tx_submission_data',2);
list($this->internal['res_count']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
// Make listing query, pass query to SQL database:
$res = $this->pi_exec_query('tx_submission_data');
$this->internal['currentTable'] = 'tx_submission_data';
$items=array(
'1'=> $this->pi_getLL('list_mode_1',' Listeansicht '),
'2'=> $this->pi_getLL('list_mode_2',' Kartenansicht '),
'3'=> $this->pi_getLL('list_mode_3',' Detailansicht '),
);
if (!isset($this->piVars['mode'])) $this->piVars['mode']=1;
// DEBUG: Output the content of $this->piVars for debug purposes.
//$content.=t3lib_div::view_array($this->piVars);
// select Template Code
if( $this->piVars['mode'] =='1') $templateName = 'LIST';
if ($this->piVars['mode'] =='2') $templateName = 'LIST_CARD';
if ($this->piVars['mode'] =='3') $templateName = 'LIST_DETAIL';
// Adds the mode selector.
$content.=$this->pi_list_modeSelector($items);
// Adds the search box:
$content.=$this->pi_list_searchBox();
// Adds the result browser:
$content.=$this->pi_list_browseresults($showResultCount=1);
// Definiere den Bereich des Templates in dem gearbeitet wird.
// Im Template sieht das dann so aus:
// <!-- ###TEMPLATE_DISPLAY_ALL### begin -->
// ...Der HTML-Code...
// <!-- ###TEMPLATE_DISPLAY_ALL### end -->
$template = $this->cObj->getSubpart($this->templateCode,"###".$templateName."###");
// Definiere ein Array für die Marker
$markerArray=array();
// Definiere ein Array für die wrappedSubparts (benutzen wir hier nicht, muss aber übergeben werden.
$wrappedSubpartArray=array();
//Lese alle Daten aus der Datenbank aus und speicher diese in $rows
//Dafür benutzen wir die Funktion getItems() die später noch definiert wird.
$rows = $this->getItems();
//Gehe alle ausgelesenen Daten durch und schreibe ins Template
while( list($c,$row)=each($rows) ){
// Definiere das Foto. Wenn nicht vorhanden setze Dummybild ein.
if ($row["photo"] == false) {$lconf["image."]["file"] = "media/emoticons/sad.gif";}
else {
$lconf["image."]["file"] = "uploads/tx_submission/".($row["photo"]);
}
$theImgCode = $this->cObj->IMAGE($lconf["image."]);
// Ersetze Wrap-Marker mit Inhalt aus der Datenbank
// Ersetze die einzelne Marker mit Inhalt aus der DB
$markerArray["###UID###"] = $row['uid'];
$markerArray["###FIRST_NAME###"] = $row['first_name'];
$markerArray["###LAST_NAME###"] = $row['last_name'];
$markerArray["###GENDER###"] = $row['gender'];
// EMail Adresse durch TypoLink schicken damit Anti-Spam Funktionen greifen
$temp_conf = $this->typolink_conf;
$temp_conf["parameter."]["wrap"] = "|".$row["email"];
$markerArray["###EMAIL###"] = $this->cObj->typolink($row["email"],$temp_conf);
// Ersetze die einzelne Marker mit Inhalt aus der DB
$markerArray["###PHONE###"] = $row['home_tel'];
// Hier binden wir das Foto des Mitglieds ein. Die nötigen Daten dazu kommen aus $theImgCode
$markerArray["###PHOTO###"] = $theImgCode;
$markerArray["###BIRTHDAY###"] = $row['birthdate'];
$markerArray["###BIRTHLOCATION###"] = $row['birthlocation'];
$markerArray["###HOME_STREET###"] = $row['home_street'];
$markerArray["###HOME_ZIP###"] = $row['home_zip'];
$markerArray["###HOME_CITY###"] = $row['home_location'];
$markerArray["###PHONE###"] = $row['home_tel'];
$markerArray["###STUDY_STREET###"] = $row['study_address'];
$markerArray["###STUDY_ZIP###"] = $row['study_zip'];
$markerArray["###STUDY_CITY###"] = $row['study_location'];
$markerArray["###MATURA_DATE###"] = $row['matura_date'];
$markerArray["###MATURA_LOCATION###"] = $row['matura_location'];
$markerArray["###SBP_DATE###"] = $row['sbp_date'];
$markerArray["###SBP_LOCATION###"] = $row['sbp_location'];
$markerArray["###SF###"] = $row['sf'];
$markerArray["###EP_DATE###"] = $row['ep_date'];
// Die HTML-Vorlage inkl. ersetzte Marker in die $content Variable schreiben
//return debug($content); //Debug um die übergabe an das Template zu ändern
$content.=$this->cObj->substituteMarkerArrayCached($template,$markerArray,array(),$wrappedSubpartArray);
}
// Wir geben die gerade erzeugten Daten an die main() Funktion zurück
return $content;
}
/**
* Returns a table row with column names of the table
*
* @return A HTML table row
*/
function getItems(){
// pid_list ist die PID/PID-Liste des Sysordners mit den Daten
// Ist im Setup keine Liste mit ID angegeben werden die Werte des "Ausgangspunktes" benutzt.
$this->config["pid_list"] = trim($this->cObj->stdWrap($this->conf["pid_list"],$this->conf["pid_list."]));
$this->config["pid_list"] = $this->config["pid_list"] ? implode(t3lib_div::intExplode(",",$this->config["pid_list"]),",") : $this->cObj->data["pages"];
list($pid) = explode(",",$this->config["pid_list"]);
$this->pid = $pid;
// Führe die Abfrage durch und lasse versteckte Elemente aus
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','tx_submission_data','hidden="0" and deleted="0"','','last_name ASC');// Get number of records:
// Schreibe in das Array $out
$out = array();
while( $row = mysql_fetch_assoc($res) ){
$out[]=$row;
}
return $out;
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/submission/pi1/class.tx_submission_pi1.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/submission/pi1/class.tx_submission_pi1.php']);
}
?>