* @author Romain Quetiez * @author Denis Flaven * @license http://www.opensource.org/licenses/gpl-3.0.html LGPL */ require_once(APPROOT."/application/webpage.class.inc.php"); /** * Web page with some associated CSS and scripts (jquery) for a fancier display */ class NiceWebPage extends WebPage { var $m_aReadyScripts; var $m_sRootUrl; public function __construct($s_title) { parent::__construct($s_title); $this->m_aReadyScripts = array(); $this->add_linked_script("../js/jquery-1.4.2.min.js"); $this->add_linked_stylesheet('../css/ui-lightness/jquery-ui-1.8.2.custom.css'); $this->add_linked_script('../js/jquery-ui-1.8.2.custom.min.js'); $this->add_linked_script("../js/hovertip.js"); $this->add_linked_stylesheet("../css/light-grey.css"); $this->m_sRootUrl = '../'; } public function SetRootUrl($sRootUrl) { $this->m_sRootUrl = $sRootUrl; } public function small_p($sText) { $this->add("

$sText

\n"); } // By Rom, used by CSVImport and Advanced search public function MakeClassesSelect($sName, $sDefaultValue, $iWidthPx, $iActionCode = null) { // $aTopLevelClasses = array('bizService', 'bizContact', 'logInfra', 'bizDocument'); // These are classes wich root class is cmdbAbstractObject ! $this->add(""); } // By Rom, used by Advanced search public function add_select($aChoices, $sName, $sDefaultValue, $iWidthPx) { $this->add(""); } public function add_ready_script($sScript) { $this->m_aReadyScripts[] = $sScript; } /** * Outputs (via some echo) the complete HTML page by assembling all its elements */ public function output() { $sAbsURLAppRoot = addslashes($this->m_sRootUrl); $this->add_script( <<set_base($this->m_sRootUrl.'pages/'); if (count($this->m_aReadyScripts)>0) { $this->add_script("\$(document).ready(function() {\n".implode("\n", $this->m_aReadyScripts)."\n});"); } parent::output(); } } ?>