当前位置: 首页>>代码示例>>PHP>>正文


PHP HTML_TreeMenu类代码示例

本文整理汇总了PHP中HTML_TreeMenu的典型用法代码示例。如果您正苦于以下问题:PHP HTML_TreeMenu类的具体用法?PHP HTML_TreeMenu怎么用?PHP HTML_TreeMenu使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了HTML_TreeMenu类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: draw_folders

		/**
		 * draw the Tree-Folder structure
		 */
		function draw_folders() {
			global $c, $lang, $sid;

			echo "<table width=\"98%\" cellpadding=\"0\" cellspacing=\"0\">";
			echo "<tr><td >";
			echo '<div id="explore" class="sidebar_explore" style="height:400px;">';
			
			// draw the folder here
			$icon = 'site_root.gif';
			$expandedIcon = 'site_root.gif';
			$menu = new HTML_TreeMenu();
			$startnode = new HTML_TreeNode(array (
				'text' => $lang->get("website", "Website"),
				'link' => $this->action . "?sid=$sid&pnode=0",
				'icon' => $icon,
				'expandedIcon' => $expandedIcon,
				isDynamic => true,
				'defaultClass' => "treemenu"
			));

			$this->buildSitemap($startnode, "0");

			$menu->addItem($startnode);
			$treeMenu = new HTML_TreeMenu_DHTML($menu, array (
				'images' => $c["docroot"] . 'api/userinterface/tree/images',
				'defaultClass' => "treemenu"
			),                                  true);

			$treeMenu->printMenu();

			echo '</div>';
			echo '</td></tr>';
			echo "</table>";
		}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:37,代码来源:sitemap_menu2.inc.php

示例2: buildTree

 /**
  * A method to return the HTML code needed to display a tree-based
  * menu of all the simulations.
  *
  * @return string A string containing the HTML code needed to display
  *                the tests in a tree-based menu.
  */
 function buildTree()
 {
     $icon_pkg = "package.png";
     // Create the root of the test suite
     $menu = new HTML_TreeMenu();
     $rootNode = new HTML_TreeNode(array('text' => 'Test Datasets', 'icon' => $icon_pkg, 'link' => 'home.php', 'linkTarget' => 'right'));
     // Create the top-level test groups
     $aTypes = array('datasets' => 'menu.php');
     foreach ($aTypes as $type => $link) {
         $nodeName = $type . 'RootNode';
         ${$nodeName} = new HTML_TreeNode(array('text' => ucwords($type), 'icon' => $icon_pkg, 'link' => $link, 'linkTarget' => "left"));
         $list = get_file_list(TD_DATAPATH, '.xml', true);
         foreach ($list as $index => $file) {
             ${$nodeName}->addItem(new HTML_TreeNode(array('text' => $file, 'icon' => $icon_pkg, 'link' => "action.php?&datasetfile={$file}", 'linkTarget' => 'right')));
         }
         $rootNode->addItem(${$nodeName});
     }
     $menu->addItem($rootNode);
     $tree = new HTML_TreeMenu_DHTML($menu);
     $code = file_get_contents(MAX_PATH . '/tests/testClasses/menu.css');
     $code .= "\n<script>\n";
     $code .= file_get_contents(MAX_PATH . '/tests/testClasses/TreeMenu.js');
     $code .= "\n</script>";
     $code .= $tree->toHTML();
     return $code;
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:33,代码来源:menu.php

示例3: list_action

 function list_action()
 {
     //$this->tree->rebuild_tree(1,1);
     $icon = 'folder.gif';
     $expandedIcon = 'folder-expanded.gif';
     $menu = new HTML_TreeMenu();
     $this->_last_node = null;
     $rnode = $this->_array_recurse($this->tree->tree);
     $menu->addItem($rnode);
     $treeMenu = new HTML_TreeMenu_DHTML($menu, array('images' => 'images', 'defaultClass' => 'treeMenuDefault'));
     $this->assign("tree_html", $treeMenu->toHTML());
     return $this->fetch($GLOBALS['template_dir'] . "document_categories/" . $this->template_mod . "_list.html");
 }
开发者ID:aaricpittman,项目名称:openemr,代码行数:13,代码来源:C_DocumentCategory.class.php

示例4: buildTree

 /**
  * A method to return the HTML code needed to display a tree-based
  * menu of all the simulations.
  *
  * @return string A string containing the HTML code needed to display
  *                the tests in a tree-based menu.
  */
 function buildTree()
 {
     $menu = new HTML_TreeMenu();
     $rootNode = new HTML_TreeNode(array('text' => 'OpenX Developer Toolbox', 'icon' => '', 'link' => 'action.php?action=index', 'linkTarget' => 'right'));
     $aItems[] = array('title' => 'Plugins', 'action' => 'about&item=plugins', 'children' => array(0 => array('title' => 'New Plugin', 'action' => 'create_plugin')));
     $aItems[] = array('title' => 'Schemas', 'action' => 'about&item=schema', 'children' => array(0 => array('title' => 'Schema Editor', 'action' => 'schema_editor'), 1 => array('title' => 'Changeset Archives', 'action' => 'schema_changesets')));
     $aItems[] = array('title' => 'Core Schema Utilities', 'action' => 'about&item=core_utils', 'children' => array(0 => array('title' => 'Integrity Check', 'action' => 'schema_integ'), 1 => array('title' => 'Dump Data', 'action' => 'schema_datadump'), 2 => array('title' => 'Load Data', 'action' => 'schema_dataload')));
     $aItems[] = array('title' => 'Schema Analysis', 'action' => 'schema_analysis');
     // Generate DataObjects
     $aDataObjects[] = array('title' => 'OpenX Core', 'action' => 'generate_dataobjects');
     $plugins = $GLOBALS['_MAX']['CONF']['pluginPaths']['packages'];
     foreach ($GLOBALS['_MAX']['CONF']['pluginGroupComponents'] as $name => $enabled) {
         $schema = strtolower($name);
         $aDataObjects[] = array('title' => $name, 'action' => "generate_dataobjects&schema={$plugins}{$name}/etc/tables_{$schema}.xml&dbopath={$plugins}{$name}/etc/DataObjects");
     }
     $aItems[] = array('title' => 'Generate DataObjects', 'action' => 'about&item=dataobjects', 'children' => $aDataObjects);
     // Upgrade Packages
     $aPackages[] = array('title' => 'New Core Upgrade Package', 'action' => 'upgrade_package&name=OpenXCore');
     foreach ($GLOBALS['_MAX']['CONF']['pluginGroupComponents'] as $name => $enabled) {
         $aPackages[] = array('title' => $name, 'action' => 'upgrade_package&name=' . $name);
     }
     $aItems[] = array('title' => 'Upgrade Packages', 'action' => 'about&item=upgrade_packages', 'children' => $aPackages);
     // Upgrade Packages Array
     $aUpgrades[] = array('title' => 'OpenX Core', 'action' => 'upgrade_array&read=/etc/changes&write=/etc/changes/openads_upgrade_array.txt');
     foreach ($GLOBALS['_MAX']['CONF']['pluginGroupComponents'] as $name => $enabled) {
         $aUpgrades[] = array('title' => $name, 'action' => "upgrade_array&read={$plugins}{$name}/etc/changes&write={$plugins}{$name}/etc/changes/{$name}_upgrade_array.txt");
     }
     $aItems[] = array('title' => 'Upgrade Packages Array', 'action' => 'about&item=upgrade_array', 'children' => $aUpgrades);
     foreach ($aItems as $aItem) {
         $newNode =& $rootNode->addItem(new HTML_TreeNode(array('text' => $aItem['title'], 'icon' => 'package.png', 'link' => 'action.php?action=' . $aItem['action'], 'linkTarget' => 'right')));
         if (isset($aItem['children'])) {
             foreach ($aItem['children'] as $aChild) {
                 $newNode->addItem(new HTML_TreeNode(array('text' => $aChild['title'], 'icon' => 'Method.png', 'link' => 'action.php?action=' . $aChild['action'], 'linkTarget' => 'right')));
             }
         }
     }
     $menu->addItem($rootNode);
     $options = array('images' => 'assets/images');
     $tree = new HTML_TreeMenu_DHTML($menu, $options);
     $code = file_get_contents(PATH_ASSETS . '/css/menu.css');
     $code .= "\n<script>\n";
     $code .= file_get_contents(PATH_ASSETS . '/js/TreeMenu.js');
     $code .= "\n</script>";
     $code .= $tree->toHTML();
     return $code;
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:53,代码来源:menu.php

示例5: buildTree

 /**
  * A method to return the HTML code needed to display a tree-based
  * menu of all the OpenX tests.
  *
  * @return string A string containing the HTML code needed to display
  *                the tests in a tree-based menu.
  */
 function buildTree()
 {
     preg_match('/^(\\d+\\.\\d+)/', VERSION, $aMatches);
     // Create the root of the test suite
     $menu = new HTML_TreeMenu();
     $rootNode = new HTML_TreeNode(array('text' => PRODUCT_NAME . ' ' . $aMatches[1] . ' Tests', 'icon' => "package.png"));
     // Create the top-level test groups
     foreach ($GLOBALS['_MAX']['TEST']['groups'] as $type) {
         $nodeName = $type . 'RootNode';
         ${$nodeName} = new HTML_TreeNode(array('text' => ucwords($type) . ' Test Suite', 'icon' => "package.png", 'link' => "run.php?type={$type}&level=all", 'linkTarget' => "right"));
         $structure = TestFiles::getAllTestFiles($type);
         foreach ($structure as $layerCode => $folders) {
             $firstNode =& ${$nodeName}->addItem(new HTML_TreeNode(array('text' => $GLOBALS['_MAX']['TEST'][$type . '_layers'][$layerCode][0], 'icon' => "package.png", 'link' => "run.php?type={$type}&level=layer&layer={$layerCode}", 'linkTarget' => 'right')));
             foreach ($folders as $folder => $files) {
                 if (count($files)) {
                     $secondNode =& $firstNode->addItem(new HTML_TreeNode(array('text' => $folder, 'icon' => "class_folder.png", 'link' => "run.php?type={$type}&level=folder&layer={$layerCode}&folder={$folder}", 'linkTarget' => 'right')));
                 }
                 foreach ($files as $index => $file) {
                     $secondNode->addItem(new HTML_TreeNode(array('text' => $file, 'icon' => "Method.png", 'link' => "run.php?type={$type}&level=file&layer={$layerCode}&folder={$folder}&file={$file}", 'linkTarget' => 'right')));
                 }
             }
         }
         $rootNode->addItem(${$nodeName});
     }
     /**
      * @TODO Clean up the following code to ensure that adding new
      *       PEAR PHPUnit tests to the test suite is easier!
      */
     // Create the PEAR PHPUnit tests
     $nodeName = 'PearRootNode';
     ${$nodeName} = new HTML_TreeNode(array('text' => 'PEAR PHPUnit Test Suite', 'icon' => "package.png", 'link' => "", 'linkTarget' => "right"));
     $firstNode =& ${$nodeName}->addItem(new HTML_TreeNode(array('text' => 'PEAR::MDB2', 'icon' => "package.png", 'link' => "run.php?type=phpunit&dir=../lib/pear/MDB2/tests", 'linkTarget' => 'right')));
     $firstNode =& ${$nodeName}->addItem(new HTML_TreeNode(array('text' => 'PEAR::MDB2_Schema', 'icon' => "package.png", 'link' => "run.php?type=phpunit&dir=../lib/pear/MDB2_Schema/tests", 'linkTarget' => 'right')));
     $rootNode->addItem(${$nodeName});
     // Add the root node to the menu, and return the HTML code
     $menu->addItem($rootNode);
     $tree = new HTML_TreeMenu_DHTML($menu);
     $code = file_get_contents(MAX_PATH . '/tests/testClasses/menu.css');
     $code .= "\n<script>\n";
     $code .= file_get_contents(MAX_PATH . '/tests/testClasses/TreeMenu.js');
     $code .= "\n</script>";
     $code .= $tree->toHTML();
     return $code;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:51,代码来源:Menu.php

示例6: HTML_TreeMenu

<?php

/**
Map a filesystem with HTML TreeMenu
@author Tomas V.V.Cox <cox@idecnet.com>
*/
require_once '../HTML_TreeMenu/TreeMenu.php';
$map_dir = '.';
$menu = new HTML_TreeMenu('menuLayer', 'images', '_self');
$menu->addItem(recurseDir($map_dir));
function &recurseDir($path)
{
    if (!($dir = opendir($path))) {
        return false;
    }
    $files = array();
    $node = new HTML_TreeNode(basename($path), basename($path), 'folder.gif');
    while (($file = readdir($dir)) !== false) {
        if ($file != '.' && $file != '..') {
            if (@is_dir("{$path}/{$file}")) {
                $addnode =& recurseDir("{$path}/{$file}");
            } else {
                $addnode = new HTML_TreeNode($file, $file, 'document2.png');
            }
            $node->addItem($addnode);
        }
    }
    closedir($dir);
    return $node;
}
?>
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:31,代码来源:map_fs.php

示例7: manage_category

function manage_category()
{
    global $hesk_settings, $hesklang;
    $catid = intval(hesk_GET('catid')) or hesk_error($hesklang['kb_cat_inv']);
    $result = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'kb_categories` ORDER BY `parent` ASC, `cat_order` ASC');
    $kb_cat = array();
    while ($cat = hesk_dbFetchAssoc($result)) {
        $kb_cat[] = $cat;
        if ($cat['id'] == $catid) {
            $this_cat = $cat;
        }
    }
    if (isset($_SESSION['manage_cat'])) {
        $_SESSION['manage_cat'] = hesk_stripArray($_SESSION['manage_cat']);
        $this_cat['type'] = $_SESSION['manage_cat']['type'];
        $this_cat['parent'] = $_SESSION['manage_cat']['parent'];
        $this_cat['name'] = $_SESSION['manage_cat']['title'];
    }
    /* Translate main category "Knowledgebase" if needed */
    $kb_cat[0]['name'] = $hesklang['kb_text'];
    require HESK_PATH . 'inc/treemenu/TreeMenu.php';
    $icon = HESK_PATH . 'img/folder.gif';
    $expandedIcon = HESK_PATH . 'img/folder-expanded.gif';
    $menu = new HTML_TreeMenu();
    $thislevel = array('0');
    $nextlevel = array();
    $i = 1;
    $j = 1;
    while (count($kb_cat) > 0) {
        foreach ($kb_cat as $k => $cat) {
            if (in_array($cat['parent'], $thislevel)) {
                $up = $cat['parent'];
                $my = $cat['id'];
                $type = $cat['type'] ? '*' : '';
                $text_short = $cat['name'] . $type . ' (' . $cat['articles'] . ', ' . $cat['articles_private'] . ', ' . $cat['articles_draft'] . ')';
                if (isset($node[$up])) {
                    $node[$my] =& $node[$up]->addItem(new HTML_TreeNode(array('hesk_parent' => $this_cat['parent'], 'text' => 'Text', 'text_short' => $text_short, 'hesk_catid' => $cat['id'], 'hesk_select' => 'option' . $j, 'icon' => $icon, 'expandedIcon' => $expandedIcon, 'expanded' => true)));
                } else {
                    $node[$my] = new HTML_TreeNode(array('hesk_parent' => $this_cat['parent'], 'text' => 'Text', 'text_short' => $text_short, 'hesk_catid' => $cat['id'], 'hesk_select' => 'option' . $j, 'icon' => $icon, 'expandedIcon' => $expandedIcon, 'expanded' => true));
                }
                $nextlevel[] = $cat['id'];
                $j++;
                unset($kb_cat[$k]);
            }
        }
        $thislevel = $nextlevel;
        $nextlevel = array();
        /* Break after 20 recursions to avoid hang-ups in case of any problems */
        if ($i > 20) {
            break;
        }
        $i++;
    }
    $menu->addItem($node[1]);
    // Create the presentation class
    $listBox =& ref_new(new HTML_TreeMenu_Listbox($menu));
    /* Print header */
    require_once HESK_PATH . 'inc/header.inc.php';
    /* Print main manage users page */
    require_once HESK_PATH . 'inc/show_admin_nav.inc.php';
    ?>

	
     <div class="container manage-kb-category-title"><a href="manage_knowledgebase.php" class="smaller"><b><?php 
    echo $hesklang['kb'];
    ?>
</b></a> &gt; <?php 
    echo $hesklang['kb_cat_man'];
    ?>
</div>

	<!-- SUB NAVIGATION -->
	<?php 
    show_subnav('', $catid);
    ?>
	<!-- SUB NAVIGATION -->

	<?php 
    if (!isset($_SESSION['hide']['article_list'])) {
        ?>

     <div class="container category-kb"><?php 
        echo $hesklang['category'];
        ?>
: <span class="black"><?php 
        echo $this_cat['name'];
        ?>
</span></div>

    &nbsp;<br />

    <?php 
        $result = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "kb_articles` WHERE `catid`='{$catid}' ORDER BY `sticky` DESC, `art_order` ASC");
        $num = hesk_dbNumRows($result);
        if ($num == 0) {
            echo '<div class="container kb_no_article">' . $hesklang['kb_no_art'] . ' &nbsp;<br/><br/> 
		<a href="manage_knowledgebase.php?a=add_article&amp;catid=' . $catid . '"><img src="../img/add_article.png" width="16" height="16" alt="' . $hesklang['kb_i_art2'] . '" title="' . $hesklang['kb_i_art2'] . '" border="0" style="border:none;vertical-align:text-bottom" /></a>' . '<a href="manage_knowledgebase.php?a=add_article&amp;catid=' . $catid . '"><b>' . $hesklang['kb_i_art2'] . '</b></a></div>';
        } else {
            /* Get number of sticky articles */
            $res2 = hesk_dbQuery("SELECT COUNT(*) FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "kb_articles` WHERE `catid`='{$catid}' AND `sticky` = '1' ");
//.........这里部分代码省略.........
开发者ID:ermedita-xhafaj,项目名称:support,代码行数:101,代码来源:manage_knowledgebase.php

示例8: displayMenuRecords

function displayMenuRecords()
{
    global $_CONF, $_TABLES, $CONF_NEXMENU, $LANG_NEXMENU01, $LANG_NEXMENU02, $menulocation;
    global $statusmsg, $imagesdir, $folder_icon, $showdisabled, $idCurrent, $LANG_NEXMENU04;
    include $_CONF['path_system'] . 'classes/navbar.class.php';
    require_once $_CONF['path_system'] . 'nexpro/classes/TreeMenu.php';
    $menu = new HTML_TreeMenu();
    $mquery = DB_query("SELECT id,pid,label,menuorder, menutype, is_enabled from {$_TABLES['nexmenu']} WHERE pid='0' AND location='{$menulocation}' ORDER BY menuorder");
    $menuOrd = 10;
    $stepNumber = 10;
    while (list($id, $pid, $label, $order, $menutype, $enabled) = DB_fetchARRAY($mquery)) {
        /* Re-order any Offer or Stories that may have just been moved */
        if ($order != $menuOrd) {
            DB_query("UPDATE {$_TABLES['nexmenu']} SET menuorder = '{$menuOrd}' WHERE id = '{$id}'");
        }
        $menuOrd += $stepNumber;
        if ($enabled == '1' or $showdisabled == '1' and $enabled == '0') {
            $icon = $CONF_NEXMENU['icons'][$menutype];
            if ($idCurrent == $id) {
                $label = '<span class="treeMenuSelected">' . $label . '</span>';
            } elseif ($enabled == '0') {
                $label = '<span class="treeMenuDisabled">' . $label . '</span>';
            }
            $node[$id] = new HTML_TreeNode(array('text' => $label, 'link' => $_CONF['site_admin_url'] . "/plugins/nexmenu/index.php?op=display&id={$id}&showdisabled={$showdisabled}&menulocation={$menulocation}", 'icon' => $icon));
            recursive_node($node[$id], $id);
            $menu->addItem($node[$id]);
        }
    }
    $treeMenu =& new HTML_TreeMenu_DHTML($menu, array('images' => $imagesdir, 'defaultClass' => 'treeMenuDefault', 'usePersistance' => true));
    $mainview = new Template($_CONF['path_layout'] . 'nexmenu/admin');
    $mainview->set_file(array('mainview' => 'mainview.thtml'));
    $mainview->set_var('site_url', $_CONF['site_url']);
    if ($statusmsg != '') {
        $mainview->set_var('showalert', '');
    } else {
        $mainview->set_var('showalert', 'none');
    }
    $mainview->set_var('statusmsg', $statusmsg);
    $mainview->set_var('imgset', $_CONF['layout_url'] . '/nexmenu/images/admin');
    if ($showdisabled == '1') {
        $mainview->set_var('chk_enabled', 'CHECKED');
    } else {
        $mainview->set_var('chk_disabled', 'CHECKED');
    }
    if ($statusmsg != '') {
        $mainview->set_var('statusmsg', $statusmsg);
    }
    if ($CONF_NEXMENU['load_HTMLTree']) {
        $javascript = "<script language=JavaScript src=\"{$_CONF['site_url']}/nexmenu/javascript/TreeMenu.js\" type=\"text/javascript\"></script>";
        $mainview->set_var('include_javascript', $javascript);
    }
    $scripturl = $_CONF['site_admin_url'] . '/plugins/nexmenu/index.php';
    $navbar = new navbar();
    $navbar->add_menuitem($LANG_NEXMENU04['1'], $scripturl . "?menulocation=header&showdisabled={$showdisabled}");
    $navbar->add_menuitem($LANG_NEXMENU04['2'], $scripturl . "?menulocation=block&showdisabled={$showdisabled}");
    $navbar->add_menuitem($LANG_NEXMENU04['3'], $scripturl . "?op=addaction&id={$idCurrent}&menulocation={$menulocation}&showdisabled={$showdisabled}");
    $navbar->add_menuitem($LANG_NEXMENU04['6'], $scripturl . "?op=config&menulocation=block&showdisabled={$showdisabled}");
    if ($menulocation == 'block') {
        $navbar->set_selected($LANG_NEXMENU04['2']);
        $mainview->set_var('navbar', $navbar->generate());
        $mainview->set_var('location', 'block');
    } else {
        $navbar->set_selected($LANG_NEXMENU04['1']);
        $mainview->set_var('navbar', $navbar->generate());
        $mainview->set_var('location', 'header');
    }
    $mainview->set_var('LANG_OPTIONS', $LANG_NEXMENU01['LANG_OPTIONS']);
    $mainview->set_var('LANG_ADD', $LANG_NEXMENU01['LANG_ADD']);
    $mainview->set_var('LANG_HEADING1', $LANG_NEXMENU01['LANG_HEADING1']);
    $mainview->set_var('treemenu', $treeMenu->toHTML());
    $filteroptions = '<option value=\'block\' ';
    $filteroptions .= $menulocation == 'block' ? 'SELECTED' : '';
    $filteroptions .= '>Block Menu Items</option><option value=\'header\' ';
    $filteroptions .= $menulocation == 'header' ? 'SELECTED' : '';
    $filteroptions .= '>Header Menu Items</option>';
    $mainview->set_var('filteroptions', $filteroptions);
    if ($idCurrent == 0 or DB_getItem($_TABLES['nexmenu'], "location", "id='{$idCurrent}'") != $menulocation) {
        $mainview->set_var('showdiv', 'none');
        $mainview->set_var('LANG_edithelp', $LANG_NEXMENU01['LANG_EditHelp']);
    } else {
        $mainview->set_var('show_itemhelp', 'none');
        $mainview->set_var('LANG_HEADING2', $LANG_NEXMENU01['LANG_HEADING2']);
        $query = DB_query("SELECT pid, menutype, menuorder, label, url, grp_access, is_enabled FROM {$_TABLES['nexmenu']} WHERE id={$idCurrent}");
        list($pid, $menutype, $order, $label, $url, $grp_id, $is_enabled) = DB_fetchArray($query);
        $chk1 = $is_enabled == 1 ? ' checked' : '';
        if ($pid == 0) {
            $parent = $LANG_NEXMENU01['LANG_TopLevelMenu'];
        } else {
            $parent = DB_getItem($_TABLES['nexmenu'], "label", "id={$pid}");
        }
        if (trim($url) == '') {
            $url = 'Not Defined';
        }
        $mainview->set_var('showurl', $menutype == 3 ? 'none' : '');
        $mainview->set_var('id', $idCurrent);
        $mainview->set_var('location', $menulocation);
        $mainview->set_var('label', stripslashes($label));
        $mainview->set_var('parent', $parent);
        $mainview->set_var('url', substr($url, 0, 40));
        $mainview->set_var('full_url', $url);
//.........这里部分代码省略.........
开发者ID:hostellerie,项目名称:nexpro,代码行数:101,代码来源:index.php

示例9: displaydir


//.........这里部分代码省略.........
    } else {
        $repodir = $repo->read_dir($uuid);
    }
    // Store the UUID value that we are currently browsing.
    $repo->set_repository_location($uuid, $id, $userid, $shared, $oid);
    if (!empty($repodir->folders)) {
        foreach ($repodir->folders as $folder) {
            $dirlist[] = $folder;
        }
    }
    if (!empty($repodir->files)) {
        foreach ($repodir->files as $file) {
            $filelist[] = $file;
        }
    }
    echo '<form action="index.php" method="post" name="reposearch">';
    echo '<input type="hidden" name="choose" value="' . $choose . '" />';
    echo "<input type=\"hidden\" name=\"id\" value=\"{$id}\" />";
    echo "<input type=\"hidden\" name=\"oid\" value=\"{$oid}\" />";
    echo "<input type=\"hidden\" name=\"shared\" value=\"{$shared}\" />";
    echo "<input type=\"hidden\" name=\"userid\" value=\"{$userid}\" />";
    echo "<input type=\"hidden\" name=\"uuid\" value=\"{$uuid}\" /> ";
    echo "<input type=\"hidden\" name=\"sesskey\" value=\"{$USER->sesskey}\" />";
    echo '<center>';
    echo '<input type="text" name="search" size="40" value="' . s($search) . '" /> ';
    echo '<input type="submit" value="' . get_string('search') . '" />';
    helpbutton('search', get_string('alfrescosearch', 'repository_alfresco'), 'block_repository');
    echo '</center><br />';
    if ($cats = $repo->category_get_children(0)) {
        $baseurl = $CFG->wwwroot . '/file/repository/index.php?choose=' . $choose . '&amp;id=' . $id . '&amp;shared=' . $shared . '&amp;oid=' . $oid . '&amp;userid=' . $userid . '&amp;wdir=' . $wdir . '&amp;uuid=' . $uuid;
        $catfilter = repository_alfresco_get_category_filter();
        $icon = 'folder.gif';
        $eicon = 'folder-expanded.gif';
        $menu = new HTML_TreeMenu();
        $tnodes = array();
        if ($cats = $repo->category_get_children(0)) {
            if ($nodes = repository_alfresco_make_category_select_tree_browse($cats, $catselect, $baseurl)) {
                for ($i = 0; $i < count($nodes); $i++) {
                    $menu->addItem($nodes[$i]);
                }
            }
        }
        $treemenu = new HTML_TreeMenu_DHTML($menu, array('images' => $CFG->wwwroot . '/lib/HTML_TreeMenu-1.2.0/images'));
        // Add roll up - roll down code here, similar to Show Advanced in course/modedit
        // Advanced Search/Hide Advanced Search
        // "category filter" now has help text - so, how to add that too, but use yui library
        // for hiding this
        echo '<script language="JavaScript" type="text/javascript">';
        echo "<!--\n";
        include $CFG->libdir . '/HTML_TreeMenu-1.2.0/TreeMenu.js';
        echo "\n// -->";
        echo '</script>';
        print_simple_box_start('center', '75%');
        //looks for search.html file and gets text alfrescosearch from repository_alfresco lang file which I guess we use too...
        // now hmmm, so where does search.html go? or in our case, categoryfilter.html, I guess repository/alfresco
        print_heading(helpbutton('categoryfilter', get_string('alfrescocategoryfilter', 'block_repository'), 'block_repository', true, false, null, true) . get_string('categoryfilter', 'block_repository') . ':', 'center', '3');
        $treemenu->printMenu();
        echo '<br />';
        print_simple_box_end();
    }
    echo '</form>';
    echo '<center>';
    print_single_button('index.php', array('id' => $id, 'shared' => $shared, 'oid' => $oid, 'userid' => $userid, 'uuid' => $uuid), get_string('showall'), 'get');
    echo '</center>';
    if ($canedit) {
        echo "<form action=\"index.php\" method=\"post\" name=\"dirform\" id=\"dirform\">";
开发者ID:remotelearner,项目名称:elis.alfresco,代码行数:67,代码来源:index.php

示例10: array

    {
        $this->path = $path;
        $options = array();
        if ($text) {
            $options['text'] = $text;
        }
        if ($link) {
            $options['link'] = $link;
        }
        if ($icon) {
            $options['icon'] = $icon;
        }
        HTML_TreeNode::HTML_TreeNode($options, $events);
    }
}
$menu = new HTML_TreeMenu();
$filename = '';
if (isset($_GET) && isset($_GET['fileName'])) {
    $filename = $_GET['fileName'];
}
$filename = realpath($filename);
$pd = substr(PHP_OS, 0, 3) == 'WIN' ? '\\' : '/';
$test = $pd == '/' ? '/' : 'C:\\';
if (empty($filename) || $filename == $test) {
    $filename = $pd == '/' ? '/' : 'C:\\';
    $node = false;
    getDir($filename, $node);
} else {
    flush();
    //            if ($pd != '/') $pd = $pd.$pd;
    $anode = false;
开发者ID:TTsWeb,项目名称:phptvdb,代码行数:31,代码来源:file_dialog.php

示例11: generate_content

 /**
  * Creates a DHTML menu of serendipity categories.
  *
  * The menu is echoed out.
  *
  * @param  string $title  (Serves as the top level menu item if present)
  * @return void
  * @see    http://pear.php.net/HTML_TreeMenu  PEAR::HTML_TreeMenu
  */
 function generate_content(&$title)
 {
     global $serendipity;
     $title = $this->get_config('title', $this->title);
     // may want to put this in bundled_libs or a sub directory of this directory
     $pear = false;
     if (@(include_once 'HTML/TreeMenu.php')) {
         $pear = true;
     } elseif (@(include_once 'HTML_TreeMenu/TreeMenu.php')) {
         $pear = true;
     }
     if ($pear) {
         $which_category = $this->get_config('authorid');
         // build an accessible array of categories
         foreach (serendipity_fetchCategories(empty($which_category) ? 'all' : $which_category) as $cat) {
             if (!is_array($cat) || !isset($cat['categoryid'])) {
                 continue;
             }
             $categories[$cat['categoryid']] = $cat;
         }
         // create an array of numbers of entries per category
         $cat_count = array();
         if (serendipity_db_bool($this->get_config('show_count'))) {
             $cat_sql = "SELECT c.categoryid, c.category_name, count(e.id) as postings\n                                                FROM {$serendipity['dbPrefix']}entrycat ec,\n                                                     {$serendipity['dbPrefix']}category c,\n                                                     {$serendipity['dbPrefix']}entries e\n                                                WHERE ec.categoryid = c.categoryid\n                                                  AND ec.entryid = e.id\n                                                  AND e.isdraft = 'false'\n                                                      " . (!serendipity_db_bool($serendipity['showFutureEntries']) ? " AND e.timestamp  <= " . serendipity_db_time() : '') . "\n                                                GROUP BY c.categoryid, c.category_name\n                                                ORDER BY postings DESC";
             $category_rows = serendipity_db_query($cat_sql);
             if (is_array($category_rows)) {
                 foreach ($category_rows as $cat) {
                     $cat_count[$cat['categoryid']] = $cat['postings'];
                 }
             }
         }
         $image = $this->get_config('image', serendipity_getTemplateFile('img/xml.gif'));
         $image = $image == "'none'" || $image == 'none' ? '' : $image;
         // create nodes
         foreach ($categories as $cid => $cat) {
             if (function_exists('serendipity_categoryURL')) {
                 $link = serendipity_categoryURL($cat, 'serendipityHTTPPath');
             } else {
                 $link = serendipity_rewriteURL(PATH_CATEGORIES . '/' . serendipity_makePermalink(PERM_CATEGORIES, array('id' => $cat['categoryid'], 'title' => $cat['category_name'])), 'serendipityHTTPPath');
             }
             if (!empty($cat_count[$cat['categoryid']])) {
                 // $categories[$cid]['true_category_name'] = $cat['category_name'];
                 $cat['category_name'] .= ' (' . $cat_count[$cat['categoryid']] . ')';
                 // $categories[$cid]['article_count'] = $cat_count[$cat['categoryid']];
             }
             if (!empty($image)) {
                 $feedURL = serendipity_feedCategoryURL($cat, 'serendipityHTTPPath');
                 $feed = '<a class="serendipity_xml_icon" href="' . $feedURL . '"><img src="' . $image . '" alt="XML" style="border: 0px;vertical-align:middle"/></a> ';
                 $link = '<a href="' . $link . '" target="_self"><span>' . $cat['category_name'] . '</span></a>';
                 // work around a problem in HTML_TreeNode: when there is a href in 'text', 'link' is not converted to a link.
                 $cat_nodes[$cat['categoryid']] = new HTML_TreeNode(array('text' => $feed . $link));
             } else {
                 $cat_nodes[$cat['categoryid']] = new HTML_TreeNode(array('text' => $feed . $cat['category_name'], 'link' => $link));
             }
         }
         // create a top level for "all categories"
         // this serves as the title
         $cat_nodes[0] = new HTML_TreeNode(array('text' => ALL_CATEGORIES, 'link' => $serendipity['baseURL']));
         // nest nodes (thanks to PHP references)
         foreach ($categories as $category) {
             $cat_nodes[$category['parentid']]->addItem($cat_nodes[$category['categoryid']]);
         }
         // nest the "all categories" category
         $menu = new HTML_TreeMenu();
         $menu->addItem($cat_nodes[0]);
         $tree = new HTML_TreeMenu_DHTML($menu, array('images' => $serendipity['baseURL'] . $this->get_config('image_path')));
         // Add heading for block
         #$output = '<h2 class="serendipitySideBarTitle" style="font-weight: bold;">'.$title.'</h2><br />';
         // Put inside a div with "overflow:hidden" to avoid items of the sidebar plugin running outside the blog
         // Maybe we can put a config setting to choose if the block should be displayed with or without overflow setting.
         $output .= '<div style="overflow: hidden;">';
         $output .= $tree->toHTML();
         $output .= '</div>';
         echo '<script type="text/javascript" src="' . $serendipity['baseURL'] . $this->get_config('script_path') . '"></script>';
     } else {
         $output .= "Please install PEAR package HTML_TreeMenu to enable this plugin.";
     }
     echo $output;
 }
开发者ID:sqall01,项目名称:additional_plugins,代码行数:88,代码来源:serendipity_plugin_category_dhtml_menu.php

示例12: repository_alfresco_get_category_filter

    }
}
/// Get (or create) the array of category IDs that are already selected in the filter.
$catfilter = repository_alfresco_get_category_filter();
print_simple_box_start('center', '75%');
echo '<form method="post" action="' . $CFG->wwwroot . '/file//repository/alfresco/config-categories.php">';
echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
echo '<center>';
echo '<input type="submit" name="reset" value="' . get_string('resetcategories', 'repository_alfresco') . '" /><br />' . get_string('resetcategoriesdesc', 'repository_alfresco') . '<br /><br />';
if ($categories = $repo->category_get_children(0)) {
    echo '<input type="button" value="' . get_string('selectall') . '" onclick="checkall();" />';
    echo '&nbsp;<input type="button" value="' . get_string('deselectall') . '" onclick="checknone();" /><br />';
    echo '<input type="submit" value="' . get_string('savechanges') . '" />';
    echo '</center><br />';
    if ($nodes = repository_alfresco_make_category_select_tree_choose($categories, $catfilter)) {
        $menu = new HTML_TreeMenu();
        for ($i = 0; $i < count($nodes); $i++) {
            $menu->addItem($nodes[$i]);
        }
        $treemenu =& new HTML_TreeMenu_DHTML($menu, array('images' => $CFG->wwwroot . '/lib/HTML_TreeMenu-1.2.0/images'));
        echo '<script language="JavaScript" type="text/javascript">';
        echo "<!--\n";
        include $CFG->libdir . '/HTML_TreeMenu-1.2.0/TreeMenu.js';
        echo "\n// -->";
        echo '</script>';
        $treemenu->printMenu();
    }
    echo '<center><br />';
    echo '<input type="button" value="' . get_string('selectall') . '" onclick="checkall();" />';
    echo '&nbsp;<input type="button" value="' . get_string('deselectall') . '" onclick="checknone();" /><br />';
    echo '<input type="submit" value="' . get_string('savechanges') . '" /> ' . close_window_button('closewindow', true);
开发者ID:remotelearner,项目名称:elis.alfresco,代码行数:31,代码来源:config-categories.php

示例13: HTML_TreeMenu

<?php

/**
Map a filesystem with HTML TreeMenu
@author Tomas V.V.Cox <cox@idecnet.com>
*/
require_once '../HTML_TreeMenu/TreeMenu.php';
$map_dir = '.';
$menu = new HTML_TreeMenu('menuLayer', 'images', '_self');
$menu->addItem(recurseDir($map_dir));
function &recurseDir($path)
{
    if (!($dir = opendir($path))) {
        return false;
    }
    $files = array();
    $node =& new HTML_TreeNode(basename($path), basename($path), 'folder.gif');
    while (($file = readdir($dir)) !== false) {
        if ($file != '.' && $file != '..') {
            if (@is_dir("{$path}/{$file}")) {
                $addnode =& recurseDir("{$path}/{$file}");
            } else {
                $addnode =& new HTML_TreeNode($file, $file, 'document2.png');
            }
            $node->addItem($addnode);
        }
    }
    closedir($dir);
    return $node;
}
?>
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:31,代码来源:map_fs.php

示例14: displayPages

function displayPages($catid)
{
    global $_CONF, $CONF_SE, $_TABLES, $statusmsg, $type, $LANG_SE02;
    $menu = new HTML_TreeMenu();
    if ($catid != 0) {
        $parentCatid = DB_getItem($_TABLES['nexcontent_pages'], 'pid', "id='{$catid}'");
        $node[0] = new HTML_TreeNode(array('text' => 'up one level', 'link' => $_CONF['site_admin_url'] . "/plugins/nexcontent/index.php?catid={$parentCatid}", 'icon' => 'folder.gif'));
        $menu->addItem($node[0]);
        $label = DB_getItem($_TABLES['nexcontent_pages'], 'name', "id='{$catid}'");
        $psql = "SELECT id FROM {$_TABLES['nexcontent_pages']} WHERE pid='{$catid}' AND (type='page' OR type='link')";
        $psql .= COM_getPermSQL('AND');
        $psql .= ' ORDER BY pageorder, id asc';
        $pquery = DB_query($psql);
        $numpages = DB_numRows($pquery);
        if ($numpages > 0) {
            $label = $label . '&nbsp;(' . $numpages . ')';
        }
        $label = '<span class="treeMenuSelected">' . $label . '</span>';
        $node[$catid] = new HTML_TreeNode(array('text' => $label, 'link' => $_CONF['site_admin_url'] . "/plugins/nexcontent/index.php?catid=" . $catid, 'icon' => 'folder.gif'));
        nexcontent_recursiveView($node[$catid], $catid);
        $menu->addItem($node[$catid]);
    } else {
        $msql = "SELECT id,pid,name,pageorder from {$_TABLES['nexcontent_pages']} WHERE pid='0' and type='category'";
        $msql .= COM_getPermSQL('AND');
        $msql .= ' ORDER BY pageorder, id asc';
        $mquery = DB_QUERY($msql);
        while (list($id, $category, $name, $order) = DB_fetchARRAY($mquery)) {
            //echo "<br>id:$id, cat: $category, name:$name, order:$order";
            if ($catid != 0 and $catid == $id) {
                $name = '<span class="treeMenuSelected">' . $name . '</span>';
            }
            $pquery = DB_query("SELECT id FROM {$_TABLES['nexcontent_pages']} WHERE pid='{$id}' AND (type='page' OR type='link')");
            $numpages = DB_numRows($pquery);
            if ($numpages > 0) {
                $name = $name . '&nbsp;(' . $numpages . ')';
            }
            $node[$id] = new HTML_TreeNode(array('text' => $name, 'link' => $_CONF['site_admin_url'] . "/plugins/nexcontent/index.php?catid=" . $id, 'icon' => 'folder.gif'));
            nexcontent_recursiveView($node[$id], $id);
            $menu->addItem($node[$id]);
        }
    }
    $treeMenu =& new HTML_TreeMenu_DHTML($menu, array('images' => $_CONF['layout_url'] . '/nexpro/images/treemenu', 'defaultClass' => 'treeMenuDefault'));
    $q = DB_query("SELECT id,name from {$_TABLES['nexcontent_pages']} WHERE type='category' ORDER BY id");
    $selCategories = '<option value="0">Top Level</option>' . LB;
    $selCategories .= nexcontent_getFolderList($catid);
    /* Retrieve all the pages for the selected category */
    $sql = "SELECT id,sid,pageorder,name,hits,type,menutype,submenu_item,is_draft FROM {$_TABLES['nexcontent_pages']} WHERE pid='{$catid}' or id='{$catid}'";
    $sql .= COM_getPermSQL('AND');
    //$sql .= '  ORDER by type, pid,pageorder';
    $sql .= '  ORDER by pid,pageorder';
    $query = DB_query($sql);
    $mainview = new Template($_CONF['path_layout'] . 'nexcontent/admin');
    $mainview->set_file(array('mainview' => 'pageview.thtml', 'msgline' => 'alertline.thtml', 'records' => 'pagerecords.thtml'));
    $mainview->set_var('navbar', nexcontent_showNavbar($LANG_SE02['1']));
    $mainview->set_var('type', $type);
    $mainview->set_var('catid', $catid);
    $mainview->set_var('folderview', $treeMenu->toHTML());
    $mainview->set_var('phpself', $_SERVER['PHP_SELF']);
    if ($statusmsg != '') {
        $mainview->set_var('alertmsg', $statusmsg);
    } else {
        $mainview->set_var('alertmsg', '');
        $mainview->set_var('msgmode', 'none');
    }
    $mainview->set_var('filteroptions', $selCategories);
    $mainview->parse('alertline', 'msgline', true);
    $mainview->set_var('HEADING1', 'ID');
    $mainview->set_var('HEADING2', 'Name');
    $mainview->set_var('HEADING3', 'Hits');
    $mainview->set_var('HEADING4', 'Menu Type');
    $mainview->set_var('HEADING5', 'Draft');
    $mainview->set_var('HEADING6', 'Action');
    $mainview->set_var('imgset', $CONF_SE['public_url'] . '/images');
    $mainview->set_var('site_url', $_CONF['site_url']);
    $mainview->set_var('site_admin_url', $_CONF['site_admin_url']);
    $mainview->set_var('layout_url', $_CONF['layout_url']);
    $mainview->set_var('nexcontent_url', $CONF_SE['public_url']);
    $i = 1;
    $currentCategory = '';
    $pageOrd = 10;
    $stepNumber = 10;
    while (list($id, $sid, $order, $name, $hits, $type, $menutype, $submenu, $is_draft) = DB_fetchArray($query)) {
        if ($type == 'page' and $currentCategory != $category) {
            $pageOrd = 10;
            $currentCategory = $category;
        }
        if ($id != $catid and $order != $pageOrd) {
            DB_query("UPDATE {$_TABLES['nexcontent_pages']} SET pageorder = '{$pageOrd}' WHERE id = '{$id}'");
            $order = $pageOrd;
        }
        $pageOrd += $stepNumber;
        $check1 = $submenu >= 1 ? ' CHECKED' : '';
        $check2 = $is_draft == 1 ? ' CHECKED' : '';
        if ($type == 'category') {
            $mainview->set_var('pagelink', "{$_CONF['site_admin_url']}/plugins/nexcontent/index.php?catid={$id}");
            $mainview->set_var('pageimage', '<img src="' . $_CONF['layout_url'] . '/nexcontent/images/admin/sitecategory.gif">');
            $editop = 'editCategory';
        } else {
            if ($type == 'link') {
                $mainview->set_var('pagelink', "{$_CONF['site_admin_url']}/plugins/nexcontent/index.php?op=editLink&pageid={$id}");
//.........这里部分代码省略.........
开发者ID:hostellerie,项目名称:nexpro,代码行数:101,代码来源:index.php

示例15: list_action

 function list_action($patient_id = "")
 {
     $this->_last_node = null;
     $categories_list = $this->tree->_get_categories_array($patient_id);
     //print_r($categories_list);
     $menu = new HTML_TreeMenu();
     $rnode = $this->_array_recurse($this->tree->tree, $categories_list);
     $menu->addItem($rnode);
     $treeMenu =& new HTML_TreeMenu_DHTML($menu, array('images' => 'images', 'defaultClass' => 'treeMenuDefault'));
     $treeMenu_listbox =& new HTML_TreeMenu_Listbox($menu, array('linkTarget' => '_self'));
     $this->assign("tree_html", $treeMenu->toHTML());
     return $this->fetch($GLOBALS['template_dir'] . "documents/" . $this->template_mod . "_list.html");
 }
开发者ID:richsiy,项目名称:openemr,代码行数:13,代码来源:C_Document.class.php


注:本文中的HTML_TreeMenu类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。