]> git.llucax.com Git - software/bife/bife-all.git/commitdiff
- Added a new feature to Link. Now if the URL is a directory (finishes with
authorLeandro Lucarella <llucax@gmail.com>
Thu, 10 Jul 2003 04:02:26 +0000 (04:02 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Thu, 10 Jul 2003 04:02:26 +0000 (04:02 +0000)
  '/'), index.xbf is automaticly appended.
- Added two new functions to deal with subdirectories and Apaches 'PATH_INFO':
  getWebPath() and getFsPath(). Both returns a string to prepend to a path to
  fix it, one for URL paths and the other for Filesystem paths.
- Added subdirectory support examples.
- Updated UML diagram and version numbers.

base/Doxyfile
base/base.xmi
base/examples/dir/index.xbf [new file with mode: 0644]
base/examples/dir/subdir/index.xbf [new file with mode: 0644]
base/examples/index.xbf
base/examples/otherdir/index.xbf [new file with mode: 0644]
base/package.xml
base/src/BIFE/Link.php

index d217b67f86925972dcae874a9e20ba893b7c83b9..1707af633332d1cba5855631492bd9f5240940a9 100644 (file)
@@ -4,7 +4,7 @@
 # General configuration options
 #---------------------------------------------------------------------------
 PROJECT_NAME           = "BIFE Base"
 # General configuration options
 #---------------------------------------------------------------------------
 PROJECT_NAME           = "BIFE Base"
-PROJECT_NUMBER         = 1.0.0beta1
+PROJECT_NUMBER         = 1.0.0beta2
 OUTPUT_DIRECTORY       = api
 OUTPUT_LANGUAGE        = English
 USE_WINDOWS_ENCODING   = NO
 OUTPUT_DIRECTORY       = api
 OUTPUT_LANGUAGE        = English
 USE_WINDOWS_ENCODING   = NO
index 3581fdef536902de61651a31166648b87d77fc42..56d770e23b458cc132ac744de6dc7cd0c9f15265 100644 (file)
@@ -9,7 +9,7 @@
   <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="2" documentation="Parse XML data getting widgets." uniqueid="159" />
+  <docsettings viewid="2" documentation="Parse XML data getting widgets." uniqueid="161" />
   <umlobjects>
    <UML:Class stereotype="" package="BIFE" xmi.id="5" abstract="1" documentation="x2c:extern" name="Container" static="0" scope="200" />
    <UML:Class stereotype="" package="BIFE" xmi.id="61" abstract="1" documentation="x2c:extern" name="Fallback" static="0" scope="200" />
   <umlobjects>
    <UML:Class stereotype="" package="BIFE" xmi.id="5" abstract="1" documentation="x2c:extern" name="Container" static="0" scope="200" />
    <UML:Class stereotype="" package="BIFE" xmi.id="61" abstract="1" documentation="x2c:extern" name="Fallback" static="0" scope="200" />
@@ -28,6 +28,8 @@
     <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="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="160" type="string" abstract="0" documentation="Gets the relative path of the current BIFE file for web (URL) usage." name="getWebPath" static="0" scope="200" />
+    <UML:Operation stereotype="" package="" xmi.id="161" type="string" abstract="0" documentation="Gets the relative path of the current BIFE file for filesystem usage." name="getFsPath" static="0" scope="200" />
     <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: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>
@@ -38,7 +40,7 @@
     <widgets>
      <UML:ConceptWidget usesdiagramfillcolour="0" width="106" showattsigs="600" usesdiagramusefillcolour="0" x="82" linecolour="#ff0000" y="11" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#dcdcdc" height="25" usefillcolor="1" showattributes="0" xmi.id="5" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
      <UML:ConceptWidget usesdiagramfillcolour="0" width="97" showattsigs="601" usesdiagramusefillcolour="0" x="15" linecolour="#ff0000" y="90" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#dcdcdc" height="25" usefillcolor="1" showattributes="0" xmi.id="61" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
     <widgets>
      <UML:ConceptWidget usesdiagramfillcolour="0" width="106" showattsigs="600" usesdiagramusefillcolour="0" x="82" linecolour="#ff0000" y="11" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#dcdcdc" height="25" usefillcolor="1" showattributes="0" xmi.id="5" showoperations="0" showpackage="1" showscope="1" showstereotype="0" font="Helvetica,9,-1,5,48,0,0,0,0,0" />
      <UML:ConceptWidget usesdiagramfillcolour="0" width="97" showattsigs="601" usesdiagramusefillcolour="0" x="15" linecolour="#ff0000" y="90" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#dcdcdc" height="25" usefillcolor="1" showattributes="0" xmi.id="61" showoperations="0" 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="152" linecolour="none" y="89" 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="0" width="107" showattsigs="601" usesdiagramusefillcolour="0" x="152" linecolour="#ff0000" y="89" showopsigs="600" usesdiagramlinecolour="0" fillcolour="#ffffc0" height="112" 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="11" linecolour="none" y="150" 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/>
      <UML:ConceptWidget usesdiagramfillcolour="1" width="104" showattsigs="601" usesdiagramusefillcolour="1" x="11" linecolour="none" y="150" 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/>
@@ -74,7 +76,9 @@
       <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="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="161" label="getFsPath" />
        <listitem open="0" type="815" id="142" label="getURL" />
        <listitem open="0" type="815" id="142" label="getURL" />
+       <listitem open="0" type="815" id="160" label="getWebPath" />
        <listitem open="0" type="815" id="157" label="render" />
       </listitem>
       <listitem open="0" type="813" id="7" label="Translate" >
        <listitem open="0" type="815" id="157" label="render" />
       </listitem>
       <listitem open="0" type="813" id="7" label="Translate" >
diff --git a/base/examples/dir/index.xbf b/base/examples/dir/index.xbf
new file mode 100644 (file)
index 0000000..b214ba8
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Page title="Güinas!">
+    <Title>It worked!</Title>
+    <P>You're now in a directory. You can go <Link url="../">back</Link>.</P>
+    <HR noshade="noshade" size="2"/>
+    <Link data-s="1" data-b="1">View BIFE (xbf) source</Link> |
+    <Link data-s="1">View PHP source</Link>
+</Page>
diff --git a/base/examples/dir/subdir/index.xbf b/base/examples/dir/subdir/index.xbf
new file mode 100644 (file)
index 0000000..af93cdf
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Page title="Hi all!">
+    <Title>It worked!</Title>
+    <P>
+        You're now in a subdirectory. You can go
+        <Link url="../../">back</Link>.
+    </P>
+    <HR noshade="noshade" size="2"/>
+    <Link data-s="1" data-b="1">View BIFE (xbf) source</Link> |
+    <Link data-s="1">View PHP source</Link>
+</Page>
index 87606e81597317cfc43f9ada77e6b002ecbd3c36..3e846c1296f79f745de74cf1f30116196d08c880 100644 (file)
@@ -5,6 +5,10 @@
     <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 url="link.xbf">link</Link> to another BIFE file</P>
     <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 url="link.xbf">link</Link> to another BIFE file</P>
+    <Title>Links to subdirectories</Title>
+    <P>Here's a <Link url="dir/">file in a directory</Link>.</P>
+    <P>And a <Link url="dir/subdir/">file in a subdirectory</Link>.</P>
+    <P>Finally a <Link url="otherdir/">file in a another directory</Link>.</P>
     <HR noshade="noshade" size="2"/>
     <Link data-s="1" data-b="1">View BIFE (xbf) source</Link> |
     <Link data-s="1">View PHP source</Link>
     <HR noshade="noshade" size="2"/>
     <Link data-s="1" data-b="1">View BIFE (xbf) source</Link> |
     <Link data-s="1">View PHP source</Link>
diff --git a/base/examples/otherdir/index.xbf b/base/examples/otherdir/index.xbf
new file mode 100644 (file)
index 0000000..e818393
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Page title="Hola mundo!">
+    <Title>It worked!</Title>
+    <P>
+        You're now in a another directory. You can go
+        <Link url="../">back</Link>.
+    </P>
+    <HR noshade="noshade" size="2"/>
+    <Link data-s="1" data-b="1">View BIFE (xbf) source</Link> |
+    <Link data-s="1">View PHP source</Link>
+</Page>
index 0e671cac93aa9abeddc0008524654f4a407e4d27..a90058f05536718d217cee0109bbc34db3665e5d 100644 (file)
@@ -16,7 +16,7 @@
     </maintainers>
 
     <release>
     </maintainers>
 
     <release>
-        <version>1.0.0beta1</version>
+        <version>1.0.0beta2</version>
         <date>2003-06-29</date>
         <state>beta</state>
         <notes>Check http://bife.llucax.hn.org/ for details.</notes>
         <date>2003-06-29</date>
         <state>beta</state>
         <notes>Check http://bife.llucax.hn.org/ for details.</notes>
index 65a134bf251a3a7663a8dd42c024901e48a1fe6b..0929c3f8752dd45d71c6001c1eb35501c01e3b14 100644 (file)
@@ -85,6 +85,9 @@ class BIFE_Link extends BIFE_Container {
     function getURL($attrs) // ~X2C
     {
         $url = @$attrs['URL'];
     function getURL($attrs) // ~X2C
     {
         $url = @$attrs['URL'];
+        if (substr($url, strlen($url)-1) == '/') {
+            $url .= 'index.xbf'; // TODO - add a configuration option for this.
+        }
         unset($attrs['URL']);
         $query = array();
         foreach($attrs as $name => $value) {
         unset($attrs['URL']);
         $query = array();
         foreach($attrs as $name => $value) {
@@ -101,6 +104,32 @@ class BIFE_Link extends BIFE_Container {
     }
     // -X2C
 
     }
     // -X2C
 
+    // +X2C Operation 160
+    /**
+     * Gets the relative path of the current BIFE file for web (URL) usage.
+     *
+     * @return string
+     * @access public
+     */
+    function getWebPath() // ~X2C
+    {
+        return (@$_SERVER['PATH_INFO']) ? '../' : './';
+    }
+    // -X2C
+
+    // +X2C Operation 161
+    /**
+     * Gets the relative path of the current BIFE file for filesystem usage.
+     *
+     * @return string
+     * @access public
+     */
+    function getFsPath() // ~X2C
+    {
+        return dirname('.' . @$_SERVER['PATH_INFO']) . '/';
+    }
+    // -X2C
+
     // +X2C Operation 157
     /**
      * Renders the widget.
     // +X2C Operation 157
     /**
      * Renders the widget.
@@ -119,4 +148,4 @@ class BIFE_Link extends BIFE_Container {
 
 } // -X2C Class :Link
 
 
 } // -X2C Class :Link
 
-?>
+?>
\ No newline at end of file