]> git.llucax.com Git - software/bife/bife-all.git/commitdiff
Moved back to a clean bife directory. Each subdirectory has a module
authorLeandro Lucarella <llucax@gmail.com>
Mon, 30 Jun 2003 07:25:58 +0000 (07:25 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Mon, 30 Jun 2003 07:25:58 +0000 (07:25 +0000)
(including 'core' module and 'hit').

62 files changed:
album/BIFE/Album/Pager.php [new file with mode: 0644]
album/BIFE/Album/Photo.php [new file with mode: 0644]
album/BIFE/Album/Thumbs.php [new file with mode: 0644]
album/Doxyfile [new file with mode: 0644]
album/Makefile [new file with mode: 0644]
album/album.xmi [new file with mode: 0644]
album/examples/index.php [new file with mode: 0644]
album/examples/index.xbf [new file with mode: 0644]
album/examples/photo.xbf [new file with mode: 0644]
album/examples/templates/album/body.tpl.html [new file with mode: 0644]
album/examples/templates/album/cell.tpl.html [new file with mode: 0644]
album/examples/templates/album/empty.tpl.html [new file with mode: 0644]
album/examples/templates/album/item.tpl.html [new file with mode: 0644]
album/examples/templates/album/photo.tpl.html [new file with mode: 0644]
album/examples/templates/album/row.tpl.html [new file with mode: 0644]
album/examples/templates/bife_link.tpl.html [new file with mode: 0644]
album/examples/templates/bife_page.tpl.html [new file with mode: 0644]
album/examples/templates/bife_title.tpl.html [new file with mode: 0644]
album/package.xml [new file with mode: 0644]
album/xmi2code.config [new file with mode: 0644]
album/xmi2code.tpl.php [new file with mode: 0644]
core/BIFE/Container.php [new file with mode: 0644]
core/BIFE/Fallback.php [new file with mode: 0644]
core/BIFE/Link.php [new file with mode: 0644]
core/BIFE/Parser.php [new file with mode: 0644]
core/BIFE/Translate.php [new file with mode: 0644]
core/BIFE/Widget.php [new file with mode: 0644]
core/Doxyfile [new file with mode: 0644]
core/Makefile [new file with mode: 0644]
core/README [new file with mode: 0644]
core/ROADMAP [new file with mode: 0644]
core/bife.xmi [new file with mode: 0644]
core/build.xml [new file with mode: 0644]
core/core/HTML/Template/HIT.php [new file with mode: 0644]
core/core/Makefile [new file with mode: 0644]
core/examples/index.php [new file with mode: 0644]
core/examples/index.xbf [new file with mode: 0644]
core/examples/link.xbf [new file with mode: 0644]
core/examples/templates/bife_link.tpl.html [new file with mode: 0644]
core/examples/templates/bife_page.tpl.html [new file with mode: 0644]
core/examples/templates/bife_title.tpl.html [new file with mode: 0644]
core/package.xml [new file with mode: 0644]
core/xmi2code.config [new file with mode: 0644]
core/xmi2code.tpl.php [new file with mode: 0644]
hit/Doxyfile [new file with mode: 0644]
hit/HTML/Template/HIT.php [new file with mode: 0644]
hit/Makefile [new file with mode: 0644]
hit/examples/hit.php [new file with mode: 0644]
hit/examples/hooks/body.tpl.html [new file with mode: 0644]
hit/examples/hooks/cell.tpl.html [new file with mode: 0644]
hit/examples/hooks/row.tpl.html [new file with mode: 0644]
hit/hit.xmi [new file with mode: 0644]
hit/package.xml [new file with mode: 0644]
hit/xmi2code.config [new file with mode: 0644]
hit/xmi2code.tpl.php [new file with mode: 0644]
menu/BIFE/Menu/Menu.php [new file with mode: 0644]
menu/Doxyfile [new file with mode: 0644]
menu/Makefile [new file with mode: 0644]
menu/menu.xmi [new file with mode: 0644]
menu/package.xml [new file with mode: 0644]
menu/xmi2code.config [new file with mode: 0644]
menu/xmi2code.tpl.php [new file with mode: 0644]

diff --git a/album/BIFE/Album/Pager.php b/album/BIFE/Album/Pager.php
new file mode 100644 (file)
index 0000000..7a37116
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+// vim: set expandtab 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: Sun Jun 22 12:45:47 2003                                  |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C includes
+require_once 'BIFE/Widget.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/album/BIFE/Album/Photo.php b/album/BIFE/Album/Photo.php
new file mode 100644 (file)
index 0000000..c99ef29
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+// vim: set expandtab 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: Sat May 24 00:54:15 2003                                  |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C includes
+require_once 'BIFE/Widget.php';
+// ~X2C
+
+// +X2C Class 103 :Photo
+/**
+ * Photo widget.
+ *
+ * @access public
+ */
+class BIFE_Album_Photo extends BIFE_Widget {
+    // ~X2C
+
+    // +X2C Operation 108
+    /**
+     * 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
+    {
+        $attrs['FILE'] = @$this->attrs['FILE'] ? $this->attrs['FILE'] : @$_REQUEST['BIFE_ALBUM_FILE'];
+        $attrs['DESC'] = @$this->attrs['DESC'] ? $this->attrs['DESC'] : basename($attrs['FILE']);
+        $out = $template->parse('photo', $attrs, '', 'album');
+        return $out;
+    }
+    // -X2C
+
+} // -X2C Class :Photo
+
+?>
\ No newline at end of file
diff --git a/album/BIFE/Album/Thumbs.php b/album/BIFE/Album/Thumbs.php
new file mode 100644 (file)
index 0000000..50adcd7
--- /dev/null
@@ -0,0 +1,271 @@
+<?php
+// vim: set expandtab 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: Wed May 17 18:16:54 ART 2003                              |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C includes
+require_once 'BIFE/Widget.php';
+// ~X2C
+
+require_once 'BIFE/Link.php';
+require_once 'Image/Transform.php';
+
+// +X2C Class 20 :Thumbs
+/**
+ * Photo album widget. [TODO: Make a better explanation]
+ *
+ * @access public
+ */
+class BIFE_Album_Thumbs extends BIFE_Widget {
+    // ~X2C
+
+    // +X2C Operation 22
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function BIFE_Album_Thumbs($attrs) // ~X2C
+    {
+        $this->__construct($attrs);
+    }
+    // -X2C
+
+    // +X2C Operation 57
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($attrs) // ~X2C
+    {
+        // TODO - get defaults from an INI file.
+        $defaults = array(
+            'DIR'           => '.',
+            'RECURSIVE'     => true,
+            'THUMBSFORMAT'  => 'jpeg',
+            'THUMBSDIR'     => '.thumbs',
+            'EXTENSIONS'    => 'png,jpg,jpeg,PNG,JPG,JPEG',
+            'MAXROWS'       => 0,
+            'COLUMNS'       => 4,
+            'LINK-BIFE'     => 'photo.xbf',
+            'LINK-URL'      => '',
+        );
+        $attrs = array_merge($defaults, $attrs);
+        $attrs['EXTENSIONS'] = explode(',', $attrs['EXTENSIONS']);
+        parent::__construct($attrs);
+    }
+    // -X2C
+
+    // +X2C Operation 23
+    /**
+     * Renders the widget.
+     *
+     * @param  HTML_Template_HIT &$template Template to use to render the widget.
+     *
+     * @return string
+     * @access public
+     */
+    function render(&$template) // ~X2C
+    {
+        $template->pushGroup('album');
+        $list = $this->getList();
+        $tot  = count($list);
+        $rows = ceil($tot / $this->attrs['COLUMNS']);
+        for ($row = 0; $row < $rows; $row++) {
+            for ($col = 0; $col < $this->attrs['COLUMNS']; $col++) {
+                $cur = $row * $this->attrs['COLUMNS'] + $col;
+                if ($photo = @$list[$cur]) {
+                    if (is_null($photo['THUMB'])) {
+                        $photo['THUMB'] = $this->makeThumb($photo['FILE']);
+                    }
+                    $photo['URL'] = BIFE_Link::getURL(
+                        array(
+                            'BIFE'                  => $this->attrs['LINK-BIFE'],
+                            'URL'                   => $this->attrs['LINK-URL'],
+                            'DATA-BIFE_ALBUM_FILE'  => $photo['FILE'],
+                        )
+                    );
+                    $cell = $template->parse('item', $photo);
+                } else {
+                    $cell = $template->parse('empty');
+                }
+                $template->parseBuffered('cell', 'CONTENTS', $cell);
+            }
+            $template->parseBuffered('row', 'CONTENTS',
+                $template->popBuffer('cell'));
+        }
+        $out = $template->parse('body', array(
+            'DESC'     => $this->getDescription(),
+            'CONTENTS' => $template->popBuffer('row')));
+        $template->popGroup();
+        return $out;
+    }
+    // -X2C
+
+    // +X2C Operation 95
+    /**
+     * Gets a list of photos with their descriptions and thumbnails.
+Returns an array of associative arrays with this keys:
+<ul>
+<li><b>file:</b> Photo filename.</li>
+<li><b>desc:</b> Photo Description.</li>
+<li><b>thumb:</b> Photo thumbnail filename.</li>
+</ul>
+     *
+     * @return array
+     * @access protected
+     */
+    function getList() // ~X2C
+    {
+        $root = $this->attrs['DIR'];
+        $exts = $this->attrs['EXTENSIONS'];
+        $format = $this->attrs['THUMBSFORMAT'];
+        $return = array();
+        $d = dir($root);
+        if ($d) {
+            while (($file = $d->read()) !== false) {
+                list($path, $name, $ext) = $this->splitFilename("$root/$file");
+                if (is_readable("$root/$file") and in_array($ext, $exts)) {
+                    $thumb = $this->getThumbFilename("$root/$file");
+                    $return[] = array(
+                        'FILE'  => "$root/$file",
+                        'DESC'  => $name,
+                        'THUMB' => is_readable($thumb) ? $thumb : null,
+                    );
+                }              
+            }
+            $d->close();
+        }
+        return $return;
+    }
+    // -X2C
+
+    // +X2C Operation 97
+    /**
+     * Creates an image thumbnail, returning his filename.
+     *
+     * @param  string $filename Filename of the image to create the thumb.
+     * @param  int $size Maximum thumbnail size.
+     *
+     * @return string
+     * @access protected
+     */
+    function makeThumb($filename, $size = 100) // ~X2C
+    {
+        $format = $this->attrs['THUMBSFORMAT'];
+        $thumb = $this->getThumbFilename($filename);
+        list($path, $name, $ext) = $this->splitFilename($thumb);
+        $img =& Image_Transform::factory('GD');
+        $img->load($filename);
+        // If image is larger than the maximum size, we resize it.
+        if ($img->img_x > $size or $img->img_y > $size ) {
+            if (!@is_dir($path) and !@mkdir($path)) {
+                return null;
+            }
+            if (PEAR::isError($img)) {
+                return null;
+            }
+            if (!$img->scale($size)) {
+                return null;
+            }
+        }
+        $img->save("$path/$name.$format", $format);
+        $img->free();
+
+        return $thumb;
+    }
+    // -X2C
+
+    // +X2C Operation 98
+    /**
+     * Returns the filename of an image thumb.
+     *
+     * @param  string $filename Filename of the image to get the thumb name.
+     *
+     * @return string
+     * @access protected
+     */
+    function getThumbFilename($filename) // ~X2C
+    {
+        $root = $this->attrs['DIR'];
+        $format = $this->attrs['THUMBSFORMAT'];
+        $thumbsdir = $this->attrs['THUMBSDIR'];
+
+        list($path, $name, $ext) = $this->splitFilename($filename);
+
+        return "$root/$thumbsdir/$name.$format";
+    }
+    // -X2C
+
+    // +X2C Operation 102
+    /**
+     * Returns the description of the album.
+     *
+     * @return string
+     * @access protected
+     */
+    function getDescription() // ~X2C
+    {
+        $root = $this->attrs['DIR'];
+        return @join('', file($file));
+    }
+    // -X2C
+
+    // +X2C Operation 100
+    /**
+     * Splits a filename returning an array with the path, name and extension.
+     *
+     * @param  string $filename Filename to split.
+     *
+     * @return array
+     * @access public
+     * @static
+     */
+    function splitFilename($filename) // ~X2C
+    {
+        $path = explode('/', $filename);
+        $file = array_pop($path);
+        $ext  = '';
+        if (strstr($file, '.')) {
+            preg_match('|([^/]+?)(\.([^\.]*))?$|', $file, $m);
+            $file = @$m[1] . ((@$m[2] == '.' ) ? '.' : '');
+            $ext  = @$m[3];
+        }
+        $dir = count($path) ? join('/', $path) : '';
+        return array($dir, $file, $ext);
+    }
+    // -X2C
+
+} // -X2C Class :Thumbs
+
+?>
diff --git a/album/Doxyfile b/album/Doxyfile
new file mode 100644 (file)
index 0000000..116883f
--- /dev/null
@@ -0,0 +1,227 @@
+# vim: set expandtab 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 <luca@lugmen.org.ar>                    |
+# +--------------------------------------------------------------------+
+#
+# $Id$
+#
+
+# Doxyfile 1.3-rc3
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = "BIFE Album"
+PROJECT_NUMBER         = 0.11
+OUTPUT_DIRECTORY       = api
+OUTPUT_LANGUAGE        = English
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ALWAYS_DETAILED_SEC    = YES
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+INTERNAL_DOCS          = YES
+CASE_SENSE_NAMES       = YES
+SHORT_NAMES            = NO
+HIDE_SCOPE_NAMES       = NO
+VERBATIM_HEADERS       = YES
+SHOW_INCLUDE_FILES     = YES
+JAVADOC_AUTOBRIEF      = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+DISTRIBUTE_GROUP_DOC   = NO
+TAB_SIZE               = 8
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ALIASES                = 
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+SHOW_USED_FILES        = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = doxygen.warn
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = 
+FILE_PATTERNS          = *.php
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = YES
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = YES
+TREEVIEW_WIDTH         = 200
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = YES
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_SCHEMA             = 
+XML_DTD                = 
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = YES
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+GRAPHICAL_HIERARCHY    = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
+CGI_NAME               = search.cgi
+CGI_URL                = 
+DOC_URL                = 
+DOC_ABSPATH            = 
+BIN_ABSPATH            = /usr/local/bin/
+EXT_DOC_PATHS          = 
diff --git a/album/Makefile b/album/Makefile
new file mode 100644 (file)
index 0000000..6234a59
--- /dev/null
@@ -0,0 +1,41 @@
+# 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 <luca@lugmen.org.ar>                    |
+# +--------------------------------------------------------------------+
+#
+# $Id$
+#
+
+MODULE=album
+
+PHP_FILES=$(subst ./,,$(shell find BIFE -name '*.php'))
+EXAMPLE_FILES=$(subst ./,,$(shell find examples -regex '.*\.svn.*'))
+DOC_FILES=
+
+package: package.xml $(PHP_FILES) $(EXAMPLE_FILES) $(DOC_FILES)
+       pear package
+
+code: $(MODULE).xmi xmi2code.config
+       @xmi2code
+
+code-clean:
+       @find -name '*.bak' | xargs rm -vf
diff --git a/album/album.xmi b/album/album.xmi
new file mode 100644 (file)
index 0000000..c23cb92
--- /dev/null
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<XMI xmlns:UML="org.omg/standards/UML" verified="false" timestamp="" xmi.version="1.2" >
+ <XMI.header>
+  <XMI.documentation>
+   <XMI.exporter>umbrello uml modeller http://uml.sf.net</XMI.exporter>
+   <XMI.exporterVersion>1.1</XMI.exporterVersion>
+  </XMI.documentation>
+  <XMI.model xmi.name="album" href="/home/luca/website/www/test/bife/modules/album/album.xmi" />
+  <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
+ </XMI.header>
+ <XMI.content>
+  <docsettings viewid="114" documentation="Parse XML data getting widgets." uniqueid="155" />
+  <umlobjects>
+   <UML:Class stereotype="" package="BIFE" xmi.id="3" abstract="1" documentation="Base widget class.
+x2c:extern" name="Widget" static="0" scope="200" />
+   <UML:Class stereotype="" package="BIFE/Album" xmi.id="20" abstract="0" documentation="Photo album widget. [TODO: Make a better explanation]" name="Thumbs" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="22" type="void" abstract="0" documentation="Constructor." name="BIFE_Album_Thumbs" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="57" type="void" abstract="0" documentation="Constructor." name="__construct" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="23" type="string" abstract="0" documentation="Renders the widget." name="render" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_HIT" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="95" type="array" abstract="0" documentation="Gets a list of photos with their descriptions and thumbnails.
+
+Returns an array of associative arrays with this keys:
+&lt;ul>
+&lt;li>&lt;b>file:&lt;/b> Photo filename.&lt;/li>
+&lt;li>&lt;b>desc:&lt;/b> Photo Description.&lt;/li>
+&lt;li>&lt;b>thumb:&lt;/b> Photo thumbnail filename.&lt;/li>
+&lt;/ul>
+" name="getList" static="0" scope="202" />
+    <UML:Operation stereotype="" package="" xmi.id="97" type="string" abstract="0" documentation="Creates an image thumbnail, returning his filename." name="makeThumb" static="0" scope="202" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Filename of the image to create the thumb." name="filename" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="100" type="int" abstract="0" documentation="Maximum thumbnail size." name="size" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="98" type="string" abstract="0" documentation="Returns the filename of an image thumb." name="getThumbFilename" static="0" scope="202" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Filename of the image to get the thumb name." name="filename" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="102" type="string" abstract="0" documentation="Returns the description of the album." name="getDescription" static="0" scope="202" />
+    <UML:Operation stereotype="" package="" xmi.id="100" type="array" abstract="0" documentation="Splits a filename returning an array with the path, name and extension." name="splitFilename" static="1" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Filename to split." name="filename" static="0" scope="200" />
+    </UML:Operation>
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE/Album" xmi.id="103" abstract="0" documentation="Photo widget." name="Photo" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="108" type="string" abstract="0" documentation="Renders the widget using a template returning a string with the results." name="render" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_HIT" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
+    </UML:Operation>
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE/Album" xmi.id="151" abstract="0" documentation="Album pager to an easier navigation when viewing photos." name="Pager" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="153" type="void" abstract="0" documentation="Constructor." name="BIFE_Album_Pager" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="154" type="void" abstract="0" documentation="Constructor." name="__construct" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="155" type="string" abstract="0" documentation="Renders the widget using a template returning a string with the results." name="render" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_HIT" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
+    </UML:Operation>
+   </UML:Class>
+  </umlobjects>
+  <diagrams>
+   <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" showgrid="1" showopsig="0" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="114" documentation="" type="402" showops="1" showpackage="1" name="Album Classes" localid="30000" showstereotype="0" showscope="1" font="Helvetica,9,-1,5,48,0,0,0,0,0" linecolor="#ff0000" >
+    <widgets>
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="90" showattsigs="600" usesdiagramusefillcolour="0" x="222" linecolour="#ff0000" y="23" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#dcdcdc" height="25" usefillcolor="1" showattributes="0" xmi.id="3" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="161" showattsigs="601" usesdiagramusefillcolour="0" x="22" linecolour="#ff0000" y="175" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="142" usefillcolor="1" showattributes="1" xmi.id="20" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="126" showattsigs="601" usesdiagramusefillcolour="0" x="204" linecolour="#ff0000" y="175" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="37" usefillcolor="1" showattributes="1" xmi.id="103" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="148" showattsigs="601" usesdiagramusefillcolour="0" x="352" linecolour="#ff0000" y="175" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="67" usefillcolor="1" showattributes="1" xmi.id="151" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+    </widgets>
+    <messages/>
+    <associations>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="4" indexb="1" widgetbid="3" widgetaid="20" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="102" starty="175" />
+       <endpoint endx="244" endy="48" />
+      </linepath>
+     </UML:AssocWidget>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="4" indexb="2" widgetbid="3" widgetaid="103" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="267" starty="175" />
+       <endpoint endx="267" endy="48" />
+      </linepath>
+     </UML:AssocWidget>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="4" indexb="3" widgetbid="3" widgetaid="151" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="426" starty="175" />
+       <endpoint endx="289" endy="48" />
+      </linepath>
+     </UML:AssocWidget>
+    </associations>
+   </diagram>
+  </diagrams>
+  <listview>
+   <listitem open="1" type="800" id="-1" label="Views" >
+    <listitem open="1" type="801" id="-1" label="Logical View" >
+     <listitem open="1" type="803" id="-1" label="Album" >
+      <listitem open="1" type="807" id="114" label="Album Classes" />
+      <listitem open="0" type="813" id="151" label="Pager" >
+       <listitem open="0" type="815" id="153" label="BIFE_Album_Pager" />
+       <listitem open="0" type="815" id="154" label="__construct" />
+       <listitem open="0" type="815" id="155" label="render" />
+      </listitem>
+      <listitem open="0" type="813" id="103" label="Photo" >
+       <listitem open="0" type="815" id="108" label="render" />
+      </listitem>
+      <listitem open="0" type="813" id="20" label="Thumbs" >
+       <listitem open="0" type="815" id="22" label="BIFE_Album_Thumbs" />
+       <listitem open="0" type="815" id="57" label="__construct" />
+       <listitem open="0" type="815" id="102" label="getDescription" />
+       <listitem open="0" type="815" id="95" label="getList" />
+       <listitem open="0" type="815" id="98" label="getThumbFilename" />
+       <listitem open="0" type="815" id="97" label="makeThumb" />
+       <listitem open="0" type="815" id="23" label="render" />
+       <listitem open="0" type="815" id="100" label="splitFilename" />
+      </listitem>
+     </listitem>
+     <listitem open="1" type="803" id="-1" label="BIFE" >
+      <listitem open="0" type="813" id="3" label="Widget" />
+     </listitem>
+    </listitem>
+    <listitem open="1" type="802" id="-1" label="Use Case View" />
+   </listitem>
+  </listview>
+ </XMI.content>
+</XMI>
diff --git a/album/examples/index.php b/album/examples/index.php
new file mode 100644 (file)
index 0000000..3b9f86d
--- /dev/null
@@ -0,0 +1,47 @@
+<?
+// vim: set expandtab 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: Wed May 17 18:16:54 ART 2003                              |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+$tmp = ini_get('include_path');
+ini_set('include_path', "..:$tmp");
+unset($tmp);
+umask('002');
+
+require_once 'HTML/Template/HIT.php';
+require_once 'BIFE/Parser.php';
+require_once 'BIFE/Translate.php';
+
+$file = isset($_REQUEST['BIFE']) ? $_REQUEST['BIFE'] : 'index.xbf';
+
+$template =& new HTML_Template_HIT('templates');
+
+$parser =& new BIFE_Parser('BIFE_Translate');
+$page =& $parser->parseFile($file);
+$parser->__destruct();
+echo $page->render($template);
+
+?>
diff --git a/album/examples/index.xbf b/album/examples/index.xbf
new file mode 100644 (file)
index 0000000..4ace0c3
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Page title="Hola mundo!" menu="true">
+    <Title>Datos!</Title>
+    <H3>Photo album</H3>
+    <Album:Thumbs dir="../.." columns="8"/>
+    <HR color="blue" size="3"/>
+</Page>
diff --git a/album/examples/photo.xbf b/album/examples/photo.xbf
new file mode 100644 (file)
index 0000000..ba7f57c
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Page title="Foto" use="AlbumPhoto">
+    <Album:Photo/>
+</Page>
diff --git a/album/examples/templates/album/body.tpl.html b/album/examples/templates/album/body.tpl.html
new file mode 100644 (file)
index 0000000..2dd5085
--- /dev/null
@@ -0,0 +1,8 @@
+<H3 class="album">{DESC}</H3>
+<DIV class="center">
+    <TABLE class="album">
+        <TBODY>
+            {CONTENTS}
+        </TBODY>
+    </TABLE>
+</DIV>
diff --git a/album/examples/templates/album/cell.tpl.html b/album/examples/templates/album/cell.tpl.html
new file mode 100644 (file)
index 0000000..dcbedbf
--- /dev/null
@@ -0,0 +1,3 @@
+<TD align="center" valign="middle">
+    {CONTENTS}
+</TD>
diff --git a/album/examples/templates/album/empty.tpl.html b/album/examples/templates/album/empty.tpl.html
new file mode 100644 (file)
index 0000000..a735e36
--- /dev/null
@@ -0,0 +1 @@
+VACÍO
diff --git a/album/examples/templates/album/item.tpl.html b/album/examples/templates/album/item.tpl.html
new file mode 100644 (file)
index 0000000..c41be64
--- /dev/null
@@ -0,0 +1 @@
+<A href="{URL}"><IMG alt="{DESC}" src="{THUMB}"></A>
diff --git a/album/examples/templates/album/photo.tpl.html b/album/examples/templates/album/photo.tpl.html
new file mode 100644 (file)
index 0000000..901274f
--- /dev/null
@@ -0,0 +1,2 @@
+<H2>{DESC}</H2>
+<A href="./"><IMG alt="{DESC}" src="{FILE}"/></A>
diff --git a/album/examples/templates/album/row.tpl.html b/album/examples/templates/album/row.tpl.html
new file mode 100644 (file)
index 0000000..6f623b2
--- /dev/null
@@ -0,0 +1,3 @@
+<TR>
+    {CONTENTS}
+</TR>
diff --git a/album/examples/templates/bife_link.tpl.html b/album/examples/templates/bife_link.tpl.html
new file mode 100644 (file)
index 0000000..873ba85
--- /dev/null
@@ -0,0 +1 @@
+<A href="{URL}" title="{DESC}">{CONTENTS}</A>
diff --git a/album/examples/templates/bife_page.tpl.html b/album/examples/templates/bife_page.tpl.html
new file mode 100644 (file)
index 0000000..ea824f4
--- /dev/null
@@ -0,0 +1,9 @@
+<HTML>
+    <HEAD>
+        <TITLE>{TITLE}</TITLE>
+    </HEAD>
+    <BODY>
+        <H1>{TITLE}</H1>
+        {CONTENTS}
+    </BODY>
+</HTML>
diff --git a/album/examples/templates/bife_title.tpl.html b/album/examples/templates/bife_title.tpl.html
new file mode 100644 (file)
index 0000000..3590da3
--- /dev/null
@@ -0,0 +1 @@
+<H2>{CONTENTS}</H2>
diff --git a/album/package.xml b/album/package.xml
new file mode 100644 (file)
index 0000000..62d4002
--- /dev/null
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE package SYSTEM "/usr/share/doc/pear/data/PEAR/package.dtd">
+<package version="1.0">
+    <name>BIFE Album</name>
+    <summary>BIFE Album Widget Set</summary>
+    <description>TBD.
+    </description>
+    <license>GPL</license>
+    <maintainers>
+        <maintainer>
+            <user>luca</user>
+            <name>Leandro Lucarella</name>
+            <email>luca@lugmen.org.ar</email>
+            <role>lead</role>
+        </maintainer>
+    </maintainers>
+
+    <release>
+        <version>0.11</version>
+        <date>2003-06-29</date>
+        <state>alpha</state>
+        <notes>Check http://www.llucax.hn.org/desarrollo/bife/ for details.</notes>
+        <filelist>
+            <!-- PHP -->
+            <file role="php">BIFE/Album/Thumbs.php</file>
+            <file role="php">BIFE/Album/Photo.php</file>
+            <file role="php">BIFE/Album/Pager.php</file>
+            <!-- DOC -->
+            <file role="doc">examples/index.php</file>
+            <file role="doc">examples/index.xbf</file>
+            <file role="doc">examples/photo.xbf</file>
+            <file role="doc">examples/templates/album/item.tpl.html</file>
+            <file role="doc">examples/templates/album/empty.tpl.html</file>
+            <file role="doc">examples/templates/album/cell.tpl.html</file>
+            <file role="doc">examples/templates/album/row.tpl.html</file>
+            <file role="doc">examples/templates/album/photo.tpl.html</file>
+            <file role="doc">examples/templates/album/body.tpl.html</file>
+            <file role="doc">examples/templates/bife_page.tpl.html</file>
+            <file role="doc">examples/templates/bife_link.tpl.html</file>
+            <file role="doc">examples/templates/bife_title.tpl.html</file>
+        </filelist>
+    </release>
+    <deps>
+        <dep type="php" rel="ge">4.2.3</dep>
+        <dep type="pkg" rel="ge" version="1.0.0beta">HTML_Template_HIT</dep>
+        <dep type="pkg" rel="ge" version="0.11">BIFE</dep>
+    </deps>
+</package>
diff --git a/album/xmi2code.config b/album/xmi2code.config
new file mode 100644 (file)
index 0000000..b338983
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ! vim: set expandtab 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 <luca@lugmen.org.ar>                    *
+ ! *********************************************************************+
+ ! 
+ ! $Id$
+ ! 
+ !-->
+
+<xmi2code>
+  <option key="target" value="*"/>
+  <option key="xmi-input" value="album.xmi"/>
+  <option key="config-file" value="xmi2code.config"/>
+  <option key="config-file-set" value="false"/>
+  <option key="handler" value="umbrello"/>
+  <option key="generator-path" value="."/>
+  <option key="use-package-as-dir" value="true"/>
+  <option key="indent" value="    "/>
+  <option key="files-case" value="preserve"/>
+  <option key="generator" value="php.pear"/>
+  <option key="template-path" value="."/>
+  <option key="php.template" value="xmi2code.tpl.php"/>
+  <option key="php.default-code" value="trigger_error('Not implemented!', E_USER_WARNING);"/>
+  <option key="php.pear.use-package-in-classnames" value="true"/>
+  <option key="php.pear.underscore-in-nonpublic" value="false"/>
+</xmi2code>
diff --git a/album/xmi2code.tpl.php b/album/xmi2code.tpl.php
new file mode 100644 (file)
index 0000000..ce8775b
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+// vim: set expandtab 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: @@date                                  |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
diff --git a/core/BIFE/Container.php b/core/BIFE/Container.php
new file mode 100644 (file)
index 0000000..2ddc24d
--- /dev/null
@@ -0,0 +1,97 @@
+<?php
+// vim: set expandtab 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: Wed May 17 18:16:54 ART 2003                              |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C includes
+require_once 'BIFE/Widget.php';
+// ~X2C
+
+// +X2C Class 5 :Container
+/**
+ * Base container widget class.
+ *
+ * @access public
+ * @abstract
+ */
+class BIFE_Container extends BIFE_Widget {
+    /**
+     * Widget contents.
+     *
+     * @var    array $contents
+     * @access public
+     */
+    var $contents = array();
+
+    // ~X2C
+
+    // +X2C Operation 6
+    /**
+     * Adds contents to the container.
+     *
+     * @param  mixed &$contents Contents to add to the container.
+     *
+     * @return void
+     * @access public
+     */
+    function addContents(&$contents) // ~X2C
+    {
+        if (is_object($contents)) {
+            $this->contents[] =& $contents;
+        } else {
+            $this->contents[] = $contents;
+        }
+    }
+    // -X2C
+
+    // +X2C Operation 59
+    /**
+     * Renders the widget using a template returning a string with the results.
+     *
+     * @param  HTML_Template_HIT &$template Template object to render the widget.
+     *
+     * @return string
+     * @access public
+     */
+    function renderContents(&$template) // ~X2C
+    {
+        $c = count($this->contents);
+        $o = '';
+        for ($i = 0; $i < $c; $i++) {
+            if (is_object($this->contents[$i])) {
+                $o .= $this->contents[$i]->render($template);
+            } else {
+                $o .= $this->contents[$i];
+            }
+        }
+        return $o;
+    }
+    // -X2C
+
+
+} // -X2C Class :Container
+
+?>
\ No newline at end of file
diff --git a/core/BIFE/Fallback.php b/core/BIFE/Fallback.php
new file mode 100644 (file)
index 0000000..04a11b1
--- /dev/null
@@ -0,0 +1,86 @@
+<?php
+// vim: set expandtab 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: Tue May 20 17:57:56 2003                                  |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C includes
+require_once 'BIFE/Container.php';
+// ~X2C
+
+// +X2C Class 61 :Fallback
+/**
+ * Fallback widget to use when no specific widget is implemented.
+ *
+ * @access public
+ * @abstract
+ */
+class BIFE_Fallback extends BIFE_Container {
+    /**
+     * Name of the widget.
+     *
+     * @var    string $name
+     * @access private
+     */
+    var $name = '';
+
+    // ~X2C
+
+    // +X2C Operation 62
+    /**
+     * Constructor.
+     *
+     * @param  string $name Name of the widget to draw.
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function BIFE_Fallback($name, $attrs) // ~X2C
+    {
+        $this->__construct($name, $attrs);
+    }
+    // -X2C
+
+    // +X2C Operation 63
+    /**
+     * Constructor.
+     *
+     * @param  string $name Name of the widget.
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($name, $attrs) // ~X2C
+    {
+        parent::__construct($attrs);
+        $this->name = strtolower(strtr($name, ':', '_'));
+    }
+    // -X2C
+
+} // -X2C Class :Fallback
+
+?>
\ No newline at end of file
diff --git a/core/BIFE/Link.php b/core/BIFE/Link.php
new file mode 100644 (file)
index 0000000..c8900d6
--- /dev/null
@@ -0,0 +1,125 @@
+<?php
+// vim: set expandtab 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: Sun Jun 1 20:00:20 2003                                   |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C includes
+require_once 'BIFE/Container.php';
+// ~X2C
+
+// +X2C Class 110 :Link
+/**
+ * Link to another page.
+ *
+ * @access public
+ */
+class BIFE_Link extends BIFE_Container {
+    // ~X2C
+
+    // +X2C Operation 111
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function BIFE_Link($attrs) // ~X2C
+    {
+        $this->__construct($attrs);
+    }
+    // -X2C
+
+    // +X2C Operation 112
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($attrs) // ~X2C
+    {
+        $link_attrs['URL']    = $this->getURL($attrs);
+        $link_attrs['DESC']   = @$attrs['DESC'];
+        $link_attrs['TARGET'] = @$attrs['TARGET'];
+        parent::__construct($link_attrs);
+    }
+    // -X2C
+
+    // +X2C Operation 142
+    /**
+     * Gets a URL string based on Link attributes.
+     *
+     * @param  array $attrs Link attributes.
+     *
+     * @return string
+     * @access public
+     */
+    function getURL($attrs) // ~X2C
+    {
+        $url = @$attrs['URL'];
+        unset($attrs['URL']);
+        if (isset($attrs['BIFE'])) {
+            $attrs['DATA-BIFE']  = $attrs['BIFE'];
+            unset($attrs['BIFE']);
+        }
+        $query = array();
+        foreach($attrs as $name => $value) {
+            if (substr($name, 0, 5) === 'DATA-') {
+                if ($name = substr($name, 5)) {
+                    $query[] = urlencode($name) . '=' . urlencode($value);
+                }
+            }
+        }
+        if ($query) {
+            $url .= '?' . join('&', $query);
+        }
+        return $url;
+    }
+    // -X2C
+
+    // +X2C Operation 157
+    /**
+     * Renders the widget.
+     *
+     * @param  HTML_Template_HIT &$template Template to use to render the widget.
+     *
+     * @return string
+     * @access public
+     */
+    function render(&$template) // ~X2C
+    {
+        $this->attrs['CONTENTS'] = $this->renderContents($template);
+        return $template->parse('bife_link', $this->attrs, '', '');
+    }
+    // -X2C
+
+} // -X2C Class :Link
+
+?>
\ No newline at end of file
diff --git a/core/BIFE/Parser.php b/core/BIFE/Parser.php
new file mode 100644 (file)
index 0000000..76a5845
--- /dev/null
@@ -0,0 +1,305 @@
+<?php
+// vim: set expandtab 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: Wed May 17 18:16:54 ART 2003                              |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C Class 25 :Parser
+/**
+ * This is the XML Parser.
+ *
+ * @access public
+ */
+class BIFE_Parser {
+    /**
+     * Top level widget.
+     *
+     * @var    BIFE_Widget $root
+     * @access protected
+     */
+    var $root = null;
+
+    /**
+     * XML parser resource.
+     *
+     * @var    resource $parser
+     * @access protected
+     */
+    var $parser = null;
+
+    /**
+     * BIFE widgets stack.
+     *
+     * @var    array $stack
+     * @access protected
+     */
+    var $stack = array();
+
+    /**
+     * Fallback class to use in case that a widget class is not found.
+     *
+     * @var    string $fallback
+     * @access protected
+     */
+    var $fallback = '';
+
+    /**
+     * XML cache directory. Empty if no cahching must be done (for current dir use '.').
+     *
+     * @var    string $cache
+     * @access protected
+     */
+    var $cache = '/tmp';
+
+    /**
+     * Files required by the parsed XML file.
+     *
+     * @var    array $requires
+     * @access protected
+     */
+    var $requires = array();
+
+    // ~X2C
+
+    // +X2C Operation 30
+    /**
+     * Constructor.
+     *
+     * @param  string $fallback Fallback class name (none if empty).
+     * @param  string $cache XML cache directory. Empty is no caching will be done.
+     *
+     * @return void
+     * @access public
+     */
+    function BIFE_Parser($fallback = '', $cache = '/tmp') // ~X2C
+    {
+        $this->__construct($fallback, $cache);
+    }
+    // -X2C
+
+    // +X2C Operation 31
+    /**
+     * Constructor.
+     *
+     * @param  string $fallback Fallback class name (none if empty).
+     * @param  string $cache XML cache directory. Empty is no caching will be done.
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($fallback = '', $cache = '/tmp') // ~X2C
+    {
+        $this->parser   = xml_parser_create();
+        $this->fallback = $fallback;
+        $this->cache    = $cache;
+        xml_set_object($this->parser, $this);
+        xml_set_element_handler($this->parser, 'startElement', 'endElement');
+        xml_set_character_data_handler($this->parser, 'characterData');
+    }
+    // -X2C
+
+    // +X2C Operation 32
+    /**
+     * Destructor.
+     *
+     * @return void
+     * @access public
+     */
+    function __destruct() // ~X2C
+    {
+        xml_parser_free($this->parser);
+    }
+    // -X2C
+
+    // +X2C Operation 33
+    /**
+     * XML parser start of element handler.
+     *
+     * @param  resource $parser XML parser resource.
+     * @param  string $name XML tag name.
+     * @param  array $attrs XML tag attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function startElement($parser, $name, $attrs) // ~X2C
+    {
+        $class = 'bife_' . strtolower(strtr($name, ':', '_'));
+        if (!class_exists($class)) {
+            $inc = 'BIFE/' .
+                strtr(ucwords(strtr(strtolower($name), ':', ' ')), ' ', '/') .
+                '.php';
+            if (@include_once $inc) {
+                $this->includes[] = $inc;
+            }
+        }
+        if (class_exists($class)) {
+            $obj =& new $class($attrs);
+            // XXX - Does this check make sense?
+            if (!is_a($obj, 'bife_widget')) {
+                trigger_error("Class '$class' is not a BIFE_Widget.", E_USER_WARNING);
+            }
+            $this->stack[] =& $obj;
+        } else {
+            if ($this->fallback) {
+                $class = $this->fallback;
+                $obj =& new $class($name, $attrs);
+                if (!is_a($obj, 'bife_fallback')) {
+                    trigger_error("Class '$class' is not a BIFE_Fallback.", E_USER_WARNING);
+                }
+                $this->stack[] =& $obj;
+            } else {
+                trigger_error("Class not found '$class'.", E_USER_ERROR);
+            }
+        }
+    }
+    // -X2C
+
+    // +X2C Operation 34
+    /**
+     * XML parser end of element handler.
+     *
+     * @param  resource $parser XML parser resource.
+     * @param  string $name XML tag name.
+     *
+     * @return void
+     * @access public
+     */
+    function endElement($parser, $name) // ~X2C
+    {
+        end($this->stack);
+        $current =& $this->stack[key($this->stack)];
+        array_pop($this->stack);
+        end($this->stack);
+        $parent =& $this->stack[key($this->stack)];
+        if ($parent) {
+            $parent->addContents($current);
+        } else {
+            $this->root =& $current;
+        }
+    }
+    // -X2C
+
+    // +X2C Operation 35
+    /**
+     * XML parser character data handler.
+     *
+     * @param  resource $parser XML parser resource.
+     * @param  string $data XML character data.
+     *
+     * @return void
+     * @access public
+     */
+    function characterData($parser, $data) // ~X2C
+    {
+        end($this->stack);
+        $current =& $this->stack[key($this->stack)];
+        $current->addContents($data);
+    }
+    // -X2C
+
+    // +X2C Operation 36
+    /**
+     * Parse a string with XML data.
+     *
+     * @param  string $data XML string to parse.
+     * @param  bool $final Indicates if is the last string to parse.
+     *
+     * @return void
+     * @access public
+     */
+    function parse($data, $final = true) // ~X2C
+    {
+        if (!xml_parse($this->parser, $data, $final)) {
+            trigger_error(
+                sprintf('XML error: %s at line %d.',
+                    xml_error_string(xml_get_error_code($this->parser)),
+                    xml_get_current_line_number($this->parser)
+                ),
+                E_USER_WARNING
+            );
+        }
+    }
+    // -X2C
+
+    // +X2C Operation 37
+    /**
+     * Parse a XML file with a complete and valid XML document.
+     *
+     * @param  string $filename Filename to parse.
+     *
+     * @return &BIFE_Widget
+     * @access public
+     */
+    function &parseFile($filename) // ~X2C
+    {
+        if ($this->cache) {
+            $cache = $this->cache . '/' . 'bife_parser_cache' . strtr(realpath($filename), '/', '_');
+            if (@filemtime($cache) > @filemtime($filename)) {
+                $file = file($cache);
+                foreach(unserialize(trim(array_shift($file))) as $required) {
+                    include_once $required;
+                }
+                return unserialize(join('', $file));
+            }
+        }
+        if ($fp = @fopen($filename, 'r')) {
+            while ($data = fread($fp, 4096)) {
+                $this->parse($data, feof($fp));
+            }
+        } else {
+            trigger_error("Could not open BIFE XML input file '$filename'.",
+                E_USER_WARNING);
+        }
+        fclose($fp);
+        if ($this->cache) {
+            $fp = fopen($cache, 'w');
+            fputs($fp, serialize($this->includes) . "\n");
+            fputs($fp, serialize($this->root));
+            fclose($fp);
+        }
+        return $this->root;
+    }
+    // -X2C
+
+    // +X2C Operation 74
+    /**
+     * Parse a XML string with a complete and valid XML document.
+     *
+     * @param  string $data XML data to parse.
+     *
+     * @return &BIFE_Widget
+     * @access public
+     */
+    function &parseString($data) // ~X2C
+    {
+        $this->parse($data, true);
+        return $this->root;
+    }
+    // -X2C
+
+} // -X2C Class :Parser
+
+?>
\ No newline at end of file
diff --git a/core/BIFE/Translate.php b/core/BIFE/Translate.php
new file mode 100644 (file)
index 0000000..98dc263
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+// vim: set expandtab 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: Wed May 17 18:16:54 ART 2003                              |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C includes
+require_once 'BIFE/Fallback.php';
+// ~X2C
+
+// +X2C Class 7 :Translate
+/**
+ * This is a generic and simple (but very usefull) BIFE_Fallback implementation. Translate widgets using a template with it's name, prepended with 'bife_'. If not template is found, it copy the XML to the output.
+ *
+ * @access public
+ */
+class BIFE_Translate extends BIFE_Fallback {
+    // ~X2C
+
+    // +X2C Operation 12
+    /**
+     * Renders the widget.
+     *
+     * @param  HTML_Template_HIT &$template Template to use to render the widget.
+     *
+     * @return string
+     * @access public
+     */
+    function render(&$template) // ~X2C
+    {
+        $this->attrs['CONTENTS'] = $this->renderContents($template);
+        $name = "bife_{$this->name}";
+        if ($template->exists($name, '')) {
+            $out = $template->parse($name, $this->attrs, '', '');
+        } else {
+            $name = $this->name;
+            $out = "<$name";
+            foreach ($this->attrs as $attr => $val) {
+                $out .= sprintf(' %s="%s"', $attr, $val);
+            }
+            $contents = $this->renderContents($template);
+            if ($contents !== '') {
+                $out .= ">$contents</$name>";
+            } else {
+                $out .= "/>";
+            }
+        }
+        return $out;
+    }
+    // -X2C
+
+} // -X2C Class :Translate
+
+?>
\ No newline at end of file
diff --git a/core/BIFE/Widget.php b/core/BIFE/Widget.php
new file mode 100644 (file)
index 0000000..5e0ab11
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+// vim: set expandtab 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: Wed May 17 18:16:54 ART 2003                              |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C Class 3 :Widget
+/**
+ * Base widget class.
+ *
+ * @access public
+ * @abstract
+ */
+class BIFE_Widget {
+    /**
+     * Attribute list.
+     *
+     * @var    array $attrs
+     * @access protected
+     */
+    var $attrs = array();
+
+    // ~X2C
+
+    // +X2C Operation 126
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function BIFE_Widget($attrs) // ~X2C
+    {
+        $this->__construct($attrs);
+    }
+    // -X2C
+
+    // +X2C Operation 127
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($attrs) // ~X2C
+    {
+        $this->attrs = $attrs;
+    }
+    // -X2C
+
+    // +X2C Operation 4
+    /**
+     * Renders the widget using a template returning a string with the results.
+     *
+     * @param  HTML_Template_HIT &$template Template object to render the widget.
+     *
+     * @return string
+     * @access public
+     * @abstract
+     */
+    function render(&$template) // ~X2C
+    {
+        trigger_error('Method not implemented '.get_class($this).
+            '::render().', E_USER_ERROR);
+    }
+    // -X2C
+
+} // -X2C Class :Widget
+
+?>
\ No newline at end of file
diff --git a/core/Doxyfile b/core/Doxyfile
new file mode 100644 (file)
index 0000000..caed41f
--- /dev/null
@@ -0,0 +1,227 @@
+# vim: set expandtab 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 <luca@lugmen.org.ar>                    |
+# +--------------------------------------------------------------------+
+#
+# $Id$
+#
+
+# Doxyfile 1.3-rc3
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = "BIFE - Build It FastEr"
+PROJECT_NUMBER         = 0.11
+OUTPUT_DIRECTORY       = api
+OUTPUT_LANGUAGE        = English
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ALWAYS_DETAILED_SEC    = YES
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+INTERNAL_DOCS          = YES
+CASE_SENSE_NAMES       = YES
+SHORT_NAMES            = NO
+HIDE_SCOPE_NAMES       = NO
+VERBATIM_HEADERS       = YES
+SHOW_INCLUDE_FILES     = YES
+JAVADOC_AUTOBRIEF      = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+DISTRIBUTE_GROUP_DOC   = NO
+TAB_SIZE               = 8
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ALIASES                = 
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+SHOW_USED_FILES        = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = doxygen.warn
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = 
+FILE_PATTERNS          = *.php
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = YES
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = YES
+TREEVIEW_WIDTH         = 200
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = YES
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_SCHEMA             = 
+XML_DTD                = 
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = YES
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+GRAPHICAL_HIERARCHY    = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
+CGI_NAME               = search.cgi
+CGI_URL                = 
+DOC_URL                = 
+DOC_ABSPATH            = 
+BIN_ABSPATH            = /usr/local/bin/
+EXT_DOC_PATHS          = 
diff --git a/core/Makefile b/core/Makefile
new file mode 100644 (file)
index 0000000..4bfa3e5
--- /dev/null
@@ -0,0 +1,65 @@
+# 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 <luca@lugmen.org.ar>                    |
+# +--------------------------------------------------------------------+
+#
+# $Id$
+#
+
+VERSION=0.11
+MODULE_FILE=BIFE.php
+MODULE_NAME=Core
+PHP_FILES=$(filter-out $(MODULE_FILE),$(subst ./,,$(shell find -name '*.php')))
+EXAMPLE_FILES=$(subst ./,,$(shell find examples -regex '.*\.svn.*'))
+DOC_FILES=README ROADMAP
+X2C_TEMPLATE=xmi2code.tpl.php
+
+package: package.xml $(PHP_FILES) $(EXAMPLE_FILES) $(DOC_FILES)
+       pear package
+
+code: bife.xmi xmi2code.config
+       @xmi2code
+
+code-clean:
+       @find -name '*.bak' | xargs rm -vf
+
+$(MODULE_FILE): code $(PHP_FILES) $(X2C_TEMPLATE)
+       @( \
+               ( \
+                       cat $(X2C_TEMPLATE) | \
+                       grep -v '@@date' | \
+                       grep -v '$$Id' | \
+                       egrep -v '^//$$' \
+               ); \
+               echo '//'; \
+               echo -n '// BIFE $(MODULE_NAME) (version $(VERSION)) - '; \
+               date; \
+               echo '//'; \
+               ( \
+                       cat $(PHP_FILES) | \
+                       grep -v require_once | \
+                       grep -v '?>' | \
+                       grep -v '<?php' | \
+                       egrep -v '^\s*//' \
+               ); \
+               echo -n '?>' \
+       ) > $(MODULE_FILE)
diff --git a/core/README b/core/README
new file mode 100644 (file)
index 0000000..3b21d16
--- /dev/null
@@ -0,0 +1,15 @@
+$Id$
+
+BIFE is a kind of framework inspired by Bif <http://www.lunix.com.ar/Bif.php>
+to split a PHP application (website or whatever) into 3 layers:
+XML:  Content management.
+PHP:  Programming.
+HTML: Look & Feel (it can be other type of output, not just HTML).
+
+The main goals of this proyect are:
+- Keep XML layer really easy to use for the end user, so no need of HTML or
+  PHP would be needed to make a XML page.
+- Speed. One of the main goals of this proyect is to be fast. Because of
+  this, PHP and HTML layers can have extra complications.
+
+A roadmap can be found in doc/ROADMAP.
diff --git a/core/ROADMAP b/core/ROADMAP
new file mode 100644 (file)
index 0000000..1c524cb
--- /dev/null
@@ -0,0 +1,28 @@
+$Id$
+
+
+Version 0.11
+============
+
+    - Separate modules in different repository root dirs.
+    - Make, at least, PEAR packages for each module (and BIFE Core).
+
+
+Version 0.12
+============
+
+    - Start using config file for default widgets attributes.
+
+
+Version 0.13
+============
+
+    - Separate Album funtionality function from renderer (BIFE_Album).
+    - Use hooks libs for this.
+
+
+Version 0.14
+============
+    - Make a way to put all classes in a package together in a single file to
+      avoid overhead in require_once calls (to be reviewed).
+
diff --git a/core/bife.xmi b/core/bife.xmi
new file mode 100644 (file)
index 0000000..13594f0
--- /dev/null
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<XMI xmlns:UML="org.omg/standards/UML" verified="false" timestamp="" xmi.version="1.2" >
+ <XMI.header>
+  <XMI.documentation>
+   <XMI.exporter>umbrello uml modeller http://uml.sf.net</XMI.exporter>
+   <XMI.exporterVersion>1.1</XMI.exporterVersion>
+  </XMI.documentation>
+  <XMI.model xmi.name="bife" href="/home/luca/bife/bife/bife.xmi" />
+  <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
+ </XMI.header>
+ <XMI.content>
+  <docsettings viewid="2" documentation="Parse XML data getting widgets." uniqueid="159" />
+  <umlobjects>
+   <UML:Class stereotype="" package="BIFE" xmi.id="3" abstract="1" documentation="Base widget class." name="Widget" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="126" type="void" abstract="0" documentation="Constructor." name="BIFE_Widget" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="127" type="void" abstract="0" documentation="Constructor." name="__construct" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="4" type="string" abstract="1" documentation="Renders the widget using a template returning a string with the results." name="render" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_HIT" abstract="0" documentation="Template object to render the widget." name="template" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Attribute stereotype="" package="" xmi.id="125" value="array()" type="array" abstract="0" documentation="Attribute list." name="attrs" static="0" scope="202" />
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE" xmi.id="5" abstract="1" documentation="Base container widget class." name="Container" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="6" type="void" abstract="0" documentation="Adds contents to the container." name="addContents" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;mixed" abstract="0" documentation="Contents to add to the container." name="contents" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="59" type="string" abstract="0" documentation="Renders the widget using a template returning a string with the results." name="renderContents" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_HIT" abstract="0" documentation="Template object to render the widget." name="template" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Attribute stereotype="" package="" xmi.id="47" value="array()" type="array" abstract="0" documentation="Widget contents." name="contents" static="0" scope="200" />
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE" xmi.id="25" abstract="0" documentation="This is the XML Parser." name="Parser" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="30" type="void" abstract="0" documentation="Constructor." name="BIFE_Parser" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="''" type="string" abstract="0" documentation="Fallback class name (none if empty)." name="fallback" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="'/tmp'" type="string" abstract="0" documentation="XML cache directory. Empty is no caching will be done." name="cache" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="31" type="void" abstract="0" documentation="Constructor." name="__construct" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="''" type="string" abstract="0" documentation="Fallback class name (none if empty)." name="fallback" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="'/tmp'" type="string" abstract="0" documentation="XML cache directory. Empty is no caching will be done." name="cache" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="32" type="void" abstract="0" documentation="Destructor." name="__destruct" static="0" scope="200" />
+    <UML:Operation stereotype="" package="" xmi.id="33" type="void" abstract="0" documentation="XML parser start of element handler." name="startElement" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="resource" abstract="0" documentation="XML parser resource." name="parser" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="" type="string" abstract="0" documentation="XML tag name." name="name" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="3" value="" type="array" abstract="0" documentation="XML tag attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="34" type="void" abstract="0" documentation="XML parser end of element handler." name="endElement" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="resource" abstract="0" documentation="XML parser resource." name="parser" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="" type="string" abstract="0" documentation="XML tag name." name="name" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="35" type="void" abstract="0" documentation="XML parser character data handler." name="characterData" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="resource" abstract="0" documentation="XML parser resource." name="parser" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="" type="string" abstract="0" documentation="XML character data." name="data" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="36" type="void" abstract="0" documentation="Parse a string with XML data." name="parse" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="XML string to parse." name="data" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="true" type="bool" abstract="0" documentation="Indicates if is the last string to parse." name="final" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="37" type="&amp;BIFE_Widget" abstract="0" documentation="Parse a XML file with a complete and valid XML document." name="parseFile" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Filename to parse." name="filename" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="74" type="&amp;BIFE_Widget" abstract="0" documentation="Parse a XML string with a complete and valid XML document." name="parseString" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="XML data to parse." name="data" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Attribute stereotype="" package="" xmi.id="26" value="null" type="BIFE_Widget" abstract="0" documentation="Top level widget." name="root" static="0" scope="202" />
+    <UML:Attribute stereotype="" package="" xmi.id="27" value="null" type="resource" abstract="0" documentation="XML parser resource." name="parser" static="0" scope="202" />
+    <UML:Attribute stereotype="" package="" xmi.id="29" value="array()" type="array" abstract="0" documentation="BIFE widgets stack." name="stack" static="0" scope="202" />
+    <UML:Attribute stereotype="" package="" xmi.id="84" value="''" type="string" abstract="0" documentation="Fallback class to use in case that a widget class is not found." name="fallback" static="0" scope="202" />
+    <UML:Attribute stereotype="" package="" xmi.id="148" value="'/tmp'" type="string" abstract="0" documentation="XML cache directory. Empty if no cahching must be done (for current dir use '.')." name="cache" static="0" scope="202" />
+    <UML:Attribute stereotype="" package="" xmi.id="156" value="array()" type="array" abstract="0" documentation="Files required by the parsed XML file." name="requires" static="0" scope="202" />
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE" xmi.id="61" abstract="1" documentation="Fallback widget to use when no specific widget is implemented." name="Fallback" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="62" type="void" abstract="0" documentation="Constructor." name="BIFE_Fallback" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Name of the widget to draw." name="name" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="63" type="void" abstract="0" documentation="Constructor." name="__construct" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Name of the widget." name="name" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Attribute stereotype="" package="" xmi.id="129" value="''" type="string" abstract="0" documentation="Name of the widget." name="name" static="0" scope="201" />
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE" xmi.id="7" abstract="0" documentation="This is a generic and simple (but very usefull) BIFE_Fallback implementation. Translate widgets using a template with it's name, prepended with 'bife_'. If not template is found, it copy the XML to the output." name="Translate" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="12" type="string" abstract="0" documentation="Renders the widget." name="render" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_HIT" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
+    </UML:Operation>
+   </UML:Class>
+   <UML:Class stereotype="" package="BIFE" xmi.id="110" abstract="0" documentation="Link to another page." name="Link" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="111" type="void" abstract="0" documentation="Constructor." name="BIFE_Link" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="112" type="void" abstract="0" documentation="Constructor." name="__construct" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="142" type="string" abstract="0" documentation="Gets a URL string based on Link attributes." name="getURL" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Link attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="157" type="string" abstract="0" documentation="Renders the widget." name="render" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_HIT" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
+    </UML:Operation>
+   </UML:Class>
+  </umlobjects>
+  <diagrams>
+   <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" showgrid="1" showopsig="0" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="2" documentation="" type="402" showops="1" showpackage="1" name="Core Classes" localid="30000" showstereotype="0" showscope="1" font="Helvetica,9,-1,5,48,0,0,0,0,0" linecolor="#ff0000" >
+    <widgets>
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="148" showattsigs="601" usesdiagramusefillcolour="0" x="232" linecolour="#ff0000" y="50" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="75" usefillcolor="1" showattributes="1" xmi.id="3" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="173" showattsigs="601" usesdiagramusefillcolour="0" x="220" linecolour="#ff0000" y="170" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="60" usefillcolor="1" showattributes="1" xmi.id="5" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="123" showattsigs="601" usesdiagramusefillcolour="0" x="156" linecolour="#ff0000" y="290" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="60" usefillcolor="1" showattributes="1" xmi.id="61" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="171" showattsigs="601" usesdiagramusefillcolour="0" x="10" linecolour="#ff0000" y="10" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="240" usefillcolor="1" showattributes="1" xmi.id="25" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="1" width="107" showattsigs="601" usesdiagramusefillcolour="1" x="342" linecolour="none" y="290" showopsigs="600" usesdiagramlinecolour="1" fillcolour="none" height="82" usefillcolor="1" showattributes="1" xmi.id="110" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="1" width="104" showattsigs="601" usesdiagramusefillcolour="1" x="165" linecolour="none" y="390" showopsigs="600" usesdiagramlinecolour="1" fillcolour="none" height="37" usefillcolor="1" showattributes="1" xmi.id="7" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+    </widgets>
+    <messages/>
+    <associations>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="3" widgetaid="5" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="306" starty="170" />
+       <endpoint endx="306" endy="125" />
+      </linepath>
+     </UML:AssocWidget>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="1" widgetbid="5" widgetaid="61" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="217" starty="290" />
+       <endpoint endx="277" endy="230" />
+      </linepath>
+     </UML:AssocWidget>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="2" widgetbid="5" widgetaid="110" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="395" starty="290" />
+       <endpoint endx="335" endy="230" />
+      </linepath>
+     </UML:AssocWidget>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="61" widgetaid="7" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="217" starty="390" />
+       <endpoint endx="217" endy="350" />
+      </linepath>
+     </UML:AssocWidget>
+    </associations>
+   </diagram>
+  </diagrams>
+  <listview>
+   <listitem open="1" type="800" id="-1" label="Views" >
+    <listitem open="1" type="801" id="-1" label="Logical View" >
+     <listitem open="1" type="803" id="-1" label="BIFE" >
+      <listitem open="0" type="813" id="5" label="Container" >
+       <listitem open="0" type="815" id="6" label="addContents" />
+       <listitem open="0" type="814" id="47" label="contents" />
+       <listitem open="0" type="815" id="59" label="renderContents" />
+      </listitem>
+      <listitem open="0" type="807" id="2" label="Core Classes" />
+      <listitem open="0" type="813" id="61" label="Fallback" >
+       <listitem open="0" type="815" id="62" label="BIFE_Fallback" />
+       <listitem open="0" type="815" id="63" label="__construct" />
+       <listitem open="0" type="814" id="129" label="name" />
+      </listitem>
+      <listitem open="0" type="813" id="110" label="Link" >
+       <listitem open="0" type="815" id="111" label="BIFE_Link" />
+       <listitem open="0" type="815" id="112" label="__construct" />
+       <listitem open="0" type="815" id="142" label="getURL" />
+       <listitem open="0" type="815" id="157" label="render" />
+      </listitem>
+      <listitem open="0" type="813" id="25" label="Parser" >
+       <listitem open="0" type="815" id="30" label="BIFE_Parser" />
+       <listitem open="0" type="815" id="31" label="__construct" />
+       <listitem open="0" type="815" id="32" label="__destruct" />
+       <listitem open="0" type="814" id="148" label="cache" />
+       <listitem open="0" type="815" id="35" label="characterData" />
+       <listitem open="0" type="815" id="34" label="endElement" />
+       <listitem open="0" type="814" id="84" label="fallback" />
+       <listitem open="0" type="815" id="36" label="parse" />
+       <listitem open="0" type="815" id="37" label="parseFile" />
+       <listitem open="0" type="815" id="74" label="parseString" />
+       <listitem open="0" type="814" id="27" label="parser" />
+       <listitem open="0" type="814" id="156" label="requires" />
+       <listitem open="0" type="814" id="26" label="root" />
+       <listitem open="0" type="814" id="29" label="stack" />
+       <listitem open="0" type="815" id="33" label="startElement" />
+      </listitem>
+      <listitem open="0" type="813" id="7" label="Translate" >
+       <listitem open="0" type="815" id="12" label="render" />
+      </listitem>
+      <listitem open="0" type="813" id="3" label="Widget" >
+       <listitem open="0" type="815" id="126" label="BIFE_Widget" />
+       <listitem open="0" type="815" id="127" label="__construct" />
+       <listitem open="0" type="814" id="125" label="attrs" />
+       <listitem open="0" type="815" id="4" label="render" />
+      </listitem>
+     </listitem>
+    </listitem>
+    <listitem open="1" type="802" id="-1" label="Use Case View" />
+   </listitem>
+  </listview>
+ </XMI.content>
+</XMI>
diff --git a/core/build.xml b/core/build.xml
new file mode 100644 (file)
index 0000000..5a6d0a5
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+
+<project name="BIFE" default="dist" basedir=".">
+
+    <property name="poner directorio build en propiedad"/>
+
+    <fileset dir="src/BIFE" id="files.src.core">
+        <include name="Parser.php"/>
+        <include name="Widget.php"/>
+        <include name="Container.php"/>
+        <include name="Fallback.php"/>
+        <include name="Root.php"/>
+    </fileset>
+
+    <fileset dir="build/BIFE" id="files.build.core">
+        <include name="Parser.php"/>
+        <include name="Widget.php"/>
+        <include name="Container.php"/>
+        <include name="Fallback.php"/>
+        <include name="Root.php"/>
+    </fileset>
+
+    <target name="prepare">
+        <echo msg="Preparing build..."/>
+        <mkdir dir="build/BIFE"/>
+    </target>
+
+    <target name="build" depends="prepare">
+        <echo msg="Building..."/>
+        <copy todir="build/BIFE">
+            <fileset refid="files.src.core"/>
+        </copy>
+        <chmod mode="644">
+            <fileset refid="files.build.core"/>
+        </chmod>
+    </target>
+    <target name="dist" depends="build">
+        <echo msg="Creating archive..."/>
+        <tar name="bife.tar.gz" usegzip="true">
+            <fileset dir="build">
+                <include name="**/**"/>
+            </fileset>
+        </tar>
+    </target>
+    <target name="clean">
+        <echo msg="Cleaning up..."/>
+        <delete file="build"/>
+    </target>
+
+</project>
diff --git a/core/core/HTML/Template/HIT.php b/core/core/HTML/Template/HIT.php
new file mode 100644 (file)
index 0000000..2b635c9
--- /dev/null
@@ -0,0 +1,265 @@
+<?php
+// vim: set expandtab 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: Wed Jun 17 19:03:14 2003                                  |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C Class 130 :HIT
+/**
+ * Hooks vs. IT (HIT) is a simple template implementation, based on hooks and IT template systems.
+ *
+ * @access public
+ */
+class HTML_Template_HIT {
+    /**
+     * Root directory where template files are.
+     *
+     * @var    string $root
+     * @access public
+     */
+    var $root = '.';
+
+    /**
+     * If it's true, it looks for template files in PHP's include_path.
+     *
+     * @var    bool $useIncludePath
+     * @access public
+     */
+    var $useIncludePath = false;
+
+    /**
+     * Group of templates to use (a subdirectory in root).
+     *
+     * @var    string $group
+     * @access protected
+     */
+    var $group = '';
+
+    /**
+     * Templates cache.
+     *
+     * @var    array $cache
+     * @access protected
+     */
+    var $cache = array();
+
+    /**
+     * @var    array $buffer
+     * @access protected
+     */
+    var $buffer = array();
+
+    // ~X2C
+
+    // +X2C Operation 136
+    /**
+     * Constructor.
+     *
+     * @param  string $root Root directory where template files are.
+     * @param  bool $useIncludePath If it's true, it looks for template files in PHP's include_path.
+     * @param  string $group Group of templates to use (a subdirectory in root).
+     *
+     * @return void
+     * @access public
+     */
+    function HTML_Template_HIT($root = '.', $useIncludePath = false, $group = '') // ~X2C
+    {
+        $this->__construct($root, $useIncludePath, $group);
+    }
+    // -X2C
+
+    // +X2C Operation 137
+    /**
+     * Constructor.
+     *
+     * @param  int $root Root directory where template files are.
+     * @param  false $useIncludePath If it's true, it looks for template files in PHP's include_path.
+     * @param  string $group Group of templates to use (a subdirectory in root).
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($root = '.', $useIncludePath = false, $group = '') // ~X2C
+    {
+        $this->root = $root;
+        $this->useIncludePath = $useIncludePath;
+        $this->pushGroup($group);
+    }
+    // -X2C
+
+    // +X2C Operation 138
+    /**
+     * Parse a template returning the results.
+If $vars is an array, the {[keys]} are replaced with [values] ($val is ignored). If is a string, {$vars} is replaced with $val.
+     *
+     * @param  string $name Name of template to parse.
+     * @param  mixed $vars Variables to replace in the template.
+     * @param  string $val If $vars is a string, the value to replace for $vars.
+     * @param  mixed $group Group to use to parse this template. Null to use the current group.
+     *
+     * @return string
+     * @access public
+     */
+    function parse($name, $vars = '', $val = '', $group = null) // ~X2C
+    {
+        $group = is_null($group) ? end($this->group) : $group;
+        if ($group) {
+            $file = "{$this->root}/$group/$name.tpl.html";
+        } else {
+            $file = "{$this->root}/$name.tpl.html";
+        }
+        if (!isset($this->cache[$file])) {
+            // FIXME - replace join(file()) with file_get_contents().
+            $this->cache[$file] = join('', file($file, $this->useIncludePath));
+        }
+        if ($vars) {
+            if (is_string($vars)) {
+                $vars = array($vars => $val);
+            }
+            foreach ($vars as $key => $val) {
+                $keys[] = '{' . $key . '}';
+                $vals[] = $val;
+            }
+            return str_replace($keys, $vals, $this->cache[$file]);
+        } else {
+            return $this->cache[$file];
+        }
+    }
+    // -X2C
+
+    // +X2C Operation 144
+    /**
+     * Parse a template buffering the results.
+Parse a template appending the results to an internal buffer. If $vars is an array, the {[keys]} are replaced with [values] ($val is ignored). If is a string, {$vars} is replaced with $val.
+     *
+     * @param  string $name Name of template to parse.
+     * @param  mixed $vars Variables to replace in the template.
+     * @param  string $val If $vars is a string, the value to replace for $vars.
+     *
+     * @return void
+     * @access public
+     */
+    function parseBuffered($name, $vars = '', $val = '') // ~X2C
+    {
+        @$this->buffer["{$this->group}/$name"] .= $this->parse($name, $vars, $val);
+    }
+    // -X2C
+
+    // +X2C Operation 145
+    /**
+     * Gets a parsed buffer.
+     *
+     * @param  string $name Name of the parsed template to get.
+     *
+     * @return string
+     * @access public
+     * @static
+     */
+    function getBuffer($name) // ~X2C
+    {
+        return @$this->buffer["{$this->group}/$name"];
+    }
+    // -X2C
+
+    // +X2C Operation 146
+    /**
+     * Gets a parsed buffer and removes it.
+     *
+     * @param  string $name Name of the buffer to flush.
+     *
+     * @return void
+     * @access public
+     */
+    function popBuffer($name) // ~X2C
+    {
+        $return = @$this->buffer["{$this->group}/$name"];
+        unset($this->buffer["{$this->group}/$name"]);
+        return $return;
+    }
+    // -X2C
+
+    // +X2C Operation 139
+    /**
+     * Sets the group to use and add it to the groups stack.
+     *
+     * @param  string $group Group to use.
+     *
+     * @return void
+     * @access public
+     */
+    function pushGroup($group = '') // ~X2C
+    {
+        $this->group[] = $group;
+    }
+    // -X2C
+
+    // +X2C Operation 140
+    /**
+     * Removes the group from the groups stack and returns to the previous used group.
+     *
+     * @return string
+     * @access public
+     */
+    function popGroup() // ~X2C
+    {
+        return array_pop($this->group);
+    }
+    // -X2C
+
+    // +X2C Operation 159
+    /**
+     * True if the template $name exists in $group (or the current group).
+     *
+     * @param  string $name Name of the template.
+     * @param  mixed $group Template's group. If it's null it uses the current group.
+     *
+     * @return bool
+     * @access public
+     */
+    function exists($name, $group = null) // ~X2C
+    {
+        $group = is_null($group) ? end($this->group) : $group;
+        if ($group) {
+            $file = "{$this->root}/$group/$name.tpl.html";
+        } else {
+            $file = "{$this->root}/$name.tpl.html";
+        }
+        if (!$this->useIncludePath) {
+            return is_readable($file);
+        } else {
+            $include_path = array_unique(preg_split('/[:;]/', ini_get('include_path')));
+            foreach ($include_path as $path) {
+                if (is_readable("$path/$file")) {
+                    return true;
+                }
+            }
+            return false;
+        }
+    }
+    // -X2C
+
+} // -X2C Class :HIT
+
+?>
\ No newline at end of file
diff --git a/core/core/Makefile b/core/core/Makefile
new file mode 100644 (file)
index 0000000..ed9979c
--- /dev/null
@@ -0,0 +1,62 @@
+# 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 <luca@lugmen.org.ar>                    |
+# +--------------------------------------------------------------------+
+#
+# $Id$
+#
+
+VERSION=0.10
+MODULE_FILE=BIFE.php
+MODULE_NAME=Core
+PHP_FILES=$(filter-out $(MODULE_FILE),$(subst ./,,$(shell find -name '*.php')))
+X2C_TEMPLATE=../xmi2code.tpl.php
+
+all: $(MODULE_FILE)
+
+code: bife.xmi xmi2code.config
+       @xmi2code
+
+code-clean:
+       @find -name '*.bak' | xargs rm -vf
+
+$(MODULE_FILE): code $(PHP_FILES) $(X2C_TEMPLATE)
+       @( \
+               ( \
+                       cat $(X2C_TEMPLATE) | \
+                       grep -v '@@date' | \
+                       grep -v '$$Id' | \
+                       egrep -v '^//$$' \
+               ); \
+               echo '//'; \
+               echo -n '// BIFE $(MODULE_NAME) (version $(VERSION)) - '; \
+               date; \
+               echo '//'; \
+               ( \
+                       cat $(PHP_FILES) | \
+                       grep -v require_once | \
+                       grep -v '?>' | \
+                       grep -v '<?php' | \
+                       egrep -v '^\s*//' \
+               ); \
+               echo -n '?>' \
+       ) > $(MODULE_FILE)
diff --git a/core/examples/index.php b/core/examples/index.php
new file mode 100644 (file)
index 0000000..3b9f86d
--- /dev/null
@@ -0,0 +1,47 @@
+<?
+// vim: set expandtab 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: Wed May 17 18:16:54 ART 2003                              |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+$tmp = ini_get('include_path');
+ini_set('include_path', "..:$tmp");
+unset($tmp);
+umask('002');
+
+require_once 'HTML/Template/HIT.php';
+require_once 'BIFE/Parser.php';
+require_once 'BIFE/Translate.php';
+
+$file = isset($_REQUEST['BIFE']) ? $_REQUEST['BIFE'] : 'index.xbf';
+
+$template =& new HTML_Template_HIT('templates');
+
+$parser =& new BIFE_Parser('BIFE_Translate');
+$page =& $parser->parseFile($file);
+$parser->__destruct();
+echo $page->render($template);
+
+?>
diff --git a/core/examples/index.xbf b/core/examples/index.xbf
new file mode 100644 (file)
index 0000000..df29c36
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Page title="Hello world!">
+    <Title>BIFE is working!</Title>
+    <H3>Translate Fallback is working too!</H3>
+    <P>This is a very bad use for BIFE, because I'm writing HTML :-P</P>
+    <Title>A little of 'real' use</Title>
+    <P>Here's a <Link bife="link.xbf">link</Link> to another BIFE file</P>
+    <HR color="blue" size="30"/>
+</Page>
diff --git a/core/examples/link.xbf b/core/examples/link.xbf
new file mode 100644 (file)
index 0000000..1eaa4a9
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Page title="Hi again!">
+    <Title>BIFE Links are working too!</Title>
+    <P>Go <Link bife="index.xbf">back</Link>.</P>
+</Page>
diff --git a/core/examples/templates/bife_link.tpl.html b/core/examples/templates/bife_link.tpl.html
new file mode 100644 (file)
index 0000000..873ba85
--- /dev/null
@@ -0,0 +1 @@
+<A href="{URL}" title="{DESC}">{CONTENTS}</A>
diff --git a/core/examples/templates/bife_page.tpl.html b/core/examples/templates/bife_page.tpl.html
new file mode 100644 (file)
index 0000000..ea824f4
--- /dev/null
@@ -0,0 +1,9 @@
+<HTML>
+    <HEAD>
+        <TITLE>{TITLE}</TITLE>
+    </HEAD>
+    <BODY>
+        <H1>{TITLE}</H1>
+        {CONTENTS}
+    </BODY>
+</HTML>
diff --git a/core/examples/templates/bife_title.tpl.html b/core/examples/templates/bife_title.tpl.html
new file mode 100644 (file)
index 0000000..3590da3
--- /dev/null
@@ -0,0 +1 @@
+<H2>{CONTENTS}</H2>
diff --git a/core/package.xml b/core/package.xml
new file mode 100644 (file)
index 0000000..ecaf738
--- /dev/null
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE package SYSTEM "/usr/share/doc/pear/data/PEAR/package.dtd">
+<package version="1.0">
+    <name>BIFE</name>
+    <summary>Build It FastEr</summary>
+    <description>BIFE - Build It FastEr:
+BIFE is a framwork to separate the logic, contents and looks of a PHP
+application, inspired on BIF (Buil It Fast) but with speed and simplicity
+in mind. One of the main goals of BIFE is to be fast.
+    </description>
+    <license>GPL</license>
+    <maintainers>
+        <maintainer>
+            <user>luca</user>
+            <name>Leandro Lucarella</name>
+            <email>luca@lugmen.org.ar</email>
+            <role>lead</role>
+        </maintainer>
+    </maintainers>
+
+    <release>
+        <version>0.11</version>
+        <date>2003-06-29</date>
+        <state>alpha</state>
+        <notes>Check http://www.llucax.hn.org/desarrollo/bife/ for details.</notes>
+        <filelist>
+            <!-- PHP -->
+            <file role="php">BIFE/Parser.php</file>
+            <file role="php">BIFE/Widget.php</file>
+            <file role="php">BIFE/Container.php</file>
+            <file role="php">BIFE/Fallback.php</file>
+            <file role="php">BIFE/Link.php</file>
+            <file role="php">BIFE/Translate.php</file>
+            <!-- DOC -->
+            <file role="doc">README</file>
+            <file role="doc">ROADMAP</file>
+            <file role="doc">examples/index.php</file>
+            <file role="doc">examples/index.xbf</file>
+            <file role="doc">examples/templates/bife_page.tpl.html</file>
+            <file role="doc">examples/templates/bife_title.tpl.html</file>
+            <file role="doc">examples/templates/bife_link.tpl.html</file>
+        </filelist>
+    </release>
+    <deps>
+        <dep type="php" rel="ge">4.2.3</dep>
+        <dep type="pkg" rel="ge" version="1.0.0beta">HTML_Template_HIT</dep>
+    </deps>
+</package>
diff --git a/core/xmi2code.config b/core/xmi2code.config
new file mode 100644 (file)
index 0000000..4e1a6cd
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ! vim: set expandtab 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 <luca@lugmen.org.ar>                    *
+ ! *********************************************************************+
+ ! 
+ ! $Id$
+ ! 
+ !-->
+
+<xmi2code>
+  <option key="target" value="*"/>
+  <option key="xmi-input" value="bife.xmi"/>
+  <option key="config-file" value="xmi2code.config"/>
+  <option key="config-file-set" value="false"/>
+  <option key="handler" value="umbrello"/>
+  <option key="generator-path" value="."/>
+  <option key="use-package-as-dir" value="true"/>
+  <option key="indent" value="    "/>
+  <option key="files-case" value="preserve"/>
+  <option key="generator" value="php.pear"/>
+  <option key="template-path" value="."/>
+  <option key="php.template" value="xmi2code.tpl.php"/>
+  <option key="php.default-code" value="trigger_error('Not implemented!', E_USER_WARNING);"/>
+  <option key="php.pear.use-package-in-classnames" value="true"/>
+  <option key="php.pear.underscore-in-nonpublic" value="false"/>
+</xmi2code>
diff --git a/core/xmi2code.tpl.php b/core/xmi2code.tpl.php
new file mode 100644 (file)
index 0000000..ce8775b
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+// vim: set expandtab 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: @@date                                  |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
diff --git a/hit/Doxyfile b/hit/Doxyfile
new file mode 100644 (file)
index 0000000..a7a8149
--- /dev/null
@@ -0,0 +1,227 @@
+# vim: set expandtab 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 <luca@lugmen.org.ar>                    |
+# +--------------------------------------------------------------------+
+#
+# $Id$
+#
+
+# Doxyfile 1.3-rc3
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = "HIT - Hook vs IT Template Engine"
+PROJECT_NUMBER         = 1.0.0beta
+OUTPUT_DIRECTORY       = api
+OUTPUT_LANGUAGE        = English
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ALWAYS_DETAILED_SEC    = YES
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+INTERNAL_DOCS          = YES
+CASE_SENSE_NAMES       = YES
+SHORT_NAMES            = NO
+HIDE_SCOPE_NAMES       = NO
+VERBATIM_HEADERS       = YES
+SHOW_INCLUDE_FILES     = YES
+JAVADOC_AUTOBRIEF      = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+DISTRIBUTE_GROUP_DOC   = NO
+TAB_SIZE               = 8
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ALIASES                = 
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+SHOW_USED_FILES        = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = doxygen.warn
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = 
+FILE_PATTERNS          = *.php
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = YES
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = YES
+TREEVIEW_WIDTH         = 200
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = YES
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_SCHEMA             = 
+XML_DTD                = 
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = YES
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+GRAPHICAL_HIERARCHY    = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
+CGI_NAME               = search.cgi
+CGI_URL                = 
+DOC_URL                = 
+DOC_ABSPATH            = 
+BIN_ABSPATH            = /usr/local/bin/
+EXT_DOC_PATHS          = 
diff --git a/hit/HTML/Template/HIT.php b/hit/HTML/Template/HIT.php
new file mode 100644 (file)
index 0000000..59fbf0b
--- /dev/null
@@ -0,0 +1,264 @@
+<?php
+// vim: set expandtab 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: Wed Jun 17 19:03:14 2003                                  |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C Class 130 :HIT
+/**
+ * Hooks vs. IT (HIT) is a simple template implementation, based on hooks and IT template systems.
+ *
+ * @access public
+ */
+class HTML_Template_HIT {
+    /**
+     * Root directory where template files are.
+     *
+     * @var    string $root
+     * @access public
+     */
+    var $root = '.';
+
+    /**
+     * If it's true, it looks for template files in PHP's include_path.
+     *
+     * @var    bool $useIncludePath
+     * @access public
+     */
+    var $useIncludePath = false;
+
+    /**
+     * Group of templates to use (a subdirectory in root).
+     *
+     * @var    string $group
+     * @access protected
+     */
+    var $group = '';
+
+    /**
+     * Templates cache.
+     *
+     * @var    array $cache
+     * @access protected
+     */
+    var $cache = array();
+
+    /**
+     * @var    array $buffer
+     * @access protected
+     */
+    var $buffer = array();
+
+    // ~X2C
+
+    // +X2C Operation 136
+    /**
+     * Constructor.
+     *
+     * @param  string $root Root directory where template files are.
+     * @param  bool $useIncludePath If it's true, it looks for template files in PHP's include_path.
+     * @param  string $group Group of templates to use (a subdirectory in root).
+     *
+     * @return void
+     * @access public
+     */
+    function HTML_Template_HIT($root = '.', $useIncludePath = false, $group = '') // ~X2C
+    {
+        $this->__construct($root, $useIncludePath, $group);
+    }
+    // -X2C
+
+    // +X2C Operation 137
+    /**
+     * Constructor.
+     *
+     * @param  int $root Root directory where template files are.
+     * @param  false $useIncludePath If it's true, it looks for template files in PHP's include_path.
+     * @param  string $group Group of templates to use (a subdirectory in root).
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($root = '.', $useIncludePath = false, $group = '') // ~X2C
+    {
+        $this->root = $root;
+        $this->useIncludePath = $useIncludePath;
+        $this->pushGroup($group);
+    }
+    // -X2C
+
+    // +X2C Operation 138
+    /**
+     * Parse a template returning the results.
+If $vars is an array, the {[keys]} are replaced with [values] ($val is ignored). If is a string, {$vars} is replaced with $val.
+     *
+     * @param  string $name Name of template to parse.
+     * @param  mixed $vars Variables to replace in the template.
+     * @param  string $val If $vars is a string, the value to replace for $vars.
+     * @param  mixed $group Group to use to parse this template. Null to use the current group.
+     *
+     * @return string
+     * @access public
+     */
+    function parse($name, $vars = '', $val = '', $group = null) // ~X2C
+    {
+        $group = is_null($group) ? end($this->group) : $group;
+        if ($group) {
+            $file = "{$this->root}/$group/$name.tpl.html";
+        } else {
+            $file = "{$this->root}/$name.tpl.html";
+        }
+        if (!isset($this->cache[$file])) {
+            // FIXME - replace join(file()) with file_get_contents().
+            $this->cache[$file] = join('', file($file, $this->useIncludePath));
+        }
+        if ($vars) {
+            if (is_string($vars)) {
+                $vars = array($vars => $val);
+            }
+            foreach ($vars as $key => $val) {
+                $keys[] = '{' . $key . '}';
+                $vals[] = $val;
+            }
+            return str_replace($keys, $vals, $this->cache[$file]);
+        } else {
+            return $this->cache[$file];
+        }
+    }
+    // -X2C
+
+    // +X2C Operation 144
+    /**
+     * Parse a template buffering the results.
+Parse a template appending the results to an internal buffer. If $vars is an array, the {[keys]} are replaced with [values] ($val is ignored). If is a string, {$vars} is replaced with $val.
+     *
+     * @param  string $name Name of template to parse.
+     * @param  mixed $vars Variables to replace in the template.
+     * @param  string $val If $vars is a string, the value to replace for $vars.
+     *
+     * @return void
+     * @access public
+     */
+    function parseBuffered($name, $vars = '', $val = '') // ~X2C
+    {
+        @$this->buffer["{$this->group}/$name"] .= $this->parse($name, $vars, $val);
+    }
+    // -X2C
+
+    // +X2C Operation 145
+    /**
+     * Gets a parsed buffer.
+     *
+     * @param  string $name Name of the parsed template to get.
+     *
+     * @return string
+     * @access public
+     */
+    function getBuffer($name) // ~X2C
+    {
+        return @$this->buffer["{$this->group}/$name"];
+    }
+    // -X2C
+
+    // +X2C Operation 146
+    /**
+     * Gets a parsed buffer and removes it.
+     *
+     * @param  string $name Name of the buffer to flush.
+     *
+     * @return void
+     * @access public
+     */
+    function popBuffer($name) // ~X2C
+    {
+        $return = @$this->buffer["{$this->group}/$name"];
+        unset($this->buffer["{$this->group}/$name"]);
+        return $return;
+    }
+    // -X2C
+
+    // +X2C Operation 139
+    /**
+     * Sets the group to use and add it to the groups stack.
+     *
+     * @param  string $group Group to use.
+     *
+     * @return void
+     * @access public
+     */
+    function pushGroup($group = '') // ~X2C
+    {
+        $this->group[] = $group;
+    }
+    // -X2C
+
+    // +X2C Operation 140
+    /**
+     * Removes the group from the groups stack and returns to the previous used group.
+     *
+     * @return string
+     * @access public
+     */
+    function popGroup() // ~X2C
+    {
+        return array_pop($this->group);
+    }
+    // -X2C
+
+    // +X2C Operation 159
+    /**
+     * True if the template $name exists in $group (or the current group).
+     *
+     * @param  string $name Name of the template.
+     * @param  mixed $group Template's group. If it's null it uses the current group.
+     *
+     * @return bool
+     * @access public
+     */
+    function exists($name, $group = null) // ~X2C
+    {
+        $group = is_null($group) ? end($this->group) : $group;
+        if ($group) {
+            $file = "{$this->root}/$group/$name.tpl.html";
+        } else {
+            $file = "{$this->root}/$name.tpl.html";
+        }
+        if (!$this->useIncludePath) {
+            return is_readable($file);
+        } else {
+            $include_path = array_unique(preg_split('/[:;]/', ini_get('include_path')));
+            foreach ($include_path as $path) {
+                if (is_readable("$path/$file")) {
+                    return true;
+                }
+            }
+            return false;
+        }
+    }
+    // -X2C
+
+} // -X2C Class :HIT
+
+?>
\ No newline at end of file
diff --git a/hit/Makefile b/hit/Makefile
new file mode 100644 (file)
index 0000000..16d4cab
--- /dev/null
@@ -0,0 +1,41 @@
+# 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 <luca@lugmen.org.ar>                    |
+# +--------------------------------------------------------------------+
+#
+# $Id$
+#
+
+MODULE=hit
+
+PHP_FILES=HTML/Template/HIT.php
+EXAMPLE_FILES=$(subst ./,,$(shell find examples -regex '.*\.svn.*'))
+DOC_FILES=
+
+package: package.xml $(PHP_FILES) $(EXAMPLE_FILES) $(DOC_FILES)
+       pear package
+
+code: $(MODULE).xmi xmi2code.config
+       @xmi2code
+
+code-clean:
+       @find -name '*.bak' | xargs rm -vf
diff --git a/hit/examples/hit.php b/hit/examples/hit.php
new file mode 100644 (file)
index 0000000..9040f3b
--- /dev/null
@@ -0,0 +1,54 @@
+<?
+// vim: set expandtab 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: mié jun 18 01:05:57 ART 2003                              |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// This is a simple test and example of HTML_Template_HIT
+
+$tmp = ini_get('include_path');
+ini_set('include_path', "..:$tmp");
+unset($tmp);
+umask('002');
+
+require_once 'HTML/Template/HIT.php';
+
+$hit =& new HTML_Template_HIT('hooks');
+
+for ($i = 0; $i < 20; $i++) {
+    for ($j = 0; $j < 20; $j++) {
+        $hit->parseBuffered('cell', 'CELL', "$i,$j");
+    }
+    $hit->parseBuffered('row', 'ROW', $hit->popBuffer('cell'));
+}
+echo $hit->parse(
+    'body',
+    array(
+        'ROWS' => $hit->popBuffer('row'),
+        'TITLE' => 'HOLA MUNDO!!!',
+    )
+);
+
+?>
diff --git a/hit/examples/hooks/body.tpl.html b/hit/examples/hooks/body.tpl.html
new file mode 100644 (file)
index 0000000..2481bfa
--- /dev/null
@@ -0,0 +1,10 @@
+<HTML>
+    <HEAD>
+        <TITLE>{TITLE}</TITLE>
+    </HEAD>
+    <BODY>
+        <TABLE border="1" cellpadding="5">
+            {ROWS}
+        </TABLE>
+    </BODY>
+</HTML>
diff --git a/hit/examples/hooks/cell.tpl.html b/hit/examples/hooks/cell.tpl.html
new file mode 100644 (file)
index 0000000..d4889a9
--- /dev/null
@@ -0,0 +1 @@
+<TD>{CELL}</TD>
diff --git a/hit/examples/hooks/row.tpl.html b/hit/examples/hooks/row.tpl.html
new file mode 100644 (file)
index 0000000..2889643
--- /dev/null
@@ -0,0 +1 @@
+<TR>{ROW}</TR>
diff --git a/hit/hit.xmi b/hit/hit.xmi
new file mode 100644 (file)
index 0000000..4e84cc7
--- /dev/null
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<XMI xmlns:UML="org.omg/standards/UML" verified="false" timestamp="" xmi.version="1.2" >
+ <XMI.header>
+  <XMI.documentation>
+   <XMI.exporter>umbrello uml modeller http://uml.sf.net</XMI.exporter>
+   <XMI.exporterVersion>1.1</XMI.exporterVersion>
+  </XMI.documentation>
+  <XMI.model xmi.name="hit" href="/home/luca/bife/hit/hit.xmi" />
+  <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
+ </XMI.header>
+ <XMI.content>
+  <docsettings viewid="132" documentation="Parse XML data getting widgets." uniqueid="159" />
+  <umlobjects>
+   <UML:Class stereotype="" package="HTML/Template" xmi.id="130" abstract="0" documentation="Hooks vs. IT (HIT) is a simple template implementation, based on hooks and IT template systems." name="HIT" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="136" type="void" abstract="0" documentation="Constructor." name="HTML_Template_HIT" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="'.'" type="string" abstract="0" documentation="Root directory where template files are." name="root" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="3" value="false" type="bool" abstract="0" documentation="If it's true, it looks for template files in PHP's include_path." name="useIncludePath" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="4" value="''" type="string" abstract="0" documentation="Group of templates to use (a subdirectory in root)." name="group" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="137" type="void" abstract="0" documentation="Constructor." name="__construct" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="'.'" type="int" abstract="0" documentation="Root directory where template files are." name="root" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="3" value="false" type="false" abstract="0" documentation="If it's true, it looks for template files in PHP's include_path." name="useIncludePath" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="4" value="''" type="string" abstract="0" documentation="Group of templates to use (a subdirectory in root)." name="group" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="138" type="string" abstract="0" documentation="Parse a template returning the results.
+
+If $vars is an array, the {[keys]} are replaced with [values] ($val is ignored). If is a string, {$vars} is replaced with $val." name="parse" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Name of template to parse." name="name" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="''" type="mixed" abstract="0" documentation="Variables to replace in the template." name="vars" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="3" value="''" type="string" abstract="0" documentation="If $vars is a string, the value to replace for $vars." name="val" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="4" value="null" type="mixed" abstract="0" documentation="Group to use to parse this template. Null to use the current group." name="group" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="144" type="void" abstract="0" documentation="Parse a template buffering the results.
+
+Parse a template appending the results to an internal buffer. If $vars is an array, the {[keys]} are replaced with [values] ($val is ignored). If is a string, {$vars} is replaced with $val." name="parseBuffered" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Name of template to parse." name="name" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="''" type="mixed" abstract="0" documentation="Variables to replace in the template." name="vars" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="3" value="''" type="string" abstract="0" documentation="If $vars is a string, the value to replace for $vars." name="val" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="145" type="string" abstract="0" documentation="Gets a parsed buffer." name="getBuffer" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Name of the parsed template to get." name="name" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="146" type="void" abstract="0" documentation="Gets a parsed buffer and removes it." name="popBuffer" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Name of the buffer to flush." name="name" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="139" type="void" abstract="0" documentation="Sets the group to use and add it to the groups stack." name="pushGroup" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="''" type="string" abstract="0" documentation="Group to use." name="group" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="140" type="string" abstract="0" documentation="Removes the group from the groups stack and returns to the previous used group." name="popGroup" static="0" scope="200" />
+    <UML:Operation stereotype="" package="" xmi.id="159" type="bool" abstract="0" documentation="True if the template $name exists in $group (or the current group)." name="exists" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Name of the template." name="name" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="2" value="null" type="mixed" abstract="0" documentation="Template's group. If it's null it uses the current group." name="group" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Attribute stereotype="" package="" xmi.id="133" value="'.'" type="string" abstract="0" documentation="Root directory where template files are." name="root" static="0" scope="200" />
+    <UML:Attribute stereotype="" package="" xmi.id="158" value="false" type="bool" abstract="0" documentation="If it's true, it looks for template files in PHP's include_path." name="useIncludePath" static="0" scope="200" />
+    <UML:Attribute stereotype="" package="" xmi.id="134" value="''" type="string" abstract="0" documentation="Group of templates to use (a subdirectory in root)." name="group" static="0" scope="202" />
+    <UML:Attribute stereotype="" package="" xmi.id="135" value="array()" type="array" abstract="0" documentation="Templates cache." name="cache" static="0" scope="202" />
+    <UML:Attribute stereotype="" package="" xmi.id="147" value="array()" type="array" abstract="0" documentation="" name="buffer" static="0" scope="202" />
+   </UML:Class>
+  </umlobjects>
+  <diagrams>
+   <diagram snapgrid="1" showattsig="1" fillcolor="#ffffc0" showgrid="1" showopsig="0" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="132" documentation="" type="402" showops="1" showpackage="1" name="HIT Classes" localid="30000" showstereotype="0" showscope="1" font="Helvetica,9,-1,5,50,0,0,0,0,0" linecolor="#ff0000" >
+    <widgets>
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="195" showattsigs="601" usesdiagramusefillcolour="0" x="30" linecolour="#ff0000" y="30" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="225" usefillcolor="1" showattributes="1" xmi.id="130" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,50,0,0,0,0,0" />
+    </widgets>
+    <messages/>
+    <associations/>
+   </diagram>
+  </diagrams>
+  <listview>
+   <listitem open="1" type="800" id="-1" label="Views" >
+    <listitem open="1" type="801" id="-1" label="Logical View" >
+     <listitem open="1" type="803" id="-1" label="HIT" >
+      <listitem open="0" type="813" id="130" label="HIT" >
+       <listitem open="0" type="815" id="136" label="HTML_Template_HIT" />
+       <listitem open="0" type="815" id="137" label="__construct" />
+       <listitem open="0" type="814" id="147" label="buffer" />
+       <listitem open="0" type="814" id="135" label="cache" />
+       <listitem open="0" type="815" id="159" label="exists" />
+       <listitem open="0" type="815" id="145" label="getBuffer" />
+       <listitem open="0" type="814" id="134" label="group" />
+       <listitem open="0" type="815" id="138" label="parse" />
+       <listitem open="0" type="815" id="144" label="parseBuffered" />
+       <listitem open="0" type="815" id="146" label="popBuffer" />
+       <listitem open="0" type="815" id="140" label="popGroup" />
+       <listitem open="0" type="815" id="139" label="pushGroup" />
+       <listitem open="0" type="814" id="133" label="root" />
+       <listitem open="0" type="814" id="158" label="useIncludePath" />
+      </listitem>
+      <listitem open="1" type="807" id="132" label="HIT Classes" />
+     </listitem>
+    </listitem>
+    <listitem open="1" type="802" id="-1" label="Use Case View" />
+   </listitem>
+  </listview>
+ </XMI.content>
+</XMI>
diff --git a/hit/package.xml b/hit/package.xml
new file mode 100644 (file)
index 0000000..49b1c07
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE package SYSTEM "/usr/share/doc/pear/data/PEAR/package.dtd">
+<package version="1.0">
+    <name>HIT</name>
+    <summary>Hooks vs IT Template Engine</summary>
+    <description>HIT is a simple, ultra fast template engine. It's based on
+a personal experiment called Hooks and IT Templates. It doesn't support blocks
+like IT so every chunk must be in a separated file if you want to iterate it.
+    </description>
+    <license>GPL</license>
+    <maintainers>
+        <maintainer>
+            <user>luca</user>
+            <name>Leandro Lucarella</name>
+            <email>luca@lugmen.org.ar</email>
+            <role>lead</role>
+        </maintainer>
+    </maintainers>
+
+    <release>
+        <version>1.0.0beta</version>
+        <date>2003-06-30</date>
+        <state>beta</state>
+        <notes>Check http://www.llucax.hn.org/desarrollo/bife/ for details.</notes>
+        <filelist>
+            <!-- PHP -->
+            <file role="php">HTML/Template/HIT.php</file>
+            <!-- DOC -->
+            <file role="doc">examples/hit.php</file>
+            <file role="doc">examples/hooks/body.tpl.html</file>
+            <file role="doc">examples/hooks/cell.tpl.html</file>
+            <file role="doc">examples/hooks/row.tpl.html</file>
+        </filelist>
+    </release>
+    <deps>
+        <dep type="php" rel="ge">4.2.3</dep>
+    </deps>
+</package>
diff --git a/hit/xmi2code.config b/hit/xmi2code.config
new file mode 100644 (file)
index 0000000..99e1ed6
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ! vim: set expandtab 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 <luca@lugmen.org.ar>                    *
+ ! *********************************************************************+
+ ! 
+ ! $Id$
+ ! 
+ !-->
+
+<xmi2code>
+  <option key="target" value="*"/>
+  <option key="xmi-input" value="hit.xmi"/>
+  <option key="config-file" value="xmi2code.config"/>
+  <option key="config-file-set" value="false"/>
+  <option key="handler" value="umbrello"/>
+  <option key="generator-path" value="."/>
+  <option key="use-package-as-dir" value="true"/>
+  <option key="indent" value="    "/>
+  <option key="files-case" value="preserve"/>
+  <option key="generator" value="php.pear"/>
+  <option key="template-path" value="."/>
+  <option key="php.template" value="xmi2code.tpl.php"/>
+  <option key="php.default-code" value="trigger_error('Not implemented!', E_USER_WARNING);"/>
+  <option key="php.pear.use-package-in-classnames" value="true"/>
+  <option key="php.pear.underscore-in-nonpublic" value="false"/>
+</xmi2code>
diff --git a/hit/xmi2code.tpl.php b/hit/xmi2code.tpl.php
new file mode 100644 (file)
index 0000000..ce8775b
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+// vim: set expandtab 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: @@date                                  |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
diff --git a/menu/BIFE/Menu/Menu.php b/menu/BIFE/Menu/Menu.php
new file mode 100644 (file)
index 0000000..09afd9b
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+// vim: set expandtab 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: Sun Jun 8 20:03:30 2003                                   |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//
+
+// +X2C includes
+require_once 'BIFE/Widget.php';
+// ~X2C
+
+// +X2C Class 115 :Menu
+/**
+ * Dynamic Menu.
+ *
+ * @access public
+ */
+class BIFE_Menu_Menu extends BIFE_Widget {
+    // ~X2C
+
+    // +X2C Operation 117
+    /**
+     * 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 Operation 121
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function BIFE_Menu_Menu($attrs) // ~X2C
+    {
+        trigger_error('Not implemented!', E_USER_WARNING);
+    }
+    // -X2C
+
+    // +X2C Operation 122
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($attrs) // ~X2C
+    {
+        trigger_error('Not implemented!', E_USER_WARNING);
+    }
+    // -X2C
+
+} // -X2C Class :Menu
+
+?>
\ No newline at end of file
diff --git a/menu/Doxyfile b/menu/Doxyfile
new file mode 100644 (file)
index 0000000..850e963
--- /dev/null
@@ -0,0 +1,227 @@
+# vim: set expandtab 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 <luca@lugmen.org.ar>                    |
+# +--------------------------------------------------------------------+
+#
+# $Id$
+#
+
+# Doxyfile 1.3-rc3
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = "BIFE Menu"
+PROJECT_NUMBER         = 0.1
+OUTPUT_DIRECTORY       = api
+OUTPUT_LANGUAGE        = English
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ALWAYS_DETAILED_SEC    = YES
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+INTERNAL_DOCS          = YES
+CASE_SENSE_NAMES       = YES
+SHORT_NAMES            = NO
+HIDE_SCOPE_NAMES       = NO
+VERBATIM_HEADERS       = YES
+SHOW_INCLUDE_FILES     = YES
+JAVADOC_AUTOBRIEF      = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+DISTRIBUTE_GROUP_DOC   = NO
+TAB_SIZE               = 8
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ALIASES                = 
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+SHOW_USED_FILES        = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = doxygen.warn
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = 
+FILE_PATTERNS          = *.php
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = YES
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = YES
+TREEVIEW_WIDTH         = 200
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = YES
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_SCHEMA             = 
+XML_DTD                = 
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = YES
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+GRAPHICAL_HIERARCHY    = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
+CGI_NAME               = search.cgi
+CGI_URL                = 
+DOC_URL                = 
+DOC_ABSPATH            = 
+BIN_ABSPATH            = /usr/local/bin/
+EXT_DOC_PATHS          = 
diff --git a/menu/Makefile b/menu/Makefile
new file mode 100644 (file)
index 0000000..81a6154
--- /dev/null
@@ -0,0 +1,41 @@
+# 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 <luca@lugmen.org.ar>                    |
+# +--------------------------------------------------------------------+
+#
+# $Id$
+#
+
+MODULE=menu
+
+PHP_FILES=$(subst ./,,$(shell find BIFE -name '*.php'))
+EXAMPLE_FILES=$(subst ./,,$(shell find examples -regex '.*\.svn.*'))
+DOC_FILES=
+
+package: package.xml $(PHP_FILES) $(EXAMPLE_FILES) $(DOC_FILES)
+       pear package
+
+code: $(MODULE).xmi xmi2code.config
+       @xmi2code
+
+code-clean:
+       @find -name '*.bak' | xargs rm -vf
diff --git a/menu/menu.xmi b/menu/menu.xmi
new file mode 100644 (file)
index 0000000..1b77a22
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<XMI xmlns:UML="org.omg/standards/UML" verified="false" timestamp="" xmi.version="1.2" >
+ <XMI.header>
+  <XMI.documentation>
+   <XMI.exporter>umbrello uml modeller http://uml.sf.net</XMI.exporter>
+   <XMI.exporterVersion>1.1</XMI.exporterVersion>
+  </XMI.documentation>
+  <XMI.model xmi.name="menu" href="/home/luca/website/www/test/bife/modules/menu/menu.xmi" />
+  <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
+ </XMI.header>
+ <XMI.content>
+  <docsettings viewid="116" documentation="Parse XML data getting widgets." uniqueid="156" />
+  <umlobjects>
+   <UML:Class stereotype="" package="BIFE" xmi.id="3" abstract="1" documentation="Base widget class.
+x2c:extern" name="Widget" static="0" scope="200" />
+   <UML:Class stereotype="" package="BIFE/Menu" xmi.id="115" abstract="0" documentation="Dynamic Menu." name="Menu" static="0" scope="200" >
+    <UML:Operation stereotype="" package="" xmi.id="121" type="void" abstract="0" documentation="Constructor." name="BIFE_Menu_Menu" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="122" type="void" abstract="0" documentation="Constructor." name="__construct" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
+    </UML:Operation>
+    <UML:Operation stereotype="" package="" xmi.id="117" type="string" abstract="0" documentation="Renders the widget using a template returning a string with the results." name="render" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_HIT" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
+    </UML:Operation>
+   </UML:Class>
+  </umlobjects>
+  <diagrams>
+   <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" showgrid="1" showopsig="0" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="116" documentation="" type="402" showops="1" showpackage="1" name="Menu Classes" localid="30000" showstereotype="0" showscope="1" font="Helvetica,9,-1,5,48,0,0,0,0,0" linecolor="#ff0000" >
+    <widgets>
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="145" showattsigs="601" usesdiagramusefillcolour="0" x="50" linecolour="#ff0000" y="137" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="67" usefillcolor="1" showattributes="1" xmi.id="115" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="90" showattsigs="600" usesdiagramusefillcolour="0" x="77" linecolour="#ff0000" y="51" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#dcdcdc" height="25" usefillcolor="1" showattributes="0" xmi.id="3" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
+    </widgets>
+    <messages/>
+    <associations>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="3" widgetaid="115" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="122" starty="137" />
+       <endpoint endx="122" endy="76" />
+      </linepath>
+     </UML:AssocWidget>
+    </associations>
+   </diagram>
+  </diagrams>
+  <listview>
+   <listitem open="1" type="800" id="-1" label="Views" >
+    <listitem open="1" type="801" id="-1" label="Logical View" >
+     <listitem open="1" type="803" id="-1" label="BIFE" >
+      <listitem open="0" type="813" id="3" label="Widget" />
+     </listitem>
+     <listitem open="1" type="803" id="-1" label="Menu" >
+      <listitem open="0" type="813" id="115" label="Menu" >
+       <listitem open="0" type="815" id="121" label="BIFE_Menu_Menu" />
+       <listitem open="0" type="815" id="122" label="__construct" />
+       <listitem open="1" type="815" id="117" label="render" />
+      </listitem>
+      <listitem open="1" type="807" id="116" label="Menu Classes" />
+     </listitem>
+    </listitem>
+    <listitem open="1" type="802" id="-1" label="Use Case View" />
+   </listitem>
+  </listview>
+ </XMI.content>
+</XMI>
diff --git a/menu/package.xml b/menu/package.xml
new file mode 100644 (file)
index 0000000..44f539d
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE package SYSTEM "/usr/share/doc/pear/data/PEAR/package.dtd">
+<package version="1.0">
+    <name>BIFE Menu</name>
+    <summary>BIFE Menu Widget Set</summary>
+    <description>TBD.
+    </description>
+    <license>GPL</license>
+    <maintainers>
+        <maintainer>
+            <user>luca</user>
+            <name>Leandro Lucarella</name>
+            <email>luca@lugmen.org.ar</email>
+            <role>lead</role>
+        </maintainer>
+    </maintainers>
+
+    <release>
+        <version>0.1</version>
+        <date>2003-06-29</date>
+        <state>alpha</state>
+        <notes>Check http://www.llucax.hn.org/desarrollo/bife/ for details.</notes>
+        <filelist>
+            <!-- PHP -->
+            <file role="php">BIFE/Menu/Menu.php</file>
+            <!-- DOC -->
+            <!-- file role="doc">README</file -->
+        </filelist>
+    </release>
+    <deps>
+        <dep type="php" rel="ge">4.2.3</dep>
+        <dep type="pkg" rel="ge" version="1.0.0beta">HTML_Template_HIT</dep>
+        <dep type="pkg" rel="ge" version="0.11">BIFE</dep>
+    </deps>
+</package>
diff --git a/menu/xmi2code.config b/menu/xmi2code.config
new file mode 100644 (file)
index 0000000..8278801
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ! vim: set expandtab 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 <luca@lugmen.org.ar>                    *
+ ! *********************************************************************+
+ ! 
+ ! $Id$
+ ! 
+ !-->
+
+<xmi2code>
+  <option key="target" value="*"/>
+  <option key="xmi-input" value="menu.xmi"/>
+  <option key="config-file" value="xmi2code.config"/>
+  <option key="config-file-set" value="false"/>
+  <option key="handler" value="umbrello"/>
+  <option key="generator-path" value="."/>
+  <option key="use-package-as-dir" value="true"/>
+  <option key="indent" value="    "/>
+  <option key="files-case" value="preserve"/>
+  <option key="generator" value="php.pear"/>
+  <option key="template-path" value="."/>
+  <option key="php.template" value="xmi2code.tpl.php"/>
+  <option key="php.default-code" value="trigger_error('Not implemented!', E_USER_WARNING);"/>
+  <option key="php.pear.use-package-in-classnames" value="true"/>
+  <option key="php.pear.underscore-in-nonpublic" value="false"/>
+</xmi2code>
diff --git a/menu/xmi2code.tpl.php b/menu/xmi2code.tpl.php
new file mode 100644 (file)
index 0000000..ce8775b
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+// vim: set expandtab 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: @@date                                  |
+// | Authors: Leandro Lucarella <luca@lugmen.org.ar>                    |
+// +--------------------------------------------------------------------+
+//
+// $Id$
+//