Moin, ich glaube nicht. Den Code kann ich noch nicht so richtig lesen und im php-Bereich bin ich noch Beginner:
PHP-Code:
<?php
// DEFAULT initialization of a module [BEGIN]
unset($MCONF);
require_once('conf.php');
require_once($BACK_PATH.'init.php');
require_once($BACK_PATH.'template.php');
$LANG->includeLLFile('EXT:kochrezepte/mod1/locallang.xml');
require_once(PATH_t3lib.'class.t3lib_scbase.php');
$BE_USER->modAccess($MCONF,1); // This checks permissions and exits if the users has no permission for entry.
// DEFAULT initialization of a module [END]
//--------------------------------------------------
class tx_kochrezepte_module1 extends t3lib_SCbase {
//--------------------------------------------------
var $pageinfo;
//------ init --> Modul-Initialisierung
function init() {
global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
parent::init();
/*if (t3lib_div::_GP('clear_all_cache')) {
$this->include_once[] = PATH_t3lib.'class.t3lib_tcemain.php';
}*/
}
//------ menuConfig --> Konfiguriert das Funktionen-Dropdown-Element
function menuConfig() {
global $LANG;
$this->MOD_MENU = Array (
'register' => Array (
'zutaten' => $LANG->getLL('zutaten'),
'kategorien' => $LANG->getLL('kategorien'),
'naehrwerte' => $LANG->getLL('naehrwerte'),
'saisons' => $LANG->getLL('saisons'),
)
);
parent::menuConfig();
}
//------ main --> Erstellung des Modul-Contents
function main() {
global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
// Page is shown: if there is a valid page and if this page may be viewed by the user
$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
$access = is_array($this->pageinfo) ? 1 : 0;
if (($this->id && $access) || ($BE_USER->user['admin'] && !$this->id)) {
$this->doc = t3lib_div::makeInstance('bigDoc');
$this->doc->backPath = $BACK_PATH;
$this->doc->form='<form action="" method="POST">';
// JavaScript1
$this->doc->JScode = '<script language="javascript" type="text/javascript">
script_ended = 0;
function jumpToUrl(URL) {document.location = URL;}
</script>';
// JavaScript2
$this->doc->postCode='<script language="javascript" type="text/javascript">
script_ended = 1;
if (top.fsMod) top.fsMod.recentIds["web"] = 0;
</script>';
$this->content.=$this->doc->startPage($LANG->getLL('title'));
$this->content.=$this->doc->section(($LANG->getLL('title')),t3lib_BEfunc::getFuncMenu($this->id,'SET[register]',$this->MOD_SETTINGS['register'],$this->MOD_MENU['register']).'<br />',TRUE);
$this->content.=$this->doc->divider(1);
$this->content.=$this->doc->sectionEnd();
// Render content:
$this->moduleContent(); //--> moduleContent
// ShortCut
if ($BE_USER->mayMakeShortcut()) {
$this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));
}
$this->content.=$this->doc->spacer(10);
} else {
// If no access or if ID == zero
$this->doc = t3lib_div::makeInstance('mediumDoc');
$this->doc->backPath = $BACK_PATH;
$this->content.=$this->doc->startPage($LANG->getLL('title'));
$this->content.=$this->doc->header($LANG->getLL('title'));
$this->content.=$this->doc->spacer(5);
$this->content.=$this->doc->spacer(10);
}
}
//------ printContent --> prints out the module HTML = @return void */
function printContent() {
$this->content.=$this->doc->endPage();
echo $this->content;
}
//------ moduleContent --> Generates the module content
function moduleContent() {
switch($this->MOD_SETTINGS['register']) {
case 'zutaten':
$this->content.=$this->doc->section('','Datensuche',0,1);
$this->content.=$this->doc->divider(1);
$this->content.=$this->doc->sectionEnd();
$this->content.=$this->doc->section('','Dateneingabe',0,1);
$this->content.=$this->doc->divider(1);
$this->content.=$this->doc->sectionEnd();
$this->content.=$this->doc->section('',showCategories(),0,1);
$this->content.=$this->doc->sectionEnd();
break;
case 'kategorien':
$content='<div align=center><strong>Funktion: Kategorien...</strong></div>';
$this->content.=$this->doc->section('',$content,true,1);
break;
case 'naehrwerte':
$content='<div align=center><strong>Funktion: Nährwerte...</strong></div>';
$this->content.=$this->doc->section('',$content,true,1);
break;
case 'saisons':
$content='This is the GET/POST vars sent to the script:<br />'.
'GET: '.t3lib_div::view_array($_GET).'<br />'.
'POST:'.t3lib_div::view_array($_POST).'<br />';
$this->content.=$this->doc->section('',$content,true,1);
break;
}
}
}
function showCategories() {
$tr = array(array());
$trz = 0;
$selectFields = 'uid,zkb0,zkhk0,zkk0';
$rs=$GLOBALS['TYPO3_DB']->exec_SELECTquery($selectFields,'tx_kochrezepte_zk','','');
while ($ds=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($rs))
{
$tr[$trz][0]=$ds['uid'];
$tr[$trz][1]=$ds['zkb0'];
$tr[$trz][2]=$ds['zkhk0'];
$tr[$trz][3]=$ds['zkk0'];
$trz++;
}
$rgw='<p>Zeige die Kategorien: </p>';
// $rgw.=$this->doc->table($tr);
$rgw.=$this->table($tr);
return $rgw;
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/kochrezepte/mod1/index.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/kochrezepte/mod1/index.php']);
}
// Make instance:
$SOBE = t3lib_div::makeInstance('tx_kochrezepte_module1');
$SOBE->init();
// Include files?
foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
$SOBE->main();
$SOBE->printContent();
?>
Habe den Aufruf schon korrigiert. Wo genau müsste ich die Klassendatei einbinden?
Danke für Deine Hilfe und Gruss Mensch