From ae45b7ad8f896784fe169d02c726098284f14f25 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sun, 22 Jun 2003 16:17:05 +0000 Subject: [PATCH 1/1] WARNING: This is a broken revision!!! A lot of changes. Moving to a new structure: - New modules directory. - UML diagram splited, every module has its own UML diagram in the module directory. - xmi2code per module configuration. - bife module is the BIFE Core. - basic module is a sample BIFE Core implementation. - Any other modules has it own "namespace". - A lot of things need to be fixed and re-thought. --- Makefile | 24 + doc/bife.xmi | 615 ------------------ examples/index.php | 3 - modules/album/BIFE/Album/Pager.php | 90 +++ .../album/BIFE/Album/Photo.php | 10 +- .../album/BIFE/Album/Thumbs.php | 10 +- modules/album/Makefile | 35 + modules/album/album.xmi | 141 ++++ .../album/xmi2code.config | 8 +- {src => modules/basic}/BIFE/Copy.php | 2 +- {src => modules/basic}/BIFE/Generic.php | 2 +- {src => modules/basic}/BIFE/Link.php | 0 {src => modules/basic}/BIFE/Page.php | 2 +- {src => modules/basic}/BIFE/Title.php | 0 modules/basic/Makefile | 35 + modules/basic/basic.xmi | 190 ++++++ modules/basic/xmi2code.config | 47 ++ {src => modules/bife}/BIFE/Container.php | 0 {src => modules/bife}/BIFE/Fallback.php | 0 {src => modules/bife}/BIFE/Parser.php | 0 {src => modules/bife}/BIFE/Root.php | 1 + {src => modules/bife}/BIFE/Widget.php | 0 {src => modules/bife}/HTML/Template/HIT.php | 0 modules/bife/Makefile | 35 + modules/bife/bife.xmi | 248 +++++++ modules/bife/xmi2code.config | 47 ++ {src/BIFE => modules/menu/BIFE/Menu}/Menu.php | 6 +- modules/menu/Makefile | 35 + modules/menu/menu.xmi | 70 ++ modules/menu/xmi2code.config | 47 ++ 30 files changed, 1065 insertions(+), 638 deletions(-) delete mode 100644 doc/bife.xmi create mode 100644 modules/album/BIFE/Album/Pager.php rename src/BIFE/AlbumPhoto.php => modules/album/BIFE/Album/Photo.php (94%) rename src/BIFE/Album.php => modules/album/BIFE/Album/Thumbs.php (98%) create mode 100644 modules/album/Makefile create mode 100644 modules/album/album.xmi rename xmi2code.config => modules/album/xmi2code.config (93%) rename {src => modules/basic}/BIFE/Copy.php (98%) rename {src => modules/basic}/BIFE/Generic.php (98%) rename {src => modules/basic}/BIFE/Link.php (100%) rename {src => modules/basic}/BIFE/Page.php (99%) rename {src => modules/basic}/BIFE/Title.php (100%) create mode 100644 modules/basic/Makefile create mode 100644 modules/basic/basic.xmi create mode 100644 modules/basic/xmi2code.config rename {src => modules/bife}/BIFE/Container.php (100%) rename {src => modules/bife}/BIFE/Fallback.php (100%) rename {src => modules/bife}/BIFE/Parser.php (100%) rename {src => modules/bife}/BIFE/Root.php (99%) rename {src => modules/bife}/BIFE/Widget.php (100%) rename {src => modules/bife}/HTML/Template/HIT.php (100%) create mode 100644 modules/bife/Makefile create mode 100644 modules/bife/bife.xmi create mode 100644 modules/bife/xmi2code.config rename {src/BIFE => modules/menu/BIFE/Menu}/Menu.php (96%) create mode 100644 modules/menu/Makefile create mode 100644 modules/menu/menu.xmi create mode 100644 modules/menu/xmi2code.config diff --git a/Makefile b/Makefile index 407e379..2cf53b3 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,8 @@ PHP_FILES=src/BIFE/*.php META_FILES=xmi2code.config xmi2code.tpl.php Makefile Doxyfile package.xml DOC_FILES=doc/bife.xmi APIDOC_FILES=doc/api/* doc/api/*/* +CORE_FILES=src/BIFE/Widget.php src/BIFE/Container.php src/BIFE/Root.php src/BIFE/Fallback.php src/BIFE/Parser.php +X2C_TEMPLATE=xmi2code.tpl.php code: doc/bife.xmi xmi2code.config xmi2code -a @@ -58,3 +60,25 @@ pear-packages: BIFE-$(VERSION).tgz BIFE-$(VERSION).tgz: $(PHP_FILES) $(DOC_FILES) package.xml pear package + +build/BIFE.php: $(CORE_FILES) $(X2C_TEMPLATE) + @( \ + ( \ + cat $(X2C_TEMPLATE) | \ + grep -v '@@date' | \ + grep -v '$$Id' | \ + egrep -v '^//$$' \ + ); \ + echo '//'; \ + echo -n '// BIFE Core Version $(VERSION) - '; \ + date; \ + echo '//'; \ + ( \ + cat $(CORE_FILES) | \ + grep -v require_once | \ + grep -v '?>' | \ + grep -v '' \ + ) > build/BIFE.php diff --git a/doc/bife.xmi b/doc/bife.xmi deleted file mode 100644 index b8a9ac7..0000000 --- a/doc/bife.xmi +++ /dev/null @@ -1,615 +0,0 @@ - - - - - umbrello uml modeller http://uml.sf.net - 1.1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/index.php b/examples/index.php index d00262c..72fc369 100644 --- a/examples/index.php +++ b/examples/index.php @@ -32,7 +32,6 @@ unset($tmp); umask('002'); require_once 'HTML/Template/HIT.php'; -#require_once 'HTML/Template/Sigma.php'; require_once 'BIFE/Parser.php'; require_once 'BIFE/Copy.php'; require_once 'BIFE/Page.php'; @@ -45,8 +44,6 @@ require_once 'BIFE/Link.php'; $file = isset($_REQUEST['BIFE']) ? $_REQUEST['BIFE'] : 'index.xbf'; $template =& new HTML_Template_HIT('templates'); -#$template =& new HTML_Template_Sigma('templates', 'compiled_templates'); -#$template->setErrorHandling(PEAR_ERROR_TRIGGER, E_USER_ERROR); $parser =& new BIFE_Parser('BIFE_Copy'); $page =& $parser->parseFile($file); diff --git a/modules/album/BIFE/Album/Pager.php b/modules/album/BIFE/Album/Pager.php new file mode 100644 index 0000000..76bb71a --- /dev/null +++ b/modules/album/BIFE/Album/Pager.php @@ -0,0 +1,90 @@ + | +// +--------------------------------------------------------------------+ +// +// $Id$ +// + + + +// +X2C includes +require_once 'BIFE.php'; +// ~X2C + +// +X2C Class 151 :Pager +/** + * Album pager to an easier navigation when viewing photos. + * + * @access public + */ +class BIFE_Album_Pager extends BIFE_Widget { + // ~X2C + + // +X2C Operation 153 + /** + * Constructor. + * + * @param array $attrs Attributes. + * + * @return void + * @access public + */ + function BIFE_Album_Pager($attrs) // ~X2C + { + trigger_error('Not implemented!', E_USER_WARNING); + } + // -X2C + + // +X2C Operation 154 + /** + * Constructor. + * + * @param array $attrs Attributes. + * + * @return void + * @access public + */ + function __construct($attrs) // ~X2C + { + trigger_error('Not implemented!', E_USER_WARNING); + } + // -X2C + + // +X2C Operation 155 + /** + * Renders the widget using a template returning a string with the results. + * + * @param HTML_Template_HIT &$template Template to use to render the widget. + * + * @return string + * @access public + */ + function render(&$template) // ~X2C + { + trigger_error('Not implemented!', E_USER_WARNING); + } + // -X2C + +} // -X2C Class :Pager +?> \ No newline at end of file diff --git a/src/BIFE/AlbumPhoto.php b/modules/album/BIFE/Album/Photo.php similarity index 94% rename from src/BIFE/AlbumPhoto.php rename to modules/album/BIFE/Album/Photo.php index c0ffa06..6569eb8 100644 --- a/src/BIFE/AlbumPhoto.php +++ b/modules/album/BIFE/Album/Photo.php @@ -27,16 +27,16 @@ // // +X2C includes -require_once 'BIFE/Widget.php'; +require_once 'BIFE.php'; // ~X2C -// +X2C Class 103 :AlbumPhoto +// +X2C Class 103 :Photo /** * Photo widget. * * @access public */ -class BIFE_AlbumPhoto extends BIFE_Widget { +class BIFE_Album_Photo extends BIFE_Widget { // ~X2C // +X2C Operation 106 @@ -48,7 +48,7 @@ class BIFE_AlbumPhoto extends BIFE_Widget { * @return void * @access public */ - function BIFE_AlbumPhoto($attrs) // ~X2C + function BIFE_Album_Photo($attrs) // ~X2C { $this->__construct($attrs); } @@ -89,6 +89,6 @@ class BIFE_AlbumPhoto extends BIFE_Widget { } // -X2C -} // -X2C Class :AlbumPhoto +} // -X2C Class :Photo ?> \ No newline at end of file diff --git a/src/BIFE/Album.php b/modules/album/BIFE/Album/Thumbs.php similarity index 98% rename from src/BIFE/Album.php rename to modules/album/BIFE/Album/Thumbs.php index 52af679..f79e525 100644 --- a/src/BIFE/Album.php +++ b/modules/album/BIFE/Album/Thumbs.php @@ -27,18 +27,18 @@ // // +X2C includes -require_once 'BIFE/Widget.php'; +require_once 'BIFE.php'; // ~X2C require_once 'Image/Transform.php'; -// +X2C Class 20 :Album +// +X2C Class 20 :Thumbs /** * Photo album widget. [TODO: Make a better explanation] * * @access public */ -class BIFE_Album extends BIFE_Widget { +class BIFE_Album_Thumbs extends BIFE_Widget { // ~X2C // +X2C Operation 22 @@ -50,7 +50,7 @@ class BIFE_Album extends BIFE_Widget { * @return void * @access public */ - function BIFE_Album($attrs) // ~X2C + function BIFE_Album_Thumbs($attrs) // ~X2C { $this->__construct($attrs); } @@ -267,6 +267,6 @@ Returns an array of associative arrays with this keys: } // -X2C -} // -X2C Class :Album +} // -X2C Class :Thumbs ?> \ No newline at end of file diff --git a/modules/album/Makefile b/modules/album/Makefile new file mode 100644 index 0000000..fd3a19d --- /dev/null +++ b/modules/album/Makefile @@ -0,0 +1,35 @@ +# vim: set noexpandtab tabstop=4 softtabstop=4 shiftwidth=4: +# +--------------------------------------------------------------------+ +# | BIFE - Buil It FastEr | +# +--------------------------------------------------------------------+ +# | This file is part of BIFE. | +# | | +# | BIFE 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. | +# | | +# | BIFE 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 Hooks; if not, write to the Free Software Foundation, | +# | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | +# +--------------------------------------------------------------------+ +# | Created: Mon May 19 00:16:56 ART 2003 | +# | Authors: Leandro Lucarella | +# +--------------------------------------------------------------------+ +# +# $Id$ +# + +code: album.xmi xmi2code.config + @xmi2code + +clean-code: + @find -name '*.bak' | xargs rm -vf + +clean: clean-code + diff --git a/modules/album/album.xmi b/modules/album/album.xmi new file mode 100644 index 0000000..3626421 --- /dev/null +++ b/modules/album/album.xmi @@ -0,0 +1,141 @@ + + + + + umbrello uml modeller http://uml.sf.net + 1.1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmi2code.config b/modules/album/xmi2code.config similarity index 93% rename from xmi2code.config rename to modules/album/xmi2code.config index 684f541..0decbdc 100644 --- a/xmi2code.config +++ b/modules/album/xmi2code.config @@ -29,17 +29,17 @@ !--> -