function listFolderContent($folderID, $username = "", $path = "", $edit = false) { global $style; $fields = array('id', 'title', 'pid', 'description'); $where = array('pid' => $folderID); if ($folderID == MAIN_FID) { $where['name'] = $username; } $folders = Prototype::queryData($fields, "folders", $where, false, $path, false, "title"); foreach ($folders as $key => $current_folder) { $fields = array('count(*) as count'); $where = array('folderid' => $current_folder['id']); //$countFolderBookmarks = Prototype::queryData($fields, "favourites", $where, false, $path, false); echo "\t<li class=\"treeItem folderHover\" id=\"f" . $current_folder['id'] . "\"><img src=\"" . $path . "images/style/{$style}/folder.GIF\" alt=\"Folder\" title=\"Folder\"/> <span class=\"textHolder\"><span class=\"folder_desc\" title=\"" . $current_folder['description'] . "\">" . $current_folder['title'] . "</span>"; if ($edit) { echo " <a href=\"modifyfolder.php?id=" . $current_folder['id'] . "\" class=\"editF\"><img src=\"images/books/modifyGray.GIF\" width=\"16\" height=\"16\" alt=\"" . T_("Edit") . "\" title=\"" . T_("Edit") . "\" /></a>"; ?> <script type="text/javascript"> document.write(" <a href=\"#\" onclick=\"deleteFolder(this, <?php echo $current_folder['id']; ?> ); return false;\" class=\"deleteF\"><img src=\"images/books/deleteGray.GIF\" width=\"16\" height=\"16\" alt=\"<?php echo T_("Delete"); ?> \" title=\"<?php echo T_("Delete"); ?> \" /><\/a>"); </script> <?php } echo "</span>\n\t\t<ul id=\"f" . $current_folder['id'] . "\" style=\"display: none;\">\n"; // Retrive sub-folders recusively listFolderContent($current_folder['id'], "", $path, $edit); // Retrieve folders bookmarks for now listFolderBookmarks($current_folder['id'], "", $path, $edit); echo "\t\t</ul>\n</li>\n"; } }
GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GetBoo; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ***************************************************************************/ // Using javascript (drag and drop + tooltips) from http://interface.eyecon.ro/ implementing jQuery ?> <ul class="myTree"> <?php // Call for main folder set_time_limit(0); // Unlimited execution time, will need to be fixed eventually (with AJAX maybe) echo "\t<li class=\"treeItem\"><img src=\"images/style/{$style}/folder.GIF\" alt=\"Folder\" title=\"Folder\"/> <span class=\"textHolder\">" . T_("Main") . "</span>\n\t\t<ul id=\"f0\">\n"; listFolderContent(MAIN_FID, $username, "", true, "blank"); listFolderBookmarks(MAIN_FID, $username, "", true, "blank"); echo "</ul></ul>"; ?> <script type="text/javascript"> $(document).ready( function() { tree = $('#myTree'); $('li', tree.get(0)).each( function() { subbranch = $('ul', this); if (subbranch.size() > 0) { if (subbranch.eq(0).css('display') == 'none') { $(this).prepend('<img src="images/tree/bullet_toggle_plus.png" width="16" height="16" class="expandImage" />');
</head> <body> <?php require_once $SETTINGS['path_mod'] . 'includes/user.php'; $user = new User(); $headerString = "<h2>" . WEBSITE_NAME . " " . T_("bar login") . "</h2>"; $style = $user->getStyle(); $username = $user->getUsername(); ?> <ul class="myTree"> <?php include "../includes/bookmarks.php"; // Call for main folder echo "\t<li class=\"treeItem\"><img src=\"../images/style/{$style}/folder.GIF\" alt=\"Folder\" title=\"Folder\"/> <span class=\"textHolder\">" . T_("Main") . "</span>\n\t\t<ul id=\"f0\">\n"; listFolderContent(MAIN_FID, $username, "../"); listFolderBookmarks(MAIN_FID, $username, "../"); echo "</ul></ul>"; ?> <script type="text/javascript"> $(document).ready( function() { tree = $('#myTree'); $('li', tree.get(0)).each( function() { subbranch = $('ul', this); if (subbranch.size() > 0) { if (subbranch.eq(0).css('display') == 'none') { $(this).prepend('<img src="../images/tree/bullet_toggle_plus.png" width="16" height="16" class="expandImage" />');
" style="border: 0; width: 16px; height: 16px;" /></a> <a onclick="javascript:window.location = 'bar.php?action=logout';" href="#"><img src="icons/logout.png" alt="<?php echo T_("Log Out"); ?> " title="<?php echo T_("Log Out"); ?> " style="border: 0; width: 16px; height: 16px;" /></a> </div> <br><br> <ul id="black"> <?php include '../includes/bookmarks.php'; // Call for main folder listFolderContent(MAIN_FID, $username, $SETTINGS['path_mod']); listFolderBookmarks(MAIN_FID, $username, $SETTINGS['path_mod']); echo "</ul>"; } else { if (!$headerDisplayed) { echo $headerString; } ?> <form method="post" action="bar.php"> <table> <tr> <td><span class="formsLabel"><label for="login_usrname"><?php echo T_("Username"); ?> </label></span></td> <td><input type="text" name="name" size="20" maxlength="20" class="formtext" onfocus="this.select()" id="login_usrname" /></td> </tr>