Location: PHPKode > projects > LDAPted > ldapted/browser.php
<?php
#include ("tests/Performance.php");
#$performance = new Performance ();
#$performance->start('total');
/***************************************************************************
 *
 *                                  browser.php
 *                              -------------------
 *
 *   begin                : Friday, Jul 5, 2002
 *   copyright            : (C) 2002 The Kabramps Team
 *   email                : hide@address.com,
 *                          hide@address.com
 *
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 *   See the GNU General Public License for more details.
 *   (http://www.gnu.org/licenses/gpl.html)
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   variables
 *   $basedn : full basedn defines the base for the browser
 *   (Example: ou=FB5,o=UPB,c=DE)
 *
 *   $filter :
 *   $selectedformular :
 *
 ***************************************************************************/
include("includes/Config.php");
include("includes/session.php");
include("includes/TPLInterface.php");
include("includes/LDAPinterface.php");
include("includes/XMLinterface.php");
include_once('includes/dnInterpreter.php');
include_once ('includes/ControlFactory.php');
include("includes/Tree.php");
include("includes/Path.php");
include("includes/ControlBar.php");
require_once ('includes/xajax/xajax.inc.php');

$xajax  = new xajax();
$ldap   = new LDAPinterface($host,$bind_dn,$pw);
$config = new Config("config.xml");

$options   = $config->get_options();
$ldap_base = $config->get_host_ldapbase($host);

// include xajax functions for getJavascript()
include('xajax.php');

$controlbar = new ControlBar( $ldap, 
			      $HTTP_POST_VARS["selection"],
			      $HTTP_POST_VARS["action"],
			      $HTTP_POST_VARS["filter"],
			      $HTTP_POST_VARS["recursive"],
			      $HTTP_POST_VARS["formscombo"],
			      $_REQUEST['basedn']
			      );

$status = $controlbar->get_status();

// rendering the page
$tmpls = new TPLInterface();

//parse the tree
$tree = new Tree( $ldap, $controlbar->get_baseDN(), $controlbar->get_filter(), $controlbar->is_recursive(), $controlbar->get_selected_formular_id(), $HTTP_POST_VARS["twig"]);
//parse the path
$path = new Path( $controlbar->get_baseDN(), $config->get_host_form_base($host,$controlbar->get_selected_formular_id()).",".$config->get_host_ldapbase($host) );

#$performance->start('tree');
$treeview = $tree->get_view();
#$performance->stop('tree');


$tmpls->assign( array("PAGETITLE"  => "LDAPted: Browser",
                      "CONTROLBAR"  => $controlbar->get_view(),
                      "PATH"        => $path->get_view(),
                      "RESULTLIST"  => $treeview,
                      "STATUS"      => $status,
                      'skin_folder' => $tmpls->template_dir,
                      'jsfiles'     => array('templates/std/path.js',
                                             'templates/std/controlbar.js', //should move to controlbar ;-
                                             'templates/std/ajax.js'
                                            ),
                      'xajax'       => $xajax->getJavascript('includes/xajax')
		      ));
#$performance->start('smarty');
$tmpls->display("browser.tpl");
#$performance->stop('smarty');
#$performance->stop('total');
#$performance->to_string();
?>
Return current item: LDAPted