Ja. Sorry.
system/modules/rfslideshow/ModuleRFSlideshow.php
PHP-Code:
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
class ModuleRFSlideshow extends Module
{
protected $strTemplate = 'mod_rfslideshow';
/**
* Display a wildcard in the back end
* @return string
*/
public function generate()
{
if (TL_MODE == 'BE')
{
$objTemplate = new BackendTemplate('be_wildcard');
$objTemplate->wildcard = '### Slideshow by Ryan Florence ###';
$objTemplate->id = $this->id;
$objTemplate->link = $this->name;
return $objTemplate->parse();
}
return parent::generate();
}
/**
* Generate module
*/
protected function compile()
{
$this->import('Database');
$objDB = $this->Database->prepare('SELECT * FROM tl_rfslideshow WHERE id = ?')->execute($this->arrData['rfslideshow']);
$this->Template->transition = $objDB->transition;
$this->Template->duration = $objDB->duration;
$this->Template->delay = $objDB->delay;
$this->Template->autoplay = ($objDB->autoplay = 1) ? 'true' : 'false';
$objDB = $this->Database->prepare('SELECT * FROM tl_rfslideshow_elements WHERE pid = ? ORDER BY sorting ASC')->execute($this->arrData['rfslideshow']);
$arrElements = array();
$i=1;
while($objDB->next())
{
$arrElements[$i]['title'] = $objDB->title;
$arrElements[$i]['img'] = $objDB->singleSRC;
$arrElements[$i]['hovertext'] = $objDB->hovertext;
$arrElements[$i]['title'] = $objDB->title;
$arrElements[$i]['menutitle'] = $objDB->menutitle;
$i++;
}
$this->Template->Elements = $arrElements;
}
}
?>
system/modules/rfslideshow/config/config.php
PHP-Code:
<?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rfslideshow/html/Loop.js';
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rfslideshow/html/SlideShow.js';
//$GLOBALS['TL_CSS']['slideshow'] = 'system/modules/slideshow/html/slideshow.css';
/**
* Backend end modules
*/
array_insert($GLOBALS['BE_MOD']['content'], 5, array
(
'rfslideshow' => array
(
'tables' => array('tl_rfslideshow','tl_rfslideshow_elements')
)
));
/**
* Front end modules
*/
array_insert($GLOBALS['FE_MOD']['miscellaneous'],0, array
(
'rfslideshow' => 'ModuleRFSlideShow'
)
);
?>
system/modules/rfslideshow/config/database.sql
PHP-Code:
-- ********************************************************
-- * *
-- * IMPORTANT NOTE *
-- * *
-- * Do not import this file manually but use the Contao *
-- * install tool to create and maintain database tables! *
-- * *
-- ********************************************************
--
-- Table `tl_news`
--
CREATE TABLE `tl_rfslideshow` (
`id` int(10) unsigned NOT NULL auto_increment,
`sorting` int(10) unsigned NOT NULL default '0',
`tstamp` int(10) unsigned NOT NULL default '0',
`title` varchar(255) NOT NULL default '',
`duration` int(10) unsigned NOT NULL default '800',
`delay` int(10) unsigned NOT NULL default '4000',
`autoplay` char(1) NOT NULL default '',
`infobox` char(1) NOT NULL default '',
`transition` varchar(32) NOT NULL default 'fade',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `tl_rfslideshow_elements` (
`id` int(10) unsigned NOT NULL auto_increment,
`pid` int(10) unsigned NOT NULL default '0',
`sorting` int(10) unsigned NOT NULL default '0',
`tstamp` int(10) unsigned NOT NULL default '0',
`title` varchar(255) NOT NULL default '',
`menutitle` varchar(255) NOT NULL default '',
`hovertext` text NULL,
`singleSRC` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `pid` (`pid`),
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `tl_module` (
`rfslideshow` int(10) unsigned NOT NULL default '0',
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Die DCA's auch?
olli
Lesezeichen