From: alex <bin...@li...> - 2001-07-15 00:28:22
|
alex Sat Jul 14 17:28:17 2001 EDT Modified files: /r2/binarycloud/base/core Page.php /r2/binarycloud/user/htdocs index.php Log: Added a unique id capability to page, ala Justin's suggestion. Some differences: we use 'id' not 'tag' and no global, it's $Page->modules_id['module_id']. This works quite nicely, and is convenient. Index: r2/binarycloud/base/core/Page.php diff -u r2/binarycloud/base/core/Page.php:1.9 r2/binarycloud/base/core/Page.php:1.10 --- r2/binarycloud/base/core/Page.php:1.9 Tue Jul 10 14:31:46 2001 +++ r2/binarycloud/base/core/Page.php Sat Jul 14 17:28:10 2001 @@ -1,7 +1,7 @@ <?php // Header {{{ /* - * -File $Id: Page.php,v 1.9 2001/07/10 21:31:46 alex Exp $ + * -File $Id: Page.php,v 1.10 2001/07/15 00:28:10 alex Exp $ * -License LGPL (http://www.gnu.org/copyleft/lesser.html) * -Copyright 2001, The Turing Studio, Inc. * -Authors alex black, en...@tu... @@ -129,10 +129,15 @@ foreach ($modules[$_group]['load'] as $pos=>$mod) { import("user.mod.$mod[package].$mod[name]"); $this->modules[$_group][$pos] = new $mod['name']($mod['options']); + + if (isset($mod['id'])) { + $this->modules_id[$mod['id']] =& $this->modules[$_group][$pos]; + } } } // }}} // {{{ Vars + var $modules_id; var $modules; var $output; var $title; Index: r2/binarycloud/user/htdocs/index.php diff -u r2/binarycloud/user/htdocs/index.php:1.11 r2/binarycloud/user/htdocs/index.php:1.12 --- r2/binarycloud/user/htdocs/index.php:1.11 Tue Jul 10 18:07:56 2001 +++ r2/binarycloud/user/htdocs/index.php Sat Jul 14 17:28:16 2001 @@ -1,7 +1,7 @@ <?php // {{{ Header /* - * -File $Id: index.php,v 1.11 2001/07/11 01:07:56 alex Exp $ + * -File $Id: index.php,v 1.12 2001/07/15 00:28:16 alex Exp $ * -License LGPL (http://www.gnu.org/copyleft/lesser.html) * -Copyright 2001, The Turing Studio, Inc. * -Author alex black, en...@tu... @@ -43,11 +43,13 @@ ), 'load' => array( array( + 'id' => 'mooboo', 'name' => "OtherWorld", 'package' => "hello_world", 'load_order' => "3" ), array( + 'id' => 'some_other_unique_name', 'name' => "Set_Lang_Example", 'package' => "set_lang_example", 'load_order' => "6" |