From 3347178eee9c0d4b779a172af1139885db5655dc Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 9 Jul 2009 18:59:04 -0700 Subject: Created the dynamic albums module which provides a dynamic album containing either recent updates or most viewed images. --- modules/dynamic/helpers/dynamic_installer.php | 46 +++++++++++++++++++++++++++ modules/dynamic/helpers/dynamic_menu.php | 27 ++++++++++++++++ modules/dynamic/helpers/dynamic_theme.php | 39 +++++++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 modules/dynamic/helpers/dynamic_installer.php create mode 100644 modules/dynamic/helpers/dynamic_menu.php create mode 100644 modules/dynamic/helpers/dynamic_theme.php (limited to 'modules/dynamic/helpers') diff --git a/modules/dynamic/helpers/dynamic_installer.php b/modules/dynamic/helpers/dynamic_installer.php new file mode 100644 index 00000000..8780864b --- /dev/null +++ b/modules/dynamic/helpers/dynamic_installer.php @@ -0,0 +1,46 @@ + false, + "limit" => null, + "description" => "", + "key_field" => "view_count", + "title" => t("Most Viewed")))); + module::set_var("dynamic", "updates", + serialize((object)array("enabled" => false, + "limit" => null, + "description" => "", + "key_field" => "created", + "title" => t("Recent Updates")))); + module::set_version("dynamic", 1); + } + } + + static function upgrade($version) { + } + + static function uninstall() { + /* @todo Put database table drops here */ + module::delete("dynamic"); + } +} diff --git a/modules/dynamic/helpers/dynamic_menu.php b/modules/dynamic/helpers/dynamic_menu.php new file mode 100644 index 00000000..b2c73d6f --- /dev/null +++ b/modules/dynamic/helpers/dynamic_menu.php @@ -0,0 +1,27 @@ +get("content_menu") + ->append(Menu::factory("link") + ->id("dynamic_menu") + ->label(t("Dynamic Albums")) + ->url(url::site("admin/dynamic"))); + } +} diff --git a/modules/dynamic/helpers/dynamic_theme.php b/modules/dynamic/helpers/dynamic_theme.php new file mode 100644 index 00000000..ba355098 --- /dev/null +++ b/modules/dynamic/helpers/dynamic_theme.php @@ -0,0 +1,39 @@ +enabled) { + $albums[$album] = $album_defn->title; + } + } + if (!empty($albums)) { + $block = new Block(); + $block->css_id = "gDynamic"; + $block->title = t("Dynamic Albums"); + $block->content = new View("dynamic_block.html"); + $block->content->albums = $albums; + return $block; + } + return ""; + } + +} -- cgit v1.2.3