Hallo typo3 Profis,
Ich bin beim Typo3 neu und versuche gerade eine Erweiterung zu schreiben. Ich habe folgende Grundlagen meiner Erweiterung mit Kickstarter Wizard festgelegt:
README.txt
Feel free to add some documentation or simply add a link to the online manual.
ext_localconf.php
<?php
if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
t3lib_extMgm::addUserTSConfig('
options.saveDocNew.user_rmmitarbeiter_main=1
');
t3lib_extMgm::addPItoST43($_EXTKEY, 'pi1/class.user_rmmitarbeiter_pi1.php', '_pi1', 'list_type', 0);
?>
ext_tables.php
<?php
if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
t3lib_extMgm::allowTableOnStandardPages('user_rmmitarbeiter_main');
$TCA['user_rmmitarbeiter_main'] = array (
'ctrl' => array (
'title' => 'LLL:EXT:user_rmmitarbeiter/locallang_db.xml:user_rmmitarbeiter_main',
'label' => 'uid',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'default_sortby' => 'ORDER BY crdate',
'delete' => 'deleted',
'disabled' => 'hidden',
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'icon_user_rmmitarbeiter_main.gif',
),
);
t3lib_div::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi1']='layout,select_key';
t3lib_extMgm::addPlugin(array(
'LLL:EXT:user_rmmitarbeiter/locallang_db.xml:tt_content.list_type_pi1',
$_EXTKEY . '_pi1',
t3lib_extMgm::extRelPath($_EXTKEY) . 'ext_icon.gif'
),'list_type');
?>
ext_tables.sql
#
# Table structure for table 'user_rmmitarbeiter_main'
#
CREATE TABLE user_rmmitarbeiter_main (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
cruser_id int(11) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
ac4ed9e336 tinytext,
a0a057a44d tinytext,
6d300d70b3 text,
PRIMARY KEY (uid),
KEY parent (pid)
);
locallang_db.xml
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<t3locallang>
<meta type="array" />
<type>database</type>
<description>Language labels for database tables/fields belonging to extension 'user_rmmitarbeiter'</description>
</meta>
<data type="array">
<languagekey index="default" type="array">
<label index="user_rmmitarbeiter_main">Snowboardtrainer</label>
<label index="user_rmmitarbeiter_main.ac4ed9e336">Vorname</label>
<label index="user_rmmitarbeiter_main.a0a057a44d">Nachname</label>
<label index="user_rmmitarbeiter_main.6d300d70b3">Bild</label>
<label index="tt_content.list_type_pi1">Snowboardlehrer</label>
</languagekey>
</data>
</t3locallang>
pi1/class.user_rmmitarbeiter_pi1.php
<?php
/***************************************************************
* Copyright notice
*
* (c) 2010 Ranks Marce <ranksmarce@itnest.eu>
* 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!
***************************************************************/
/**
* [CLASS/FUNCTION INDEX of SCRIPT]
*
* Hint: use extdeveval to insert/update function index above.
*/
require_once(PATH_tslib.'class.tslib_pibase.php');
/**
* Plugin 'Snowboardlehrer' for the 'user_rmmitarbeiter' extension.
*
* @author Ranks Marce <ranksmarce@itnest.eu>
* @package TYPO3
* @subpackage user_rmmitarbeiter
*/
class user_rmmitarbeiter_pi1 extends tslib_pibase {
var $prefixId = 'user_rmmitarbeiter_pi1'; // Same as class name
var $scriptRelPath = 'pi1/class.user_rmmitarbeiter_pi1.php'; // Path to this script relative to the extension dir.
var $extKey = 'user_rmmitarbeiter'; // The extension key.
/**
* 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) {
$this->conf = $conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
$this->pi_USER_INT_obj = 1; // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
$content='
<strong>This is a few paragraphs:</strong><br />
<p>This is line 1</p>
<p>This is line 2</p>
<h3>This is a form:</h3>
<form action="'.$this-">pi_getPageLink($GLOBALS['TSFE']->id).'" method="POST">
<input type="text" name="'.$this-" />prefixId.'[input_field]" value="'.htmlspecialchars($this->piVars['input_field']).'">
<input type="submit" name="'.$this-" />prefixId.'[submit_button]" value="'.htmlspecialchars($this->pi_getLL('submit_button_label')).'">
</form>
<br />
<p>You can click here to '.$this->pi_linkToPage('get to this page again',$GLOBALS['TSFE']->id).'</p>
';
return $this->pi_wrapInBaseClass($content);
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/user_rmmitarbeiter/pi1/class.user_rmmitarbeiter_pi1.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/user_rmmitarbeiter/pi1/class.user_rmmitarbeiter_pi1.php']);
}
?>
pi1/locallang.xml
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<t3locallang>
<meta type="array" />
<type>module</type>
<description>Language labels for plugin "user_rmmitarbeiter_pi1"</description>
</meta>
<data type="array">
<languagekey index="default" type="array">
<label index="list_mode_1">Mode 1</label>
<label index="list_mode_2">Mode 2</label>
<label index="list_mode_3">Mode 3</label>
<label index="back">Back</label>
<label index="submit_button_label">Click here to submit value</label>
</languagekey>
</data>
</t3locallang>
tca.php
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$TCA['user_rmmitarbeiter_main'] = array (
'ctrl' => $TCA['user_rmmitarbeiter_main']['ctrl'],
'interface' => array (
'showRecordFieldList' => 'hidden,ac4ed9e336,a0a057a44d,6d300d70b3'
),
'feInterface' => $TCA['user_rmmitarbeiter_main']['feInterface'],
'columns' => array (
'hidden' => array (
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array (
'type' => 'check',
'default' => '0'
)
),
'exclude' => 1,
'label' => 'LLL:EXT:user_rmmitarbeiter/locallang_db.xml:user_rmmitarbeiter_main.ac4ed9e336',
'config' => array (
'type' => 'input',
'size' => '30',
)
),
'exclude' => 1,
'label' => 'LLL:EXT:user_rmmitarbeiter/locallang_db.xml:user_rmmitarbeiter_main.a0a057a44d',
'config' => array (
'type' => 'input',
'size' => '30',
)
),
'exclude' => 1,
'label' => 'LLL:EXT:user_rmmitarbeiter/locallang_db.xml:user_rmmitarbeiter_main.6d300d70b3',
'config' => array (
'type' => 'group',
'internal_type' => 'file',
'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
'uploadfolder' => 'uploads/tx_userrmmitarbeiter',
'show_thumbs' => 1,
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
),
'types' => array (
'0' => array('showitem' => 'hidden;;1;;1-1-1, ac4ed9e336, a0a057a44d, 6d300d70b3')
),
'palettes' => array (
'1' => array('showitem' => '')
)
);
?>
Die Seiten FE und BE sind nicht mehr zugänglich wenn die Erweiterung installiert ist und ich bekomme die Fehlermeldung am Screen:
Parse error: syntax error, unexpected ',' in /opt/lampp/htdocs/t3/typo3conf/temp_CACHED_FE_ps82cd_ext_tables.php on line 1570
Ich habe geschafft die Seiten wieder zugänglich zu machen, dafür musste ich die Erweiterung deinstallieren.
Bitte kann jemand mir sagen wie ich das Problem beseitigen werden?
Ich bedanke mich in Voraus.
Ranks