123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?php
- require_once '../auth.php';
- require_once 'menustring.php';
- $phplm_www = '';
- $phplm_dir = '';
- require_once ($phplm_dir . "lib/layersmenu-common.inc.php");
- require_once ($phplm_dir . "lib/layersmenu-process.inc.php");
- $mid = new ProcessLayersMenu();
- $mid->setMenuStructureString($menuString);
- $mid->parseStructureForMenu('treemenu1');
- $tmpTable = "t".date('YmdHis');
- $mid->setTableName($tmpTable);
- $sqlDump = $mid->getSQLDump('treemenu1');
- $sqlCreate = "CREATE TEMPORARY TABLE ".$tmpTable." ( ".
- " ".implode(" varchar(255), ", $mid->tableFields)." varchar(255) ".
- " )";
- //$adodb->debug = 1;
- $adodb->Execute($sqlCreate);
- $pie = explode(";", $sqlDump);
- foreach ($pie as $k => $v) $adodb->Execute($v);
- if (isset($_GET['id'])) {
- $rs = $adodb->Execute("SELECT * FROM ".$tmpTable.
- " WHERE parent_id = ? ", array($_GET['id']));
- header("Content-Type: text/xml");
- header("Cache-Control: no-cache");
- echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
- echo "<tree>\n";
- while (!$rs->EOF) {
- $rs2 = $adodb->Execute("SELECT COUNT(*) as cnt FROM ".$tmpTable.
- " WHERE parent_id = ? ", array($rs->fields['id']));
- echo "<tree ".
- " text=\"".htmlspecialchars($rs->fields['text'])."\" ";
- if ($rs2->fields['cnt']>0) {
- echo " src=\"".htmlspecialchars($_SERVER['PHP_SELF']."?id=".$rs->fields['id'])."\" ";
- }
- echo " action=\"".htmlspecialchars($rs->fields['href'])."\" ".
- " target=\"".htmlspecialchars($rs->fields['target'])."\" ".
- " />\n";
- $rs->MoveNext();
- }
- echo "</tree>\n";
- exit;
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html>
- <head>
- <title>XLoadTree Demo (WebFX)</title>
- <script type="text/javascript" src="xloadtree/xtree.js"></script>
- <script type="text/javascript" src="xloadtree/xmlextras.js"></script>
- <script type="text/javascript" src="xloadtree/xloadtree.js"></script>
- <link type="text/css" rel="stylesheet" href="xloadtree/xtree.css" />
- <style type="text/css">
- body {
- background: white;
- color: black;
- }
- </style>
- </head>
- <body>
- <script type="text/javascript">
- /// XP Look
- webFXTreeConfig.rootIcon = "xloadtree/images/xp/folder.png";
- webFXTreeConfig.openRootIcon = "xloadtree/images/xp/openfolder.png";
- webFXTreeConfig.folderIcon = "xloadtree/images/xp/folder.png";
- webFXTreeConfig.openFolderIcon = "xloadtree/images/xp/openfolder.png";
- webFXTreeConfig.fileIcon = "xloadtree/images/xp/file.png";
- webFXTreeConfig.lMinusIcon = "xloadtree/images/xp/Lminus.png";
- webFXTreeConfig.lPlusIcon = "xloadtree/images/xp/Lplus.png";
- webFXTreeConfig.tMinusIcon = "xloadtree/images/xp/Tminus.png";
- webFXTreeConfig.tPlusIcon = "xloadtree/images/xp/Tplus.png";
- webFXTreeConfig.iIcon = "xloadtree/images/xp/I.png";
- webFXTreeConfig.lIcon = "xloadtree/images/xp/L.png";
- webFXTreeConfig.tIcon = "xloadtree/images/xp/T.png";
- webFXTreeConfig.errorLoadingText = "Error Loading";
- //var tree = new WebFXLoadTree("Root", "<?=$_SERVER['PHP_SELF']?>?id=1");
- var tree = new WebFXLoadTree("<?=__('Tree Menu', 'Root', 'MAIN MENU');?>", "<?=$_SERVER['PHP_SELF']?>?id=1");
- //tree.setBehavior("classic");
- document.write(tree);
- </script>
- </body>
- </html>
|