1
0

Change the developer module to generate the <module>_block.php to the new API.

This commit is contained in:
Tim Almdal 2009-09-30 20:25:44 -07:00
parent 10231b5718
commit c625e416b2

View File

@ -1,5 +1,6 @@
<?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-2009 Bharat Mediratta
@ -21,18 +22,32 @@
class <?= $module ?>_block {
static function get($block_id) {
$block = new Block();
if ($block_id == "<?= $module ?>") {
switch ($block_id) {
case "<?= "{$module}_admin" ?>":
$block->css_id = "g<?= $css_id ?>Admin";
$block->title = t("<?= $module ?> Dashboard Block");
$block->content = new View("<?= $module ?>block.html");
$block->content = new View("admin_<?= $module ?>_block.html");
$block->content->item = ORM::factory("item", 1);
break;
case "<?= "{$module}_site" ?>":
$block->css_id = "g<?= $css_id ?>Site";
$block->title = t("<?= $module ?> Sidebar Block");
$block->content = new View("<?= $module ?>_block.html");
$block->content->item = ORM::factory("item", 1);
break;
}
return $block;
}
static function get_list() {
static function get_site_list() {
return array(
"<?= $module ?>" => t("<?= $name ?> Dashboard Block"));
"<?= "{$module}_site" ?>" => t("<?= $name ?> Sidebar Block"));
}
static function get_admin_list() {
return array(
"<?= "{$module}_admin" ?>" => t("<?= $name ?> Dashboard Block"));
}
}