Primer acercamiento, basicamente esta la estructura.
--- /dev/null
+<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
+-------------------------------------------------------------------------------
+ mlib
+-------------------------------------------------------------------------------
+This file is part of mlib.
+
+mlib is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+mlib 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 Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License; if
+not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+Boston, MA 02111-1307 USA
+-------------------------------------------------------------------------------
+Created: lun ago 2 09:50:35 ART 2004
+Authors: Martín Marrese <m_marrese@argentina.com>
+ Leandro Lucarella <luca@llucax.hn.org>
+-------------------------------------------------------------------------------
+$Id$
+-----------------------------------------------------------------------------*/
+
+/**
+ * Interface / dummy class for all MLIB_Widget classes.
+ *
+ * @todo Add a global example using all the methods.
+ * @author Leandro Lucarella <luca@llucax.hn.org>
+ * @author Martín Marrese <m_marrese@argentina.com>
+ * @since 1.0
+ */
+class /* interface */ MLIB_Widget {
+
+ /**
+ * Converts the widget to a string that is human readable.
+ *
+ * @return The Widget "converted" to a string.
+ * @todo Add an example.
+ */
+ function __toString()
+ {
+ trigger_error('Not implemented!', E_USER_ERROR);
+ }
+
+ /**
+ * Draws in the screen the "converted" widget
+ *
+ * @return void.
+ * @todo Add an example.
+ */
+ function draw()
+ {
+ trigger_error('Not implemented!', E_USER_ERROR);
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
+-------------------------------------------------------------------------------
+ mlib
+-------------------------------------------------------------------------------
+This file is part of mlib.
+
+mlib is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+mlib 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 Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License; if
+not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+Boston, MA 02111-1307 USA
+-------------------------------------------------------------------------------
+Created: lun ago 2 09:50:35 ART 2004
+Authors: Martín Marrese <m_marrese@argentina.com>
+ Leandro Lucarella <luca@llucax.hn.org>
+-------------------------------------------------------------------------------
+$Id$
+-----------------------------------------------------------------------------*/
+
+/**
+ * Base class for all MLIB_Widget classes.
+ *
+ * @todo Add a global example using all the methods.
+ * @author Leandro Lucarella <luca@llucax.hn.org>
+ * @author Martín Marrese <m_marrese@argentina.com>
+ * @since 1.0
+ */
+class MLIB_Widget_Base
+
+ /**
+ * Draws in the screen the "converted" widget
+ *
+ * @return void.
+ * @todo Add an example.
+ */
+ function draw()
+ {
+ echo $this->__toString();
+ }
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
+-------------------------------------------------------------------------------
+ mlib
+-------------------------------------------------------------------------------
+This file is part of mlib.
+
+mlib is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+mlib 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 Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License; if
+not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+Boston, MA 02111-1307 USA
+-------------------------------------------------------------------------------
+Created: lun ago 2 10:48:51 ART 2004
+Authors: Martín Marrese <m_marrese@argentina.com>
+ Leandro Lucarella <luca@llucax.hn.org>
+-------------------------------------------------------------------------------
+$Id$
+-----------------------------------------------------------------------------*/
+
+require_once 'MLIB/Widget.php';
+
+/**
+ * Container base class.
+ *
+ * @todo Add a global example using all the methods.
+ * @author Leandro Lucarella <luca@llucax.hn.org>
+ * @author Martín Marrese <m_marrese@argentina.com>
+ * @since 1.0
+ */
+class MLIB_Widget_Container extends MLIB_Widget {
+
+ /**
+ * Contents of the widget.
+ *
+ * @protected
+ */
+ var $contents = array ();
+
+ /**
+ * Adds new content to the container and returns the corresponding key.
+ *
+ * @param $content New content.
+ *
+ * @return Key
+ * @todo Add an example.
+ */
+ function addContent($content)
+ {
+ $this->contents[] = $content;
+ return key($this->contents);
+ }
+
+ /**
+ * Sets new content erasing previous one.ng key.
+ *
+ * @param $content New content. It can be a single component or an array of
+ * components.
+ *
+ * @todo Add an example.
+ */
+ function setContent($content)
+ {
+ if (is_array($content))
+ {
+ $this->contents = $content;
+ }
+ else
+ {
+ $this->contents = array ($content);
+ }
+ }
+
+ /**
+ * Gets a content.
+ *
+ * @param $raw If is true, this method will return the contents array,
+ * otherwise it will return a string as result of joining the
+ * array components.
+ *
+ * @return mixed
+ * @todo Add an example.
+ */
+ function getContent($raw = false)
+ {
+ if ($raw)
+ {
+ return $this->contents;
+ }
+ else
+ {
+ $output = '';
+ foreach ($this->contents as $content)
+ {
+ if (is_object($content))
+ {
+ $output .= $content->__toString();
+ }
+ else
+ {
+ $output .= $content;
+ }
+ }
+ }
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
+-------------------------------------------------------------------------------
+ mlib
+-------------------------------------------------------------------------------
+This file is part of mlib.
+
+mlib is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+mlib 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 Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License; if
+not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+Boston, MA 02111-1307 USA
+-------------------------------------------------------------------------------
+Created: lun ago 2 11:05:12 ART 2004
+Authors: Martín Marrese <m_marrese@argentina.com>
+ Leandro Lucarella <luca@llucax.hn.org>
+-------------------------------------------------------------------------------
+$Id$
+-----------------------------------------------------------------------------*/
+
+require_once 'MLIB/Widget/Window.php';
+
+/**
+ * This class accelerates the process of creation of Web sites, creating a
+ * contextual frame where the programmer puts only the _local_ code.
+ *
+ * @todo Add a global example using all the methods.
+ * @author Leandro Lucarella <luca@llucax.hn.org>
+ * @author Martín Marrese <m_marrese@argentina.com>
+ * @since 1.0
+ */
+class MLIB_Widget_Frame extends MLIB_Widget_Window {
+
+ //Esta clase es la traduccion de MLIB_Marco.
+ //Esta es la que se utilizaria en los sistemas para agilizar el
+ //funcionamiento.
+
+ /**
+ * Constructor.
+ * For PHP4 backward compatibility.
+ *
+ * @copydoc __construct()
+ * @see __construct()
+ */
+ function MLIB_Widget_Frame($confFile, $permObject = null)
+ {
+ $this->__construct($confFile, $permObject);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param conFile Location of the configuration file.
+ * @param permObject MLIB_Perm or a derived class of it.
+ *
+ * @todo Add an example.
+ */
+ function __constructor($confFile, $permObject = null)
+ {
+ }
+
+ /**
+ * Converts the widget to a string that is human readable.
+ *
+ * @copydoc MLIB_Widget::__toString()
+ * @todo Add an example.
+ */
+ function __toString()
+ {
+ //Agrego el header.
+ //Titulo
+ //Agrego el body.
+ //Menues
+ //Cuerpo's (si son objetos llamos al metodo __toString y si este no
+ // existe al toHtml)
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
+-------------------------------------------------------------------------------
+ mlib
+-------------------------------------------------------------------------------
+This file is part of mlib.
+
+mlib is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+
+mlib 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 Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License; if
+not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+Boston, MA 02111-1307 USA
+-------------------------------------------------------------------------------
+Created: lun ago 2 11:05:12 ART 2004
+Authors: Martín Marrese <m_marrese@argentina.com>
+ Leandro Lucarella <luca@llucax.hn.org>
+-------------------------------------------------------------------------------
+$Id$
+-----------------------------------------------------------------------------*/
+
+require_once 'MLIB/Widget/Container.php';
+
+/**
+ * Window base class.
+ *
+ * @todo Add a global example using all the methods.
+ * @author Leandro Lucarella <luca@llucax.hn.org>
+ * @author Martín Marrese <m_marrese@argentina.com>
+ * @since 1.0
+ */
+class MLIB_Widget_Window extends MLIB_Widget_Container {
+
+ /**
+ * Style selected for the window.
+ *
+ * @protected
+ */
+ var $style = null;
+
+ /**
+ * Property List.
+ *
+ * @protected
+ */
+ var $properties = array ();
+
+
+ /**
+ * Constructor.
+ * For PHP4 backward compatibility.
+ *
+ * @copydoc __construct()
+ * @see __construct()
+ */
+ function MLIB_Widget_Window($style)
+ {
+ $this->__construct($style);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param style Style selected for the window.
+ * @todo Add an example.
+ */
+ function __constructor($style)
+ {
+ $this->style = $style;
+ }
+
+ /**
+ * Converts the widget to a string that is human readable.
+ *
+ * @return The Widget "converted" to a string.
+ * @todo Add an example.
+ */
+ function __toString()
+ {
+ return $tpl->parse($this->style, $this->properties);
+ }
+
+ /**
+ * Sets a property.
+ *
+ * @param key Name of the property.
+ * @param value Value of the property.
+ *
+ * @todo Add an example.
+ */
+ function setProperty($key, $value)
+ {
+ //FixMe Tiene que haber una manera mejor de hacer esto.
+ $this->properties[$key][] = $value;
+ }
+
+ /**
+ * Removes a property and returns the property value.
+ *
+ * @param key Name of the property.
+ *
+ * @return PropValue.
+ */
+ function removeProperty($key)
+ {
+ $value = $this->properties[$key];
+ unset($this->properties[$key]);
+ return $value;
+ }
+
+ /**
+ * Gets a propertie value.
+ *
+ * @param key Name of the property.
+ *
+ * @return PropValue.
+ */
+ function getProperty($key)
+ {
+ return $this->properties[$key];
+ }
+}
+?>
\ No newline at end of file