summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-03-15 05:15:45 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-03-15 05:15:45 +0000
commit7c5ba9d4229a6e3c258f6a80769e70c5dcd68578 (patch)
treee0f1011cbfb596c0b4ee07b1cbd3392b3f1b97a3
parent181737fb12b04be0ee3d87048efae1dfba33361e (diff)
Refactored the developer module. When a new module is generated a
skeleton adminstration page is generated as well. @todo is still generate a skeleton block and a skeleton dialog.
-rw-r--r--modules/developer/config/developer.php76
-rw-r--r--modules/developer/controllers/admin_developer.php13
-rw-r--r--modules/developer/helpers/developer_task.php77
-rw-r--r--modules/developer/js/developer.js6
-rw-r--r--modules/developer/views/admin_controller.txt.php60
-rw-r--r--modules/developer/views/admin_html.txt.php10
-rw-r--r--modules/developer/views/block.txt.php (renamed from modules/developer/helpers/developer_theme.php)13
-rw-r--r--modules/developer/views/developer_module.html.php6
-rw-r--r--modules/developer/views/event.txt.php96
-rw-r--r--modules/developer/views/installer.txt.php9
-rw-r--r--modules/developer/views/menu.txt.php42
-rw-r--r--modules/developer/views/theme.txt.php163
12 files changed, 496 insertions, 75 deletions
diff --git a/modules/developer/config/developer.php b/modules/developer/config/developer.php
index eed26771..35ef0acd 100644
--- a/modules/developer/config/developer.php
+++ b/modules/developer/config/developer.php
@@ -17,30 +17,54 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
+
+/**
+ * Defines the available callback methods
+ */
$config["methods"] = array(
- "theme" => array("album_blocks" => "", "album_bottom" => "",
- "album_top" => "", "admin_credits" => "",
- "admin_footer" => "", "admin_header_top" => "",
- "admin_header_bottom" => "", "admin_page_bottom" => "",
- "admin_page_top" => "", "admin_head" => "",
- "credits" => "", "dynamic_bottom" => "",
- "dynamic_top" => "", "footer" => "",
- "head" => "", "header_bottom" => "",
- "header_top" => "", "page_bottom" => "",
- "page_top" => "", "photo_blocks" => "",
- "photo_bottom" => "", "photo_top" => "",
- "sidebar_blocks" => "", "sidebar_bottom" => "",
- "sidebar_top" => "", "thumb_bottom" => "\$child",
- "thumb_info" => "\$child", "thumb_top" => "\$child"),
- "menu" => array("admin" => "\$menu, \$theme", "album" => "\$menu, \$theme",
- "photo" => "\$menu, \$theme", "site" => "\$menu, \$theme"),
- "block" => array("get" => "\$block_id", "get_list" => ""),
- "event" => array("batch_complete" => "", "comment_add_form" => "\$form",
- "comment_created" => "\$theme, \$args", "comment_updated" => "\$old, \$new",
- "group_before_delete" => "\$group", "group_created" => "\$group",
- "item_before_delete" => "\$item", "item_created" => "\$item",
- "item_related_update" => "\$item", "item_related_update_batch" => "\$sql",
- "item_updated" => "\$old, \$new", "user_before_delete" => "\$user",
- "user_created" => "\$user", "user_login" => "\$user",
- "user_logout" => "\$user" ),
- "installer" => array("install" => "", "uninstall" => "")); \ No newline at end of file
+ "theme" => array("album_blocks" => t("Album block"),
+ "album_bottom" => t("Bottom of album content"),
+ "album_top" => t("Top of Album content"),
+ "admin_credits" => t("Administration page credits"),
+ "admin_footer" => t("Adminsitration page footer"),
+ "admin_header_top" => t("Top of administration page header"),
+ "admin_header_bottom" => t("Bottom of administration page header"),
+ "admin_page_bottom" => t("Bottom of administration page"),
+ "admin_page_top" => t("Top of administration page"),
+ "admin_head" => t("Adminstration page head"),
+ "credits" => t("Album or photo page credits"),
+ "dynamic_bottom" => t("Bottom of dynamic page content"),
+ "dynamic_top" => t("Top of dynamic page content"),
+ "footer" => t("Album or photo page footer"),
+ "head" => t("Album or photo page head"),
+ "header_bottom" => t("Album or photo header bottom"),
+ "header_top" => t("Album or photo header top"),
+ "page_bottom" => t("Album or photo bottom"),
+ "page_top" => t("Album or photo top"),
+ "photo_blocks" => t("Photo block"),
+ "photo_bottom" => t("Bottom of photo content"),
+ "photo_top" => t("Top of photo content"),
+ "sidebar_blocks" => t("Sidebar block"),
+ "sidebar_bottom" => t("Bottom of sidebar"),
+ "sidebar_top" => t("Top of sidebar"),
+ "thumb_bottom" => t("Bottom of thumbnail"),
+ "thumb_info" => t("Thumbnail information"),
+ "thumb_top" => t("Top of thumbnail display")),
+ "menu" => array("album" => t("Add an album menu element"),
+ "photo" => t("Add an photo menu element")),
+ "event" => array("batch_complete" => t("Batch completion"),
+ "comment_add_form" => t("Comment add form creation"),
+ "comment_created" => t("Comment created"),
+ "comment_updated" => t("Comment updated"),
+ "group_before_delete" => t("Before delete group"),
+ "group_created" => t("Group created"),
+ "item_before_delete" => t("Before album or photo deletion"),
+ "item_created" => t("Album or photo created"),
+ "item_related_update" => t("Photo meta data update"),
+ "item_related_update_batch" => t("Photo meta data update"),
+ "item_updated" => t("Album or photo update"),
+ "user_before_delete" => t("Before user deletion"),
+ "user_created" => t("User created"),
+ "user_login" => t("User login"),
+ "user_logout" => t("User logout")));
+ \ No newline at end of file
diff --git a/modules/developer/controllers/admin_developer.php b/modules/developer/controllers/admin_developer.php
index 3811862e..0f4eb125 100644
--- a/modules/developer/controllers/admin_developer.php
+++ b/modules/developer/controllers/admin_developer.php
@@ -45,9 +45,7 @@ class Admin_Developer_Controller extends Admin_Controller {
->callback("developer_task::create_module")
->description(t("Create a new module"))
->name(t("Create Module"));
- $path_part = strtr(strtolower($post->name), " ", "_");
- $task = task::create($task_def, array_merge(array("step" => 0, "path_part" => $path_part),
- $post->as_array()));
+ $task = task::create($task_def, array_merge(array("step" => 0), $post->as_array()));
print json_encode(array("result" => "started",
"url" => url::site("admin/developer/run_create/{$task->id}?csrf=" .
@@ -94,10 +92,9 @@ class Admin_Developer_Controller extends Admin_Controller {
$v = new View("developer_module.html");
$v->action = "admin/developer/module_create";
$v->hidden = array("csrf" => access::csrf_token());
- $v->theme = array_combine(array_keys($config["theme"]), array_keys($config["theme"]));
- $v->block = array_combine(array_keys($config["block"]), array_keys($config["block"]));
- $v->event = array_combine(array_keys($config["event"]), array_keys($config["event"]));
- $v->menu = array_combine(array_keys($config["menu"]), array_keys($config["menu"]));
+ $v->theme = $config["theme"];
+ $v->event = $config["event"];
+ $v->menu = $config["menu"];
$v->form = $form;
$v->errors = $errors;
return $v;
@@ -112,7 +109,7 @@ class Admin_Developer_Controller extends Admin_Controller {
private function _get_module_form($name="", $description="") {
$form = array("name" => "", "description" => "", "theme[]" => array(), "menu[]" => array(),
- "block[]" => array(), "event[]" => array());
+ "event[]" => array());
$errors = array_fill_keys(array_keys($form), "");
return array($form, $errors);
diff --git a/modules/developer/helpers/developer_task.php b/modules/developer/helpers/developer_task.php
index 532d3a8d..d1b8e288 100644
--- a/modules/developer/helpers/developer_task.php
+++ b/modules/developer/helpers/developer_task.php
@@ -25,68 +25,97 @@ class developer_task_Core {
static function create_module($task) {
$context = unserialize($task->context);
- $module_path = (MODPATH . "{$context['path_part']}");
+
+ if (empty($context["module"])) {
+ $context["class_name"] = strtr($context["name"], " ", "_");
+ $context["module"] = strtolower($context["class_name"]);
+ $context["module_path"] = (MODPATH . $context["module"]);
+ }
switch ($context["step"]) {
case 0: // Create directory tree
+ Kohana::log("debug", Kohana::debug($context));
foreach (array("", "controllers", "helpers", "js", "views") as $dir) {
- $path = "$module_path/$dir";
+ $path = "{$context['module_path']}/$dir";
if (!file_exists($path)) {
- mkdir($path, 0774);
- }
+ mkdir($path);
+ chmod($path, 0774);
+ }
}
break;
case 1: // Generate installer
- ob_start();
- $v = new View("installer.txt");
- $v->module_name = $context['name'];
- $v->callbacks = $context["theme"];
- print $v->render();
- file_put_contents("$module_path/helpers/{$context['name']}_installer.php", ob_get_contents());
- ob_end_clean();
+ $context["installer"] = 1;
+ self::_render_helper_file($context, "installer");
break;
case 2: // Generate theme helper
self::_render_helper_file($context, "theme");
break;
case 3: // Generate block helper
+ $context["block"] = 1;
self::_render_helper_file($context, "block");
break;
case 4: // Generate menu helper
+ $context["menu"] = empty($context["menu"]) ? 1 : $context["menu"];
self::_render_helper_file($context, "menu");
break;
case 5: // Generate event helper
self::_render_helper_file($context, "event");
break;
- case 6: // Generate module.info (do last)
+ case 6: // Generate admin controller
+ $file = "{$context['module_path']}/controllers/admin_{$context['module']}.php";
+ ob_start();
+ $v = new View("admin_controller.txt");
+ $v->name = $context["name"];
+ $v->module = $context["module"];
+ $v->class_name = $context["class_name"];
+ print $v->render();
+ file_put_contents($file, ob_get_contents());
+ ob_end_clean();
+ break;
+ case 7: // Generate admin form
+ $file = "{$context['module_path']}/views/admin_{$context['module']}.html.php";
+ Kohana::log("debug", $file);
+ ob_start();
+ $v = new View("admin_html.txt");
+ $v->name = $context["name"];
+ $v->module = $context["module"];
+ $v->class = strtr($context["name"], " ", "");
+ Kohana::log("debug", Kohana::debug($v->render()));
+ print $v->render();
+ file_put_contents($file, ob_get_contents());
+ ob_end_clean();
+ break;
+ case 8: // Generate module.info (do last)
+ $file = "{$context["module_path"]}/module.info";
ob_start();
$v = new View("module_info.txt");
- $v->module_name = $context['name'];
+ $v->module_name = $context["name"];
$v->module_description = $context["description"];
print $v->render();
- file_put_contents("$module_path/module.info", ob_get_contents());
+ file_put_contents($file, ob_get_contents());
ob_end_clean();
break;
}
- $task->done = (++$context["step"]) >= 7;
+ $task->done = (++$context["step"]) >= 9;
$task->context = serialize($context);
$task->state = "success";
- $task->percent_complete = ($context["step"] / 7.0) * 100;
+ $task->percent_complete = ($context["step"] / 9.0) * 100;
}
private static function _render_helper_file($context, $helper) {
if (!empty($context[$helper])) {
$config = Kohana::config("developer.methods");
+ $file = "{$context["module_path"]}/helpers/{$context["module"]}_{$helper}.php";
+ touch($file);
+ chmod($file, 0772);
ob_start();
- $v = new View("helpers.txt");
+ $v = new View("$helper.txt");
$v->helper = $helper;
- $v->module_name = $context['name'];
- $v->callbacks = array();
- foreach ($context[$helper] as $callback) {
- $v->callbacks[$callback] = $config[$helper][$callback];
- }
+ $v->module = $context["module"];
+ $v->module_name = $context["name"];
+ $v->callbacks = empty($context[$helper]) ? array() : array_fill_keys($context[$helper], 1);
print $v->render();
- file_put_contents(MODPATH . "{$context['name']}/helpers/{$context['name']}_{$helper}.php",
- ob_get_contents());
+ file_put_contents($file, ob_get_contents());
ob_end_clean();
}
}
diff --git a/modules/developer/js/developer.js b/modules/developer/js/developer.js
index 2440bad4..4d60b5da 100644
--- a/modules/developer/js/developer.js
+++ b/modules/developer/js/developer.js
@@ -3,12 +3,13 @@ $("#gDeveloperTools").ready(function() {
});
var module_success = function(data) {
- $("#gGenerateModule").after('<div id="moduleProgress" style="margin-left: 5em;"></div>');
+ $("#gGenerateModule").after('<div id="moduleProgress" style="margin-left: 5.5em;"></div>');
$("#moduleProgress").progressbar();
var task = data.task;
var url = data.url;
var done = false;
+ var counter = 0;
while (!done) {
$.ajax({async: false,
success: function(data, textStatus) {
@@ -19,6 +20,7 @@ var module_success = function(data) {
type: "POST",
url: url
});
+ done = done || ++counter >= 10;
}
document.location.reload();
};
@@ -27,7 +29,7 @@ function ajaxify_developer_form(selector, success) {
$(selector).ajaxForm({
dataType: "json",
success: function(data) {
- if (data.form && data.reseult != "started") {
+ if (data.form && data.result != "started") {
$(selector).replaceWith(data.form);
ajaxify_developer_form(selector, success);
}
diff --git a/modules/developer/views/admin_controller.txt.php b/modules/developer/views/admin_controller.txt.php
new file mode 100644
index 00000000..42b5ff38
--- /dev/null
+++ b/modules/developer/views/admin_controller.txt.php
@@ -0,0 +1,60 @@
+<?php defined("SYSPATH") or die("No direct script access."); ?>
+<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2008 Bharat Mediratta
+ *
+ * This program 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.
+ *
+ * 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class Admin_<?= $class_name ?>_Controller extends Admin_Controller {
+ public function index() {
+ $view = new Admin_View("admin.html");
+ $view->content = new View("admin_<?=$module ?>.html");
+ $view->content->form = $this->_get_admin_form();
+
+ print $view;
+ }
+
+ public function handler() {
+ access::verify_csrf();
+
+ $form = $this->_get_admin_form();
+ if ($form->validate()) {
+ // @todo process the admin form
+
+ message::success(t("<?= $name ?> Adminstration Complete Successfully"));
+
+ url::redirect("admin/<?= $module ?>");
+ }
+ $view = new Admin_View("admin.html");
+ $view->content = new View("admin_<?=$module ?>.html");
+ $view->content->form = $form;
+
+ print $view;
+ }
+
+ private function _get_admin_view($form=null) {
+ }
+
+ private function _get_admin_form() {
+ $form = new Forge("admin/<?= $module ?>/handler", "", "post",
+ array("id" => "gAdminForm"));
+ $group = $form->group("group");
+ $group->input("text")->label(t("Text"))->rules("required");
+ $group->submit("submit")->value(t("Submit"));
+
+ return $form;
+ }
+} \ No newline at end of file
diff --git a/modules/developer/views/admin_html.txt.php b/modules/developer/views/admin_html.txt.php
new file mode 100644
index 00000000..34b699d7
--- /dev/null
+++ b/modules/developer/views/admin_html.txt.php
@@ -0,0 +1,10 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\") ?>" ?>
+
+<div id="gAdmin<?= $class ?>">
+ <h2>
+ <?= "<?= t(\"$name Adminstration\") ?>" ?>
+ </h2>
+ <?= "<?= \$form ?>" ?>
+
+</div>
diff --git a/modules/developer/helpers/developer_theme.php b/modules/developer/views/block.txt.php
index 168b1e4c..b8a96da0 100644
--- a/modules/developer/helpers/developer_theme.php
+++ b/modules/developer/views/block.txt.php
@@ -1,4 +1,5 @@
-<?php defined("SYSPATH") or die("No direct script access.");
+<?php defined("SYSPATH") or die("No direct script access."); ?>
+<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2008 Bharat Mediratta
@@ -17,9 +18,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class developer_theme_Core {
- static function admin_head($theme) {
- $url = url::file("modules/developer/js/developer.js");
- return "<script src=\"$url\" type=\"text/javascript\"></script>";
+class <?= $module ?>_block {
+ static function get($block_id) {
}
-} \ No newline at end of file
+ static function get_list() {
+ }
+}
diff --git a/modules/developer/views/developer_module.html.php b/modules/developer/views/developer_module.html.php
index d572ecfb..4ce28ff7 100644
--- a/modules/developer/views/developer_module.html.php
+++ b/modules/developer/views/developer_module.html.php
@@ -32,12 +32,8 @@ $("#gModuleCreateForm").ready(function() {
<?= form::dropdown(array("name" => "theme[]", "multiple" => true, "size" => 6), $theme, $form["theme[]"]) ?>
</li>
<li>
- <?= form::label("block[]", t("Block Callbacks")) ?>
- <?= form::dropdown(array("name" => "block[]", "multiple" => true, "size" => 6), $block, $form["block[]"]) ?>
- </li>
- <li>
<?= form::label("menu[]", t("Menu Callback")) ?>
- <?= form::dropdown(array("name" => "menu[]", "multiple" => true, "size" => 6), $menu, $form["block[]"]) ?>
+ <?= form::dropdown(array("name" => "menu[]", "multiple" => true, "size" => 6), $menu, $form["menu[]"]) ?>
</li>
<li>
<?= form::label("event[]", t("Gallery Event Handlers")) ?>
diff --git a/modules/developer/views/event.txt.php b/modules/developer/views/event.txt.php
new file mode 100644
index 00000000..e2731f96
--- /dev/null
+++ b/modules/developer/views/event.txt.php
@@ -0,0 +1,96 @@
+<?php defined("SYSPATH") or die("No direct script access."); ?>
+<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2008 Bharat Mediratta
+ *
+ * This program 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.
+ *
+ * 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class <?= $module ?>_event {
+<? if (!empty($callbacks["batch_complete"])): ?>
+ static function batch_complete() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["comment_add_form"])): ?>
+ static function comment_add_form($form) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["comment_created"])): ?>
+ static function comment_created($theme, $args) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["comment_updated"])): ?>
+ static function comment_updated($old, $new) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["group_before_delete"])): ?>
+ static function group_before_delete($group) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["group_created"])): ?>
+ static function group_created($group) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["item_before_delete"])): ?>
+ static function item_before_delete($item) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["item_created"])): ?>
+ static function item_created($item) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["item_related_update"])): ?>
+ static function item_related_update($item) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["item_related_update_batch"])): ?>
+ static function item_related_update_batch($sql) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["item_updated"])): ?>
+ static function item_updated($old, $new) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["user_before_delete"])): ?>
+ static function user_before_delete($user) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["user_created"])): ?>
+ static function user_created($user) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["user_login"])): ?>
+ static function user_login($user) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["user_logout"])): ?>
+ static function user_logout($user) {
+ }
+<? endif ?>
+}
diff --git a/modules/developer/views/installer.txt.php b/modules/developer/views/installer.txt.php
index 81d6d795..1ccc3327 100644
--- a/modules/developer/views/installer.txt.php
+++ b/modules/developer/views/installer.txt.php
@@ -18,16 +18,17 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
-class <?= $module_name ?>_installer {
+class <?= $module ?>_installer {
static function install() {
- $version = module::get_version("<?= $module_name ?>");
+ $version = module::get_version("<?= $module ?>");
if ($version == 0) {
/* @todo Put database creation here */
- module::set_version("<?= $module_name ?>", 1);
+ module::set_version("<?= $module ?>", 1);
}
}
static function uninstall() {
- module::delete("<?= $module_name ?>");
+ /* @todo Put database table drops here */
+ module::delete("<?= $module ?>");
}
}
diff --git a/modules/developer/views/menu.txt.php b/modules/developer/views/menu.txt.php
new file mode 100644
index 00000000..5404f6c5
--- /dev/null
+++ b/modules/developer/views/menu.txt.php
@@ -0,0 +1,42 @@
+<?php defined("SYSPATH") or die("No direct script access."); ?>
+<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2008 Bharat Mediratta
+ *
+ * This program 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.
+ *
+ * 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class <?= $module ?>_menu {
+ static function admin($menu, $theme) {
+ $menu->get("settings_menu")
+ ->append(Menu::factory("link")
+ ->id("<?= $module ?>_menu")
+ ->label(t("<?= $module_name ?> Administration"))
+ ->url(url::site("admin/<?= $module ?>")));
+ }
+
+<? if (!empty($callbacks["album"])): ?>
+ static function album($menu, $theme) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["photo"])): ?>
+ static function photo($menu, $theme) {
+ }
+
+<? endif ?>
+ static function site($menu, $theme) {
+ }
+}
diff --git a/modules/developer/views/theme.txt.php b/modules/developer/views/theme.txt.php
new file mode 100644
index 00000000..df7b18e0
--- /dev/null
+++ b/modules/developer/views/theme.txt.php
@@ -0,0 +1,163 @@
+<?php defined("SYSPATH") or die("No direct script access."); ?>
+<?= "<?php defined(\"SYSPATH\") or die(\"No direct script access.\");" ?>
+/**
+ * Gallery - a web based photo album viewer and editor
+ * Copyright (C) 2000-2008 Bharat Mediratta
+ *
+ * This program 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.
+ *
+ * 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+class <?= $module ?>_theme {
+
+<? if (!empty($callbacks["album_blocks"])): ?>
+ static function album_blocks() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["album_bottom"])): ?>
+ static function album_bottom() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["album_top"])): ?>
+ static function album_top() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["admin_credits"])): ?>
+ static function admin_credits() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["photo"])): ?>
+ static function admin_footer() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["admin_header_top"])): ?>
+ static function admin_header_top() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["admin_header_bottom"])): ?>
+ static function admin_header_bottom() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["admin_page_bottom"])): ?>
+ static function admin_page_bottom() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["admin_page_top"])): ?>
+ static function admin_page_top() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["admin_head"])): ?>
+ static function admin_head() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["credits"])): ?>
+ static function credits() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["dynamic_bottom"])): ?>
+ static function dynamic_bottom() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["dynamic_top"])): ?>
+ static function dynamic_top() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["footer"])): ?>
+ static function footer() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["head"])): ?>
+ static function head() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["header_bottom"])): ?>
+ static function header_bottom() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["header_top"])): ?>
+ static function header_top() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["page_bottom"])): ?>
+ static function page_bottom() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["pae_top"])): ?>
+ static function page_top() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["photo_blocks"])): ?>
+ static function photo_blocks() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["photo_bottom"])): ?>
+ static function photo_bottom() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["photo_top"])): ?>
+ static function photo_top() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["sidebar_blocks"])): ?>
+ static function sidebar_blocks() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["sidebar_bottom"])): ?>
+ static function sidebar_bottom() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["sidebar_top"])): ?>
+ static function sidebar_top() {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["thumb_bottom"])): ?>
+ static function thumb_bottom($child) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["thumb_info"])): ?>
+ static function thumb_info($child) {
+ }
+
+<? endif ?>
+<? if (!empty($callbacks["thumb_top"])): ?>
+ static function thumb_top($child) {
+ }
+
+<? endif ?>
+}