Class siteInformation

Description

The main class of PLICI. siteInformation give alls informations needed on a website.

This class is launched for every PLICI webPage, you can use it for know if you are on an admin page or a front page for exemaple.

  • author: SimpliciWeb
  • version: $Id: site_information.class.php 922 2008-03-22 09:35:03Z stephanet $

Located in /core/internal_components/common/globals/site_information.class.php (line 63)


	
			
Variable Summary
 string $m_bo_entry
 string $m_css_file
 string $m_fo_entry
 string $m_js_file
 string $m_root_http
 unknown_type $m_root_http_fo
 string $m_site_name
 string $m_tmp_root
 string $m_view_root
Method Summary
 void appendBaseHttpForReferencing (string $p_value)
 array getArrayQueryString (string $p_from_string, [array $p_add_array = array()], [array $p_array_del_keys = array()], [bool $p_is_first_params_for_url = true])
 string getBaseFullHttp ()
 string getBaseFullHttpFo ()
 string getBaseHttp ()
 string getBaseHttpFo ()
 void getCurrentFrontLanguageId ( &$id_lang, integer $id_lang)
 bool getCurrentLanguageId ( &$default_lang_id, integer $default_lang_id)
 bool getExistTemplateNotCompiledFilePath (string $p_filename,  &$r_template_not_compiled_path, [bool $p_force_front = false], [string $p_dir = ""], string $r_template_not_compiled_path)
 string getFrontSiteEntry ()
 string getHost ()
 string getHttpCssFile ()
 unknown getHttpCssFileFo ()
 string getHttpJsFile ()
 string getHTTPorHTTPS ([bool $p_force_http = false])
 string getHttpServername ([true $p_force_http = false])
 string getImportPath ()
 unknown getLanguagePart ()
 string getModuleHttpPath ()
 string getModulePath ()
 string getPagePart ()
 string getPictureFilePath ()
 string getPictureFilePathSpecified (string $p_database_selected)
 string getPictureHttpPath ()
 string getQueryString (string $p_from_string, [array $p_add_array = array()], [array $p_array_del_keys = array()], [bool $p_is_first_params_for_url = true])
 string getRoot ()
 string getSessionBoIdName ()
 string getSessionFoIdName ()
 string getSiteDirectoryForTmp ([bool $p_force_front = false])
 string getSiteDirectoryForView ([bool $p_force_front = false])
 string getSiteName ()
 string getTemplateCacheFilePath ([bool $p_force_front = false])
 string getTemplateCacheFilePathSpecific ([string $p_database = ""])
 string getTemplateNotCompiledFilePath ([string $p_dir = ""], [bool $p_force_front = false])
 string getTmpFilePath ([bool $p_force_front = false])
 string getTmpRootPath ()
 string getViewFilePathBO ()
 string getViewFilePathFO ()
 string getViewRootPath ()
 bool isAdmin ()
 bool isAdminSuper ()
 bool isFromRobot ()
 string isJssOrCss ()
 bool isNotLocalhost ()
 string makeUrlForLanguage (integer $lang_id)
 string multiDomaineModify (string $database_site_name)
 void redirectToBoUrl (string $p_url)
 void redirectToExternalUrl (string $p_url)
 void redirectToIndex ()
 void redirectToPageAndDie (integer $p_page_id, [string $p_page_title = ""], [array $p_param = array()], [bool $transfet_query_string = false])
 void redirectToProductAndDie (integer $pro_id, integer $p_id_father_page, [string $pro_title = ""], [bool $p_param = array()])
 void setCurrentFrontLanguageId (integer $id_lang)
 bool setCurrentLanguageId (integer $p_current_language_id)
 void setPageCenterCanBeCached (bool $p_page_center_can_be_cached)
 void setTemplateFilename (string $p_tpl_filename)
 void xFindIfIsAdmin ( &$p_siteinformation_object,  &$p_template_site_name, string $p_fo_name, string $p_bo_name, string $p_admin_corresp_site_template, siteInformation $p_siteinformation_object, string $p_template_site_name)
 void xRedirect (string $p_url, [bool $p_transfert_query_string = true])
 void xSetLanguageIdToUrl (unknown_type $lang_id)
Variables
bool $is_localhost = false (line 366)

Is from locahost

  • var: TRUE = website access by local
string $m_admin_plici_site_dir_name = "admin_plici/" (line 275)

"admin_plici/"

string $m_admin_site_prefix = "admin_" (line 256)

"admin_"

string $m_back_site_dir_name = "admin_sites/" (line 269)

"admin_sites/"

string $m_bd_from_root = "bd/" (line 348)

"bd/"

string $m_bo_entry = "" (line 75)

The Entree Back path : racineweb.$this->m_entrees_from_root.$this->m_back_site_dir_name

string $m_bo_stats_entry = "" (line 81)

The Statistics entree path: $this->m_view_external.$this->m_ext_cmp_stat_dir = view/external_components/stats/

string $m_core_themeelements = "theme_elements/" (line 250)

"theme_elements/"

string $m_css_file = "css_screen.css" (line 318)

"css_screen.css"

string $m_database_site_name = "" (line 105)

Database name for the current web site

string $m_entrees_from_root = "/core/entrees/" (line 195)

"/core/entrees/"

string $m_error_doc_busy_page_from_view = "../error_doc/busy.php" (line 226)

"../error_doc/busy.php"

string $m_ext_cmp_stat_dir = "stats/" (line 219)

"stats/"

string $m_fo_entry = "" (line 69)

The Entree Front path : racineweb.$this->m_entrees_from_root.$this->m_front_site_dir_name

string $m_fo_internal = "" (line 87)

The Front Internal Path : $local_site_racineweb_path.$this->m_internal_from_root.$this->m_front_site_dir_name;

string $m_front_site_dir_name = "front_sites/" (line 263)

"front_sites/"

string $m_import_directory_name = "import/" (line 282)

"import/"

string $m_internal_from_root = "/core/internal_components/" (line 244)

"/core/internal_components/"

bool $m_is_admin = false (line 99)

Current site is BackOffice

  • var: TRUE = BackOffice or Superadmin, FALSE = Front office
bool $m_is_js_or_css = false (line 161)

Is a JSS or CSS page

bool $m_i_have_personal_no_photo = false (line 174)

I have no personal photo

string $m_js_dialog_path = "pCODING/js/dialog/" (line 330)

pCODING/js/dialog/"

string $m_js_file = "js_general.js" (line 324)

"js_general.js"

string $m_local_site_racineweb_path = "" (line 399)

Racine web path (PLICI directory)

string $m_message_file = "messages.txt" (line 187)
  • deprecated: Seems not used
string $m_module_dir_file = "module/" (line 207)

"module/"

string $m_module_dir_http = "plici_mod" (line 213)

"plici_mod"

bool $m_page_center_can_be_cached = true (line 385)

Page center can be cached

string $m_picture_directory_name = "picture/" (line 288)

"picture/"

string $m_picture_http = "" (line 149)

The picture http url : $this->m_root_http_fo.$this->getPictureDirectoryName();

string $m_picture_http_bo = "" (line 155)

The picture http url for BackOffice : $this->m_root_http.$this->getPictureDirectoryName();

string $m_refenrencing_http_path = "" (line 143)

The only part of the url to be referenced ex : my%20product For an url http://www.plici.net/p254_my%20product.html

string $m_root_http = "" (line 123)

The Root Http url with language id : $this->m_root_http_without_lang."l".$lang_id."/";

unknown_type $m_root_http_fo = "" (line 129)

The root http url with language forced to Front URL: $this->m_root_http_fo_without_lang."l".$lang_id."/";

string $m_root_http_fo_without_lang = "" (line 372)

The root http url without language forced to Front URL

string $m_root_http_without_lang = "" (line 378)

The root http url without language

string $m_site_name = "" (line 111)

Sitename (database name for front, admin directory for backoffice or superadmin)

string $m_stats_file_path = "pVISITEURS/stats/" (line 336)

"pVISITEURS/stats/"

string $m_template_filename = "" (line 181)

Template filename to display

string $m_template_site_name = "" (line 117)

Template site name (database name for front, admin directory for backoffice or superadmin)

string $m_theme_from_my_or_plici = "" (line 406)

Theme from my or plici (the name)

  • var: for_plici|my
string $m_theme_screen_shoot_big = "/screen_shoot_big.jpg" (line 360)

"/screen_shoot_big.jpg"

string $m_theme_screen_shoot_little = "/screen_shoot_little.jpg" (line 354)

"screen_shoot_little.jpg"

string $m_tmp_from_root = "/tmp/" (line 238)

"/tmp/"

string $m_tmp_root = "" (line 414)

Temporary file path : $local_site_racineweb_path.$this->m_tmp_from_root;

string $m_tpl_cache_file = "cache/" (line 312)

"cache/"

string $m_tpl_compiled_file = "template_compiled/" (line 300)

"template_compiled/"

string $m_tpl_config_file = "config/" (line 306)

"config/"

string $m_tpl_not_compiled_file = "/" (line 294)

"template_not_compiled/"

string $m_uri_for_ini = "" (line 136)

The short uri (for ini file) : /index.html

  • deprecated: Ini file not used
string $m_view_external = "" (line 167)

Path to the view external : $local_site_racineweb_path."/".$this->m_view_external_from_root;

string $m_view_external_from_root = "view/external_components/" (line 201)

"view/external_components/"

string $m_view_from_root = "/view/sites/" (line 232)

"/view/sites/"

string $m_view_root = "" (line 93)

The View Path : $local_site_racineweb_path.$this->m_view_from_root

array $params_to_not_pass_in_querystring = array("id_menu", "c_l_a", "ht_ray_id",
"page_id", "tpl_name", "father_page_id",'shopcart_pm_id','shopcart_ps_id','shopcart_quantity')
(line 392)

When making a redirect, list of parameters to doesn't pass again

Methods
Constructor siteInformation (line 1623)

Constructor, init the requests and objects

siteInformation siteInformation ()
appendBaseHttpForReferencing (line 1206)

Set m_refenrencing_http_path

void appendBaseHttpForReferencing (string $p_value)
  • string $p_value
generateBusyPage (line 1795)

Display a busy page when the web site is unactivated by SuperAdmin

void generateBusyPage ()
generateFatalError404 (line 1820)

Display the page not found error

void generateFatalError404 ()
getArrayQueryString (line 1366)

Modify the http parameters to add or delete someone

  • return: Parameters modified
array getArrayQueryString (string $p_from_string, [array $p_add_array = array()], [array $p_array_del_keys = array()], [bool $p_is_first_params_for_url = true])
  • string $p_from_string: REQUEST|POST|GET|GETPOST
  • array $p_add_array: Params to add
  • array $p_array_del_keys: Params to delete
  • bool $p_is_first_params_for_url
getBackSiteStatsEntry (line 826)

"view/external_components/stats/"

string getBackSiteStatsEntry ()
getBaseFullHttp (line 1188)

Return full http path : http://www.xx.xxx/l1/ or http://www.xx.xxx/admin_xxx/l1/

string getBaseFullHttp ()
getBaseFullHttpFo (line 1180)

Return full http path force front: http://www.xx.xxx/l1/

string getBaseFullHttpFo ()
getBaseFullHttpFoWithoutLanguage (line 1171)

Return full http path force front: http://www.xx.xxx/

string getBaseFullHttpFoWithoutLanguage ()
getBaseFullHttpStats (line 1233)

Return full http path: http://www.xx.xxx/admin_xxx/l1/pVISITEURS/stats/

string getBaseFullHttpStats ()
getBaseHttp (line 1197)

Base Http path : / for example or /admin_xxx for back

string getBaseHttp ()
getBaseHttpFo (line 1137)

Base Http path : / for example for front

string getBaseHttpFo ()
getBaseHttpReferencing (line 1216)

return the referencing part for url

string getBaseHttpReferencing ()
getCurrentFrontLanguageId (line 607)

Return current language id for front

void getCurrentFrontLanguageId ( &$id_lang, integer $id_lang)
  • integer $id_lang
  • &$id_lang
getCurrentLanguageId (line 553)

Get current language id

  • return: TRUE on error
bool getCurrentLanguageId ( &$default_lang_id, integer $default_lang_id)
  • integer $default_lang_id
  • &$default_lang_id
getDatabaseSiteName (line 708)

Database site name

string getDatabaseSiteName ()
getExistTemplateNotCompiledFilePath (line 958)

Search and test if template exsit

  • return: TRUE = finded ($r_template_not_compiled_path set to path)
bool getExistTemplateNotCompiledFilePath (string $p_filename,  &$r_template_not_compiled_path, [bool $p_force_front = false], [string $p_dir = ""], string $r_template_not_compiled_path)
  • string $p_filename
  • string $r_template_not_compiled_path
  • bool $p_force_front
  • string $p_dir
  • &$r_template_not_compiled_path
getFrontSiteEntry (line 837)

Get path : racineweb/core/entrees/front_sites/

string getFrontSiteEntry ()
getFrontSiteInternal (line 846)

Get path : racineweb/core/internal_components/front_sites/

string getFrontSiteInternal ()
getHost (line 422)

Return the current HTTP host, for example : www.plici.net for a web page from plici.net If the http host is not finded, we will return the server_name.

string getHost ()
getHttpCssFile (line 1251)

Get Http path for css files : /css_screen.css

string getHttpCssFile ()
getHttpCssFileFo (line 1242)

Get http path for css front in front : /css_screen.css

unknown getHttpCssFileFo ()
getHttpJsFile (line 1262)

Get Http path for css files : /js_general.js

string getHttpJsFile ()
getHTTPorHTTPS (line 1147)

Return the http or https url prefix

string getHTTPorHTTPS ([bool $p_force_http = false])
  • bool $p_force_http
getHttpPathJsDialog (line 1273)

return htt path for js dialog : pCODING/js/dialog/

string getHttpPathJsDialog ()
getHttpServername (line 1160)

Get htt servername : http(s)://www.host.xxx/

string getHttpServername ([true $p_force_http = false])
  • true $p_force_http
getHttpStatsStickFo (line 1225)

Return the http stats stick : /pVISITEURS/stats/

string getHttpStatsStickFo ()
getIHavePersonalNoPhoto (line 508)

I have personal no photo

bool getIHavePersonalNoPhoto ()
getImportPath (line 1107)

Import file path : view/sites/my/sitename/admin_xxx/import/

string getImportPath ()
getLanguagePart (line 496)

Get prefix language : /l1/

unknown getLanguagePart ()
getModuleHttpPath (line 1300)

Return the module http path : /plici_mod/

string getModuleHttpPath ()
getModulePath (line 1125)

Get the module file path /view/external_components/module/

string getModulePath ()
getMyOrPliciDirectoryForMyTheme (line 1573)

Find if it is My or For_plici direectory to use from theme.

because a theme can be in for_plici or my (personal theme)

string getMyOrPliciDirectoryForMyTheme ()
getPageCenterCanBeCached (line 638)

Page can be cached

bool getPageCenterCanBeCached ()
getPagePart (line 517)

Get page part : /pxxx

string getPagePart ()
getPictureDirectoryName (line 1098)

Get picture directory name : picture/

string getPictureDirectoryName ()
getPictureFilePath (line 1080)

Get picture file path : racineweb/view/sites/my/sitenamen/picture/

string getPictureFilePath ()
getPictureFilePathSpecified (line 1089)

Get picture file path specified : /view/sites/my/sitename/picture/

string getPictureFilePathSpecified (string $p_database_selected)
  • string $p_database_selected
getPictureHttpPath (line 1282)

Get picture http path : /picture/

string getPictureHttpPath ()
getPictureHttpPathBO (line 1291)

Get picture http path for BO: /admin_xxx/picture/

string getPictureHttpPathBO ()
getQueryString (line 1396)

Get the query string : ?var=value&var2=value2

string getQueryString (string $p_from_string, [array $p_add_array = array()], [array $p_array_del_keys = array()], [bool $p_is_first_params_for_url = true])
  • string $p_from_string: "REQUEST", "POST", "GET", "GETPOST"
  • array $p_add_array
  • array $p_array_del_keys
  • bool $p_is_first_params_for_url: Define if url start with & ou ?
getRoot (line 814)

Get root path for plici

string getRoot ()
getSessionBoIdName (line 1317)

BackOffice session id name : bsid

string getSessionBoIdName ()
getSessionBoIdTestName (line 1325)

BackOffice Test session id name : bsidTest

string getSessionBoIdTestName ()
getSessionFoIdName (line 1308)

FrontOffice session id name : fsid

string getSessionFoIdName ()
getSiteDirectoryForTmp (line 692)

Get site directory for tmp : database_site_name ou template_site_name

string getSiteDirectoryForTmp ([bool $p_force_front = false])
  • bool $p_force_front
getSiteDirectoryForView (line 676)

Get site directory for view

string getSiteDirectoryForView ([bool $p_force_front = false])
  • bool $p_force_front
getSiteName (line 666)

Site Name

string getSiteName ()
getTemplateCacheFilePath (line 898)

Get template cache file path for smarty

string getTemplateCacheFilePath ([bool $p_force_front = false])
  • bool $p_force_front
getTemplateCacheFilePathSpecific (line 908)

Get template cache file path for smarty for a specified website

string getTemplateCacheFilePathSpecific ([string $p_database = ""])
  • string $p_database
getTemplateCompiledFilePath (line 879)

Get template compiled file path for smarty

string getTemplateCompiledFilePath ()
getTemplateConfigFilePath (line 888)

Get template config file path for smarty

string getTemplateConfigFilePath ()
getTemplateFilename (line 1891)

Return template's filename to display

string getTemplateFilename ()
getTemplateNotCompiledFilePath (line 921)

Get template not compiled file path for smarty

string getTemplateNotCompiledFilePath ([string $p_dir = ""], [bool $p_force_front = false])
  • string $p_dir
  • bool $p_force_front
getTmpFilePath (line 870)

Get temporary file path for smarty

string getTmpFilePath ([bool $p_force_front = false])
  • bool $p_force_front
getTmpRootPath (line 859)

Get temporary root path : racineweb/tmp/

string getTmpRootPath ()
getUriForIniSection (line 657)

Get uri for ini section

  • deprecated: INI file not used
string getUriForIniSection ()
getUrlWithQueryString (line 647)

Get current url with query string

string getUrlWithQueryString ()
getViewExternalFromRoot (line 1040)

Get View external from root : view/external_components/

string getViewExternalFromRoot ()
getViewExternalPath (line 1116)

Get view external path : racineweb/view/external_components/

string getViewExternalPath ()
getViewFilePathBO (line 1071)

Get view file path from BackOffice

string getViewFilePathBO ()
getViewFilePathFO (line 1062)

Get view file path front office : racineweb/view/sites/sitename/

string getViewFilePathFO ()
getViewRootPath (line 1053)

Get view root : racineweb/view/sites/

string getViewRootPath ()
isAdmin (line 1334)

Is page for admin site (becareful super admin is an admin site)

bool isAdmin ()
isAdminSuper (line 1343)

Is page for super_admin

bool isAdminSuper ()
isFromRobot (line 437)

Test if it is from robot

bool isFromRobot ()
isJssOrCss (line 1353)

Is a page for a css or js file

string isJssOrCss ()
isNotLocalhost (line 1563)

IS not from localhost

bool isNotLocalhost ()
makeUrlForLanguage (line 472)

Make url for language : /l1/

string makeUrlForLanguage (integer $lang_id)
  • integer $lang_id
multiDomaineModify (line 1840)

CHeck for a site_name wich database it must used (manage the PLICI host)

string multiDomaineModify (string $database_site_name)
  • string $database_site_name
redirectToBoIndex (line 1476)

Redirect to BackOffice index

void redirectToBoIndex ()
redirectToBoUrl (line 1467)

Redirect to Backoffice url

void redirectToBoUrl (string $p_url)
  • string $p_url
redirectToExternalUrl (line 1434)

Redirect to external uri

void redirectToExternalUrl (string $p_url)
  • string $p_url: must be a full url "http://www.xxx.xxx"
redirectToIndex (line 1490)

redirect to Front Office Index

void redirectToIndex ()
redirectToPageAndDie (line 1519)

Redirect to a page and die

void redirectToPageAndDie (integer $p_page_id, [string $p_page_title = ""], [array $p_param = array()], [bool $transfet_query_string = false])
  • integer $p_page_id
  • string $p_page_title
  • array $p_param
  • bool $transfet_query_string
redirectToPhpSelfAndDie (line 1506)

Redirect to php self

Used when adding a product to avoid the link will be memorized by a navigator back

void redirectToPhpSelfAndDie ()
redirectToProductAndDie (line 1542)

Redirect to a product and die

void redirectToProductAndDie (integer $pro_id, integer $p_id_father_page, [string $pro_title = ""], [bool $p_param = array()])
  • integer $pro_id
  • integer $p_id_father_page
  • string $pro_title
  • bool $p_param
setCurrentFrontLanguageId (line 598)

Set current language id

void setCurrentFrontLanguageId (integer $id_lang)
  • integer $id_lang
setCurrentLanguageId (line 529)

Set current language id

  • return: TRUE on error
bool setCurrentLanguageId (integer $p_current_language_id)
  • integer $p_current_language_id
setPageCenterCanBeCached (line 629)

Set page can be cached

void setPageCenterCanBeCached (bool $p_page_center_can_be_cached)
  • bool $p_page_center_can_be_cached
setTemplateFilename (line 1879)

Set template's filename var

void setTemplateFilename (string $p_tpl_filename)
  • string $p_tpl_filename
xFindIfIsAdmin (line 1597)

Find if it is admin

  • access: private
void xFindIfIsAdmin ( &$p_siteinformation_object,  &$p_template_site_name, string $p_fo_name, string $p_bo_name, string $p_admin_corresp_site_template, siteInformation $p_siteinformation_object, string $p_template_site_name)
  • siteInformation $p_siteinformation_object
  • string $p_template_site_name
  • string $p_fo_name
  • string $p_bo_name
  • string $p_admin_corresp_site_template
  • &$p_siteinformation_object
  • &$p_template_site_name
xRedirect (line 1446)

Redirect

  • access: private
void xRedirect (string $p_url, [bool $p_transfert_query_string = true])
  • string $p_url
  • bool $p_transfert_query_string
xSetLanguageIdToUrl (line 541)

set language id to urls

  • access: private
void xSetLanguageIdToUrl (unknown_type $lang_id)
  • unknown_type $lang_id

Documentation generated on Tue, 25 Mar 2008 15:35:48 +0100 by phpDocumentor 1.3.2