<?php
//
// +---------------------------------------------------------------------------+
// | Nitro :: Module :: Include |
// +---------------------------------------------------------------------------+
// | Copyright (c) 2006 June Systems BV |
// +---------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or modify it |
// | under the terms of the GNU Lesser General Public License as published by |
// | the Free Software Foundation; either version 2.1 of the License, or (at |
// | your option) any later version. |
// | |
// | This library 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 Lesser |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public License |
// | along with this library; if not, write to the Free Software Foundation, |
// | Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
// +---------------------------------------------------------------------------+
// | Authors: Siggi Oskarsson <hide@address.com> |
// | Jesper Avot <hide@address.com |
// +---------------------------------------------------------------------------+
//
// $Id: Include.inc.php 229 2008-04-17 09:20:31Z oli $
//
// Nitro's default Include php/html file handling class
//
/**
* This file contains the Nitro Include Module
*
* @author Siggi Oskarsson
* @copyright June Systems BV, 2006
* @version $Revision: 1.4 $
* @package Modules
*/
/**
* Include prototype module class
*/
require_once "Nitro/Module.inc.php";
/**
* Include module class
*
* @package Modules
* @author Siggi Oskarsson <hide@address.com>
* @author Jesper Avot <hide@address.com>
* @copyright June Systems BV, 2006
* @access public
*/
class NitroModuleInclude extends NitroModule {
/**
* @var string Module ID string
*/
var $IDString = "NitroModuleInclude";
/**
* Include module constructor function
*
* @param string $ObjectID String with the current ObjectID
* @param mixed $Settings Array with the Module Settings, default is FALSE
* @access public
*/
function NitroModuleInclude($ObjectID, $Settings = FALSE)
{
/**
* Call the parent constructor
*/
parent::NitroModule();
/**
* Set ObjectID and ModuleSettings
*/
$this->ObjectID = $ObjectID;
$this->SetModuleSettings($Settings);
}
/**
* GetModuleDataConfiguration function
*
* @return array Array for the form libraries.
*/
function GetModuleDataConfiguration()
{
return Array("IncludeFile" => "TEXT/LABEL=" . Language('Include File'));
}
/**
* Draw function
*
* @return mixed The contents of the requested include file or in case of failure FALSE.
*/
function Draw()
{
$RV = FALSE;
if ($this->Settings["IncludeFile"]) { // We do not test for existance of file, because it can reside anywhere in the include path
ob_start();
@include($this->Settings["IncludeFile"]);
$RV = ob_get_contents();
ob_end_clean();
}
return $RV;
}
}
?>