加到tpl模板里面去.
至于隐藏的话,用js实现也不难!用jquery实现,还会有动画效果.
给你个下拉的面板,其实原理是一样的!
http://blog.sevenight.com/index.php?m=blog&a=show&id=73

解决方案 »

  1.   

    左右分别做成两个div,用js控制显示 style="display:block" 或  style="display:none"
      

  2.   

    代码应该加在tpl文件中,因为要用js来控制。如果是div+css结构,楼上正解;如果是iframe框架<script type="text/javascript">
    var displayBar=true;
    function switchBar(obj) {
      if (displayBar) {
        window.top.document.getElementById('frame').cols='0,*';
        displayBar=false;
        obj.innerHTML='打开左侧菜单';
      } else {
        window.top.document.getElementById('frame').cols='145,*';
        displayBar=true;
        obj.innerHTML='关闭左侧菜单';
      }
    }
    </script>
      

  3.   

    具体怎么加啊?
    主页面代码:<?
    /**
     * TestLink Open Source Project - http://testlink.sourceforge.net/ 
     *
     * Filename $RCSfile: frmWorkArea.php,v $
     *
     * @version $Revision: 1.6 $
     * @modified $Date: 2005/11/26 19:58:22 $ by $Author: schlundus $
     *
     * @author Martin Havlat
     *
     *This page is window for navigation and working area (eg tree + edit page).
     *
     * @author Francisco Mancardi - 20050828
     * get default value for treewidth from config.inc.php DEFINE
     *
    **/
    require_once('../../config.inc.php');
    require_once("common.php");
    testlinkInitPage();/// <enhancement version="???" date="2005-04-09" author="fm" >
    /// Changes a lot of if/else for configuration
    /// </enhancement>
    // Associative Array TreeFramePath 
    // key  : feature
    // value: page to lauch
    $aa_tfp = array( 
                'editTc' => 'lib/testcases/listTestCases.php?feature=tcEdit',
                'assignReqs' => 'lib/testcases/listTestCases.php?feature=assignReqs',
                'searchTc' => 'lib/testcases/searchForm.php',
                'printTc' => 'lib/print/selectData.php?type=product',
                'keywordsAssign' => 'lib/testcases/listTestCases.php?feature=keywordsAssign',
                'testSetAdd'    => 'lib/plan/planAddTCNavigator.php',
                'testSetRemove' => 'lib/plan/testSetNavigator.php?feature=removeTC',
                'printTestSet'  => 'lib/print/selectData.php?type=testSet',
                'priority' => 'lib/plan/testSetNavigator.php?feature=priorityAssign',
                'executeTest' => 'lib/execute/execNavigator.php',
                'showMetrics' => 'lib/results/resultsNavigator.php',
                'planAssignTesters' => 'lib/plan/planTestersNavigator.php');/** feature to display */
    $showFeature = isset($_GET['feature']) ? $_GET['feature'] : null;
    if (isset($aa_tfp[$showFeature]) === FALSE)
    {
    // argument is wrong
    tLog("Wrong get argument 'feature'.", 'ERROR');
    exit();
    }
    // features that need to run the validate build function
    if (in_array($showFeature,array('executeTest','showMetrics')))
    {
    validateBuildAvailability($_SESSION['testPlanId'],
                              $_SESSION['testPlanName'],
                              $_SESSION['productName']);
    }
    /// <enhancement version="???" date="2005-04-09" author="fm" >
    /// 1. get path from global var
    /// 2. the URL made easier after setting some rules for help/instruction files
    ///    naming convention.
    /// </enhancement>
    $smarty = new TLSmarty();/** default width of left pane */
    // 20050828 - fm
    $smarty->assign('treewidth', TL_FRMWORKAREA_LEFT_FRAME_WIDTH);
    $smarty->assign('treeframe', $aa_tfp[$showFeature]);
    $smarty->assign('workframe', $g_rpath['help'] . "/{$showFeature}" . ".html");
    $smarty->display('frmInner.tpl');/** 
     *  validate that some build exists (for Test Plan related features).
     *  If no valid build is found give feedback to user and exit.
     *
     *  @author Martin Havlat 
     *  @author Andreas Morsing - added escaping of productNames and build identifiers
     *
     * @author Francisco Mancardi - 20050905 - added tpID, tpName, prodName
     *
     **/
    /// <enhancement date="2005-04-16" author="fm"> improved user message </<enhancement>
    function validateBuildAvailability($tpID, $tpName, $prodName)
    {
    require_once("exec.inc.php");


    $message = '<p>' . lang_get('no_build_warning_part1') . 
              "<b>". htmlspecialchars($prodName) . "::" . 
                     htmlspecialchars($tpName) . "</b>" .
              "  (Product::Test Plan) "  . 
              '</p><p>' . lang_get('no_build_warning_part2') . '</p>';

    if (!buildsNumber($tpID))
    {            
    // show info and exit
    $smarty = new TLSmarty;
    $smarty->assign('content', $message);
    $smarty->display('workAreaSimple.tpl');
    exit();
    }
    }
    ?>
    frmInner.tpl的代码:{* TestLink Open Source Project - http://testlink.sourceforge.net/ *}
    {* $Id: frmInner.tpl,v 1.4 2005/10/09 18:13:48 schlundus Exp $ *}
    {* Purpose: smarty template - inner frame for workarea *}
    {*
     20050810 - am - added frameborder/border for displaying a border fix for 0000138
    *}
    {*******************************************************************}
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset={$pageCharset}" />
    <meta http-equiv="Content-language" content="en" />
    <meta http-equiv="expires" content="-1" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta name="generator" content="testlink" />
    <meta name="author" content="Martin Havlat" />
    <meta name="copyright" content="GNU" />
    <meta name="robots" content="NOFOLLOW" />
    <base href="{$basehref}" />
    <title>TestLink Inner Frame</title>
    <style media="all" type="text/css">@import "{$css}";</style>
    </head><frameset cols="{$treewidth|default:"30%"},*" border="5" 
              frameborder="10" framespacing="1">
    <frame src="{$treeframe}" name="treeframe" scrolling="auto" />
    <frame src="{$workframe}" name="workframe" scrolling="auto" />
    </frameset></html>workAreaSimple.tpl的代码:{* TestLink Open Source Project - http://testlink.sourceforge.net/ *}
    {* $Id: workAreaSimple.tpl,v 1.2 2005/08/16 17:59:13 franciscom Exp $ *}
    {* Purpose: smarty template - show workarea with simple structure
     * title + content *}
    {include file="inc_head.tpl"}<body>{if $title ne ''}
    <h1>{$title|escape}</h1>
    {/if}<div class="workBack">{if $content ne ''}
    {$content}
    {/if}

    </div></body>
    </html>
    具体怎么加?高手指教。
      

  4.   

    UP!
    UP!UP!
    UP!UP!UP!
    UP!UP!UP!UP!
    UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!
    UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!UP!