*/ /** * [CLASS/FUNCTION INDEX of SCRIPT] * * * * 70: tx_cljoboffers_pi1 extends tslib_pibase * 94: function main($content, $conf) * 136: function readTemplate() * 157: function listView($content, $conf) * 297: function pi_list_makelist($res,$tableParams='') * 372: function singleView($content,$conf) * 539: function pi_list_row($c, $row, $overlay) * 612: function pi_list_header() * 685: function getFieldContent($fN,$data,$overlay,$field="") * 841: function getFieldHeader($fN) * 857: function getFieldHeader_sortLink($fN) * 868: function createBackLink() * * TOTAL FUNCTIONS: 11 * */ require_once(PATH_tslib."class.tslib_pibase.php"); require_once(t3lib_extMgm::extPath("smarty")."class.tx_smarty.php"); /** * Plugin 'Job Offers and Apprenticeships'. * * @author Chris Lauer */ class tx_cljoboffers_pi1 extends tslib_pibase { var $prefixId = "tx_cljoboffers_pi1"; // Same as class name var $scriptRelPath = "pi1/class.tx_cljoboffers_pi1.php"; // Path to this script relative to the extension dir. var $extKey = "cl_joboffers"; // The extension key. var $templateDir='uploads/tx_cljoboffers/'; //Directory for Files related to this Extension //Template-Variablen var $template; //eingelesenes Template-File //Table-Variable var $table; //Benutzte Tabelle, Unterscheidung zwischen Job und Praktikum //Multilang-Variablen var $sys_language_uid; //eingestellte Sprache var $overlay_uid; //Datensatz für Merge-Felder (Parent wird bei Übersetzung geladen) var $config; /** * main Function, some Initializations, Call of List & Single-View. * * @param string $content : ... * @param array $conf : configuration array from TS * @return string rendered content ready for output */ function main($content,$conf) { $this->offer_uid = intval($this->piVars["showUid"]["showUID"]); // Get the submitted uid of an offer (if any) /* Patch iScream.net rpalard@iscream.net */ if ($GLOBALS['TSFE']->config['config']['sys_language_uid'] != '') { $this->sys_language_uid = $GLOBALS['TSFE']->config['config']['sys_language_uid']; //Get site-language } else { $this->sys_language_uid = 0; } // use multilanguage addresses, only if TYPO3 version >= 3.7.0 $t3_version = str_replace('.','',$GLOBALS['TYPO_VERSION']); if ($t3_version >= 370) { $this->config['use_l18nParent'] = $GLOBALS['TYPO_VERSION']; } //Unterscheidung Job <-> Praktikum if(!$this->cObj->data['tx_cljoboffers_display']){ $this->table = "tx_cljoboffers_offer"; } else{ $this->table = "tx_cljoboffers_apprentice"; } switch((string)$conf["CMD"]){ case "singleView": list($t) = explode(":",$this->cObj->currentRecord); $this->internal["currentTable"]=$t; $this->internal["currentRow"]=$this->cObj->data; return $this->pi_wrapInBaseClass($this->singleView($content,$conf)); break; default: if (strstr($this->cObj->currentRecord,"tt_content")) { $conf["pidList"] = $this->cObj->data["pages"]; $conf["recursive"] = $this->cObj->data["recursive"]; } return $this->pi_wrapInBaseClass($this->listView($content,$conf)); break; } } /* returns the read-in Template. * * @param no paramters * @return string Template-File-Code */ function readTemplate(){ $templatefile = $this->cObj->data['tx_cljoboffers_template']; $smarty = new tx_smarty($this->extKey); $smarty->template_dir = $this->templateDir; $smarty->compile_dir = $this->templateDir.''; $smarty->cache = $this->templateDir.''; $tmpl.=$smarty->display($templatefile); return $tmpl; } /** * Function for List View, selects the requested offers or apprenticeships and calls sub-routines for data-gathering. * * @param string $content : ... * @param array $conf : configuration array from TS * @return string fully rendered table with requested addresses */ function listView($content,$conf) { $this->conf=$conf; // Setting the TypoScript passed to this function in $this->conf $this->pi_setPiVarDefaults(); $this->pi_loadLL(); // Loading the LOCAL_LANG values $lConf = $this->conf["listView."]; // Local settings for the listView function if ($this->piVars["showUid"]) { // If a single element should be displayed: $this->internal["currentTable"] = $this->table; $this->internal["currentRow"] = $this->pi_getRecord($this->table,$this->piVars["showUid"]); $content = $this->singleView($content,$conf); return $content; } else { $items=array( "1"=> $this->pi_getLL("list_mode_1","Mode 1"), "2"=> $this->pi_getLL("list_mode_2","Mode 2"), "3"=> $this->pi_getLL("list_mode_3","Mode 3"), ); if (!isset($this->piVars["pointer"])) $this->piVars["pointer"]=0; if (!isset($this->piVars["mode"])) $this->piVars["mode"]=1; if (!isset($this->piVars["sort"])) $this->piVars["sort"]="position:0"; $orderby = array(); list($orderby["field"], $orderby["order"]) = explode(":",$this->piVars["sort"]); if($this->cObj->data['tx_cljoboffers_display'] && $orderby["field"] == "position") $this->piVars["sort"]="topic:0"; // 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,10); // 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. if(!$this->cObj->data['tx_cljoboffers_display']){ $this->internal["searchFieldList"]="position,lead,duties,profile,turnto,link"; $this->internal["orderByList"]="position,file,link,begin"; } else{ $this->internal["searchFieldList"]="topic,branch_study,link"; $this->internal["orderByList"]="topic,branch_study,begin,file,link"; } // Get number of records: $res = $this->pi_exec_query($this->table,1); list($this->internal["res_count"]) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res); // Make listing query, pass query to SQL database: //Ausgabe der definierten Datensätze $pidList = $this->pi_getPidList($this->conf['pidList'],$this->conf['recursive']); if(!$this->cObj->data['tx_cljoboffers_display']){ //AUSGABE STELLENANGEBOTE $res = $this->pi_exec_query($this->table,0,"","","","","FROM ".$this->table." WHERE ".$this->table.".sys_language_uid = ".$this->sys_language_uid." AND ".$this->table.".pid IN (".$pidList.") ".$this->cObj->enableFields($this->table).chr(10)); if(!$res) return ''; } else{ switch($this->cObj->data['tx_cljoboffers_show']){ case 0: //AUSGABE BEIDES $where = "(".$this->table.".apprentice = 1 OR ".$this->table.".dissertation = 1)"; break; case 1: //AUSGABE PRAKTIKA $where = $this->table.".apprentice = 1"; break; case 2: //AUSGABE DIPLOMARBEITEN $where = $this->table.".dissertation = 1"; break; default: $where = "(".$this->table.".apprentice = 1 OR ".$this->table.".dissertation = 1)"; break; } $res = $this->pi_exec_query($this->table,0,"","","","","FROM ".$this->table." WHERE ".$where." AND ".$this->table.".pid IN (".$pidList.") ".$this->cObj->enableFields($this->table).chr(10)); //Bei nicht Standardsprache (da apprentice und dissertation bei übersetzten immer 0 sind) if($this->sys_language_uid != 0){ $list = '0'; //Erstellung der Liste mit kriteriengerechten Datensätzen in Standardsprache while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { $list = $list.','.$row['uid']; } if($list = '0') return ''; //Abfrage nach übersetzten Datensätzen $where = $this->table.".l18n_parent IN (".$list.") AND ".$this->table.".sys_language_uid = ".$this->sys_language_uid.""; $res = $this->pi_exec_query($this->table,0,"","","","","FROM ".$this->table." WHERE ".$where." AND ".$this->table.".pid IN (".$pidList.") ".$this->cObj->enableFields($this->table).chr(10)); } } $this->internal["currentTable"] = $this->table; // Put the whole list together: $fullTable=""; // Clear var; # $fullTable.=t3lib_div::view_array($this->piVars); // DEBUG: Output the content of $this->piVars for debug purposes. REMEMBER to comment out the IP-lock in the debug() function in t3lib/config_default.php if nothing happens when you un-comment this line! // Adds the mode selector. //$fullTable.=$this->pi_list_modeSelector($items); // Adds the whole list table //Auslesen der TableProperties aus dem TS-Setup $TStableProperties = array(); $TStableProperties = $this->conf["listView."]; if(!$this->cObj->data['tx_cljoboffers_display']){ $TStableProperties = $TStableProperties["tablePropertiesJob."]; } else{ $TStableProperties = $TStableProperties["tablePropertiesApprentice."]; } //Override, falls leere Werte vorhanden sind if(!$TStableProperties["border"]) $TStableProperties["border"]='0'; if(!$TStableProperties["width"]) $TStableProperties["width"]=''; if(!$TStableProperties["cellspacing"]) $TStableProperties["cellspacing"]='0'; if(!$TStableProperties["cellpadding"]) $TStableProperties["cellpadding"]='0'; $tableProp = (!empty($TStableProperties["width"])?'width="'. $TStableProperties["width"]:'') . '" border="'.$TStableProperties["border"].'" cellspacing="'.$TStableProperties["cellspacing"].'" cellpadding="'.$TStableProperties["cellpadding"].'"'; $fullTable.=$this->pi_list_makelist($res, $tableProp); // Adds the search box: //$fullTable.=$this->pi_list_searchBox(); // Adds the result browser: //$fullTable.=$this->pi_list_browseresults(); // Returns the content from the plugin. return $fullTable; } } /** * Fetches Result-Array, calls sub-routine for data-gathering and puts all the stuff in a table (configurated via TS) * * @param string $res : Result-Array * @param array $tableParams : configuration for table parameters from TS * @return string fully rendered table with requested job offers or apprenticeships */ function pi_list_makelist($res,$tableParams='') { // Make list table header: $tRows=array(); $this->internal['currentRow']=''; $tRows[] = $this->pi_list_header(); // Make list table rows $c=0; //Ergebnisarray durchgehen while($this->internal['currentRow'] = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { //Wenn keine Standardsprache, hole Default-Datensatz-ID if($this->sys_language_uid != 0){ $this->overlay_uid = $this->internal['currentRow']['l18n_parent']; } //Hole Datensatz in Standardsprache if($this->overlay_uid){ $default = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $this->table, $this->table.'.uid='.intval($this->overlay_uid)); $overlay = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($default); } else{ $overlay = array(); } $tRows[] = $this->pi_list_row($c, $this->internal['currentRow'], $overlay); $c++; } //TypoScript-Setup für colgroup $TStableProperties = array(); $TStableProperties = $this->conf["listView."]; if(!$this->cObj->data['tx_cljoboffers_display']){ $TStableProperties = $TStableProperties["tablePropertiesJob."]; if(!$TStableProperties["colgroup"]) $TStableProperties["colgroup"]='150|150|150|100'; } else{ $TStableProperties = $TStableProperties["tablePropertiesApprentice."]; if(!$TStableProperties["colgroup"]) $TStableProperties["colgroup"]='150|150|150|150|100'; } /* //colgroup zusammensetzen $widths = explode("|",$TStableProperties["colgroup"]); $col = ''; //col widths setzen $a = '0'; while ($a < count($widths)) { $col.=''; $a++; } $col.=''; */ $out = ' pi_classParam('listrow').'> <'.trim('table '.$tableParams).'> '.$col.' '.implode('',$tRows).' '; return $out; } /** * Fetches Result-Array and calls sub-routine for data-gathering * * @param string $content: ... * @param string $conf: ... * @return string Single-View for a Record, optionally rendered with Subsitute Markers defined by a Template */ function singleView($content,$conf) { $this->conf=$conf; $this->pi_setPiVarDefaults(); $this->pi_loadLL(); // find out, if the item has a translation if ($this->sys_language_uid != 0) { $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($this->table.'.uid',$this->table,$this->table.'.l18n_parent='.intval($this->offer_uid).' AND '.$this->table.'.sys_language_uid='.intval($this->sys_language_uid).''); $l18n_parent = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); if ($l18n_parent['uid']) { $this->overlay_uid = $this->offer_uid; $this->offer_uid = $l18n_parent['uid']; } } // WHERE-Klausel $singleWhere = $this->table.'.uid='.intval($this->piVars["showUID"]).' AND '.$this->table.'.sys_language_uid='.$this->sys_language_uid; $singleWhere .= $this->enableFields; //Nur aktive Datensätze //Abfrage durchführen $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $this->table, $singleWhere); $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); //Fehlermeldung, wenn kein Datensatz gefunden wird if (!$row['uid']){ return $this->pi_getLL('noIdMsg'); } //Wenn keine Standardsprache, default-Abfrage für Merge-Felder if($this->overlay_uid){ $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $this->table, $this->table.'.uid='.intval($this->overlay_uid)); $overlay = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); } else{ $overlay = array(); } // This sets the title of the page for use in indexed search results and title-field: if(!$this->cObj->data['tx_cljoboffers_display']){ $GLOBALS['TSFE']->page['title'] = $row["position"]; if ($row["position"]) $GLOBALS["TSFE"]->indexedDocTitle=$row["position"]; } else{ $GLOBALS['TSFE']->page['title'] = $row["topic"]; if ($row["topic"]) $GLOBALS["TSFE"]->indexedDocTitle=$row["topic"]; } //Template einfügen //Versuch, Template zu lesen $this->template = $this->readTemplate(); //Unterscheidung Template vorhanden <-> nicht vorhanden if(substr($this->template,0,6)=='
'){ //Darstellung ohne ausgewähltes Template $content='pi_classParam("singleView").'> '; //Unterscheidung Job, Praktikum if(!$this->cObj->data['tx_cljoboffers_display']){ $content.=''; } else{ $content.=''; } $content.= '
pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("position").'

'.$this->getFieldContent("position",$row,$overlay).'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("lead").'

'.$this->getFieldContent("lead",$row,$overlay).'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("duties").'

'.$this->getFieldContent("duties",$row,$overlay).'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("profile").'

'.$this->getFieldContent("profile",$row,$overlay).'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("turnto").'

'.$this->getFieldContent("turnto",$row,$overlay).'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("topic").'

'.$this->getFieldContent("topic",$row,$overlay).'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("branch_study").'

'.$this->getFieldContent("branch_study",$row,$overlay).'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("apprentice").'

'.$this->getFieldContent("apprentice",$row,$overlay).'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("dissertation").'

'.$this->getFieldContent("dissertation",$row,$overlay).'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("company").'

'.$this->getFieldContent("company",$row,$overlay,"name").'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("begin").'

'.$this->getFieldContent("begin",$row,$overlay).'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("file").'

'.$this->getFieldContent("file",$row,$overlay).'

pi_classParam("singleView-HCell").'>

'.$this->getFieldHeader("link").'

'.$this->getFieldContent("link",$row,$overlay).'

'.$this->createBackLink().'

'. $this->pi_getEditPanel(); return $content; } else{ if(!$this->cObj->data['tx_cljoboffers_display']){ $datarowcontent = $this->cObj->getSubpart($this->template, '###SINGLE_JOB###'); } else{ $datarowcontent = $this->cObj->getSubpart($this->template, '###SINGLE_APPR###'); } //Austauschen der Marker gegen Werte $substArray=array(); $substArray['###JO_POSITION###'] = $this->getFieldContent("position",$row,$overlay); $substArray['###JO_LEAD###'] = $this->getFieldContent("lead",$row,$overlay); $substArray['###JO_DUTIES###'] = $this->getFieldContent("duties",$row,$overlay); $substArray['###JO_PROFILE###'] = $this->getFieldContent("profile",$row,$overlay); $substArray['###JO_TURNTO###'] = $this->getFieldContent("turnto",$row,$overlay); $substArray['###JO_TOPIC###'] = $this->getFieldContent("topic",$row,$overlay); $substArray['###JO_APPRENTICE###'] = $this->getFieldContent("apprentice",$row,$overlay); $substArray['###JO_DISSERTATION###'] = $this->getFieldContent("dissertation",$row,$overlay); $substArray['###JO_BRANCH###'] = $this->getFieldContent("branch_study",$row,$overlay); $substArray['###JO_BEGIN###'] = $this->getFieldContent("begin",$row,$overlay); $substArray['###JO_COMPANY###'] = $this->getFieldContent("company",$row,$overlay,"name"); $substArray['###JO_ADDRESS###'] = $this->getFieldContent("company",$row,$overlay,"address"); $substArray['###JO_CITY###'] = $this->getFieldContent("company",$row,$overlay,"city"); $substArray['###JO_ZIP###'] = $this->getFieldContent("company",$row,$overlay,"zip"); $substArray['###JO_COUNTRY###'] = $this->getFieldContent("company",$row,$overlay,"country"); $substArray['###JO_PHONE###'] = $this->getFieldContent("company",$row,$overlay,"tel"); $substArray['###JO_FAX###'] = $this->getFieldContent("company",$row,$overlay,"fax"); $substArray['###JO_FILE###'] = $this->getFieldContent("file",$row,$overlay); $substArray['###JO_WWW###'] = $this->getFieldContent("link",$row,$overlay); $substArray['###JO_BACKLINK###'] = $this->createBackLink(); return $this->cObj->substituteMarkerArrayCached($datarowcontent,$substArray); } } /** * Gets Data for one Row in List-View * * @param string $c : ... * @param array $row : Data of the requested Record in requested language * @param array $overlay : Default-Language-Version of a Record for merging Blank Fields * @return string Row of requested Record, optionally rendered with Subsitute Markers defined by a Template */ function pi_list_row($c, $row, $overlay) { $editPanel = $this->pi_getEditPanel(); if ($editPanel) $editPanel="".$editPanel.""; //Template einfügen //Versuch, Template zu lesen $this->template = $this->readTemplate(); //Unterscheidung Template vorhanden <-> nicht vorhanden if(substr($this->template,0,6)=='
'){ //Darstellung ohne ausgewähltes Template $returnstring = 'pi_classParam("listrow-odd") : "").'>

'.$this->getFieldContent("uid",$row,$overlay).'

'; //Unterscheidung Job, Praktikum if(!$this->cObj->data['tx_cljoboffers_display']){ $returnstring.= '

'.$this->getFieldContent("position",$row,$overlay).'

'; } else{ $returnstring.= '

'.$this->getFieldContent("topic",$row,$overlay).'

'; } $returnstring.= '

'.$this->getFieldContent("company",$row,$overlay,"name").'

'.$this->getFieldContent("begin",$row,$overlay).'

'.$this->getFieldContent("file",$row,$overlay).'

'.$this->getFieldContent("link",$row,$overlay).'

'.$editPanel.' '; return $returnstring; } else{ if(!$this->cObj->data['tx_cljoboffers_display']){ $datarowcontent = $this->cObj->getSubpart($this->template, '###LIST_JOB###'); } else{ $datarowcontent = $this->cObj->getSubpart($this->template, '###LIST_APPR###'); } //Austauschen der Marker gegen Werte $substArray=array(); $substArray['###JO_POSITION###'] = $this->getFieldContent("position",$row,$overlay); $substArray['###JO_LEAD###'] = $this->getFieldContent("lead",$row,$overlay); $substArray['###JO_DUTIES###'] = $this->getFieldContent("duties",$row,$overlay); $substArray['###JO_PROFILE###'] = $this->getFieldContent("profile",$row,$overlay); $substArray['###JO_TURNTO###'] = $this->getFieldContent("turnto",$row,$overlay); $substArray['###JO_TOPIC###'] = $this->getFieldContent("topic",$row,$overlay); $substArray['###JO_APPRENTICE###'] = $this->getFieldContent("apprentice",$row,$overlay); $substArray['###JO_DISSERTATION###'] = $this->getFieldContent("dissertation",$row,$overlay); $substArray['###JO_BRANCH###'] = $this->getFieldContent("branch_study",$row,$overlay); $substArray['###JO_BEGIN###'] = $this->getFieldContent("begin",$row,$overlay); $substArray['###JO_COMPANY###'] = $this->getFieldContent("company",$row,$overlay,"name"); $substArray['###JO_ADDRESS###'] = $this->getFieldContent("company",$row,$overlay,"address"); $substArray['###JO_CITY###'] = $this->getFieldContent("company",$row,$overlay,"city"); $substArray['###JO_ZIP###'] = $this->getFieldContent("company",$row,$overlay,"zip"); $substArray['###JO_COUNTRY###'] = $this->getFieldContent("company",$row,$overlay,"country"); $substArray['###JO_PHONE###'] = $this->getFieldContent("company",$row,$overlay,"tel"); $substArray['###JO_FAX###'] = $this->getFieldContent("company",$row,$overlay,"fax"); $substArray['###JO_FILE###'] = $this->getFieldContent("file",$row,$overlay); $substArray['###JO_WWW###'] = $this->getFieldContent("link",$row,$overlay); $substArray['###JO_SINGLELINK###'] = $this->getFieldContent("uid",$row,$overlay); return $this->cObj->substituteMarkerArrayCached($datarowcontent,$substArray); } } /** * Returns requested Table-Header-Row * * @param no parameters * @return string Table-Header-Row for List-View, optionally rendered with Subsitute Markers defined by a Template */ function pi_list_header() { //Template einfügen //Versuch, Template zu lesen $this->template = $this->readTemplate(); //Unterscheidung Template vorhanden <-> nicht vorhanden if(substr($this->template,0,6)=='
'){ //Darstellung ohne ausgewähltes Template $returnstring = 'pi_classParam("listrow-header").'>

'.$this->getFieldHeader_sortLink("uid").'

'; //Unterscheidung Job, Praktikum - Überschrift if(!$this->cObj->data['tx_cljoboffers_display']){ $returnstring.= '

'.$this->getFieldHeader_sortLink("position").'

'; } else{ $returnstring.= '

'.$this->getFieldHeader_sortLink("topic").'

'; } $returnstring.= '

'.$this->getFieldHeader("company").'

'.$this->getFieldHeader("begin").'

'.$this->getFieldHeader("file").'

'.$this->getFieldHeader_sortLink("link").'

'; return $returnstring; } else{ if(!$this->cObj->data['tx_cljoboffers_display']){ $datarowcontent = $this->cObj->getSubpart($this->template, '###HEADER_JOB###'); } else{ $datarowcontent = $this->cObj->getSubpart($this->template, '###HEADER_APPR###'); } //Austauschen der Marker gegen Werte $substArray=array(); $substArray['###JO_POSITION###'] = $this->getFieldHeader_sortLink("position"); $substArray['###JO_LEAD###'] = $this->getFieldHeader("lead"); $substArray['###JO_DUTIES###'] = $this->getFieldHeader("duties"); $substArray['###JO_PROFILE###'] = $this->getFieldHeader("profile"); $substArray['###JO_TURNTO###'] = $this->getFieldHeader("turnto"); $substArray['###JO_TOPIC###'] = $this->getFieldHeader_sortLink("topic"); $substArray['###JO_APPRENTICE###'] = $this->getFieldHeader("apprentice"); $substArray['###JO_DISSERTATION###'] = $this->getFieldHeader("dissertation"); $substArray['###JO_BRANCH###'] = $this->getFieldHeader_sortLink("branch_study"); $substArray['###JO_BEGIN###'] = $this->getFieldHeader_sortLink("begin"); $substArray['###JO_COMPANY###'] = $this->getFieldHeader("company"); $substArray['###JO_ADDRESS###'] = $this->getFieldHeader("address"); $substArray['###JO_COUNTRY###'] = $this->getFieldHeader("country"); $substArray['###JO_PHONE###'] = $this->getFieldHeader("tel"); $substArray['###JO_FAX###'] = $this->getFieldHeader("fax"); $substArray['###JO_CITY###'] = $this->getFieldHeader("city"); $substArray['###JO_ZIP###'] = $this->getFieldHeader("zip"); $substArray['###JO_FILE###'] = $this->getFieldHeader_sortLink("file"); $substArray['###JO_WWW###'] = $this->getFieldHeader_sortLink("link"); return $this->cObj->substituteMarkerArrayCached($datarowcontent,$substArray); } } /** * Returns field-data for the requested fields of a record * * @param string $fN : requested FieldName * @param array $data : Data of the requested Record in requested language * @param array $overlay : Default-Language-Version of a Record for merging Blank Fields * @param array $field : requested field for related company-table-entry, used in sql-select * @return string Data of requested Fields, rendered as requested */ function getFieldContent($fN,$data,$overlay,$field="") { if($this->overlay_uid){ $data['turnto'] = $overlay['turnto']; $data['company'] = $overlay['company']; $data['begin'] = $overlay['begin']; $data['apprentice'] = $overlay['apprentice']; $data['dissertation'] = $overlay['dissertation']; if(!$data['position']) $data['position'] = $overlay['position']; if(!$data['lead']) $data['lead'] = $overlay['lead']; if(!$data['duties']) $data['duties'] = $overlay['duties']; if(!$data['profile']) $data['profile'] = $overlay['profile']; if(!$data['file']) $data['file'] = $overlay['file']; if(!$data['link']) $data['link'] = $overlay['link']; if(!$data['topic']) $data['topic'] = $overlay['topic']; if(!$data['branch_study']) $data['branch_study'] = $overlay['branch_study']; } switch($fN) { case "uid": $singlePID=intval($this->cObj->data['tx_cljoboffers_singlepid']); $singlePID=$singlePID?$singlePID:intval($GLOBALS['TSFE']->id); //Sprachversionen abfangen $reqPage = $data["uid"]; if($this->sys_language_uid != 0){ $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($this->table.'.l18n_parent',$this->table,$this->table.'.uid='.intval($reqPage)); $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); $reqPage = $row['l18n_parent']; } // return $this->pi_list_linkSingle($this->pi_getLL("more"),array('showUID' => intval($reqPage), 'backPID' => $GLOBALS['TSFE']->id),1,'',0,$singlePID); // The "1" means that the display of single items is CACHED! Set to zero to disable caching. return $this->pi_list_linkSingle($this->pi_getLL("more"),$singlePID,false,array('showUID' => intval($reqPage), 'backPID' => $GLOBALS['TSFE']->id),0,$singlePID); // The "1" means that the display of single items is CACHED! Set to zero to disable caching. break; case "company": if(!$data[$fN]) return; //Datenbankanfrage nach Kategorie-Titel $query = 'SELECT * FROM tx_clcompanydatabase_address WHERE uid='.intval($data[$fN]); $res = mysql(TYPO3_db,$query); //Wenn nichts gefunden wird, leeres Feld zurückgeben if($res){ $row = mysql_fetch_assoc($res); return $row[$field]; } return ''; break; case "lead": case "duties": case "profile": case "turnto": return nl2br($this->pi_RTEcssText($data[$fN])); break; case "apprentice": case "dissertation": if($data[$fN]) return $this->pi_getLL("yes"); return $this->pi_getLL("no"); break; case "file": if(!$data[$fN]) return; $dir = $this->templateDir.''.$data[$fN]; return ''.$this->pi_getLL("filelink").''; break; case "link": //Werte für Seite und Target laden $link = array(); $link = explode(" ",$data[$fN]); if(!$link[0]) return; /* Text oder Image für Link auslesen aus TS */ /********************************************/ //Auslesen der Link-Konfiguration (Text, Image) $TSLink = array(); $TSLink = $this->conf["link."]; //Wenn Link lt. TS Text ist if(strtoupper($TSLink["type"]) == "TEXT"){ $TSLink = $TSLink["type."]; $linktext = $TSLink["value"]; } //Wenn Link lt. TS Image ist if(strtoupper($TSLink["type"]) == "IMAGE"){ $TSLink = $TSLink["type."]; $linksymbol = $TSLink["value"]; $linktext = ''.$link[0].''; } //Wenn nichts definiert ist if(!$linktext) $linktext = "[ Link ]"; /* Target setzen */ /*****************/ //Überprüfung ob Target gegeben if($link[1]) $target = 'target="'.$link[1].'"'; //Wenn Seitengröße statt Target gegeben, _blank verwenden if(is_numeric(substr($link[1],0,strpos($link[1],"x")))) $target = 'target="_blank"'; /* Link generieren */ /*******************/ //Unterscheidung interne <-> externe Seite if(is_numeric($link[0])){ $output = ''.$linktext.''; } else{ if(substr($link[0],0,7) != "http://") $http = "http://"; $output = ''.$linktext.''; } return $output; case "begin": if(!$data[$fN]) return; // For a numbers-only date, use something like: %d-%m-%y return strftime("%A %e. %B %Y",$data[$fN]); break; default: return $data[$fN]; break; } } /** * Returns single Table-Headers for different Fields * * @param string $fN : requested FieldName * @return string A single Table-Header as requested */ function getFieldHeader($fN) { switch($fN) { default: return $this->pi_getLL("listFieldHeader_".$fN,"[".$fN."]"); break; } } /** * Returns single, sortable Table-Headers for different Fields * * @param string $fN : requested FieldName * @return string A single, sortable Table-Header as requested */ function getFieldHeader_sortLink($fN) { return $this->pi_linkTP_keepPIvars($this->getFieldHeader($fN),array("sort"=>$fN.":".($this->internal["descFlag"]?0:1))); } /** * Creates the "Back"-Link for Single-Views * * @param no parameters * @return string Back-Link for Single-View */ function createBackLink(){ $backID=array(); $backID['parameter']=$this->piVars["backPID"]; return $this->cObj->typoLink($this->pi_getLL("back"), $backID); } } if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/cl_joboffers/pi1/class.tx_cljoboffers_pi1.php"]) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/cl_joboffers/pi1/class.tx_cljoboffers_pi1.php"]); } ?>