Use as menu

Discuss everything related to ApPHP TreeMenu. Any questions related to the ApPHP TreeMenu developing or using should be posted to this forum.

Moderators: ne_moj, zewa, Milton, vadimako, ne_moj, zewa, Milton, vadimako

Lonestarjack
Senior
Senior
Posts: 41
Joined: Dec 24th, '11, 13:54

Use as menu

Postby Lonestarjack » Feb 14th, '12, 17:16

I would like a to show a tree that only includes wwwroot folder and shows only *.php and *.html files.
I would then like to click on a node and execute that script.
Is this possible with this product?
Thanks

Milton
Senior
Senior
Posts: 31
Joined: Jan 14th, '10, 14:17

Re: Use as menu

Postby Milton » Feb 14th, '12, 19:28

Hello!

Filtering by extension is not supported however you may achieve this by making some minor changes to BuildNodeFromFolder function (TreeMenu class, treemenu.class.php file).
Find the following snippet:

Code: Select all

if($file != "." && $file != ".." && is_dir($folder."/".$file))
                         $dirs[count($dirs)]=$file;
                      else if($file != "." && $file != "..")
                         $files[count($files)]=$file;


And change it to:

Code: Select all

if($file != "." && $file != ".." && !is_dir($folder."/".$file))
                      {
                         $extension=strtolower(substr(strrchr($file,"."),1));
                         if($extension == "html" || $extension == "php")
                            $files[count($files)]=$file;
                  }


Then just attach your TreeMenu object to wwwroot folder:

Code: Select all

$treeMenu->BuildFromFolder("wwwroot");


Hope that helps

Lonestarjack
Senior
Senior
Posts: 41
Joined: Dec 24th, '11, 13:54

Re: Use as menu

Postby Lonestarjack » Feb 14th, '12, 21:41

Thanks
I will uy the product

Sowell11
Newbie
Newbie
Posts: 1
Joined: Dec 11th, '13, 07:30

Re: Use as menu

Postby Sowell11 » Dec 11th, '13, 07:57

There are so many kind of energy resources. It depends on their choice to using each of them. It is important to choose right one since the first time.


Return to “ApPHP TreeMenu”