Bläddra i källkod

Renaming of the WebPage class (and its derived classes) to stick to the same naming convention as other classes.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@250 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 15 år sedan
förälder
incheckning
17ff53a2e4

+ 2 - 2
addons/userrights/userrightsprofile.class.inc.php

@@ -148,7 +148,7 @@ class URP_Users extends UserRightsBaseClass
 		$oPage->table($aDisplayConfig, $aDisplayData);
 	}
 
-	function DisplayBareRelations(web_page $oPage)
+	function DisplayBareRelations(WebPage $oPage)
 	{
 		parent::DisplayBareRelations($oPage);
 
@@ -272,7 +272,7 @@ class URP_Profiles extends UserRightsBaseClass
 		$oPage->table($aDisplayConfig, $aDisplayData);
 	}
 
-	function DisplayBareRelations(web_page $oPage)
+	function DisplayBareRelations(WebPage $oPage)
 	{
 		parent::DisplayBareRelations($oPage);
 

+ 1 - 1
application/ajaxwebpage.class.inc.php

@@ -11,7 +11,7 @@ require_once("../application/webpage.class.inc.php");
  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
  */
  
-class ajax_page extends web_page
+class ajax_page extends WebPage
 {
     /**
      * Jquery style ready script

+ 16 - 16
application/cmdbabstract.class.inc.php

@@ -116,7 +116,7 @@ abstract class cmdbAbstractObject extends CMDBObject
 		return $sDisplayValue;
 	}
 
-	function DisplayBareHeader(web_page $oPage)
+	function DisplayBareHeader(WebPage $oPage)
 	{
 		// Standard Header with name, actions menu and history block
 		//
@@ -140,12 +140,12 @@ abstract class cmdbAbstractObject extends CMDBObject
 		$oPage->add("</div>\n");
 	}
 
-	function DisplayBareDetails(web_page $oPage)
+	function DisplayBareDetails(WebPage $oPage)
 	{
 		$oPage->add($this->GetBareDetails($oPage));		
 	}
 
-	function DisplayBareRelations(web_page $oPage)
+	function DisplayBareRelations(WebPage $oPage)
 	{
 		// Related objects
 		$oPage->AddTabContainer('Related Objects');
@@ -197,7 +197,7 @@ abstract class cmdbAbstractObject extends CMDBObject
 		return $sDisplayName;
 	}
 
-	function GetBareDetails(web_page $oPage)
+	function GetBareDetails(WebPage $oPage)
 	{
 		$sHtml = '';
 		$oAppContext = new ApplicationContext();	
@@ -244,7 +244,7 @@ abstract class cmdbAbstractObject extends CMDBObject
 	}
 
 	
-	function DisplayDetails(web_page $oPage)
+	function DisplayDetails(WebPage $oPage)
 	{
 		$sTemplate = Utils::ReadFromFile(MetaModel::GetDisplayTemplate(get_class($this)));
 		if (!empty($sTemplate))
@@ -262,7 +262,7 @@ abstract class cmdbAbstractObject extends CMDBObject
 		}
 	}
 	
-	function DisplayPreview(web_page $oPage)
+	function DisplayPreview(WebPage $oPage)
 	{
 		$aDetails = array();
 		$sClass = get_class($this);
@@ -276,13 +276,13 @@ abstract class cmdbAbstractObject extends CMDBObject
 	
 	// Comment by Rom: this helper may be used to display objects of class DBObject
 	//                 -> I am using this to display the changes history
-	public static function DisplaySet(web_page $oPage, CMDBObjectSet $oSet, $aExtraParams = array())
+	public static function DisplaySet(WebPage $oPage, CMDBObjectSet $oSet, $aExtraParams = array())
 	{
 		$oPage->add(self::GetDisplaySet($oPage, $oSet, $aExtraParams));
 	}
 	
-	//public static function GetDisplaySet(web_page $oPage, CMDBObjectSet $oSet, $sLinkageAttribute = '', $bDisplayMenu = true, $bSelectMode = false)
-	public static function GetDisplaySet(web_page $oPage, CMDBObjectSet $oSet, $aExtraParams = array())
+	//public static function GetDisplaySet(WebPage $oPage, CMDBObjectSet $oSet, $sLinkageAttribute = '', $bDisplayMenu = true, $bSelectMode = false)
+	public static function GetDisplaySet(WebPage $oPage, CMDBObjectSet $oSet, $aExtraParams = array())
 	{
 		static $iListId = 0;
 		$iListId++;
@@ -418,7 +418,7 @@ abstract class cmdbAbstractObject extends CMDBObject
 		return $sHtml;
 	}
 	
-	static function DisplaySetAsCSV(web_page $oPage, CMDBObjectSet $oSet, $aParams = array())
+	static function DisplaySetAsCSV(WebPage $oPage, CMDBObjectSet $oSet, $aParams = array())
 	{
 		$oPage->add(self::GetSetAsCSV($oSet, $aParams));
 	}
@@ -455,7 +455,7 @@ abstract class cmdbAbstractObject extends CMDBObject
 		return $sHtml;
 	}
 	
-	static function DisplaySetAsXML(web_page $oPage, CMDBObjectSet $oSet, $aParams = array())
+	static function DisplaySetAsXML(WebPage $oPage, CMDBObjectSet $oSet, $aParams = array())
 	{
 		$oAppContext = new ApplicationContext();
 		$sClassName = $oSet->GetFilter()->GetClass();
@@ -480,7 +480,7 @@ abstract class cmdbAbstractObject extends CMDBObject
 	}
 
 	// By rom
-	function DisplayChangesLog(web_page $oPage)
+	function DisplayChangesLog(WebPage $oPage)
 	{
 		$oFltChangeOps = new CMDBSearchFilter('CMDBChangeOpSetAttribute');
 		$oFltChangeOps->AddCondition('objkey', $this->GetKey(), '=');
@@ -498,13 +498,13 @@ abstract class cmdbAbstractObject extends CMDBObject
 		}
 	}
 	
-	public static function DisplaySearchForm(web_page $oPage, CMDBObjectSet $oSet, $aExtraParams = array())
+	public static function DisplaySearchForm(WebPage $oPage, CMDBObjectSet $oSet, $aExtraParams = array())
 	{
 
 		$oPage->add(self::GetSearchForm($oPage, $oSet, $aExtraParams));
 	}
 	
-	public static function GetSearchForm(web_page $oPage, CMDBObjectSet $oSet, $aExtraParams = array())
+	public static function GetSearchForm(WebPage $oPage, CMDBObjectSet $oSet, $aExtraParams = array())
 	{
 		static $iSearchFormId = 0;
 		$oAppContext = new ApplicationContext();
@@ -755,7 +755,7 @@ abstract class cmdbAbstractObject extends CMDBObject
 		return $sHTMLValue;
 	}
 	
-	public function DisplayModifyForm(web_page $oPage)
+	public function DisplayModifyForm(WebPage $oPage)
 	{
 		static $iFormId = 0;
 		$iFormId++;
@@ -812,7 +812,7 @@ abstract class cmdbAbstractObject extends CMDBObject
 		$oPage->add("</form>\n");
 	}
 	
-	public static function DisplayCreationForm(web_page $oPage, $sClass, $oObjectToClone = null, $aArgs = array())
+	public static function DisplayCreationForm(WebPage $oPage, $sClass, $oObjectToClone = null, $aArgs = array())
 	{
 		static $iCreationFormId = 0;
 

+ 1 - 1
application/csvpage.class.inc.php

@@ -4,7 +4,7 @@ require_once("../application/webpage.class.inc.php");
  * Simple web page with no includes or fancy formatting, useful to generateXML documents
  * The page adds the content-type text/XML and the encoding into the headers
  */
-class CSVPage extends web_page
+class CSVPage extends WebPage
 {
     function __construct($s_title)
     {

+ 6 - 6
application/displayblock.class.inc.php

@@ -149,7 +149,7 @@ class DisplayBlock
 		return new $sBlockClass($oFilter, $sBlockType, $bAsynchronous, $aParams);		
 	}
 	
-	public function Display(web_page $oPage, $sId, $aExtraParams = array())
+	public function Display(WebPage $oPage, $sId, $aExtraParams = array())
 	{
 		$oPage->add($this->GetDisplay($oPage, $sId, $aExtraParams));
 		/*
@@ -184,7 +184,7 @@ class DisplayBlock
 		*/
 	}
 	
-	public function GetDisplay(web_page $oPage, $sId, $aExtraParams = array())
+	public function GetDisplay(WebPage $oPage, $sId, $aExtraParams = array())
 	{
 		$sHtml = '';
 		$aExtraParams = array_merge($aExtraParams, $this->m_aParams);
@@ -220,12 +220,12 @@ class DisplayBlock
 		return $sHtml;
 	}
 	
-	public function RenderContent(web_page $oPage, $aExtraParams = array())
+	public function RenderContent(WebPage $oPage, $aExtraParams = array())
 	{
 		$oPage->add($this->GetRenderContent($oPage, $aExtraParams));
 	}
 	
-	public function GetRenderContent(web_page $oPage, $aExtraParams = array())
+	public function GetRenderContent(WebPage $oPage, $aExtraParams = array())
 	{
 		$sHtml = '';
 		// Add the extra params into the filter if they make sense for such a filter
@@ -615,7 +615,7 @@ class DisplayBlock
  */
 class HistoryBlock extends DisplayBlock
 {
-	public function GetRenderContent(web_page $oPage, $aExtraParams = array())
+	public function GetRenderContent(WebPage $oPage, $aExtraParams = array())
 	{
 		$sHtml = '';
 		// Add the extra params into the filter if they make sense for such a filter
@@ -689,7 +689,7 @@ class HistoryBlock extends DisplayBlock
 
 class MenuBlock extends DisplayBlock
 {
-	public function GetRenderContent(web_page $oPage, $aExtraParams = array())
+	public function GetRenderContent(WebPage $oPage, $aExtraParams = array())
 	{
 		$sHtml = '';
 		$oAppContext = new ApplicationContext();

+ 3 - 3
application/loginwebpage.class.inc.php

@@ -3,7 +3,7 @@ require_once("../application/nicewebpage.class.inc.php");
 /**
  * Web page used for displaying the login form
  */
-class login_web_page extends nice_web_page
+class LoginWebPage extends NiceWebPage
 {
     public function __construct()
     {
@@ -96,7 +96,7 @@ h1 {
 			}
 			else
 			{
-				$oPage = new login_web_page();
+				$oPage = new LoginWebPage();
 				$oPage->DisplayLoginForm();
 				$oPage->output();
 				exit;
@@ -110,7 +110,7 @@ h1 {
 		if (!UserRights::Login($sAuthUser, $sAuthPwd))
 		{
 			self::ResetSession();
-			$oPage = new login_web_page();
+			$oPage = new LoginWebPage();
 			$oPage->DisplayLoginForm( true /* failed attempt */);
 			$oPage->output();
 			exit;

+ 2 - 2
application/menunode.class.inc.php

@@ -113,7 +113,7 @@ class menuNode extends DBObject
 		return $oSet;
 	}
 
-	public function RenderContent(web_page $oPage, $aExtraParams = array())
+	public function RenderContent(WebPage $oPage, $aExtraParams = array())
 	{
 		$sTemplate = $this->Get('template');
 		$oTemplate = new DisplayTemplate($sTemplate);
@@ -136,7 +136,7 @@ class menuNode extends DBObject
 		}
 		$oP->AddToMenu("</li>\n");
 	}
-	static public function DisplayCreationForm(web_page $oP, $sClass, $sFilter, $aExtraParams = array())
+	static public function DisplayCreationForm(WebPage $oP, $sClass, $sFilter, $aExtraParams = array())
 	{
 		$oFilter = DBObjectSearch::unserialize($sFilter);
 		$oP->p('Create a new menu item for: '.$oFilter->__DescribeHTML());

+ 1 - 1
application/nicewebpage.class.inc.php

@@ -3,7 +3,7 @@ require_once("../application/webpage.class.inc.php");
 /**
  * Web page with some associated CSS and scripts (jquery) for a fancier display
  */
-class nice_web_page extends web_page
+class NiceWebPage extends WebPage
 {
 	var $m_aReadyScripts;
 	

+ 1 - 1
application/template.class.inc.php

@@ -15,7 +15,7 @@ class DisplayTemplate
 		$this->m_sTemplate = $sTemplate;
 	}
 	
-	public function Render(web_page $oPage, $aParams = array())
+	public function Render(WebPage $oPage, $aParams = array())
 	{
 		$this->m_sTemplate = MetaModel::ApplyParams($this->m_sTemplate, $aParams);
 		$iStart = 0;

+ 4 - 4
application/ui.linkswidget.class.inc.php

@@ -17,7 +17,7 @@ class UILinksWidget
 		$this->m_iInputId = $iInputId;
 	}
 	
-	public function Display(web_page $oPage, $oCurrentValuesSet = null)
+	public function Display(WebPage $oPage, $oCurrentValuesSet = null)
 	{
 		$sHTMLValue = '';
 		$sTargetClass = self::GetTargetClass($this->m_sClass, $this->m_sAttCode);
@@ -122,7 +122,7 @@ class UILinksWidget
 	}
 	/**
 	 * This static function is called by the Ajax Page when there is a need to fill an autocomplete combo
-	 * @param $oPage web_page The ajax page used for the put^put (sent back to the browser
+	 * @param $oPage WebPage The ajax page used for the put^put (sent back to the browser
 	 * @param $oContext UserContext The context of the user (for limiting the search)
 	 * @param $sClass string The name of the class of the current object being edited
 	 * @param $sAttCode string The name of the attribute being edited
@@ -130,7 +130,7 @@ class UILinksWidget
 	 * @param $iMaxCount integer The maximum number of items to return
 	 * @return void
 	 */	 	 	  	 	 	 	
-	static public function Autocomplete(web_page $oPage, UserContext $oContext, $sClass, $sAttCode, $sName, $iMaxCount)
+	static public function Autocomplete(WebPage $oPage, UserContext $oContext, $sClass, $sAttCode, $sName, $iMaxCount)
 	{
 		// #@# todo - add context information, otherwise any value will be authorized for external keys
 		$aAllowedValues = MetaModel::GetAllowedValues_att($sClass, $sAttCode, array() /* $aArgs */, $sName);
@@ -166,7 +166,7 @@ class UILinksWidget
 	/**
 	 * This static function is called by the Ajax Page display a set of objects being linked
 	 * to the object being created	 
-	 * @param $oPage web_page The ajax page used for the put^put (sent back to the browser
+	 * @param $oPage WebPage The ajax page used for the put^put (sent back to the browser
 	 * @param $sClass string The name of the 'linking class' which is the class of the objects to display
 	 * @param $sSet JSON serialized set of objects
 	 * @param $sExtKeyToMe Name of the attribute in sClass that is pointing to a given object

+ 6 - 6
application/uilinkswizard.class.inc.php

@@ -55,7 +55,7 @@ class UILinksWizard
 		}
 	}
 
-	public function Display(web_page $oP, UserContext $oContext, $aExtraParams = array())
+	public function Display(WebPage $oP, UserContext $oContext, $aExtraParams = array())
 	{
 		$oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $this->m_sLinkageAttr);
 		$sTargetClass = $oAttDef->GetTargetClass();
@@ -295,7 +295,7 @@ class UILinksWizard
 		return $aRow;
 	}
 	
-	protected function DisplayFormTable(web_page $oP, $aConfig, $aData)
+	protected function DisplayFormTable(WebPage $oP, $aConfig, $aData)
 	{
 		$oP->add("<table class=\"listResults\">\n");
 		// Header
@@ -327,7 +327,7 @@ class UILinksWizard
 		$oP->add("</table>\n");
 	}
 	
-	protected function DisplayFormRow(web_page $oP, $aConfig, $aRow, $iRowId)
+	protected function DisplayFormRow(WebPage $oP, $aConfig, $aRow, $iRowId)
 	{
 		$oP->add("<tr id=\"row_$iRowId\">\n");
 		foreach($aConfig as $sName=>$void)
@@ -337,7 +337,7 @@ class UILinksWizard
 		$oP->add("</tr>\n");
 	}
 	
-	public function DisplayAddForm(web_page $oP, UserContext $oContext)
+	public function DisplayAddForm(WebPage $oP, UserContext $oContext)
 	{
 		$oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $this->m_sLinkageAttr);
 		$sTargetClass = $oAttDef->GetTargetClass();
@@ -361,7 +361,7 @@ class UILinksWizard
 		$oP->add_ready_script("$('div#SearchFormToAdd form').bind('submit', function() {var the_form = this; SearchObjectsToAdd(the_form.id); return false;});");
 	}
 
-	public function SearchObjectsToAdd(web_page $oP, UserContext $oContext)
+	public function SearchObjectsToAdd(WebPage $oP, UserContext $oContext)
 	{
 		//$oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $this->m_sLinkageAttr);
 
@@ -371,7 +371,7 @@ class UILinksWizard
 		$oBlock->Display($oP, 'ResultsToAdd', array('menu' => false, 'selection_mode' => true, 'display_limit' => false)); // Don't display the 'Actions' menu on the results
 	}
 	
-	public function DoAddObjects(web_page $oP, UserContext $oContext, $aLinkedObjectIds = array())
+	public function DoAddObjects(WebPage $oP, UserContext $oContext, $aLinkedObjectIds = array())
 	{
 		//$oAttDef = MetaModel::GetAttributeDef($this->m_sClass, $this->m_sLinkageAttr);
 		//$sTargetClass = $oAttDef->GetTargetClass();

+ 2 - 2
application/webpage.class.inc.php

@@ -6,11 +6,11 @@
  * and renders the full web page by putting the elements in the proper place & order
  * when the output() method is called.
  * Usage:
- * 	$oPage = new web_page("Title of my page");
+ * 	$oPage = new WebPage("Title of my page");
  *	$oPage->p("Hello World !");
  *	$oPage->output();
  */
-class web_page
+class WebPage
 {
     protected $s_title;
     protected $s_content;

+ 1 - 1
application/xmlpage.class.inc.php

@@ -4,7 +4,7 @@ require_once("../application/webpage.class.inc.php");
  * Simple web page with no includes or fancy formatting, useful to generateXML documents
  * The page adds the content-type text/XML and the encoding into the headers
  */
-class XMLPage extends web_page
+class XMLPage extends WebPage
 {
     function __construct($s_title)
     {

+ 7 - 7
business/itop.business.class.inc.php

@@ -646,7 +646,7 @@ class bizLocation extends logInfra
   */
 	}
 
-	function DisplayDetails(web_page $oPage)
+	function DisplayDetails(WebPage $oPage)
 	{
 		parent::DisplayDetails($oPage);
 /*
@@ -865,7 +865,7 @@ class bizInterface extends logInfra
 		MetaModel::Init_SetZListItems('advanced_search', array('name', 'status', 'device_id', 'org_id')); // Criteria of the advanced search form
 	}
 
-	function DisplayDetails(web_page $oPage)
+	function DisplayDetails(WebPage $oPage)
 	{
 		parent::DisplayDetails($oPage);
     /*
@@ -942,7 +942,7 @@ class bizSubnet extends logInfra
 		MetaModel::Init_SetZListItems('advanced_search', array('name', 'ip','mask')); // Criteria of the advanced search form
 	}
 
-	function DisplayBareRelations(web_page $oPage)
+	function DisplayBareRelations(WebPage $oPage)
 	{
 		parent::DisplayBareRelations($oPage);
 
@@ -1109,7 +1109,7 @@ class bizPC extends bizDevice
 		MetaModel::Init_SetZListItems('advanced_search', array('name', 'status', 'type', 'brand', 'model', 'cpu', 'memory_size', 'hdd_size')); // Criteria of the advanced search form
 	}
 
-	function DisplayDetails(web_page $oPage)
+	function DisplayDetails(WebPage $oPage)
 	{
 		parent::DisplayDetails($oPage);
 		/*
@@ -1256,7 +1256,7 @@ class bizServer extends bizDevice
 		MetaModel::Init_SetZListItems('advanced_search', array('name', 'status','brand', 'model', 'os_family', 'os_version', 'location_id', 'cpu', 'number_of_cpus', 'memory_size', 'hdd_size', 'hdd_free_size')); // Criteria of the advanced search form
 	}
 	
-	function DisplayDetails(web_page $oPage)
+	function DisplayDetails(WebPage $oPage)
 	{
 		parent::DisplayDetails($oPage);
 		/*
@@ -1436,7 +1436,7 @@ class bizInfraGroup extends logInfra
 		MetaModel::Init_SetZListItems('advanced_search', array('name', 'status', 'type', 'description', 'org_id')); // Criteria of the advanced search form
 	}
 
-	function DisplayDetails(web_page $oPage)
+	function DisplayDetails(WebPage $oPage)
 	{
 		parent::DisplayDetails($oPage);
 	/*
@@ -1537,7 +1537,7 @@ class bizApplication extends logInfra
 		}
 	}
 
-	function DisplayDetails(web_page $oPage)
+	function DisplayDetails(WebPage $oPage)
 	{
 		parent::DisplayDetails($oPage);
 	/*

+ 1 - 1
pages/UI.php

@@ -30,7 +30,7 @@ $currentOrganization = utils::ReadParam('org_id', '');
 $operation = utils::ReadParam('operation', '');
 
 require_once('../application/loginwebpage.class.inc.php');
-login_web_page::DoLogin(); // Check user rights and prompt if needed
+LoginWebPage::DoLogin(); // Check user rights and prompt if needed
 
 
 $oP = new iTopWebPage("Welcome to ITop", $currentOrganization);

+ 1 - 1
pages/advanced_search.php

@@ -9,7 +9,7 @@ require_once('../application/dialogstack.class.inc.php');
 require_once('../application/startup.inc.php');
 
 // #@# not used, but... require_once('../classes/usercontext.class.inc.php');
-$oPage = new nice_web_page("ITop finder");
+$oPage = new NiceWebPage("ITop finder");
 $oPage->no_cache();
 
 

+ 1 - 1
pages/ajax.php

@@ -9,7 +9,7 @@ function ReadParam($sName, $defaultValue = "")
 	return isset($_REQUEST[$sName]) ? $_REQUEST[$sName] : $defaultValue;
 }
 
-$oPage = new nice_web_page("Asynchronous versus asynchronous DisplayBlocks");
+$oPage = new NiceWebPage("Asynchronous versus asynchronous DisplayBlocks");
 $oPage->no_cache();
 $oPage->add("<h1>Asynchronous versus asynchronous DisplayBlocks</h1>\n");
 

+ 2 - 2
pages/ajax.render.php

@@ -296,7 +296,7 @@ $oPage->output();
 /**
  * Downloads a document to the browser, either as 'inline' or 'attachment'
  *  
- * @param web_page $oPage The web page for the output
+ * @param WebPage $oPage The web page for the output
  * @param UserContext $oContext The current User/security context to retreive the objects
  * @param string $sClass Class name of the object
  * @param mixed $id Identifier of the object
@@ -304,7 +304,7 @@ $oPage->output();
  * @param string $sContentDisposition Either 'inline' or 'attachment'
  * @return none
  */   
-function DownloadDocument(web_page $oPage, UserContext $oContext, $sClass, $id, $sAttCode, $sContentDisposition = 'attachement')
+function DownloadDocument(WebPage $oPage, UserContext $oContext, $sClass, $id, $sAttCode, $sContentDisposition = 'attachement')
 {
 	try
 	{

+ 1 - 1
pages/audit.php

@@ -8,7 +8,7 @@ $operation = utils::ReadParam('operation', '');
 $oAppContext = new ApplicationContext();
 
 require_once('../application/loginwebpage.class.inc.php');
-login_web_page::DoLogin(); // Check user rights and prompt if needed
+LoginWebPage::DoLogin(); // Check user rights and prompt if needed
 
 $oP = new iTopWebPage("iTop - CMDB Audit", $currentOrganization);
 

+ 1 - 1
pages/csvimport.php

@@ -5,7 +5,7 @@ require_once('../application/itopwebpage.class.inc.php');
 require_once('../application/startup.inc.php');
 
 require_once('../application/loginwebpage.class.inc.php');
-login_web_page::DoLogin(); // Check user rights and prompt if needed
+LoginWebPage::DoLogin(); // Check user rights and prompt if needed
 
 $oContext = new UserContext();
 $oAppContext = new ApplicationContext();

+ 3 - 3
pages/data_generator.php

@@ -62,11 +62,11 @@ $aClassesToGenerate = array('bizOrganization' /* This one is special and must go
 /**
  * Populate an organization with objects of each class listed in the (global) $aClassesToGenerate array
  *
- * @param web_page $oPage The object used for the HTML output
+ * @param WebPage $oPage The object used for the HTML output
  * @param cmdbGenerator $oGenerator The object used for the generation of the objects
  * @param string $sSize An enum specifying (roughly) how many objects of each class to create: one of 'small', 'medium', 'big', 'huge' or 'max'
  */
-function PopulateOrganization(CMDBChange $oMyChange, web_page $oPage, cmdbDataGenerator $oGenerator, $sSize = 'small')
+function PopulateOrganization(CMDBChange $oMyChange, WebPage $oPage, cmdbDataGenerator $oGenerator, $sSize = 'small')
 {
 	global $aClassesToGenerate;
 	
@@ -111,7 +111,7 @@ function PopulateOrganization(CMDBChange $oMyChange, web_page $oPage, cmdbDataGe
 /**
  * Delete an organization and all the instances of 'Object' belonging to this organization
  *
- * @param web_page $oPage The object used for the HTML output
+ * @param WebPage $oPage The object used for the HTML output
  * @param string $sOrganizationCode The code (pkey) of the organization to delete
  */
 function DeleteOrganization($oMyChange, $oPage, $sOrganizationCode)

+ 1 - 1
pages/db_importer.php

@@ -5,7 +5,7 @@ require_once('../application/itopwebpage.class.inc.php');
 require_once('../application/startup.inc.php');
 
 require_once('../application/loginwebpage.class.inc.php');
-login_web_page::DoLogin(); // Check user rights and prompt if needed
+LoginWebPage::DoLogin(); // Check user rights and prompt if needed
 
 $sOperation = utils::ReadParam('operation', 'menu');
 $oContext = new UserContext();

+ 10 - 10
pages/incident.php

@@ -24,7 +24,7 @@ abstract class DialogWizard
 		return $this->m_aSteps[$sStep];
 	}
 
-	protected function AddContextToForm(web_page $oPage)
+	protected function AddContextToForm(WebPage $oPage)
 	{
 		// Store as hidden fields in the page all the variables from the previous steps
 		foreach($this->m_aSteps as $sStep => $aFields)
@@ -37,7 +37,7 @@ abstract class DialogWizard
 		}
 	}
 	
-	function GetObjectPicker(web_page $oPage, $sTitle, $sFieldName, $sClass)
+	function GetObjectPicker(WebPage $oPage, $sTitle, $sFieldName, $sClass)
 	{
 		$sScript =
 <<<EOF
@@ -226,7 +226,7 @@ EOF;
 		return $sHTML;
 	}
 	
-	function DisplayObjectPickerList(web_page $oPage, $sClass)
+	function DisplayObjectPickerList(WebPage $oPage, $sClass)
 	{
 		$oFilter = new CMDBSearchFilter($sClass);
 		$oFilter->AddCondition('pkey', array(0), 'IN');
@@ -258,7 +258,7 @@ class IncidentCreationWizard extends DialogWizard
 		$oPage->add("<input type=\"hidden\" name=\"step\" value=\"".$this->m_sNextStep."\" />\n");
 	}
 
-	public function DisplayNewTicketForm(web_page $oPage)
+	public function DisplayNewTicketForm(WebPage $oPage)
 	{
 		assert($this->m_sCurrentStep == '1');
 		$this->m_sNextStep = '2';
@@ -280,7 +280,7 @@ class IncidentCreationWizard extends DialogWizard
 		$oPage->add('</form>');
 	}
 
-	public function DisplayImpactedInfraForm(web_page $oPage)
+	public function DisplayImpactedInfraForm(WebPage $oPage)
 	{
 		assert($this->m_sCurrentStep == '2');
 		$this->m_sNextStep = '3';
@@ -296,7 +296,7 @@ class IncidentCreationWizard extends DialogWizard
 		$oPage->add('</form>');
 	}
 
-	public function DisplayAdditionalImpactedObjectForm(web_page $oPage)
+	public function DisplayAdditionalImpactedObjectForm(WebPage $oPage)
 	{
 		assert($this->m_sCurrentStep == '3');
 		$this->m_sNextStep = '4';
@@ -344,7 +344,7 @@ class IncidentCreationWizard extends DialogWizard
 		$oPage->add('</form>');
 	}
 
-	public function DisplayRelatedTicketsForm(web_page $oPage)
+	public function DisplayRelatedTicketsForm(WebPage $oPage)
 	{
 		assert($this->m_sCurrentStep == '4');
 		$this->m_sNextStep = '5';
@@ -380,7 +380,7 @@ class IncidentCreationWizard extends DialogWizard
 		$oPage->add('</form>');
 	}
 	
-	public function DisplayContactsToNotifyForm(web_page $oPage)
+	public function DisplayContactsToNotifyForm(WebPage $oPage)
 	{
 		assert($this->m_sCurrentStep == '5');
 		$this->m_sNextStep = '6';
@@ -395,7 +395,7 @@ class IncidentCreationWizard extends DialogWizard
 		$oPage->add('</form>');
 	}
 	
-	function DisplayFinalForm(web_page $oPage)
+	function DisplayFinalForm(WebPage $oPage)
 	{
 		$oAppContext = new ApplicationContext();
 		assert($this->m_sCurrentStep == '6');
@@ -483,7 +483,7 @@ class IncidentCreationWizard extends DialogWizard
 		$oPage->add('</form>');
 	}
 	
-	public function CreateIncident(web_page $oPage)
+	public function CreateIncident(WebPage $oPage)
 	{
 		$oAppContext = new ApplicationContext();
 		assert($this->m_sCurrentStep == '7');

+ 10 - 10
pages/index.php

@@ -5,7 +5,7 @@ require_once('../application/dialogstack.class.inc.php');
 
 require_once('../application/startup.inc.php');
 
-$oPage = new nice_web_page("The very first iTop page");
+$oPage = new NiceWebPage("The very first iTop page");
 $oPage->no_cache();
 
 
@@ -82,7 +82,7 @@ function DisplaySelectOrg($oPage, $sCurrentOrganization, $iContext)
 	}
 }
 
-function DisplayDetails(web_page $oPage, $sClassName, $sKey)
+function DisplayDetails(WebPage $oPage, $sClassName, $sKey)
 {
 	global $oContext;
     //$oObj = MetaModel::GetObject($sClassName, $sKey);
@@ -135,7 +135,7 @@ function DisplayDetails(web_page $oPage, $sClassName, $sKey)
 }
 
 // By Rom
-function DisplayChangesLog(web_page $oPage, $sClassName, $sKey)
+function DisplayChangesLog(WebPage $oPage, $sClassName, $sKey)
 {
 	global $oContext;
     //$oObj = MetaModel::GetObject($sClassName, $sKey);
@@ -149,7 +149,7 @@ function DisplayChangesLog(web_page $oPage, $sClassName, $sKey)
 	$oPage->p("<a href=\"?operation=delete&class=$sClassName&key=$sKey\">Delete this object (no confirmation!)</a>");
 }
 
-function DumpObjectsAsCSV(web_page $oPage, $sClassName, $oSearchFilter = null,  $sSeparator = ",")
+function DumpObjectsAsCSV(WebPage $oPage, $sClassName, $oSearchFilter = null,  $sSeparator = ",")
 {
 	global $oContext;
 	
@@ -179,7 +179,7 @@ function DumpObjectsAsCSV(web_page $oPage, $sClassName, $oSearchFilter = null,
 	}
 }
 
-function DumpObjects(web_page $oPage, $sClassName, CMDBSearchFilter $oSearchFilter = null)
+function DumpObjects(WebPage $oPage, $sClassName, CMDBSearchFilter $oSearchFilter = null)
 {
 	global $oContext;
 
@@ -209,7 +209,7 @@ function DumpObjects(web_page $oPage, $sClassName, CMDBSearchFilter $oSearchFilt
 	$oPage->table($aAttribs, $aValues);
 }
 
-function DisplayEditForm(web_page $oPage, $sClassName, $sKey)
+function DisplayEditForm(WebPage $oPage, $sClassName, $sKey)
 {
 	global $oContext;
     //$oObj = MetaModel::GetObject($sClassName, $sKey);
@@ -264,7 +264,7 @@ function DisplayEditForm(web_page $oPage, $sClassName, $sKey)
     $oPage->add("<form method=\"post\">\n");
 }
 
-function DisplayCreationForm(web_page $oPage, $sClassName)
+function DisplayCreationForm(WebPage $oPage, $sClassName)
 {
 	global $oContext;
     $oPage->p("New $sClassName\n");
@@ -303,7 +303,7 @@ function DisplayCreationForm(web_page $oPage, $sClassName)
     $oPage->add("<form method=\"post\">\n");
 }
 
-function UpdateObject(web_page $oPage, $sClassName, $sKey, $aAttributes)
+function UpdateObject(WebPage $oPage, $sClassName, $sKey, $aAttributes)
 {
 	global $oContext;
     //$oObj = MetaModel::GetObject($sClassName, $sKey);
@@ -346,7 +346,7 @@ function UpdateObject(web_page $oPage, $sClassName, $sKey, $aAttributes)
 	$oPage->p("<a href=\"\">Return to main page</a>");
 }
 
-function DeleteObject(web_page $oPage, $sClassName, $sKey)
+function DeleteObject(WebPage $oPage, $sClassName, $sKey)
 {
 	global $oContext;
 	$sClassLabel = MetaModel::GetName($sClassName);
@@ -380,7 +380,7 @@ function DeleteObject(web_page $oPage, $sClassName, $sKey)
 	$oPage->p("<a href=\"\">Return to main page</a>");
 }
 
-function CreateObject(web_page $oPage, $sClassName, $aAttributes)
+function CreateObject(WebPage $oPage, $sClassName, $aAttributes)
 {
     $oObj = MetaModel::NewObject($sClassName);
     $sClassLabel = MetaModel::GetName(get_class($oObj));

+ 1 - 1
pages/run_query.php

@@ -5,7 +5,7 @@ require_once('../application/itopwebpage.class.inc.php');
 require_once('../application/startup.inc.php');
 
 require_once('../application/loginwebpage.class.inc.php');
-login_web_page::DoLogin(); // Check user rights and prompt if needed
+LoginWebPage::DoLogin(); // Check user rights and prompt if needed
 
 
 function ShowExamples($oP, $sExpression)

+ 1 - 1
pages/schema.php

@@ -457,7 +457,7 @@ function DisplayRelationDetails($oPage, $sRelCode)
 
 
 require_once('../application/loginwebpage.class.inc.php');
-login_web_page::DoLogin(); // Check user rights and prompt if needed
+LoginWebPage::DoLogin(); // Check user rights and prompt if needed
 
 // Display the menu on the left
 $oContext = new UserContext();

+ 1 - 1
pages/usermanagement_classproj.php

@@ -79,7 +79,7 @@ function ComputeProjections($oPage, $sScope)
 
 
 require_once('../application/loginwebpage.class.inc.php');
-login_web_page::DoLogin(); // Check user rights and prompt if needed
+LoginWebPage::DoLogin(); // Check user rights and prompt if needed
 
 // Display the menu on the left
 $oContext = new UserContext();

+ 1 - 1
pages/usermanagement_profileproj.php

@@ -90,7 +90,7 @@ function ComputeProjections($oPage)
 
 
 require_once('../application/loginwebpage.class.inc.php');
-login_web_page::DoLogin(); // Check user rights and prompt if needed
+LoginWebPage::DoLogin(); // Check user rights and prompt if needed
 
 // Display the menu on the left
 $oContext = new UserContext();

+ 1 - 1
pages/usermanagement_userstatus.php

@@ -242,7 +242,7 @@ function ComputeUserRights($oPage, $oUser, $oObject)
 
 
 require_once('../application/loginwebpage.class.inc.php');
-login_web_page::DoLogin(); // Check user rights and prompt if needed
+LoginWebPage::DoLogin(); // Check user rights and prompt if needed
 
 // Display the menu on the left
 $oContext = new UserContext();

+ 5 - 5
setup/ajax.dataloader.php

@@ -26,7 +26,7 @@ header("Expires: Fri, 17 Jul 1970 05:00:00 GMT");    // Date in the past
 $sFileName = Utils::ReadParam('file', '');
 $sSessionStatus = Utils::ReadParam('session_status', '');
 $iPercent = (integer)Utils::ReadParam('percent', 0);
-setup_web_page::log("Info - Loading file: $sFileName");
+SetupWebPage::log("Info - Loading file: $sFileName");
 
 try
 {
@@ -42,26 +42,26 @@ try
 		$oChange->Set("date", time());
 		$oChange->Set("userinfo", "Initialization");
 		$iChangeId = $oChange->DBInsert();
-		setup_web_page::log("Info - starting data load session");
+		SetupWebPage::log("Info - starting data load session");
 		$oDataLoader->StartSession($oChange);
 	}
 
 	$oDataLoader->LoadFile($sFileName);
 	$sResult = sprintf("Info - loading of %s done. (Overall %d %% completed).", basename($sFileName), $iPercent);
 	echo $sResult;
-	setup_web_page::log($sResult);
+	SetupWebPage::log($sResult);
 
 	if ($sSessionStatus == 'end')
 	{
 	    $oDataLoader->EndSession();
-	    setup_web_page::log("Info - ending data load session");
+	    SetupWebPage::log("Info - ending data load session");
 	}
 }
 catch(Exception $e)
 {
 	echo "<p>An error happened while loading the data</p>\n";
 	echo '<p>'.$e."</p>\n";
-	setup_web_page::log("Error - An error happened while loading the data. ".$e);
+	SetupWebPage::log("Error - An error happened while loading the data. ".$e);
 }
 
 ?>

+ 13 - 13
setup/index.php

@@ -14,14 +14,14 @@ define('PHP_MIN_VERSION', '5.2.0');
 define('MYSQL_MIN_VERSION', '5.0.0');
 
 $sOperation = Utils::ReadParam('operation', 'step1');
-$oP = new setup_web_page('iTop configuration wizard');
+$oP = new SetupWebPage('iTop configuration wizard');
 
 /**
  * Helper function to check if the current version of PHP
  * is compatible with the application
  * @return boolean true if this is Ok, false otherwise
  */
-function CheckPHPVersion(setup_web_page $oP)
+function CheckPHPVersion(SetupWebPage $oP)
 {
 	$bResult = true;
 	$oP->log('Info - CheckPHPVersion');
@@ -131,7 +131,7 @@ function CheckPHPVersion(setup_web_page $oP)
  * the existing databases
  * @return Array The list of databases found in the server
  */
-function CheckServerConnection(setup_web_page $oP, $sDBServer, $sDBUser, $sDBPwd)
+function CheckServerConnection(SetupWebPage $oP, $sDBServer, $sDBUser, $sDBPwd)
 {
 	$aResult = array();
 	$oP->log('Info - CheckServerConnection');
@@ -194,7 +194,7 @@ function CheckServerConnection(setup_web_page $oP, $sDBServer, $sDBUser, $sDBPwd
  * @param $bAllowMissingDatabase boolean Whether or not to allow loading a data model with no corresponding DB 
  * @return none
  */    
-function InitDataModel(setup_web_page $oP, $sConfigFileName, $bAllowMissingDatabase = true)
+function InitDataModel(SetupWebPage $oP, $sConfigFileName, $bAllowMissingDatabase = true)
 {
 	require_once('../core/coreexception.class.inc.php');
 	require_once('../core/attributedef.class.inc.php');
@@ -215,7 +215,7 @@ function InitDataModel(setup_web_page $oP, $sConfigFileName, $bAllowMissingDatab
  * Helper function to create the database structure
  * @return boolean true on success, false otherwise
  */
-function CreateDatabaseStructure(setup_web_page $oP, Config $oConfig, $sDBName, $sDBPrefix)
+function CreateDatabaseStructure(SetupWebPage $oP, Config $oConfig, $sDBName, $sDBPrefix)
 {
 	InitDataModel($oP, TMP_CONFIG_FILE, true); // Allow the DB to NOT exist since we're about to create it !
 	$oP->log('Info - CreateDatabaseStructure');
@@ -240,7 +240,7 @@ function CreateDatabaseStructure(setup_web_page $oP, Config $oConfig, $sDBName,
  * Helper function to create and administrator account for iTop
  * @return boolean true on success, false otherwise 
  */
-function CreateAdminAccount(setup_web_page $oP, Config $oConfig, $sAdminUser, $sAdminPwd)
+function CreateAdminAccount(SetupWebPage $oP, Config $oConfig, $sAdminUser, $sAdminPwd)
 {
 	$oP->log('Info - CreateAdminAccount');
 	InitDataModel($oP, TMP_CONFIG_FILE, true);  // allow missing DB
@@ -258,7 +258,7 @@ function CreateAdminAccount(setup_web_page $oP, Config $oConfig, $sAdminUser, $s
 
 //aFilesToLoad[aFilesToLoad.length] = './menus.xml'; // First load the menus
 
-function ListDataFiles($sDirectory, setup_web_page $oP)
+function ListDataFiles($sDirectory, SetupWebPage $oP)
 {
 	$aFilesToLoad = array();
 	if ($hDir = @opendir($sDirectory))
@@ -288,7 +288,7 @@ function ListDataFiles($sDirectory, setup_web_page $oP)
 /**
  * Scans the ./data directory for XML files and output them as a Javascript array
  */ 
-function PopulateDataFilesList(setup_web_page $oP)
+function PopulateDataFilesList(SetupWebPage $oP)
 {
 
 	$oP->add("<script type=\"text/javascript\">\n");
@@ -322,7 +322,7 @@ function PopulateDataFilesList(setup_web_page $oP)
  * Display the form for the first step of the configuration wizard
  * which consists in the database server selection
  */  
-function DisplayStep1(setup_web_page $oP)
+function DisplayStep1(SetupWebPage $oP)
 {
 	$sNextOperation = 'step2';
 	$oP->add("<h1>iTop configuration wizard</h1>\n");
@@ -353,7 +353,7 @@ function DisplayStep1(setup_web_page $oP)
  * 1) Validating the parameters by connecting to the database server
  * 2) Prompting to select an existing database or to create a new one  
  */  
-function DisplayStep2(setup_web_page $oP, Config $oConfig, $sDBServer, $sDBUser, $sDBPwd)
+function DisplayStep2(SetupWebPage $oP, Config $oConfig, $sDBServer, $sDBUser, $sDBPwd)
 {
 	$sNextOperation = 'step3';
 	$oP->add("<h1>iTop configuration wizard</h1>\n");
@@ -411,7 +411,7 @@ function DisplayStep2(setup_web_page $oP, Config $oConfig, $sDBServer, $sDBUser,
  * 2) Creating the database structure  
  * 3) Prompting for the admin account to be created  
  */  
-function DisplayStep3(setup_web_page $oP, Config $oConfig, $sDBName, $sDBPrefix)
+function DisplayStep3(SetupWebPage $oP, Config $oConfig, $sDBName, $sDBPrefix)
 {
 	$sNextOperation = 'step4';
 	$oP->add("<h1>iTop configuration wizard</h1>\n");
@@ -451,7 +451,7 @@ function DisplayStep3(setup_web_page $oP, Config $oConfig, $sDBName, $sDBPrefix)
  * 1) Creating the admin user account
  * 2) Prompting to load some sample data  
  */  
-function DisplayStep4(setup_web_page $oP, Config $oConfig, $sAdminUser, $sAdminPwd)
+function DisplayStep4(SetupWebPage $oP, Config $oConfig, $sAdminUser, $sAdminPwd)
 {
 	$sNextOperation = 'step5';
 	$oP->add("<h1>iTop configuration wizard</h1>\n");
@@ -492,7 +492,7 @@ function DisplayStep4(setup_web_page $oP, Config $oConfig, $sAdminUser, $sAdminP
  * 1) Creating the final configuration file
  * 2) Prompting the user to make the file read-only  
  */  
-function DisplayStep5(setup_web_page $oP, Config $oConfig, $sAuthUser, $sAuthPwd)
+function DisplayStep5(SetupWebPage $oP, Config $oConfig, $sAuthUser, $sAuthPwd)
 {
 	try
 	{

+ 1 - 1
setup/setuppage.class.inc.php

@@ -5,7 +5,7 @@ define('INSTALL_LOG_FILE', '../setup.log');
 /**
  * Web page used for displaying the login form
  */
-class setup_web_page extends nice_web_page
+class SetupWebPage extends NiceWebPage
 {
     public function __construct($sTitle)
     {

+ 1 - 1
setup/xmldataloader.class.inc.php

@@ -252,7 +252,7 @@ class XMLDataLoader
 						if ($iExtKey == 0)
 						{
 							$sMsg = "unresolved extkey in $sClass::".$oTargetObj->GetKey()."(".$oTargetObj->GetName().")::$sAttCode=$sTargetClass::$iTempKey";
-							setup_web_page::log("Warning - $sMsg");
+							SetupWebPage::log("Warning - $sMsg");
 							echo "Warning: $sMsg<br/>\n";
 							echo "<pre>aKeys[".$sTargetClass."]:\n";
 							print_r($this->m_aKeys[$sTargetClass]);

+ 5 - 5
webservices/export.php

@@ -7,7 +7,7 @@ require_once('../application/xmlpage.class.inc.php');
 require_once('../application/startup.inc.php');
 
 require_once('../application/loginwebpage.class.inc.php');
-login_web_page::DoLogin(); // Check user rights and prompt if needed
+LoginWebPage::DoLogin(); // Check user rights and prompt if needed
 
 $sOperation = utils::ReadParam('operation', 'menu');
 $oContext = new UserContext();
@@ -31,7 +31,7 @@ if (!empty($sExpression))
 			switch($sFormat)
 			{
 				case 'html':
-				$oP = new nice_web_page("iTop - Export");
+				$oP = new NiceWebPage("iTop - Export");
 				// The HTML output is made for pages located in the /pages/ folder
 				// since this page is in a different folder, let's adjust the HTML 'base' attribute
 				// to make the relative hyperlinks in the page work
@@ -61,14 +61,14 @@ if (!empty($sExpression))
 				break;
 				
 				default:
-				$oP = new web_page("iTop - Export");
+				$oP = new WebPage("iTop - Export");
 				$oP->add("Unsupported format '$sFormat'. Possible values are: html, csv or xml.");
 			}
 		}
 	}
 	catch(Exception $e)
 	{
-		$oP = new web_page("iTop - Export");
+		$oP = new WebPage("iTop - Export");
 		$oP->p("Error the query can not be executed.");		
 		$oP->p($e->GetHtmlDesc());		
 	}
@@ -76,7 +76,7 @@ if (!empty($sExpression))
 if (!$oP)
 {
 	// Display a short message about how to use this page
-	$oP = new web_page("iTop - Export");
+	$oP = new WebPage("iTop - Export");
 	$oP->p("<strong>General purpose export page.</strong>");
 	$oP->p("<strong>Parameters:</strong>");
 	$oP->p("<ul><li>expression: an OQL expression (URL encoded if needed)</li>

+ 2 - 2
webservices/import.php

@@ -40,7 +40,7 @@ class WebServiceException extends Exception
 {
 }
 
-login_web_page::DoLogin(); // Check user rights and prompt if needed
+LoginWebPage::DoLogin(); // Check user rights and prompt if needed
 
 $oContext = new UserContext();
 $oAppContext = new ApplicationContext();
@@ -50,7 +50,7 @@ $oAppContext = new ApplicationContext();
 // Main program
 
 //$oP = new XMLPage("iTop - Bulk import");
-$oP = new web_page("iTop - Bulk import");
+$oP = new WebPage("iTop - Bulk import");
 $oP->add('<warning>This is a prototype, I repeat: PRO-TO-TYPE, therefore it suffers bugs and limitations, documented in the code. Next step: specify...</warning>');		
 try
 {