]> git.llucax.com Git - software/bife/bife-all.git/commitdiff
* Added __construc() method for PHP5 forward compatibility.
authorLeandro Lucarella <llucax@gmail.com>
Wed, 21 May 2003 01:04:55 +0000 (01:04 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Wed, 21 May 2003 01:04:55 +0000 (01:04 +0000)
* Updated and fixed UML diagram and generated code.
* Changed internal contents management of Container class.
* Fixed xmi2code config file.
* Added a Fallback class to use when the Parser doesn't finds a class for a
  widget (TBD).

doc/bife.xmi
examples/index.php
src/BIFE/Album.php
src/BIFE/Container.php
src/BIFE/Fallback.php [new file with mode: 0644]
src/BIFE/Generic.php
src/BIFE/Page.php
src/BIFE/Title.php
src/BIFE/Widget.php
xmi2code.config

index 120fc0147a55843b89ba6cdc2310f4316c669a28..f36bd7e85fd35422ff7c2772cf5ac686dedc48b5 100644 (file)
@@ -5,47 +5,58 @@
    <XMI.exporter>umbrello uml modeller http://uml.sf.net</XMI.exporter>
    <XMI.exporterVersion>1.1</XMI.exporterVersion>
   </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/llucar/public_html/bife/bife.xmi" />
+  <XMI.model xmi.name="bife" href="/mnt/burns/luca/website/www/test/bife/doc/bife.xmi" />
   <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
  </XMI.header>
  <XMI.content>
   <XMI.metamodel xmi.name="UML" href="UML.xml" xmi.version="1.3" />
  </XMI.header>
  <XMI.content>
-  <docsettings viewid="41" documentation="" uniqueid="46" />
+  <docsettings viewid="2" documentation="" uniqueid="72" />
   <umlobjects>
    <UML:Class stereotype="" package="BIFE" xmi.id="3" abstract="1" documentation="Base widget class." name="Widget" static="0" scope="200" >
   <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="4" type="void" abstract="1" documentation="Renders the widget returning a string.
-
-Renders the widget using a template returning a string with the
-results." name="render" static="0" scope="200" >
+    <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_Sigma" abstract="0" documentation="Template object to render the widget." name="template" static="0" scope="200" />
     </UML:Operation>
    </UML:Class>
    <UML:Class stereotype="" package="BIFE" xmi.id="5" abstract="1" documentation="Base container widget class." name="Container" static="0" scope="200" >
      <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_Sigma" abstract="0" documentation="Template object to render the widget." name="template" static="0" scope="200" />
     </UML:Operation>
    </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="1" documentation="Adds contents to the container." name="addContents" static="0" scope="200" >
-     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Contents to add to the container." name="contents" static="0" scope="200" />
+    <UML:Operation stereotype="" package="" xmi.id="48" type="void" abstract="0" documentation="Constructor." name="BIFE_Container" static="0" scope="200" />
+    <UML:Operation stereotype="" package="" xmi.id="50" type="void" abstract="0" documentation="Constructor." name="__construct" 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="render" static="0" scope="200" >
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_Sigma" abstract="0" documentation="Template object to render the widget." name="template" static="0" scope="200" />
     </UML:Operation>
     </UML:Operation>
+    <UML:Attribute stereotype="" package="" xmi.id="47" value="" type="array" abstract="0" documentation="" name="contents" static="0" scope="200" />
    </UML:Class>
    <UML:Class stereotype="" package="BIFE" xmi.id="7" abstract="1" documentation="This is a generic and simple BIFE_Container implementation." name="Generic" static="0" scope="200" >
     <UML:Operation stereotype="" package="" xmi.id="10" type="void" abstract="0" documentation="Constructor." name="BIFE_Generic" 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:Class>
    <UML:Class stereotype="" package="BIFE" xmi.id="7" abstract="1" documentation="This is a generic and simple BIFE_Container implementation." name="Generic" static="0" scope="200" >
     <UML:Operation stereotype="" package="" xmi.id="10" type="void" abstract="0" documentation="Constructor." name="BIFE_Generic" 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="51" 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="11" type="void" abstract="0" documentation="Add contents to the widget." name="addContents" static="0" scope="200" >
     <UML:Operation stereotype="" package="" xmi.id="11" type="void" abstract="0" documentation="Add contents to the widget." name="addContents" static="0" scope="200" >
-     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="string" abstract="0" documentation="Contents to add." name="contents" static="0" scope="200" />
+     <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;mixed" abstract="0" documentation="Contents to add." name="contents" static="0" scope="200" />
     </UML:Operation>
     </UML:Operation>
-    <UML:Operation stereotype="" package="" xmi.id="12" type="void" abstract="0" documentation="Renders the widget." name="render" 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_Sigma" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
     </UML:Operation>
     <UML:Attribute stereotype="" package="" xmi.id="8" value="" type="array" abstract="0" documentation="Attribute list." name="attrs" static="0" scope="200" />
      <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_Sigma" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
     </UML:Operation>
     <UML:Attribute stereotype="" package="" xmi.id="8" value="" type="array" abstract="0" documentation="Attribute list." name="attrs" static="0" scope="200" />
-    <UML:Attribute stereotype="" package="" xmi.id="9" value="" type="string" abstract="0" documentation="" name="contents" static="0" scope="200" />
    </UML:Class>
    <UML:Class stereotype="" package="BIFE" xmi.id="14" abstract="0" documentation="Page widget." name="Page" static="0" scope="200" >
     <UML:Operation stereotype="" package="" xmi.id="15" type="void" abstract="0" documentation="Constructor." name="BIFE_Page" 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:Class>
    <UML:Class stereotype="" package="BIFE" xmi.id="14" abstract="0" documentation="Page widget." name="Page" static="0" scope="200" >
     <UML:Operation stereotype="" package="" xmi.id="15" type="void" abstract="0" documentation="Constructor." name="BIFE_Page" 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="53" 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:Class>
    <UML:Class stereotype="" package="BIFE" xmi.id="17" abstract="0" documentation="Title widget." name="Title" static="0" scope="200" >
     <UML:Operation stereotype="" package="" xmi.id="18" type="void" abstract="0" documentation="Constructor." name="BIFE_Title" 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:Class>
    <UML:Class stereotype="" package="BIFE" xmi.id="17" abstract="0" documentation="Title widget." name="Title" static="0" scope="200" >
     <UML:Operation stereotype="" package="" xmi.id="18" type="void" abstract="0" documentation="Constructor." name="BIFE_Title" 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="55" 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:Class>
    <UML:Class stereotype="" package="BIFE" xmi.id="20" abstract="0" documentation="Photo album widget.
 
    </UML:Class>
    <UML:Class stereotype="" package="BIFE" xmi.id="20" abstract="0" documentation="Photo album widget.
 
@@ -53,7 +64,10 @@ results." name="render" static="0" scope="200" >
     <UML:Operation stereotype="" package="" xmi.id="22" type="void" abstract="0" documentation="Constructor." name="BIFE_Album" 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="22" type="void" abstract="0" documentation="Constructor." name="BIFE_Album" 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="void" abstract="0" documentation="Renders the widget." name="render" static="0" scope="200" >
+    <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_Sigma" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
     </UML:Operation>
     <UML:Attribute stereotype="" package="" xmi.id="21" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
      <UML:Parameter stereotype="" package="" xmi.id="1" value="" type="&amp;HTML_Template_Sigma" abstract="0" documentation="Template to use to render the widget." name="template" static="0" scope="200" />
     </UML:Operation>
     <UML:Attribute stereotype="" package="" xmi.id="21" value="" type="array" abstract="0" documentation="Attributes." name="attrs" static="0" scope="200" />
@@ -92,55 +106,72 @@ results." name="render" static="0" scope="200" >
     <UML:Attribute stereotype="" package="" xmi.id="28" value="" type="HTML_Template_Sigma" abstract="0" documentation="Template to use to render the parsed file." name="template" static="0" scope="200" />
     <UML:Attribute stereotype="" package="" xmi.id="29" value="" type="array" abstract="0" documentation="BIFE widgets stack." name="stack" static="0" scope="200" />
    </UML:Class>
     <UML:Attribute stereotype="" package="" xmi.id="28" value="" type="HTML_Template_Sigma" abstract="0" documentation="Template to use to render the parsed file." name="template" static="0" scope="200" />
     <UML:Attribute stereotype="" package="" xmi.id="29" value="" type="array" abstract="0" documentation="BIFE widgets stack." name="stack" static="0" scope="200" />
    </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:Class>
   </umlobjects>
   <diagrams>
    <diagram snapgrid="1" showattsig="1" fillcolor="#ffffc0" showgrid="1" showopsig="1" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="2" documentation="" type="402" showops="1" showpackage="1" name="Class Diagram" localid="30000" showstereotype="0" showscope="1" font="Helvetica,10,-1,5,48,0,0,0,0,0" linecolor="#ff0000" >
     <widgets>
   </umlobjects>
   <diagrams>
    <diagram snapgrid="1" showattsig="1" fillcolor="#ffffc0" showgrid="1" showopsig="1" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="2" documentation="" type="402" showops="1" showpackage="1" name="Class Diagram" localid="30000" showstereotype="0" showscope="1" font="Helvetica,10,-1,5,48,0,0,0,0,0" linecolor="#ff0000" >
     <widgets>
-     <UML:ConceptWidget usesdiagramfillcolour="0" width="104" showattsigs="601" usesdiagramusefillcolour="0" x="170" linecolour="#ff0000" y="70" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="3" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
-     <UML:ConceptWidget usesdiagramfillcolour="0" width="123" showattsigs="601" usesdiagramusefillcolour="0" x="80" linecolour="#ff0000" y="160" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="5" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
-     <UML:ConceptWidget usesdiagramfillcolour="0" width="109" showattsigs="601" usesdiagramusefillcolour="0" x="90" linecolour="#ff0000" y="260" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="7" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
-     <UML:ConceptWidget usesdiagramfillcolour="0" width="90" showattsigs="601" usesdiagramusefillcolour="0" x="30" linecolour="#ff0000" y="360" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="14" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
-     <UML:ConceptWidget usesdiagramfillcolour="0" width="84" showattsigs="601" usesdiagramusefillcolour="0" x="170" linecolour="#ff0000" y="360" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="17" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
-     <UML:ConceptWidget usesdiagramfillcolour="0" width="98" showattsigs="601" usesdiagramusefillcolour="0" x="250" linecolour="#ff0000" y="160" showopsigs="601" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="28" usefillcolor="1" showattributes="0" xmi.id="20" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="104" showattsigs="601" usesdiagramusefillcolour="0" x="270" linecolour="#ff0000" y="30" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="42" usefillcolor="1" showattributes="1" xmi.id="3" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="145" showattsigs="601" usesdiagramusefillcolour="0" x="160" linecolour="#ff0000" y="130" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="102" usefillcolor="1" showattributes="1" xmi.id="5" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="131" showattsigs="601" usesdiagramusefillcolour="0" x="100" linecolour="#ff0000" y="290" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="102" usefillcolor="1" showattributes="1" xmi.id="7" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="120" showattsigs="601" usesdiagramusefillcolour="0" x="30" linecolour="#ff0000" y="460" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="59" usefillcolor="1" showattributes="1" xmi.id="14" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="120" showattsigs="600" usesdiagramusefillcolour="0" x="190" linecolour="#ff0000" y="460" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="59" usefillcolor="1" showattributes="1" xmi.id="17" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="120" showattsigs="601" usesdiagramusefillcolour="0" x="360" linecolour="#ff0000" y="130" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="85" usefillcolor="1" showattributes="1" xmi.id="20" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
+     <UML:ConceptWidget usesdiagramfillcolour="0" width="134" showattsigs="601" usesdiagramusefillcolour="0" x="260" linecolour="#ff0000" y="290" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="59" usefillcolor="1" showattributes="1" xmi.id="61" showoperations="1" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,10,-1,5,48,0,0,0,0,0" />
     </widgets>
     <messages/>
     <associations>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="1" widgetbid="3" widgetaid="5" documentation="" type="500" >
       <linepath>
     </widgets>
     <messages/>
     <associations>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="1" widgetbid="3" widgetaid="5" documentation="" type="500" >
       <linepath>
-       <startpoint startx="141" starty="160" />
-       <endpoint endx="204" endy="98" />
+       <startpoint startx="232" starty="130" />
+       <endpoint endx="304" endy="72" />
       </linepath>
      </UML:AssocWidget>
       </linepath>
      </UML:AssocWidget>
-     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="2" indexb="1" widgetbid="5" widgetaid="7" documentation="" type="500" >
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="1" widgetbid="5" widgetaid="7" documentation="" type="500" >
       <linepath>
       <linepath>
-       <startpoint startx="144" starty="260" />
-       <endpoint endx="141" endy="188" />
+       <startpoint startx="165" starty="290" />
+       <endpoint endx="208" endy="232" />
       </linepath>
      </UML:AssocWidget>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="1" widgetbid="7" widgetaid="14" documentation="" type="500" >
       <linepath>
       </linepath>
      </UML:AssocWidget>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="1" widgetbid="7" widgetaid="14" documentation="" type="500" >
       <linepath>
-       <startpoint startx="75" starty="360" />
-       <endpoint endx="126" endy="288" />
+       <startpoint startx="90" starty="460" />
+       <endpoint endx="143" endy="392" />
       </linepath>
      </UML:AssocWidget>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="2" widgetbid="7" widgetaid="17" documentation="" type="500" >
       <linepath>
       </linepath>
      </UML:AssocWidget>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="2" widgetbid="7" widgetaid="17" documentation="" type="500" >
       <linepath>
-       <startpoint startx="212" starty="360" />
-       <endpoint endx="162" endy="288" />
+       <startpoint startx="250" starty="460" />
+       <endpoint endx="187" endy="392" />
       </linepath>
      </UML:AssocWidget>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="2" widgetbid="3" widgetaid="20" documentation="" type="500" >
       <linepath>
       </linepath>
      </UML:AssocWidget>
      <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="2" widgetbid="3" widgetaid="20" documentation="" type="500" >
       <linepath>
-       <startpoint startx="299" starty="160" />
-       <endpoint endx="239" endy="98" />
+       <startpoint startx="420" starty="130" />
+       <endpoint endx="339" endy="72" />
+      </linepath>
+     </UML:AssocWidget>
+     <UML:AssocWidget totalcounta="2" indexa="1" totalcountb="3" indexb="2" widgetbid="5" widgetaid="61" documentation="" type="500" >
+      <linepath>
+       <startpoint startx="327" starty="290" />
+       <endpoint endx="256" endy="232" />
       </linepath>
      </UML:AssocWidget>
     </associations>
    </diagram>
    <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" showgrid="0" showopsig="1" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="41" documentation="" type="403" showops="1" showpackage="0" name="Parse" localid="29998" showstereotype="0" showscope="1" font="Helvetica,12,-1,5,50,0,0,0,0,0" linecolor="#ff0000" >
     <widgets>
       </linepath>
      </UML:AssocWidget>
     </associations>
    </diagram>
    <diagram snapgrid="0" showattsig="1" fillcolor="#ffffc0" showgrid="0" showopsig="1" usefillcolor="1" snapx="10" snapy="10" showatts="1" xmi.id="41" documentation="" type="403" showops="1" showpackage="0" name="Parse" localid="29998" showstereotype="0" showscope="1" font="Helvetica,12,-1,5,50,0,0,0,0,0" linecolor="#ff0000" >
     <widgets>
-     <UML:ObjectWidget usesdiagramfillcolour="0" width="71" usesdiagramusefillcolour="0" x="62" linecolour="#ff0000" y="49" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="31" usefillcolor="1" length="250" xmi.id="25" decon="0" localid="29999" multipleinstance="0" drawasactor="0" font="Helvetica,12,-1,5,50,0,0,0,0,0" />
-     <UML:ObjectWidget usesdiagramfillcolour="0" width="74" usesdiagramusefillcolour="0" x="478" linecolour="#ff0000" y="49" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="31" usefillcolor="1" length="250" xmi.id="3" decon="0" localid="29998" multipleinstance="0" drawasactor="0" font="Helvetica,12,-1,5,50,0,0,0,0,0" />
+     <UML:ObjectWidget usesdiagramfillcolour="0" width="71" usesdiagramusefillcolour="0" x="62" linecolour="#ff0000" y="49" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="29" usefillcolor="1" length="250" xmi.id="25" decon="0" localid="29999" multipleinstance="0" drawasactor="0" font="Helvetica,12,-1,5,50,0,0,0,0,0" />
+     <UML:ObjectWidget usesdiagramfillcolour="0" width="74" usesdiagramusefillcolour="0" x="478" linecolour="#ff0000" y="49" instancename="" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="29" usefillcolor="1" length="250" xmi.id="3" decon="0" localid="29998" multipleinstance="0" drawasactor="0" font="Helvetica,12,-1,5,50,0,0,0,0,0" />
     </widgets>
     <messages>
      <UML:MessageWidget usesdiagramfillcolour="1" width="416" usesdiagramusefillcolour="1" x="98" linecolour="none" y="119" operation="render(template : &amp;HTML_Template_Sigma) : void" widgetbid="29998" usesdiagramlinecolour="1" fillcolour="none" height="8" usefillcolor="1" seqnum="" widgetaid="29999" textid="42" xmi.id="43" font="helvetica,12,-1,5,50,0,0,0,0,0" />
     </widgets>
     <messages>
      <UML:MessageWidget usesdiagramfillcolour="1" width="416" usesdiagramusefillcolour="1" x="98" linecolour="none" y="119" operation="render(template : &amp;HTML_Template_Sigma) : void" widgetbid="29998" usesdiagramlinecolour="1" fillcolour="none" height="8" usefillcolor="1" seqnum="" widgetaid="29999" textid="42" xmi.id="43" font="helvetica,12,-1,5,50,0,0,0,0,0" />
@@ -172,25 +203,36 @@ results." name="render" static="0" scope="200" >
      <listitem open="1" type="803" id="-1" label="Widgets" >
       <listitem open="0" type="813" id="20" label="Album" >
        <listitem open="0" type="815" id="22" label="BIFE_Album" />
      <listitem open="1" type="803" id="-1" label="Widgets" >
       <listitem open="0" type="813" id="20" label="Album" >
        <listitem open="0" type="815" id="22" label="BIFE_Album" />
+       <listitem open="0" type="815" id="57" label="__construct" />
        <listitem open="0" type="814" id="21" label="attrs" />
        <listitem open="0" type="815" id="23" label="render" />
       </listitem>
       <listitem open="0" type="807" id="2" label="Class Diagram" />
       <listitem open="0" type="813" id="5" label="Container" >
        <listitem open="0" type="814" id="21" label="attrs" />
        <listitem open="0" type="815" id="23" label="render" />
       </listitem>
       <listitem open="0" type="807" id="2" label="Class Diagram" />
       <listitem open="0" type="813" id="5" label="Container" >
+       <listitem open="0" type="815" id="48" label="BIFE_Container" />
+       <listitem open="0" type="815" id="50" label="__construct" />
        <listitem open="0" type="815" id="6" label="addContents" />
        <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="render" />
+      </listitem>
+      <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>
       <listitem open="0" type="813" id="7" label="Generic" >
        <listitem open="0" type="815" id="10" label="BIFE_Generic" />
       </listitem>
       <listitem open="0" type="813" id="7" label="Generic" >
        <listitem open="0" type="815" id="10" label="BIFE_Generic" />
+       <listitem open="0" type="815" id="51" label="__construct" />
        <listitem open="0" type="815" id="11" label="addContents" />
        <listitem open="0" type="814" id="8" label="attrs" />
        <listitem open="0" type="815" id="11" label="addContents" />
        <listitem open="0" type="814" id="8" label="attrs" />
-       <listitem open="0" type="814" id="9" label="contents" />
        <listitem open="0" type="815" id="12" label="render" />
       </listitem>
       <listitem open="0" type="813" id="14" label="Page" >
        <listitem open="0" type="815" id="15" label="BIFE_Page" />
        <listitem open="0" type="815" id="12" label="render" />
       </listitem>
       <listitem open="0" type="813" id="14" label="Page" >
        <listitem open="0" type="815" id="15" label="BIFE_Page" />
+       <listitem open="0" type="815" id="53" label="__construct" />
       </listitem>
       <listitem open="0" type="813" id="17" label="Title" >
        <listitem open="0" type="815" id="18" label="BIFE_Title" />
       </listitem>
       <listitem open="0" type="813" id="17" label="Title" >
        <listitem open="0" type="815" id="18" label="BIFE_Title" />
+       <listitem open="0" type="815" id="55" label="__construct" />
       </listitem>
       <listitem open="0" type="813" id="3" label="Widget" >
        <listitem open="0" type="815" id="4" label="render" />
       </listitem>
       <listitem open="0" type="813" id="3" label="Widget" >
        <listitem open="0" type="815" id="4" label="render" />
index 57a35af254a681221764d84c8230930aec31fe32..5e216233c96e1ec6e3701765914ddaab9f49ad9f 100644 (file)
@@ -30,7 +30,6 @@ $tmp = ini_get('include_path');
 ini_set('include_path', "../src:$tmp");
 unset($tmp);
 
 ini_set('include_path', "../src:$tmp");
 unset($tmp);
 
-require_once 'prepend.php';
 require_once 'HTML/Template/Sigma.php';
 require_once 'BIFE/Parser.php';
 require_once 'BIFE/Page.php';
 require_once 'HTML/Template/Sigma.php';
 require_once 'BIFE/Parser.php';
 require_once 'BIFE/Page.php';
index 3b19ad44c2e34d37f7bee24467877f0b07298eae..07fb437c64509fd5b6f2ac7dd3ca1382d8bf8974 100644 (file)
@@ -59,6 +59,21 @@ class BIFE_Album extends BIFE_Widget {
      * @access public
      */
     function BIFE_Album($attrs) // ~X2C
      * @access public
      */
     function BIFE_Album($attrs) // ~X2C
+    {
+        $this->__construct($attrs);
+    }
+    // -X2C
+
+    // +X2C Operation 57
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($attrs) // ~X2C
     {
         $defaults = array(
             'DIR'           => '.',
     {
         $defaults = array(
             'DIR'           => '.',
@@ -80,7 +95,7 @@ class BIFE_Album extends BIFE_Widget {
      *
      * @param  HTML_Template_Sigma &$template Template to use to render the widget.
      *
      *
      * @param  HTML_Template_Sigma &$template Template to use to render the widget.
      *
-     * @return void
+     * @return string
      * @access public
      */
     function render(&$template) // ~X2C
      * @access public
      */
     function render(&$template) // ~X2C
index d1ea194aefe10878372e84e1088330340e58b295..14c71054344ea3867fd321812ac1ece49924a4a8 100644 (file)
@@ -38,22 +38,80 @@ require_once 'BIFE/Widget.php';
  * @abstract
  */
 class BIFE_Container extends BIFE_Widget {
  * @abstract
  */
 class BIFE_Container extends BIFE_Widget {
+    /**
+     * @var    array $contents
+     * @access public
+     */
+    var $contents;
+
     // ~X2C
 
     // ~X2C
 
+    // +X2C Operation 48
+    /**
+     * Constructor.
+     *
+     * @return void
+     * @access public
+     */
+    function BIFE_Container() // ~X2C
+    {
+        $this->__construct();
+    }
+    // -X2C
+
+    // +X2C Operation 50
+    /**
+     * Constructor.
+     *
+     * @return void
+     * @access public
+     */
+    function __construct() // ~X2C
+    {
+        $this->contents = array();
+    }
+    // -X2C
+
     // +X2C Operation 6
     /**
      * Adds contents to the container.
      *
     // +X2C Operation 6
     /**
      * Adds contents to the container.
      *
-     * @param  string $contents Contents to add to the container.
+     * @param  mixed &$contents Contents to add to the container.
      *
      * @return void
      * @access public
      *
      * @return void
      * @access public
-     * @abstract
      */
      */
-    function addContents($contents) // ~X2C
+    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_Sigma &$template Template object to render the widget.
+     *
+     * @return string
+     * @access public
+     */
+    function render(&$template) // ~X2C
     {
     {
-        trigger_error('Method not implemented '.get_class($this).
-            '::addContents().', E_USER_ERROR);
+        $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
 
diff --git a/src/BIFE/Fallback.php b/src/BIFE/Fallback.php
new file mode 100644 (file)
index 0000000..ed6ebdd
--- /dev/null
@@ -0,0 +1,78 @@
+<?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 {
+    // ~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
+    {
+        trigger_error('Not implemented!', E_USER_WARNING);
+    }
+    // -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
+    {
+        trigger_error('Not implemented!', E_USER_WARNING);
+    }
+    // -X2C
+
+} // -X2C Class :Fallback
+?>
\ No newline at end of file
index 6b5258e98d5117d69de79af9b2440f4c296b0de6..1cca6451eeb989ad7734786292a3b345cc35c6e5 100644 (file)
@@ -47,12 +47,6 @@ class BIFE_Generic extends BIFE_Container {
      */
     var $attrs;
 
      */
     var $attrs;
 
-    /**
-     * @var    string $contents
-     * @access public
-     */
-    var $contents;
-
     // ~X2C
 
     // +X2C Operation 10
     // ~X2C
 
     // +X2C Operation 10
@@ -66,8 +60,23 @@ class BIFE_Generic extends BIFE_Container {
      */
     function BIFE_Generic($attrs) // ~X2C
     {
      */
     function BIFE_Generic($attrs) // ~X2C
     {
-        $this->attrs    = $attrs;
-        $this->contents = '';
+        $this->__construct($attrs);
+    }
+    // -X2C
+
+    // +X2C Operation 51
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($attrs) // ~X2C
+    {
+        parent::__construct();
+        $this->attrs = $attrs;
     }
     // -X2C
 
     }
     // -X2C
 
@@ -75,14 +84,17 @@ class BIFE_Generic extends BIFE_Container {
     /**
      * Add contents to the widget.
      *
     /**
      * Add contents to the widget.
      *
-     * @param  string $contents Contents to add.
+     * @param  mixed &$contents Contents to add.
      *
      * @return void
      * @access public
      */
      *
      * @return void
      * @access public
      */
-    function addContents($contents) // ~X2C
+    function addContents(&$contents) // ~X2C
     {
     {
-        $this->contents .= trim($contents);
+        if (is_string($contents)) {
+            $contents = trim($contents);
+        }
+        parent::addContents($contents);
     }
     // -X2C
 
     }
     // -X2C
 
@@ -92,18 +104,18 @@ class BIFE_Generic extends BIFE_Container {
      *
      * @param  HTML_Template_Sigma &$template Template to use to render the widget.
      *
      *
      * @param  HTML_Template_Sigma &$template Template to use to render the widget.
      *
-     * @return void
+     * @return string
      * @access public
      */
     function render(&$template) // ~X2C
     {
         $template->loadTemplateFile(get_class($this).'.html');
         $template->setVariable($this->attrs);
      * @access public
      */
     function render(&$template) // ~X2C
     {
         $template->loadTemplateFile(get_class($this).'.html');
         $template->setVariable($this->attrs);
-        $template->setVariable('CONTENTS', $this->contents);
+        $template->setVariable('CONTENTS', parent::render($template));
         return $template->get();
     }
     // -X2C
 
 } // -X2C Class :Generic
 
         return $template->get();
     }
     // -X2C
 
 } // -X2C Class :Generic
 
-?>
\ No newline at end of file
+?>
index e1d8aaafef07c843515761ba4359dcef23b78add..0d6455c14df1dc9a33cdb0404a2f13df27f52e29 100644 (file)
@@ -50,7 +50,22 @@ class BIFE_Page extends BIFE_Generic {
      */
     function BIFE_Page($attrs) // ~X2C
     {
      */
     function BIFE_Page($attrs) // ~X2C
     {
-        $this->BIFE_Generic($attrs);
+        $this->__construct($attrs);
+    }
+    // -X2C
+
+    // +X2C Operation 53
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($attrs) // ~X2C
+    {
+        parent::__construct($attrs);
     }
     // -X2C
 
     }
     // -X2C
 
index 518ded2df3141720475c3372fbdf62b554bedfc0..6ff15cf2518245846649b815f6f70d02d1d27067 100644 (file)
@@ -50,7 +50,22 @@ class BIFE_Title extends BIFE_Generic {
      */
     function BIFE_Title($attrs) // ~X2C
     {
      */
     function BIFE_Title($attrs) // ~X2C
     {
-        $this->BIFE_Generic($attrs);
+        $this->__construct($attrs);
+    }
+    // -X2C
+
+    // +X2C Operation 55
+    /**
+     * Constructor.
+     *
+     * @param  array $attrs Attributes.
+     *
+     * @return void
+     * @access public
+     */
+    function __construct($attrs) // ~X2C
+    {
+        parent::__construct($attrs);
     }
     // -X2C
 
     }
     // -X2C
 
index 56ee704e8e43aeed337c963f215e6216b4d1cc49..96ecdd419d9d274758e4075a8ed4f125407d0c16 100644 (file)
@@ -38,13 +38,11 @@ class BIFE_Widget {
 
     // +X2C Operation 4
     /**
 
     // +X2C Operation 4
     /**
-     * Renders the widget returning a string.
-Renders the widget using a template returning a string with the
-results.
+     * Renders the widget using a template returning a string with the results.
      *
      * @param  HTML_Template_Sigma &$template Template object to render the widget.
      *
      *
      * @param  HTML_Template_Sigma &$template Template object to render the widget.
      *
-     * @return void
+     * @return string
      * @access public
      * @abstract
      */
      * @access public
      * @abstract
      */
index 9ef07d064b38dadfc4d4f42ad4a7521b435b8ab9..688b61e10bb9c3057e140ff5c67862eb7e8b1268 100644 (file)
@@ -1,28 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
  ! vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
 <?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>                    |
- ! +--------------------------------------------------------------------+
+ ! **********************************************************************
+ ! *                       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$
  ! 
  ! 
  ! $Id$
  !