Location: PHPKode > projects > LDAPted > ldapted/addon.php
<?php
//include ("tests/Performance.php");
//$performance = new Performance ();
//$performance->start('total');
/***************************************************************************
 *
 *                                   addon.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)
 *
 ***************************************************************************/

include("includes/session.php");
include("includes/smarty/Smarty.class.php");
include("includes/XMLinterface.php");
include("includes/Config.php");
include("includes/LDAPinterface.php");
include("includes/addons/Addon.php");

if ( $HTTP_GET_VARS['type'] ) {
  $type = $HTTP_GET_VARS['type'];
}

$config = new Config("config.xml");
$options = $config->get_options();
$formular = $HTTP_GET_VARS['formular'];
$path = $options["forms"].$config->get_host_form_path($host); 
$ldap = new LDAPinterface($host,$bind_dn,$pw);
$attribute = $HTTP_GET_VARS['attribute'];
$xml = new XMLinterface($path.$config->get_host_form_file($host,$formular));
$addonoptions = $xml->get_attribute_addon_options($attribute);

$tmpls = new Smarty;
$tmpls->template_dir = $options['templates'].$HTTP_SESSION_VARS['skin'];
$addon = new Addon($type);

$jsfile = $addon->get_jsfile();

$jsassign = array();
for ( $i=0; $i<count($jsfile);$i++ ) {
  $jsassign[] = array( "JSFILE" => $jsfile[$i] );
}
$tmpls->assign("jsfile",$jsassign);

$tmpls->assign(array("ADDON"  => $addon->get_view(),
		     "ONLOAD" => $addon->onload(),
		     ));

$tmpls->display("addon.tpl");
//$performance->stop('total');
//$performance->to_string();
?>
		     
Return current item: LDAPted