From 4bf486955cea9e2b67531f044c6bf34a7bc9324f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 18 Nov 2008 19:09:24 +0000 Subject: The start of the slideshow module. Mostly framework stuff, no real implementation yet --- core/config/config.php | 2 +- modules/slideshow/controllers/slideshow.php | 50 +++++++++++++++++++++++ modules/slideshow/helpers/slideshow_installer.php | 33 +++++++++++++++ modules/slideshow/views/slideshow_feed.rss.php | 20 +++++++++ themes/default/js/slideshow.js | 3 ++ themes/default/views/album.html.php | 2 +- themes/default/views/page.html.php | 1 + themes/default/views/photo.html.php | 2 +- 8 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 modules/slideshow/controllers/slideshow.php create mode 100644 modules/slideshow/helpers/slideshow_installer.php create mode 100644 modules/slideshow/views/slideshow_feed.rss.php create mode 100644 themes/default/js/slideshow.js diff --git a/core/config/config.php b/core/config/config.php index 3a81f112..2791bd76 100644 --- a/core/config/config.php +++ b/core/config/config.php @@ -129,6 +129,6 @@ $config['modules'] = array MODPATH . 'user', MODPATH . 'info', MODPATH . 'gmaps', - MODPATH . 'auth', + MODPATH . 'slideshow', MODPATH . 'comment', ); diff --git a/modules/slideshow/controllers/slideshow.php b/modules/slideshow/controllers/slideshow.php new file mode 100644 index 00000000..57553227 --- /dev/null +++ b/modules/slideshow/controllers/slideshow.php @@ -0,0 +1,50 @@ +input->get("offset", 0); + $children = array(); + // @todo actually fill the array + switch ($output_format) { + case "json": + print json_encode($children); + break; + case "rss": + $view = new View("slideshow_feed.rss"); + $view->item = $parent; + $view->children = $children; + break; + default: + throw new Exception("@todo Unsupported output format: $output_format"); + } + } + + /** + * Override the get_output_format. We want to restrict the check to only $_GET and set the + * default to rss. + * @return string + */ + protected function get_output_format() { + return $this->input->get("_format", "rss"); + } +} \ No newline at end of file diff --git a/modules/slideshow/helpers/slideshow_installer.php b/modules/slideshow/helpers/slideshow_installer.php new file mode 100644 index 00000000..bd8ef4fc --- /dev/null +++ b/modules/slideshow/helpers/slideshow_installer.php @@ -0,0 +1,33 @@ + +"; ?> + + + <?= $item->title ?> + id") ?> + description ?> + en-us + + + + + + + + + \ No newline at end of file diff --git a/themes/default/js/slideshow.js b/themes/default/js/slideshow.js new file mode 100644 index 00000000..35f792b8 --- /dev/null +++ b/themes/default/js/slideshow.js @@ -0,0 +1,3 @@ +function slideshow(parent_id) { + alert("Start a slideshow showing all the items that have the id " + parent_id + " as a descendent"); +} \ No newline at end of file diff --git a/themes/default/views/album.html.php b/themes/default/views/album.html.php index b59dba01..b2617998 100644 --- a/themes/default/views/album.html.php +++ b/themes/default/views/album.html.php @@ -2,7 +2,7 @@

title_edit ?>

description_edit ?> - Slideshow + Slideshow