phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] folders/phplayersmenu/lib treemenu.inc.php, 1.1.1.1,


From: Philipp Kamps <address@hidden>
Subject: [Phpgroupware-cvs] folders/phplayersmenu/lib treemenu.inc.php, 1.1.1.1, 1.2 layersmenu.inc.php, 1.1.1.1, 1.2 phptreemenu.inc.php, 1.1.1.1, 1.2 plainmenu.inc.php, 1.1.1.1, 1.2 PHPLIB.php, 1.1.1.1, 1.2 layersmenu-process.inc.php, 1.1.1.1, 1.2 layersmenu-common.inc.php, 1.1.1.1, 1.2
Date: Mon, 24 Nov 2003 16:46:55 +0000

Update of /cvsroot/phpgroupware/folders/phplayersmenu/lib
In directory subversions:/tmp/cvs-serv28335/phplayersmenu/lib

Modified Files:
        treemenu.inc.php layersmenu.inc.php phptreemenu.inc.php 
        plainmenu.inc.php PHPLIB.php layersmenu-process.inc.php 
        layersmenu-common.inc.php 
Log Message:
new version (3.1.1) of phplayersmenu included

Index: phptreemenu.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/folders/phplayersmenu/lib/phptreemenu.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** phptreemenu.inc.php 4 Nov 2003 12:10:24 -0000       1.1.1.1
--- phptreemenu.inc.php 24 Nov 2003 16:46:53 -0000      1.2
***************
*** 1,4 ****
  <?php
! // PHP Layers Menu 3.1.0 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
--- 1,4 ----
  <?php
! // PHP Layers Menu 3.1.1 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
***************
*** 12,16 ****
  * This class depends on the LayersMenuCommon class.  It provides 
"server-side" (PHP-based) tree menus, that to do not require JavaScript to work.
  *
! * @version 3.1.0
  * @package PHPLayersMenu
  */
--- 12,16 ----
  * This class depends on the LayersMenuCommon class.  It provides 
"server-side" (PHP-based) tree menus, that to do not require JavaScript to work.
  *
! * @version 3.1.1
  * @package PHPLayersMenu
  */
***************
*** 56,59 ****
--- 56,68 ----
  
  /**
+ * The method to set the dirroot directory
+ * @access public
+ * @return boolean
+ */
+ function setDirroot($dirroot) {
+       return $this->setDirrootCommon($dirroot);
+ }
+ 
+ /**
  * The method to set the value of separator for the Tree Menu query string
  * @access public
***************
*** 225,229 ****
        for ($cnt=$this->_firstItem[$menu_name]; 
$cnt<=$this->_lastItem[$menu_name]; $cnt++) {
                if ($visible[$cnt]) {
!                       $this->_phpTreeMenu[$menu_name] .= "<div 
class=\"treemenudiv\">\n";
  
                        // vertical lines from higher levels
--- 234,238 ----
        for ($cnt=$this->_firstItem[$menu_name]; 
$cnt<=$this->_lastItem[$menu_name]; $cnt++) {
                if ($visible[$cnt]) {
!                       $this->_phpTreeMenu[$menu_name] .= "<div 
class=\"treemenudiv\">\n"; 
  
                        // vertical lines from higher levels

Index: layersmenu-process.inc.php
===================================================================
RCS file: 
/cvsroot/phpgroupware/folders/phplayersmenu/lib/layersmenu-process.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** layersmenu-process.inc.php  4 Nov 2003 12:10:24 -0000       1.1.1.1
--- layersmenu-process.inc.php  24 Nov 2003 16:46:53 -0000      1.2
***************
*** 1,4 ****
  <?php
! // PHP Layers Menu 3.1.0 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
--- 1,4 ----
  <?php
! // PHP Layers Menu 3.1.1 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
***************
*** 12,16 ****
  * It provides methods useful to process/convert menus data, e.g. to output a 
menu structure and a DB SQL dump corresponding to already parsed data and hence 
also to convert a menu structure file to a DB SQL dump and viceversa
  *
! * @version 3.1.0
  * @package PHPLayersMenu
  */
--- 12,16 ----
  * It provides methods useful to process/convert menus data, e.g. to output a 
menu structure and a DB SQL dump corresponding to already parsed data and hence 
also to convert a menu structure file to a DB SQL dump and viceversa
  *
! * @version 3.1.1
  * @package PHPLayersMenu
  */
***************
*** 23,26 ****
--- 23,35 ----
  function ProcessLayersMenu() {
        $this->LayersMenuCommon();
+ }
+ 
+ /**
+ * The method to set the dirroot directory
+ * @access public
+ * @return boolean
+ */
+ function setDirroot($dirroot) {
+       return $this->setDirrootCommon($dirroot);
  }
  

Index: layersmenu-common.inc.php
===================================================================
RCS file: 
/cvsroot/phpgroupware/folders/phplayersmenu/lib/layersmenu-common.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** layersmenu-common.inc.php   4 Nov 2003 12:10:24 -0000       1.1.1.1
--- layersmenu-common.inc.php   24 Nov 2003 16:46:53 -0000      1.2
***************
*** 1,4 ****
  <?php
! // PHP Layers Menu 3.1.0 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
--- 1,4 ----
  <?php
! // PHP Layers Menu 3.1.1 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
***************
*** 18,22 ****
  /**
  * This is the "common" class of the PHP Layers Menu library.
! * @version 3.1.0
  * @package PHPLayersMenu
  */
--- 18,22 ----
  /**
  * This is the "common" class of the PHP Layers Menu library.
! * @version 3.1.1
  * @package PHPLayersMenu
  */
***************
*** 68,77 ****
  var $dirroot;
  /**
- * The "lib" directory of the package
- * @access private
- * @var string
- */
- var $libdir;
- /**
  * The "libjs" directory of the package
  * @access private
--- 68,71 ----
***************
*** 80,89 ****
  var $libjsdir;
  /**
- * The http path corresponding to libjsdir
- * @access private
- * @var string
- */
- var $libjswww;
- /**
  * The directory where images related to the menu can be found
  * @access private
--- 74,77 ----
***************
*** 216,220 ****
  
        $this->_packageName = "PHP Layers Menu";
!       $this->version = "3.1.0";
        $this->copyright = "(C) 2001-2003";
        $this->author = "Marco Pratesi (marco at telug dot it)";
--- 204,208 ----
  
        $this->_packageName = "PHP Layers Menu";
!       $this->version = "3.1.1";
        $this->copyright = "(C) 2001-2003";
        $this->author = "Marco Pratesi (marco at telug dot it)";
***************
*** 222,232 ****
        $this->prependedUrl = "";
  
!       $this->dirroot = "";
!       $this->libdir = "lib/";
!       $this->libjsdir = "libjs/";
!       $this->libjswww = "libjs/";
!       $this->imgdir = "images/";
        $this->imgwww = "images/";
!       $this->tpldir = "templates/";
        $this->menuStructure = "";
        $this->separator = "|";
--- 210,218 ----
        $this->prependedUrl = "";
  
!       $this->dirroot = "./";
!       $this->libjsdir = "./libjs/";
!       $this->imgdir = "./images/";
        $this->imgwww = "images/";
!       $this->tpldir = "./templates/";
        $this->menuStructure = "";
        $this->separator = "|";
***************
*** 256,260 ****
  * @return boolean
  */
! function setDirroot($dirroot) {
        if (!is_dir($dirroot)) {
                $this->error("setDirroot: $dirroot is not a directory.");
--- 242,246 ----
  * @return boolean
  */
! function setDirrootCommon($dirroot) {
        if (!is_dir($dirroot)) {
                $this->error("setDirroot: $dirroot is not a directory.");
***************
*** 264,288 ****
                $dirroot .= "/";
        }
!       $this->dirroot = $dirroot;
!       return true;
! }
! 
! /**
! * The method to set the libdir directory
! * @access public
! * @return boolean
! */
! function setLibdir($libdir) {
!       if (substr($libdir, -1) == "/") {
!               $libdir = substr($libdir, 0, -1);
        }
!       if (str_replace("/", "", $libdir) == $libdir) {
!               $libdir = $this->dirroot . $libdir;
        }
!       if (!is_dir($libdir)) {
!               $this->error("setLibdir: $libdir is not a directory.");
!               return false;
        }
!       $this->libdir = $libdir . "/";
        return true;
  }
--- 250,267 ----
                $dirroot .= "/";
        }
!       $oldlength = strlen($this->dirroot);
!       $foobar = strpos($this->libjsdir, $this->dirroot);
!       if (!($foobar === false || $foobar != 0)) {
!               $this->libjsdir = $dirroot . substr($this->libjsdir, 
$oldlength);
        }
!       $foobar = strpos($this->imgdir, $this->dirroot);
!       if (!($foobar === false || $foobar != 0)) {
!               $this->imgdir = $dirroot . substr($this->imgdir, $oldlength);
        }
!       $foobar = strpos($this->tpldir, $this->dirroot);
!       if (!($foobar === false || $foobar != 0)) {
!               $this->tpldir = $dirroot . substr($this->tpldir, $oldlength);
        }
!       $this->dirroot = $dirroot;
        return true;
  }
***************
*** 294,302 ****
  */
  function setLibjsdir($libjsdir) {
!       if (substr($libjsdir, -1) == "/") {
!               $libjsdir = substr($libjsdir, 0, -1);
        }
!       if (str_replace("/", "", $libjsdir) == $libjsdir) {
!               $libjsdir = $this->dirroot . $libjsdir;
        }
        if (!is_dir($libjsdir)) {
--- 273,284 ----
  */
  function setLibjsdir($libjsdir) {
!       if ($libjsdir != "" && substr($libjsdir, -1) != "/") {
!               $libjsdir .= "/";
        }
!       if ($libjsdir == "" || substr($libjsdir, 0, 1) != "/") {
!               $foobar = strpos($libjsdir, $this->dirroot);
!               if ($foobar === false || $foobar != 0) {
!                       $libjsdir = $this->dirroot . $libjsdir;
!               }
        }
        if (!is_dir($libjsdir)) {
***************
*** 304,324 ****
                return false;
        }
!       $this->libjsdir = $libjsdir . "/";
        return true;
  }
  
  /**
- * The method to set libjswww
- * @access public
- * @return void
- */
- function setLibjswww($libjswww) {
-       if (substr($libjswww, -1) != "/") {
-               $libjswww .= "/";
-       }
-       $this->libjswww = $libjswww;
- }
- 
- /**
  * The method to set the imgdir directory
  * @access public
--- 286,294 ----
                return false;
        }
!       $this->libjsdir = $libjsdir;
        return true;
  }
  
  /**
  * The method to set the imgdir directory
  * @access public
***************
*** 326,334 ****
  */
  function setImgdir($imgdir) {
!       if (substr($imgdir, -1) == "/") {
!               $imgdir = substr($imgdir, 0, -1);
        }
!       if (str_replace("/", "", $imgdir) == $imgdir) {
!               $imgdir = $this->dirroot . $imgdir;
        }
        if (!is_dir($imgdir)) {
--- 296,307 ----
  */
  function setImgdir($imgdir) {
!       if ($imgdir != "" && substr($imgdir, -1) != "/") {
!               $imgdir .= "/";
        }
!       if ($imgdir == "" || substr($imgdir, 0, 1) != "/") {
!               $foobar = strpos($imgdir, $this->dirroot);
!               if ($foobar === false || $foobar != 0) {
!                       $imgdir = $this->dirroot . $imgdir;
!               }
        }
        if (!is_dir($imgdir)) {
***************
*** 336,340 ****
                return false;
        }
!       $this->imgdir = $imgdir . "/";
        return true;
  }
--- 309,313 ----
                return false;
        }
!       $this->imgdir = $imgdir;
        return true;
  }
***************
*** 346,350 ****
  */
  function setImgwww($imgwww) {
!       if (substr($imgwww, -1) != "/") {
                $imgwww .= "/";
        }
--- 319,323 ----
  */
  function setImgwww($imgwww) {
!       if ($imgwww != "" && substr($imgwww, -1) != "/") {
                $imgwww .= "/";
        }
***************
*** 358,367 ****
  */
  function setTpldirCommon($tpldir) {
!       if (substr($tpldir, -1) != "/") {
!               $this->tpldir = $tpldir . "/";
        }
!       $foobar = strpos($tpldir, $this->dirroot);
!       if ($foobar === false || $foobar != 0) {
!               $tpldir = $this->dirroot . $tpldir;
        }
        if (!is_dir($tpldir)) {
--- 331,342 ----
  */
  function setTpldirCommon($tpldir) {
!       if ($tpldir != "" && substr($tpldir, -1) != "/") {
!               $tpldir .= "/";
        }
!       if ($tpldir == "" || substr($tpldir, 0, 1) != "/") {
!               $foobar = strpos($tpldir, $this->dirroot);
!               if ($foobar === false || $foobar != 0) {
!                       $tpldir = $this->dirroot . $tpldir;
!               }
        }
        if (!is_dir($tpldir)) {
***************
*** 369,372 ****
--- 344,348 ----
                return false;
        }
+       $this->tpldir = $tpldir;
        return true;
  }

Index: layersmenu.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/folders/phplayersmenu/lib/layersmenu.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** layersmenu.inc.php  4 Nov 2003 12:10:24 -0000       1.1.1.1
--- layersmenu.inc.php  24 Nov 2003 16:46:53 -0000      1.2
***************
*** 1,4 ****
  <?php
! // PHP Layers Menu 3.1.0 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
--- 1,4 ----
  <?php
! // PHP Layers Menu 3.1.1 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
***************
*** 12,16 ****
  * This class depends on the LayersMenuCommon class and on the PEAR conforming 
version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB
  *
! * @version 3.1.0
  * @package PHPLayersMenu
  */
--- 12,16 ----
  * This class depends on the LayersMenuCommon class and on the PEAR conforming 
version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB
  *
! * @version 3.1.1
  * @package PHPLayersMenu
  */
***************
*** 156,166 ****
  
        $this->_packageName = "PHP Layers Menu";
!       $this->version = "3.1.0";
        $this->copyright = "(C) 2001-2003";
        $this->author = "Marco Pratesi (marco at telug dot it)";
  
!       $this->horizontalMenuTpl = $this->dirroot . $this->tpldir . 
"layersmenu-horizontal_menu.ihtml";
!       $this->verticalMenuTpl = $this->dirroot . $this->tpldir . 
"layersmenu-vertical_menu.ihtml";
!       $this->subMenuTpl = $this->dirroot . $this->tpldir . 
"layersmenu-sub_menu.ihtml";
  
        $this->header = "";
--- 156,166 ----
  
        $this->_packageName = "PHP Layers Menu";
!       $this->version = "3.1.1";
        $this->copyright = "(C) 2001-2003";
        $this->author = "Marco Pratesi (marco at telug dot it)";
  
!       $this->horizontalMenuTpl = $this->tpldir . 
"layersmenu-horizontal_menu.ihtml";
!       $this->verticalMenuTpl = $this->tpldir . 
"layersmenu-vertical_menu.ihtml";
!       $this->subMenuTpl = $this->tpldir . "layersmenu-sub_menu.ihtml";
  
        $this->header = "";
***************
*** 233,236 ****
--- 233,249 ----
  
  /**
+ * The method to set the dirroot directory
+ * @access public
+ * @return boolean
+ */
+ function setDirroot($dirroot) {
+       $oldtpldir = $this->tpldir;
+       if ($foobar = $this->setDirrootCommon($dirroot)) {
+               $this->updateTpldir($oldtpldir);
+       }
+       return $foobar;
+ }
+ 
+ /**
  * The method to set the tpldir directory
  * @access public
***************
*** 238,247 ****
  */
  function setTpldir($tpldir) {
        if ($foobar = $this->setTpldirCommon($tpldir)) {
!               // Then we update the default filenames of templates
!               $this->horizontalMenuTpl = $this->tpldir . 
"layersmenu-horizontal_menu.ihtml";
!               $this->verticalMenuTpl = $this->tpldir . 
"layersmenu-vertical_menu.ihtml";
!               $this->subMenuTpl = $this->tpldir . "layersmenu-sub_menu.ihtml";
!               //
        }
        return $foobar;
--- 251,257 ----
  */
  function setTpldir($tpldir) {
+       $oldtpldir = $this->tpldir;
        if ($foobar = $this->setTpldirCommon($tpldir)) {
!               $this->updateTpldir($oldtpldir);
        }
        return $foobar;
***************
*** 249,252 ****
--- 259,283 ----
  
  /**
+ * The method to update the templates directory path to the new tpldir
+ * @access private
+ * @return void
+ */
+ function updateTpldir($oldtpldir) {
+       $oldlength = strlen($oldtpldir);
+       $foobar = strpos($this->horizontalMenuTpl, $oldtpldir);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->horizontalMenuTpl = $this->tpldir . 
substr($this->horizontalMenuTpl, $oldlength);
+       }
+       $foobar = strpos($this->verticalMenuTpl, $oldtpldir);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->verticalMenuTpl = $this->tpldir . 
substr($this->verticalMenuTpl, $oldlength);
+       }
+       $foobar = strpos($this->subMenuTpl, $oldtpldir);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->subMenuTpl = $this->tpldir . substr($this->subMenuTpl, 
$oldlength);
+       }
+ }
+ 
+ /**
  * The method to set horizontalMenuTpl
  * @access public
***************
*** 749,753 ****
                "thresholdY"    => $this->thresholdY,
                "abscissaStep"  => $this->abscissaStep,
-               "libjswww"      => $this->libjswww,
                "listl"         => $this->listl,
                "nodesCount"    => $this->_nodesCount,
--- 780,783 ----
***************
*** 819,823 ****
                "author"        => $this->author,
                "footer"        => $this->footer
! 
        ));
        $this->footer = $t->parse("out", "tplfile");
--- 849,853 ----
                "author"        => $this->author,
                "footer"        => $this->footer
!               
        ));
        $this->footer = $t->parse("out", "tplfile");

Index: treemenu.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/folders/phplayersmenu/lib/treemenu.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** treemenu.inc.php    4 Nov 2003 12:10:24 -0000       1.1.1.1
--- treemenu.inc.php    24 Nov 2003 16:46:53 -0000      1.2
***************
*** 1,4 ****
  <?php
! // PHP Layers Menu 3.1.0 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
--- 1,4 ----
  <?php
! // PHP Layers Menu 3.1.1 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
***************
*** 12,16 ****
  * This class depends on the LayersMenuCommon class and on the PEAR conforming 
version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB
  *
! * @version 3.1.0
  * @package PHPLayersMenu
  */
--- 12,16 ----
  * This class depends on the LayersMenuCommon class and on the PEAR conforming 
version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB
  *
! * @version 3.1.1
  * @package PHPLayersMenu
  */
***************
*** 46,49 ****
--- 46,58 ----
        $this->_firstItem = array();
        $this->_lastItem = array();
+ }
+ 
+ /**
+ * The method to set the dirroot directory
+ * @access public
+ * @return boolean
+ */
+ function setDirroot($dirroot) {
+       return $this->setDirrootCommon($dirroot);
  }
  

Index: PHPLIB.php
===================================================================
RCS file: /cvsroot/phpgroupware/folders/phplayersmenu/lib/PHPLIB.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PHPLIB.php  4 Nov 2003 12:10:24 -0000       1.1.1.1
--- PHPLIB.php  24 Nov 2003 16:46:53 -0000      1.2
***************
*** 6,11 ****
  //
  // Authors: Kristian Koehntopp <address@hidden> (original from PHPLIB)
! //          Bjoern Schotte <address@hidden> (PEARification)
! //          Martin Jansen <address@hidden> (PEAR conformance)
  //
  // $Id$
--- 6,11 ----
  //
  // Authors: Kristian Koehntopp <address@hidden> (original from PHPLIB)
! //          Bjoern Schotte <address@hidden> (PEARification)                
[...1066 lines suppressed...]
!             die("<b>Halted.</b>");
!         }
  
!         return false;
!     }
!   
!     /**
!      * printf error message to show
!      *
!      * @access public
!      * @param  string message to show
!      * @return object PEAR error object
!      */
!     function haltMsg($msg)
!     {
  //        PEAR::raiseError(sprintf("<b>Template Error:</b> %s<br>\n", $msg));
!         printf("<b>Template Error:</b> %s<br>\n", $msg);
!     }
  }
  ?>

Index: plainmenu.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/folders/phplayersmenu/lib/plainmenu.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** plainmenu.inc.php   4 Nov 2003 12:10:24 -0000       1.1.1.1
--- plainmenu.inc.php   24 Nov 2003 16:46:53 -0000      1.2
***************
*** 1,4 ****
  <?php
! // PHP Layers Menu 3.1.0 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
--- 1,4 ----
  <?php
! // PHP Layers Menu 3.1.1 (C) 2001-2003 Marco Pratesi (marco at telug dot it)
  
  /**
***************
*** 12,16 ****
  * This class depends on the LayersMenuCommon class and on the PEAR conforming 
version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB.  It 
provides plain menus, that to do not require JavaScript to work.
  *
! * @version 3.1.0
  * @package PHPLayersMenu
  */
--- 12,16 ----
  * This class depends on the LayersMenuCommon class and on the PEAR conforming 
version of the PHPLib Template class, i.e. on HTML_Template_PHPLIB.  It 
provides plain menus, that to do not require JavaScript to work.
  *
! * @version 3.1.1
  * @package PHPLayersMenu
  */
***************
*** 46,57 ****
        $this->LayersMenuCommon();
  
!       $this->plainMenuTpl = $this->dirroot . $this->tpldir . 
"layersmenu-plain_menu.ihtml";
        $this->_plainMenu = array();
  
!       $this->horizontalPlainMenuTpl = $this->dirroot . $this->tpldir . 
"layersmenu-horizontal_plain_menu.ihtml";
        $this->_horizontalPlainMenu = array();
  }
  
  /**
  * The method to set the tpldir directory
  * @access public
--- 46,70 ----
        $this->LayersMenuCommon();
  
!       $this->plainMenuTpl = $this->tpldir . "layersmenu-plain_menu.ihtml";
        $this->_plainMenu = array();
  
!       $this->horizontalPlainMenuTpl = $this->tpldir . 
"layersmenu-horizontal_plain_menu.ihtml";
        $this->_horizontalPlainMenu = array();
  }
  
  /**
+ * The method to set the dirroot directory
+ * @access public
+ * @return boolean
+ */
+ function setDirroot($dirroot) {
+       $oldtpldir = $this->tpldir;
+       if ($foobar = $this->setDirrootCommon($dirroot)) {
+               $this->updateTpldir($oldtpldir);
+       }
+       return $foobar;
+ }
+ 
+ /**
  * The method to set the tpldir directory
  * @access public
***************
*** 59,67 ****
  */
  function setTpldir($tpldir) {
        if ($foobar = $this->setTpldirCommon($tpldir)) {
!               // Then we update the default filenames of templates
!               $this->plainMenuTpl = $this->tpldir . 
"layersmenu-plain_menu.ihtml";
!               $this->horizontalPlainMenuTpl = $this->tpldir . 
"layersmenu-horizontal_plain_menu.ihtml";
!               //
        }
        return $foobar;
--- 72,78 ----
  */
  function setTpldir($tpldir) {
+       $oldtpldir = $this->tpldir;
        if ($foobar = $this->setTpldirCommon($tpldir)) {
!               $this->updateTpldir($oldtpldir);
        }
        return $foobar;
***************
*** 69,72 ****
--- 80,100 ----
  
  /**
+ * The method to update the templates directory path to the new tpldir
+ * @access private
+ * @return void
+ */
+ function updateTpldir($oldtpldir) {
+       $oldlength = strlen($oldtpldir);
+       $foobar = strpos($this->plainMenuTpl, $oldtpldir);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->plainMenuTpl = $this->tpldir . 
substr($this->plainMenuTpl, $oldlength);
+       }
+       $foobar = strpos($this->horizontalPlainMenuTpl, $oldtpldir);
+       if (!($foobar === false || $foobar != 0)) {
+               $this->horizontalPlainMenuTpl = $this->tpldir . 
substr($this->horizontalPlainMenuTpl, $oldlength);
+       }
+ }
+ 
+ /**
  * The method to set plainMenuTpl
  * @access public
***************
*** 182,186 ****
        $t->setBlock("template", "horizontal_plain_menu_cell", 
"horizontal_plain_menu_cell_blck");
        $t->setVar("horizontal_plain_menu_cell_blck", "");
!       $t->setBlock("horizontal_plain_menu_cell", "plain_menu_cell", 
"plain_menu_cell_blck");
        $t->setVar("plain_menu_cell_blck", "");
        for ($cnt=$this->_firstItem[$menu_name]; 
$cnt<=$this->_lastItem[$menu_name]; $cnt++) {
--- 210,214 ----
        $t->setBlock("template", "horizontal_plain_menu_cell", 
"horizontal_plain_menu_cell_blck");
        $t->setVar("horizontal_plain_menu_cell_blck", "");
!       $t->setBlock("horizontal_plain_menu_cell", "plain_menu_cell", 
"plain_menu_cell_blck");  
        $t->setVar("plain_menu_cell_blck", "");
        for ($cnt=$this->_firstItem[$menu_name]; 
$cnt<=$this->_lastItem[$menu_name]; $cnt++) {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]