diff options
Diffstat (limited to 'modules/developer/views')
-rw-r--r-- | modules/developer/views/admin_developer.html.php | 15 | ||||
-rw-r--r-- | modules/developer/views/developer_module.html.php | 53 | ||||
-rw-r--r-- | modules/developer/views/helpers.txt.php | 26 | ||||
-rw-r--r-- | modules/developer/views/installer.txt.php | 33 | ||||
-rw-r--r-- | modules/developer/views/module_info.txt.php | 5 |
5 files changed, 132 insertions, 0 deletions
diff --git a/modules/developer/views/admin_developer.html.php b/modules/developer/views/admin_developer.html.php new file mode 100644 index 00000000..eeebaa03 --- /dev/null +++ b/modules/developer/views/admin_developer.html.php @@ -0,0 +1,15 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<?= html::script("modules/developer/js/developer.js") ?> +<div id="gDeveloper"> + <h2> + <?= t("Developer Tools") ?> + </h2> + <div id="gDeveloperTools"> + <ul> + <li><a href="#create-module"><span><?= t("Create new module") ?></span></a></li> + </ul> + <div id="#create-module"> + <?= $module_create ?> + </div> + </div> +</div> diff --git a/modules/developer/views/developer_module.html.php b/modules/developer/views/developer_module.html.php new file mode 100644 index 00000000..d572ecfb --- /dev/null +++ b/modules/developer/views/developer_module.html.php @@ -0,0 +1,53 @@ +<?php defined("SYSPATH") or die("No direct script access.") ?> +<script> +$("#gModuleCreateForm").ready(function() { + ajaxify_developer_form("#gModuleCreateForm form", module_success); +}); + +</script> +<div id="gModuleCreateForm"> + <?= form::open($action, array("method" => "post"), $hidden) ?> + <ul> + <li <? if (!empty($errors["name"])): ?> class="gError"<? endif ?>> + <?= form::label("name", t("Name")) ?> + <?= form::input("name", $form["name"]) ?> + <? if (!empty($errors["name"]) && $errors["name"] == "required"): ?> + <p class="gError"><?= t("Module name is required") ?></p> + <? endif ?> + <? if (!empty($errors["name"]) && $errors["name"] == "module_exists"): ?> + <p class="gError"><?= t("Module is already implemented") ?></p> + <? endif ?> + </li> + <li <? if (!empty($errors["description"])): ?> class="gError"<? endif ?>> + <?= form::label("description", t("Description")) ?> + <?= form::input("description", $form["description"]) ?> + <? if (!empty($errors["description"]) && $errors["description"] == "required"): ?> + <p class="gError"><?= t("Module description is required")?></p> + <? endif ?> + </li> + <li> + <ul> + <li> + <?= form::label("theme[]", t("Theme Callbacks")) ?> + <?= 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[]"]) ?> + </li> + <li> + <?= form::label("event[]", t("Gallery Event Handlers")) ?> + <?= form::dropdown(array("name" => "event[]", "multiple" => true, "size" => 6), $event, $form["event[]"]) ?> + </li> + </ul> + </li> + <li> + <?= form::submit(array("id" => "gGenerateModule", "name" => "generate", "class" => "submit"), t("Generate")) ?> + </li> + </ul> + <?= form::close() ?> +</div> diff --git a/modules/developer/views/helpers.txt.php b/modules/developer/views/helpers.txt.php new file mode 100644 index 00000000..648015d0 --- /dev/null +++ b/modules/developer/views/helpers.txt.php @@ -0,0 +1,26 @@ +<?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_name ?>_<?= $helper ?> { +<? foreach ($callbacks as $callback => $args): ?> + static function <?= $callback ?>(<?= $args ?>) { + } +<? endforeach ?> +} diff --git a/modules/developer/views/installer.txt.php b/modules/developer/views/installer.txt.php new file mode 100644 index 00000000..81d6d795 --- /dev/null +++ b/modules/developer/views/installer.txt.php @@ -0,0 +1,33 @@ +<?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_name ?>_installer { + static function install() { + $version = module::get_version("<?= $module_name ?>"); + if ($version == 0) { + /* @todo Put database creation here */ + module::set_version("<?= $module_name ?>", 1); + } + } + + static function uninstall() { + module::delete("<?= $module_name ?>"); + } +} diff --git a/modules/developer/views/module_info.txt.php b/modules/developer/views/module_info.txt.php new file mode 100644 index 00000000..4c4b4280 --- /dev/null +++ b/modules/developer/views/module_info.txt.php @@ -0,0 +1,5 @@ +name = <?= $module_name ?> + +description = <?= $module_description ?> + +version = 1 |