From: Leandro Lucarella Date: Sat, 31 Jul 2004 03:20:35 +0000 (+0000) Subject: Cambios estéticos, se borra el bit de ejecución en las templates y el ejemplo y X-Git-Tag: svn_import~16 X-Git-Url: https://git.llucax.com/mecon/meconlib.git/commitdiff_plain/c1e6f790144affb8d7a518bef7d5734f078ed248?ds=sidebyside Cambios estéticos, se borra el bit de ejecución en las templates y el ejemplo y se agrega ejemplo a documentación de doxygen de FileDir. --- diff --git a/lib/MLIB/Tpl/FileDir.php b/lib/MLIB/Tpl/FileDir.php index d2cb5c3..e088b89 100644 --- a/lib/MLIB/Tpl/FileDir.php +++ b/lib/MLIB/Tpl/FileDir.php @@ -31,6 +31,8 @@ require_once 'MLIB/Tpl.php'; * Hooks vs IT (HIT) is a simple template implementation, based on hooks and IT * template systems. * + * @exapmle MLIB/Tpl/FileDir/test.php + * * @note This class was originally created as a part of BIFE. * @author Leandro Lucarella * @todo Add a global example and an explanation of the directory structure to diff --git a/test/Tpl/FileDir/TPLS/body.tpl.html b/test/Tpl/FileDir/TPLS/body.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/body/cell.tpl.html b/test/Tpl/FileDir/TPLS/body/cell.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/body/row.tpl.html b/test/Tpl/FileDir/TPLS/body/row.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/body/table.tpl.html b/test/Tpl/FileDir/TPLS/body/table.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/footer/cell.tpl.html b/test/Tpl/FileDir/TPLS/footer/cell.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/footer/link_meconlib_dev.tpl.html b/test/Tpl/FileDir/TPLS/footer/link_meconlib_dev.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/footer/row.tpl.html b/test/Tpl/FileDir/TPLS/footer/row.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/footer/table.tpl.html b/test/Tpl/FileDir/TPLS/footer/table.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/footer/text.tpl.html b/test/Tpl/FileDir/TPLS/footer/text.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/header/cell.tpl.html b/test/Tpl/FileDir/TPLS/header/cell.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/header/logo.tpl.html b/test/Tpl/FileDir/TPLS/header/logo.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/header/row.tpl.html b/test/Tpl/FileDir/TPLS/header/row.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/header/table.tpl.html b/test/Tpl/FileDir/TPLS/header/table.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/TPLS/source/div.tpl.html b/test/Tpl/FileDir/TPLS/source/div.tpl.html old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/img/logo.jpg b/test/Tpl/FileDir/img/logo.jpg old mode 100755 new mode 100644 diff --git a/test/Tpl/FileDir/test_MLIB_Tpl_FileDir.php b/test/Tpl/FileDir/test.php old mode 100755 new mode 100644 similarity index 81% rename from test/Tpl/FileDir/test_MLIB_Tpl_FileDir.php rename to test/Tpl/FileDir/test.php index c2d77dd..e84c0e2 --- a/test/Tpl/FileDir/test_MLIB_Tpl_FileDir.php +++ b/test/Tpl/FileDir/test.php @@ -1,4 +1,4 @@ - Leandro Lucarella ------------------------------------------------------------------------------- -$Id: Tpl.php 584 2004-07-30 05:50:10Z luca $ +$Id$ -----------------------------------------------------------------------------*/ //{{{Explanation of this example. @@ -32,6 +32,7 @@ $Id: Tpl.php 584 2004-07-30 05:50:10Z luca $ //}}} //{{{ Require Once. +ini_set('include_path', '../../../lib:' . ini_get('include_path')); require_once 'MLIB/Tpl/FileDir.php'; //}}} @@ -41,8 +42,8 @@ $img_source = './img/logo.jpg'; //}}} //{{{ Create a page from a template. -$HIT =& new MLIB_Tpl_FileDir ('TPLS'); // Where TPLS is the subdirectory where I'll - // put my html_templates. +$TPL =& new MLIB_Tpl_FileDir ('TPLS'); // Where TPLS is the subdirectory where I'll + // put my html_templates. //}}} //{{{ Show this source @@ -59,14 +60,14 @@ if (@$_GET['source']) else { //{{{ Add header group of templates. - $HIT->pushGroup('header'); + $TPL->pushGroup('header'); //{{{ First ROW //{{{ Obtain the data cells of the first row. - $cells = $HIT->parse('cell', + $cells = $TPL->parse('cell', array ( 'ATTR' => 'width="20%" align="center"', //Sets the width of the cell. - 'CELL' => $HIT->parse('logo', //Add the logo image to this cell. + 'CELL' => $TPL->parse('logo', //Add the logo image to this cell. array( 'SRC' => $img_source, //Source of the image. 'ATTR' => 'border="0"', //Image attributes @@ -75,7 +76,7 @@ else ) ) ); - $cells.= $HIT->parse('cell', + $cells.= $TPL->parse('cell', array ( 'ATTR' => 'width="80%" align="center"', //Sets the width of the cell. 'CELL' => 'MLIB_Tpl_FileDir Example' //Title. @@ -84,12 +85,12 @@ else //}}} // Obtain the first row of the header table. - $rows = $HIT->parse('row', 'CELL', $cells); + $rows = $TPL->parse('row', 'CELL', $cells); //}}} //{{{ Second Row // Obtain the data cells of the first row. - $cells = $HIT->parse('cell', + $cells = $TPL->parse('cell', array ( 'ATTR' => 'colspan="2" align="center"', //Sets the width of the cell. 'CELL' => 'This is the second row of the header table.' @@ -97,11 +98,11 @@ else ); // Obtain the first row of the header table. - $rows.= $HIT->parse('row', 'CELL', $cells); + $rows.= $TPL->parse('row', 'CELL', $cells); //}}} // Obtain the parsed templates and add it to the header "main" template. - $HEADER = $HIT->parse( + $HEADER = $TPL->parse( 'table', array ( 'ATTR' => $table_width . ' border="1" align="center"', @@ -109,14 +110,14 @@ else ) ); // Remove from the group stack the header group. - $HIT->popGroup('header'); + $TPL->popGroup('header'); //}}} //{{{ Add body group of templates. - $HIT->pushGroup('body'); + $TPL->pushGroup('body'); //{{{ First ROW - $cells = $HIT->parse('cell', + $cells = $TPL->parse('cell', array ( 'ATTR' => 'valign="center" align="center" height="370"', //Sets the width of the cell. 'CELL' => 'BODY' //Body Content @@ -124,11 +125,11 @@ else ); // Obtain the first row of the header table. - $rows = $HIT->parse('row', 'CELL', $cells); + $rows = $TPL->parse('row', 'CELL', $cells); //}}} // Obtain the parsed templates and add it to the header "main" template. - $BODY = $HIT->parse( + $BODY = $TPL->parse( 'table', array ( 'ATTR' => $table_width . ' border="0" align="center"', @@ -136,33 +137,33 @@ else ) ); // Remove from the group stack the header group. - $HIT->popGroup('body'); + $TPL->popGroup('body'); //}}} //{{{ Add footer group of templates. - $HIT->pushGroup('footer'); + $TPL->pushGroup('footer'); //{{{ First ROW //{{{ Obtain the data cells of the first row. - $cells = $HIT->parse('cell', + $cells = $TPL->parse('cell', array ( 'ATTR' => 'align="center"', //Sets the width of the cell. - 'CELL' => $HIT->parse( + 'CELL' => $TPL->parse( 'text', 'LINK', - $HIT->parse('link_meconlib_dev') + $TPL->parse('link_meconlib_dev') ) ) ); //}}} // Obtain the first row of the header table. - $rows = $HIT->parse('row', 'CELL', $cells); + $rows = $TPL->parse('row', 'CELL', $cells); //}}} // Obtain the parsed templates and add it to the header "main" template. - $FOOTER = $HIT->parse( + $FOOTER = $TPL->parse( 'table', array ( 'ATTR' => $table_width . ' border="1" align="center"', @@ -170,25 +171,25 @@ else ) ); // Remove from the group stack the header group. - $HIT->popGroup('footer'); + $TPL->popGroup('footer'); //}}} //{{{ Add SOURCE group of templates. - $HIT->pushGroup('source'); + $TPL->pushGroup('source'); // Obtain the parsed templates and add it to the header "main" template. - $SOURCE = $HIT->parse('div'); + $SOURCE = $TPL->parse('div'); // Remove from the group stack the header group. - $HIT->popGroup('source'); + $TPL->popGroup('source'); //}}} } //}}} //{{{ Add all the parsed templates to the main template. -$RESULT = $HIT->parse( +$RESULT = $TPL->parse( 'body', array ( - 'TITLE' => 'MLIB_Tpl_HIT Test', + 'TITLE' => 'MLIB_Tpl_FileDir Test', 'BODY' => $HEADER . $BODY . $FOOTER, 'SOURCE' => $SOURCE ) @@ -199,4 +200,4 @@ $RESULT = $HIT->parse( echo $RESULT; //}}} -?> +?> \ No newline at end of file