Ich möchte gerne ein kleines Modul schreiben mmit dem ich GPX Files Verwalten kann
Ich möchte einen Titel, eine Beschreibung und ein Bild anlegen. Und das File auswählen.
Aus irgend einem Grund werden die Daten nicht gespeichert und in der Übersicht angezeigt.
Das Modul wird im BA angezeigt und auch zwei Datensätze.
Es stehen aber bei der übersicht wo man einen Datensatz auswählt und in den Feldern keine Daten drinnen.
Die DB lautet 'tl_gpx_tracks'.
Code:
CREATE TABLE `tl_gpx_tracks` (
`id` int(10) unsigned NOT NULL auto_increment,
`pid` int(10) unsigned NOT NULL default '0',
`sorting` int(10) unsigned NOT NULL default '0',
`title` varchar(64) NOT NULL default '',
`beschreibung` text NULL,
`gpxfile` varchar(64) NOT NULL default '',
`image` varchar(256) NOT NULL default '',
`tstamp` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `pid` (`pid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Code:
<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');
/**
* Contao Open Source CMS
* Copyright (C) 2005-2011 Leo Feyer
*
* Formerly known as TYPOlight Open Source CMS.
*
* This program is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, please visit the Free
* Software Foundation website at <http://www.gnu.org/licenses/>.
*
* PHP version 5
* @copyright 2012
* @author maffy (Matthias Reichert)
* @package wanderwege
* @license GNU/LGPL
* @filesource
*/
/**
* Table tl_gpx_tracks
*/
$GLOBALS['TL_DCA']['tl_gpx_tracks'] = array
(
// Config
'config' => array
(
'dataContainer' => 'Table',
'table' => 'tl_gpx_tracks',
),
// List
'list' => array
(
'sorting' => array
(
'mode' => 1,
'fields' => array('title'),
'flag' => 1,
'headerFields' => array('title'),
'panelLayout' => 'search,limit',
'child_record_callback' => array('tl_gpx_tracks', 'title')
),
'global_operations' => array
(
'all' => array
(
'label' => &$GLOBALS['TL_LANG']['MSC']['all'],
'href' => 'act=select',
'class' => 'header_edit_all',
'attributes' => 'onclick="Backend.getScrollOffset();"'
)
),
'operations' => array
(
'edit' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_gpx_tracks']['edit'],
'href' => 'act=edit',
'icon' => 'edit.gif'
),
'copy' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_gpx_tracks']['copy'],
'href' => 'act=copy',
'icon' => 'copy.gif'
),
'delete' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_gpx_tracks']['delete'],
'href' => 'act=delete',
'icon' => 'delete.gif',
'attributes' => 'onclick="if (!confirm(\'' . $GLOBALS['TL_LANG']['MSC']['deleteConfirm'] . '\')) return false; Backend.getScrollOffset();"'
),
'show' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_gpx_tracks']['show'],
'href' => 'act=show',
'icon' => 'show.gif'
)
)
),
// Palettes
'palettes' => array
(
'__selector__' => array(''),
'default' => '{Allgemeine Infos},title;{GPXFile},Datei auswählen;{Kommentar:hide},Beschreibung'
),
// Fields
'fields' => array
(
'title' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_gpx_tracks']['title'],
'inputType' => 'text',
'search' => true,
'eval' => array('mandatory'=>true, 'maxlength'=>64)
),
'Datei auswählen' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_gpx_tracks']['gpxfile'],
'inputType' => 'fileTree',
'eval' => array('mandatory'=>false, 'files'=>true, 'fieldType'=>'radio',
'filesOnly' => true, 'extensions' => 'gpx', 'path' => 'tl_files/gpxviewer/')
),
'Beschreibung' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_gpx_tracks']['beschreibung'],
'inputType' => 'textarea',
'eval' => array('rte'=>'tinyFlash')
)
)
)
?>
Lesezeichen