Hi,
I am currently making a few DOCman modules/plugins, one module is select boxes populated from DOCman based on module settings and is nearly done, the other module is a tree menu based on DOCman categories that is used as the menu or if the page is loaded on a specific category from another link then the tree expands to the correct category based on the url as iff it was used to choose the page.
The plugin allows the user to enter the category to show and an option to show that category only or sub categories under that category. It also then outputs the documents that are applicable to the above and based on the current user access (The same as my module) but in my module i use the standard DOCman menu/page as the tree is on the same page and i then get the correct category from the url to open the tree on the correct node.
What i want to do in the plugin (Which will run inside a tabset) is show the tree of the categories and the table of documents based on the plugin paramters from the user (I have done this) but when they click on a category in the tree i want to reload the current page and the tab but with the new documents and the correct tree node highlighted NOT go to the standard DOCman menu/page.
So far i have the tree, the table, the tree categories/documents based on the user access but the url part is being a pain.
Currently i have set the tree node urls to take the current url as below:
Code:
($current_url = $_SERVER['REQUEST_URI'])
I then add the part below onto the url based on the node:
Code:
$href = $current_url ."/?selectedfolder={$catrow->id}"; // URL for the Tree category item
Which adds the above and the ID as required which i read back to then highlight the tree and requery the table to get the correct documents but the problems are:
1) If i then click another category it appends the same string with the new ID to the existing url so i then have "original url/?selectedfolder=1/?selectedfolder=2" which gets very long after clicking on a few categories!!!!
2) The url is then not very nice, what i want is to have the "original url of the page (This will be used on various pages)/?selectedfolder=DOCman Pathway (So for category 3 it would be "/?selectedfolder=71-cat+1/72-cat+2/73-cat+3" where the spaces are replaced with + (The same as normal DOCman urls except the + part)) and then i can use the url (The current category) to requery the table and update the tree state
3) Is there a way to remove the "cat_view" part of the DOCman urls'??
4) Is there a way to remove the ID's in the DOCman url so the above would then be "/?selectedfolder=cat+1/cat+2/cat+3" using something like the HP router extension for Joomla
Thanks
Dan