Hallo Typo3 Freunde,
ich habe mir eine kleine EXT mit dem Kickstarter gebaut und möchte diese nun auch noch um die Storage PID erweitern, damit meine Datensätze nicht auf der Seite gespeichert werden wo das FE-Plugin angelegt ist sondern in einem Storagefolder hinterlegt werden.
Soweit so gut aber ich scheitere als Anfänger offensichtlich entweder an der DB-Query oder mein Wissen ist doch noch sehr begrenzt.
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
// PID auslesen: if datapid is not set via typoscript -> get data records from Storage
if ( !isset($this->conf["dataPID"]) )
{
$this->conf["dataPID"] = $GLOBALS['TSFE']->getStorageSiterootPids();
}
$this->templateFileContent = $this->cObj->cObjGetSingle($lConf['altTemplateFile'], $lConf['altTemplateFile.']);
if ($this->piVars['showUid']) {
// If a single element should be displayed:
$this->internal['currentTable'] = 'tx_hsgbase_basisdaten';
$this->internal['currentRow'] = $this->pi_getRecord('tx_hsgbase_basisdaten', $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'] = 'sorting';
// Initializing the query parameters:
list($this->internal['orderBy'], $this->internal['ascFlag']) = explode(':', $this->piVars['sort']);
$this->internal['results_at_a_time'] = t3lib_div::intInRange($lConf['results_at_a_time'], 0, 1000, 2);
// Number of results to show in a listing.
$this->internal['maxPages'] = t3lib_div::intInRange($lConf['maxPages'], 0, 1000, 2);
;
//.....//
// Get number of records:
$res = $this->pi_exec_query('tx_hsgbase_basisdaten', 1);
list($this->internal['res_count']) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
// Make listing query, pass query to SQL database:
// Ein paar Fehlversuche
//$query = 'FROM tx_hsgbase_basisdaten WHERE NOT hidden AND NOT deleted AND pid='.$dataPID .$this->cObj->enableFields('tx_hsgbase_basisdaten');
//$res = $this->pi_exec_query($query);
// Hier scheint auch noch der Wurm drin zu sein
$addWhere = ('AND pid='.$dataPID)
$res = $this->pi_exec_query('tx_hsgbase_basisdaten', $addWhere);
$this->internal['currentTable'] = 'tx_hsgbase_basisdaten';
// 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 search box:
$fullTable .= $this->pi_list_searchBox();
// Adds the result browser:
$fullTable .= $this->pi_list_browseresults();
// Adds the whole list table
$fullTable .= $this->pi_list_makelist($res);
// Returns the content from the plugin.
return $fullTable;
}
}
Ich bin doch da noch schon wieder auf dem absoluten holzweg - oder??????
Danke