CoolFace
Apppublic

kenken999/php

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
runnerpage.php8930 linesDownload Raw Back to classes
1<?php2include_once(getabspath("classes/files.php"));3 4/**5 * Abstract base class for all pages. Contains main functionality6 */7class RunnerPage8{9	/**10     * Id on page.11     * @var integer12     * @intellisense13     */14	public $id = 1;15 16 17	/**18     * Page Designer-assigned page id19     */20	public $pageName = "";21 22	/**23	 * If use Ajax Suggest js file or not24	 * @var bool25	 * @intellisense26	 */27	protected $isUseAjaxSuggest = true;28 29	/**30     * Type of page31     * @var string32     * @intellisense33     */34	public $pageType = "";35 36	/**37     * Mode of page38     * @var integer39     * @intellisense40     */41	public $mode = 0;42 43	/**44 	 * If use display loading or not45	 * @var bool46	 * @intellisense47	 */48	public $isDisplayLoading = false;49 50	/**51     * Original table name52     * @var string53     * @intellisense54     */55	public $strOriginalTableName = ""; //fix it56 57	/**58	 * String caption of table59	 * @var string60	 * @intellisense61	 */62	protected $strCaption = "";63 64	/**65     * Short table name66     * @var string67     * @intellisense68     */69	public $shortTableName = '';70 71	/**72     * Prefix for session variable73     * @var integer74     * @intellisense75     */76	public $sessionPrefix = "";77 78	/**79     * Name of current table80     * @var string81     * @intellisense82     */83	public $tName = "";84 85 86	/**87     * String of OrderBy for query88     * @var string89     * @intellisense90     */91	public $gstrOrderBy = "";92 93	/**94     * Instance of class Xtempl95     * @var object96     * @objtype{XTempl}97     * @intellisense98     */99	public $xt = null;100 101	/**102	 * Instance of SearchClause class103	 * @var object104	 * @objtype{SearchClause}105	 * @intellisense106	 */107	public $searchClauseObj = null;108 109	/**110     * Need use search clause object or not111     * @var boolean112     * @intellisense113     */114	public $needSearchClauseObj = true;115 116	public $flyId = 1;117 118	/**119	 *	The list of including js files120	 * @intellisense121	 */122	public $includes_js = array();123 124	/**125	 *	The list of including js files126	 * @intellisense127	 */128	public $includes_jsreq = array();129 130	/**131	 *	The list of including css files132	 * @intellisense133	 */134	public $includes_css = array();135 136	/**137	 * Id of record138	 * @var integer139	 * @intellisense140	 */141	public $recId = 0;142 143	/**144	 * Google maps default settings145	 * @var array146	 * @intellisense147	 */148	public $googleMapCfg = array();149 150	/**151	 * Recaptcha default settings152	 * @var array153	 * @intellisense154	 */155	public $reCaptchaCfg = array();156 157	/**158	 * Captcha Value159	 * @var string160	 * @intellisense161	 */162	public $captchaValue = '';163 164	public $captchaName = 'captcha';165 166	/**167	 * Is captcha ok after submit or not168	 * @var boolean169	 * @intellisense170	 */171	public $isCaptchaOk = true;172 173	/**174	 * How many CAPTCHAs to skip after a successful175	 * @var integer176	 * @intellisense177	 */178	public $captchaPassesCount = 5;179 180	/**181	 * Array of permissions for pages182	 * @var array183	 * @intellisense184	 */185	public $permis = array();186 187	/**188	 * If use group scurity or not189	 * @var bool190	 * @intellisense191	 */192	public $isGroupSecurity = true;193 194	/**195	 * Use or not debug mode for js196	 * @var bool197	 * @intellisense198	 */199	protected $debugJSMode = false;200 201	/**202	 * Array of record ??? for lookup with search203	 * @var array204	 */205	protected $recIds = array();206 207	/**208	 * Use mode ajax for simple listPage209	 * @var boolean210	 * @intellisense211	 */212	public $listAjax = false;213 214	/**215	 * Array of body begin, end code and body attributs216	 * @var array217	 * @intellisense218	 */219	public $body = array('begin' => '', 'end'=> '');220 221	/**222	 * Master table name223	 * @var string224	 * @intellisense225	 */226	public $masterTable = "";227 228	/**229	 * Master page name230	 * @var string231	 * @intellisense232	 */233	public $masterPage = "";234 235	/**236	 * Master table record data237	 * @var object238	 * @intellisense239	 */240	public $masterRecordData = array();241 242	/**243	 * Array of all details tables data244	 * @var array245	 * @intellisense246	 */247	public $allDetailsTablesArr = array();248 249	/**250	 * Array of java script settings for page251	 * @var array252	 * @intellisense253	 */254	public $jsSettings = array();255 256	/**257	 * Array of controls HTML map258	 * @var array259	 * @intellisense260	 */261	public $controlsHTMLMap = array();262 263	/**264	 * Array of view controls HTML map265	 * @var array266	 * @intellisense267	 */268	public $viewControlsHTMLMap = array();269 270	/**271	 * Array of controls map272	 * @var array273	 * @intellisense274	 */275	public $controlsMap = array();276 277	/**278	 * Page data to pass to JS code. Link to an element in the  global $pagesData array279	 * @var array280	 * @intellisense281	 */282	public $pageData = array();283 284	/**285	 * Array of view controls map286	 * @var array287	 * @intellisense288	 */289	public $viewControlsMap = array();290 291	/**292	 * Array of field settings for use it in javascript settings293	 * @var array294	 * @intellisense295	 */296	public $settingsMap = array();297 298	/**299	 * Array of records per page for list and report without group fields300	 * @var array301	 * @intellisense302	 */303	public $arrRecsPerPage = array();304 305	/**306	 * Number of page size307	 * @var integer308	 * @intellisense309	 */310	public $pageSize = 0;311 312	/**313	 * The page's table type: list, report or chart314	 * @var string315	 * @intellisense316	 */317	protected $tableType = "";318 319	/**320	 * Events object for the current table321	 * @var object322	 * @intellisense323	 */324	public $eventsObject;325 326	/**327	 * Master table requested keys328	 * @var array329	 */330	public $masterKeysReq = array();331 332	/**333	 * Detail keys by master table334	 * @var array335	 * @intellisense336	 */337	public $detailKeysByM = array();338 339	/**340	 * Locking object341	 * @var object342	 * @intellisense343	 */344	public $lockingObj = null;345 346	/**347	 * Is use Video player or not348	 * @var boolean349	 * @intellisense350	 */351	protected $isUseVideo = false;352 353	/**354	 * Is columns will be resizable or not355	 * @var boolean356	 * @intellisense357	 */358	protected $isResizeColumns = false;359 360	/**361	 * Is use CKeditor or not362	 * @var boolean363	 * @intellisense364	 */365	protected $isUseCK = false;366 367	/**368	 * Is display detail data on page or not369	 * @var boolean370	 * @intellisense371	 */372 373	//	delete this variable374	 public $isShowDetailTables = true;375 376	/**377	 * arrays of files to process after adding or editing a record378	 * @intellisense379	 */380    public $filesToSave = array(); //FileFieldSingle381	public $filesToMove = array();382	public $filesToDelete = array();383 384	/**385	 * Master keys by detail table386	 * @var array387	 * @intellisense388	 */389	protected $masterKeysByD = array();390 391	/**392	 * If nedd add web report or not393	 * @var bool394	 * @intellisense395	 */396	protected $isAddWebRep = true;397 398	/**399	 * Indicator, is used section 508400	 * @var bool401	 * @intellisense402	 */403	protected $is508 = false;404 405	/**406	 * Instance of Cypher class for encoding/decoding fields values407	 * @var object408	 * @intellisense409	 */410	public $cipherer = null;411 412	/**413	 * Project settings414	 * @type ProjectSettings415	 * @intellisense416	 */417	public $pSet = null;418 419	/**420	 * Project settings for the users table. This var is used in global pages421	 * @type ProjectSettings422	 * @intellisense423	 */424	public $pSetUsers = null;425 426	/**427	 * Project settings for edit controls428	 * @type ProjectSettings429	 * @intellisense430	 */431	public $pSetEdit = null;432 433	/**434	 * Number of rows435	 * @var integer436	 * @intellisense437	 */438	public $numRowsFromSQL = 0;439 440	/**441	 * Index of my page442	 * @var integer443	 * @intellisense444	 */445	protected $myPage = 0;446 447	protected $mapProvider = 0;448 449	protected $recordsOnPage = 0;450 451	/**452	 * Number of records per row list453	 * @var integer454	 * @intellisense455	 */456	public $recsPerRowList = 0;457 458	/**459	 * Number of records per row print460	 * @var integer461	 * @intellisense462	 */463	public $recsPerRowPrint = 0;464 465	/**466	 * grid layout - gltHORIZONTAL, gltVERTICAL or gltCOLUMNS467	 * @type bool468	 */469	public $listGridLayout = false;470 471	/**472	 * grid layout - gltHORIZONTAL, gltVERTICAL or gltCOLUMNS473	 * @type bool474	 */475	public $printGridLayout = false;476 477	/**478	 *479	 * @type array480	 */481	public $gridTabs = array();482 483	/**484	 * An array that keys are different field's css rules485	 * @type array486	 */487	protected $fieldCssRules = array();488 489	/**490	 * Cells' custom css rules491	 * @type string492	 */493	protected $cell_css_rules = "";494 495	/**496	 * Rows' custom css rules497	 * @type string498	 */499	protected $row_css_rules = "";500 501	/**502	 * css rules to hide fields on mobile devices columns503	 * It could be also applied to the desktop version504	 * @type string505	 */506	protected $mobile_css_rules = "";507 508	/**509	 * Array of field names that used for totals510	 * @type array511	 * array['totalsFields']= array('fName'=>"@f.strName s", 'totalsType'=>'@f.strTotalsType', 'viewFormat'=>"@f.strViewFormat");512	 */513	public $totalsFields = array();514 515 516	/**517	 * Number of founed rows518	 * @var bool519	 * @intellisense520	 */521	public $rowsFound = false;522 523	/**524	 * Constructor, set initial params525	 * @param array $params526	 * @intellisense527	 */528	protected $deleteMessage = '';529 530	/**531	 * Number of maximum pages532	 * @var integer533	 * @intellisense534	 */535	protected $maxPages = 1;536 537	/**538	 * Name of the templete file539	 * @var string540	 * @intellisense541	 */542	public $templatefile = "";543 544	/**545	 * Array of menu nodes546	 * @var array547	 * @intellisense548	 */549	public $menuNodes = array();550 551	/**552	 * Refferense to sqlquery object553	 * @var object554	 * @intellisense555	 */556	protected $gQuery = null;557 558	/**559	 * Flag. True if fillSetCntrlMaps already called560	 * @intellisense561	 */562	protected $isControlsMapFilled = false;563 564	/**565	 * Instance of EditControlsContainer566	 * @var {object}567	 * @intellisense568	 */569	protected $controls = null;570 571	/**572	 * Instance of ViewControlsContainer573	 * @var {object}574	 * @intellisense575	 */576	public $viewControls = null;577 578	/**579	 * Associative array of readonly fields for add, edit and register page580	 * @var array581	 * @intellisense582	 */583	public $readOnlyFields = array();584 585	/**586	 * An array of edit page's fields587	 */588	public $editFields = array();589 590	/**591	 * It indicates if the searchpanel brick id added to the page's layout592	 */593	protected $searchPanelActivated = false;594 595	/**596	 * the instance of the "projectSettings" object597	 * It differs from the pSet (and is set as a pSet for the Search panel's searh table)598	 * in case the Search panel is activated on the non table page599	 * @type ProjectSettings600	 */601	public $pSetSearch = null;602 603	/**604	 * The real Search panel's searh table name.605	 * It differs from the tName in case the Search panel is activated on the non table page606	 */607	public $searchTableName = "";608 609	/**610	 * Page layout object611	 */612	protected $pageLayout = null;613 614	protected $warnLeavingPages = null;615 616	/**617	 * Indicator showing if It's neccessary to add the search panel fields's settings618	 * It's set equal to true when the Search panel is added on the non table page619	 */620	public $tableBasedSearchPanelAdded = false;621 622	public $mainTable = ""; //fix it623	public $mainField = ""; //fix it624 625	/**626	 * Cached results of getWhereComponents function627	 */628	protected $_cachedWhereComponents = null;629 630	/**631	 * the local time format regexp632	 * @type String633	 */634	protected $timeRegexp;635 636	protected $dispNoneStyle = 'style="display: none;"';637 638	/**639	 * Detail keys by detail table640	 */641	protected $detailKeysByD = array();642 643	/**644	 * The page's searchParamsLogger class instance645	 * @type Object646	 */647	public $searchLogger = null;648 649	/**650	 * @type Boolean651	 */652	public $searchSavingEnabled = false;653 654	/**655	 * @type Boolean656	 */657	public $pageHasSavedSearches = false;658 659 660	/**661	 * The 'form' logic elements662	 * @type Array663	 */664	protected $formBricks = array();665 666	protected $headerForms = array();667	protected $footerForms = array();668	protected $bodyForms = array();669 670	/**671	 * The instance of class representing a db connection672	 * @type Connection673	 */674	public $connection = null;675 676	/**677	 * Dashboard name678	 * @type string679	 */680	public $dashTName = '';681 682	/**683	 * Dashboard page id684	 * @type string685	 */686	public $dashPage = '';687 688	/**689	 * Element from dashboard690	 * @type string691	 */692	public $dashElementName = '';693 694	/**695	 * @type ProjectSettings696	 */697	protected $dashSet;698 699	/**700	 * @type Array701	 */702	protected $dashElementData = array();703 704	/**705	 *	PDF rendering mode.706	 *  empty - regular page display707	 * 	"build" - build page and return PDF708	 * 	"prepare" - build page and return HTML for browser post-processing709	 *	"convert" - convert post-processed HTML to PDF710	 */711	public $pdfMode = "";712 713	/**714	 * In a multistepped layout the step number715	 * @type Integer716	 */717	public $initialStep = 0;718 719	/**720	 *	This property is used by ReportPrint page only to indicate that export to Word/Excel is in progress.721	 *	@type String722	 */723	public $format = "";724 725	public $message = "";726 727 728	/**729	 * @type Boolean730	 */731	public $mapRefresh = false;732 733	/**734	 * @type Array735	 */736	public $vpCoordinates = array();737 738	public $querySQL = "";739 740	/**741	 * When the page is Details Preview, masterPageType has master table page type742	 * @type String743	 */744	public $masterPageType = "";745 746 747	public $masterPSet;748 749 750	/**751	 * View page data752	 * @type array753	 */754	protected $data = null;755 756	/**757	 * errorFields758	 */759	public $errorFields = array();760 761	protected $detailsTableObjects = array();762 763	/**764	 * If use body scroll for grid765	 * @type bool766	 */767	public $isScrollGridBody = false;768 769	/**770	 * Suppress Post/Redirect/Get pattern after submitting the form on Add/Edit/Register/Delete pages771	 * With $this->stopPRG=false the page will not be redirected.772	 */773	public $stopPRG = false;774 775	/**776	 * Override default page title777	 * @type String778	 */779	public $pageTitle = null;780 781	/**782	 * Indicates if the page should save its context in the global stack.783	 * If true, destructor must pop context from global stack784	 * @type Boolean785	 */786	public $pushContext = true;787 788	/**789	 * Standalone context for using in page events790	 * This should be used with pushContext=false only791	 * @type Object792	 */793	public $standaloneContext = null;794 795	/**796	 * Key field values of current or newly added record on Add/Edit/View pages797	 */798	public $keys = array();799 800	/**801	 * Array of selected record ids used on Print, Export and Edit Selected pages802	 * @type Array803	 */804	public $selection = array();805 806	/**807	 *	This is a hack, sorry.808	 *	Temporary substitute the WHERE tab name to calculate number of records in a tab809	 *	Used in getCurrentTabWhere function810	 *811	 *	@type String - substitute the tab id. Set to NULL to use current tab812	 */813	public $tabChangeling = null;814 815	/**816	 *	One more hack817	 *	Temporary skip coordinates WHERE clause to calculate number of records in a tab818	 *	Used in getWhereByMap function819	 *820	 *	@type Boolean821	 */822	public $skipMapFilter = false;823 824	public $changeDetailsTabTitles = true;825 826	/**827	 * See auxTable comments in ProjectSettings828	 */829	public $pageTable = "";830 831	/**832	 * Embedded details preview variables833	 */834	var $renderedBody = "";835	var $renderedButtons = "";836 837	var $pdfBackgroundImage = "";838 839	public $addRawFieldValues = false;840 841	/**842	 * DataSource843	 */844	protected $dataSource = null;845 846	protected $queryCommand = null;847 848	public $listPagePSet = null;849 850 851	/**852	 * @constructor853	 * @param &Array params854	 */855	function __construct(&$params)856	{857		global $locale_info, $cCharset, $page_layouts, $projectBuildKey, $wizardBuildKey;858 859		// copy properties to object860		RunnerApply($this, $params);861 862		if( $this->pushContext )863			RunnerContext::pushPageContext( $this );864		else865			$this->standaloneContext = new RunnerContextItem( CONTEXT_PAGE, array( "pageObj" => $this ));866 867		// Sanitize input. It must be checked before that, but just in case add it here.868		$this->id = (int)$this->id;869 870		if( !$this->id )871			$this->id = 1;872 873		//	see how this converts to ASP & ASP.NET874		global $pagesData;875		$pagesData[$this->id] = &$this->pageData;876		$this->pageData["proxy"] = array();877 878		$this->xt->pageId = $this->id;879		$this->xt->setPage( $this );880		$this->xt->assign( "pageid", $this->id );881		$this->xt->assign( "id", $this->id );882		$this->setTableConnection();883 884		if( $this->pageTable == "" ) {885			$this->pageTable = $this->tName;886		}887		$this->createProjectSettings();888		$this->setDataSource();889 890		$this->checkOauthLogin();891 892		$this->pageName = $this->pSet->pageName();893		$this->pageData["pageName"] = $this->pageName;894		$this->pageData["helperFormItems"] = $this->pSet->helperFormItems();895		$this->pageData["helperItemsByType"] = $this->pSet->helperItemsByType();896		$this->pageData["helperFieldItems"] = $this->pSet->allFieldItems();897		$this->pageData["buttons"] = $this->pSet->buttons();898		$this->pageData["fieldItems"] = $this->pSet->allFieldItems();899 900		foreach( $this->pSet->buttons() as $b ) {901			$this->AddJSFile( "include/button_".$b.".js" );902		}903		$this->pageData["renderedMediaType"] = getMediaType();904 905		$this->pSetEdit = $this->pSet;906		$this->pSetSearch = new ProjectSettings($this->tName, PAGE_SEARCH, $this->pageName, $this->pageTable );907		$this->searchTableName = $this->tName;908 909		if( $this->dashTName )910		{911			$this->dashSet = new ProjectSettings( $this->dashTName, "dashboard", $this->dashPage );912			if( $this->isDashboardElement() )913				$this->dashElementData = $this->dashSet->getDashboardElementData( $this->dashElementName );914		}915 916		$this->assignCipherer();917		$this->prepareCharts();918 919		include_once getabspath("classes/controls/EditControlsContainer.php");920		$this->controls = new EditControlsContainer($this, $this->pSetEdit, $this->pageType);921		include_once getabspath("classes/controls/ViewControlsContainer.php");922		$this->viewControls = new ViewControlsContainer($this->pSet, $this->pageType, $this);923 924		$this->gQuery = $this->pSet->getSQLQuery();925 926		//set google map configuration927		$this->googleMapCfg = array(928			'id' => $this->id,929			'isUseMainMaps'=>false,930			'isUseFieldsMaps'=> false,931			'isUseGoogleMap'=>false,932			'APIcode'=>GetGlobalData("apiGoogleMapsCode",""),933			'mainMapIds'=>array(),934			'fieldMapsIds'=>array(),935			'mapsData'=>array(),936			'useEmbedMapsAPI' => GetGlobalData("useEmbedMapsAPI", false) && getMapProvider() == GOOGLE_MAPS937		);938 939		//set recaptcha configuration940		$captchaSettings = GetGlobalData("CaptchaSettings", "");941		$this->captchaPassesCount = $captchaSettings["captchaPassesCount"];942		if ( $captchaSettings["type"] == RE_CAPTCHA ) {943			$this->reCaptchaCfg = array('siteKey' => $captchaSettings["siteKey"],  'inputCaptchaId' => "");944		}945 946		$this->debugJSMode = false;947 948		if($this->flyId < $this->id+1)949			$this->flyId = $this->id+1;950 951		// get permissions952		if ($this->tName)953		{954			$this->permis[$this->tName]= $this->getPermissions();955			$this->eventsObject = getEventObject($this->tName);956		}957 958		if( !$this->sessionPrefix )959			$this->assignSessionPrefix();960 961		$this->isDisplayLoading = $this->pSet->displayLoading();962 963		$this->shortTableName = GetTableURL($this->tName);964		// set layout965 966 967		$this->pageLayout = GetPageLayout($this->pageTable, $this->pageName );968 969 970		//init settingMap globalSettings971		$this->settingsMap["globalSettings"] = array();972		$this->settingsMap["globalSettings"]["shortTNames"] = array();973 974		$this->searchPanelActivated = $this->checkIfSearchPanelActivated();975		//global settings including "shortTNames" might be updated976		$this->setParamsForSearchPanel();977 978		$this->searchSavingEnabled = $this->isSearchSavingEnabled() && $this->needSearchClauseObj;979 980		if( $this->masterTable && !$this->getMasterTableInfo() ) {981			// drop a wrong master table name param982			$this->masterTable = "";983		}984 985		if ( $this->mode != LIST_MASTER && $this->mode != PRINT_MASTER )986			$this->setSessionVariables();987 988		//	get locking object989		$this->lockingObj = $this->getLockingObject();990		$this->warnLeavingPages = $this->pSet->warnLeavingPages();991		$this->is508 = isEnableSection508() && !$this->pdfJsonMode();992		$this->mapProvider = getMapProvider();993		$this->isUseVideo = $this->pSet->isUseVideo();994		$this->strCaption = GetTableCaption(GoodFieldName($this->tName));995 996		$this->tableType = $this->pSet->getTableType();997		$this->isAddWebRep = GetGlobalData("isAddWebRep",false);998		//	get details keys by master table999		$this->detailKeysByM = $this->getDetailKeysByMasterTable();1000 1001 1002		$this->isResizeColumns = $this->pSet->isResizeColumns();1003		$this->isUseAjaxSuggest = $this->pSetSearch->isUseAjaxSuggest();1004		//	get all details table for current table1005		if ( $this->mode != LIST_MASTER )1006			$this->allDetailsTablesArr = $this->pSet->getDetailTablesArr();1007 1008 1009		//	set template file1010		$this->setTemplateFile();1011 1012 1013		if($this->pageLayout)1014		{1015			$this->jsSettings['tableSettings'][$this->tName]['pageSkinStyle'] = array();1016			$this->jsSettings['tableSettings'][$this->tName]['pageSkinStyle'][ $this->pageType ] = $this->pageLayout->style." page-".$this->pageLayout->name;1017			$this->AddCSSFile( $this->pageLayout->getCSSFiles(isRTL(), isPageLayoutMobile( $this->templatefile ), $this->pdfMode != "" ) );1018 1019			//	show all forms by default1020			$helper =& $this->pSet->helperFormItems();1021			$formItems =& $helper["formItems"];1022			foreach( array_keys($formItems) as $l ) {1023				$this->xt->assign( $l . "_block", true );1024				$this->xt->assign( $l . "_outerblock", true );1025			}1026 1027		}1028 1029		if( $this->mobileTemplateMode() )1030		{1031			$this->recsPerRowList = 1;1032			$this->isScrollGridBody = false;1033			$this->listAjax = false;1034			$this->isUseAjaxSuggest = false;1035		}1036 1037 1038		//	init jsSettings1039		$this->jsSettings = array();1040		$this->jsSettings["tableSettings"] = array();1041		$this->jsSettings["tableSettings"][$this->tName] = array();1042		$this->jsSettings["tableSettings"][$this->tName]["proxy"] = array("proxy" => "");1043		$this->jsSettings["tableSettings"][$this->tName]['fieldSettings'] = array();1044 1045 1046		$this->settingsMap["globalSettings"]["webRootPath"] = projectPath();1047 1048		//	projectRoot is used for cookies and local storage1049		$this->settingsMap["globalSettings"]["projectRoot"] = projectPath();1050 1051		$this->settingsMap["globalSettings"]["ext"] = "php";1052		$this->settingsMap["globalSettings"]["charSet"] = $cCharset;1053		$this->settingsMap["globalSettings"]["curretLang"] = mlang_getcurrentlang(); // need for Runner.getGoogleLanguage() see Issue #109901054		$this->settingsMap["globalSettings"]["debugMode"] = $this->debugJSMode;1055		$this->settingsMap["globalSettings"]["googleMapsApiCode"] = GetGlobalData("apiGoogleMapsCode","");1056		$this->settingsMap["globalSettings"]["shortTNames"][$this->tName] = $this->shortTableName;1057		$this->settingsMap["globalSettings"]["useCookieBanner"] = $this->isPD() && GetGlobalData("useCookieBanner", false );1058		$this->settingsMap["globalSettings"]["cookieBanner"] = Labels::getCookieBanner();1059 1060		$this->settingsMap["globalSettings"]["projectBuildKey"] = $projectBuildKey;1061		$this->settingsMap["globalSettings"]["wizardBuildKey"] = $wizardBuildKey;1062 1063		//Active Directory1064		$this->settingsMap["globalSettings"]["isAD"] = Security::currentProviderType() == stAD;1065 1066		$this->settingsMap["globalSettings"]["isMobile"] = $this->mobileTemplateMode();1067		$this->settingsMap["globalSettings"]["mobileDeteced"] = detectMobileDevice();1068 1069		// s508 must be in global settings1070		$this->settingsMap['globalSettings']['s508'] = $this->is508;1071		$this->settingsMap['globalSettings']['mapProvider'] = $this->mapProvider;1072		$this->settingsMap['globalSettings']['staticMapsOnly'] = $this->pageType == PAGE_PRINT;1073		$this->settingsMap["globalSettings"]["locale"] = array();1074		$this->settingsMap["globalSettings"]["locale"]["dateFormat"] = $locale_info["LOCALE_IDATE"];1075		$this->settingsMap["globalSettings"]["locale"]["langName"] = $locale_info["LOCALE_LANGNAME"];1076		$this->settingsMap["globalSettings"]["locale"]["ctryName"] = $locale_info["LOCALE_CTRYNAME"];1077		$this->settingsMap["globalSettings"]["locale"]["startWeekDay"] = $locale_info["LOCALE_IFIRSTDAYOFWEEK"];1078		$this->settingsMap["globalSettings"]["locale"]["dateDelimiter"] = $locale_info["LOCALE_SDATE"];1079 1080		$this->settingsMap["globalSettings"]["locale"]["is24hoursFormat"] = $locale_info["LOCALE_ITIME"];1081		$this->settingsMap["globalSettings"]["locale"]["leadingZero"] = $locale_info["LOCALE_ITLZERO"];1082		$this->settingsMap["globalSettings"]["locale"]["timeDelimiter"] = $locale_info["LOCALE_STIME"];1083		$this->settingsMap["globalSettings"]["locale"]["timePmLetter"] = $locale_info["LOCALE_S2359"];1084		$this->settingsMap["globalSettings"]["locale"]["timeAmLetter"] = $locale_info["LOCALE_S1159"];1085 1086		$this->settingsMap["globalSettings"]["showDetailedError"] = GetGlobalData("showDetailedError", true);1087		$this->settingsMap["globalSettings"]["customErrorMessage"] = GetGlobalData("customErrorMessage", "");1088 1089		global $resizeImagesOnClient;1090		$this->settingsMap["globalSettings"]["resizeImagesOnClient"] = $resizeImagesOnClient;1091 1092 1093		if( Security::hasLogin() && ( isLogged() && !Security::isGuest() || $this->pageType == PAGE_REGISTER ) ) {1094			$this->settingsMap["globalSettings"]["sessionControl"] = $this->getSessionContolSettings();1095		}1096 1097 1098		$this->settingsMap["tableSettings"] = array();1099		$this->settingsMap['tableSettings']['entityType'] = array("default"=> 0 , "jsName"=>"entityType" );1100		$this->settingsMap['tableSettings']['hasEvents'] = array("default"=>false,"jsName"=>"hasEvents");1101		$this->settingsMap["tableSettings"]["strCaption"] = array("default"=>"","jsName"=>"strCaption");1102		$this->settingsMap["tableSettings"]["isUseAudio"] = array("default"=>false,"jsName"=>"isUseAudio"); //fix it1103		$this->settingsMap["tableSettings"]["isUseVideo"] = array("default"=>false,"jsName"=>"isUseVideo");1104		$this->settingsMap['tableSettings']['listGridLayout'] = array("default"=> gltHORIZONTAL, "jsName"=>"listGridLayout");1105		$this->settingsMap["tableSettings"]["rowHighlite"] = array("default"=>false,"jsName"=>"isUseHighlite");1106 1107		$this->settingsMap['tableSettings']['recsPerRowList'] = array("default"=>1,"jsName"=>"recsPerRowList");1108		$this->settingsMap["tableSettings"]["showAddInPopup"] = array("default"=>false, "jsName"=>"showAddInPopup");1109		$this->settingsMap["tableSettings"]["showEditInPopup"] = array("default"=>false,"jsName"=>"showEditInPopup");1110		$this->settingsMap["tableSettings"]["showViewInPopup"] = array("default"=>false,"jsName"=>"showViewInPopup");1111		$this->settingsMap["tableSettings"]["updateSelected"] = array("default"=>false,"jsName"=>"updateSelected");1112		$this->settingsMap["tableSettings"]["isResizeColumns"] = array("default"=>false,"jsName"=>"isUseResize");1113		$this->settingsMap["tableSettings"]["detailsLinksOnList"] = array("default"=>DL_SINGLE,"jsName"=>"detailsLinksOnList");1114		$this->settingsMap["tableSettings"]["isDisplayLoading"] = array("default"=>false, "jsName"=>"displayLoading");1115 1116		//if the Search panel added to the non table based page ajax suggests should be configured according to the search table's settings1117		$ajaxSuggestDefault = $this->tableBasedSearchPanelAdded ? !$this->isUseAjaxSuggest : true;1118		$this->settingsMap["tableSettings"]["isUseAjaxSuggest"] = array("default"=>$ajaxSuggestDefault,"jsName"=>"ajaxSuggest");1119		$this->settingsMap["tableSettings"]["pages"] = array("default"=>array(),"jsName"=>"pages");1120		$this->settingsMap["tableSettings"]["Keys"] = array("default"=>array(),"jsName"=>"keyFields");1121 1122 1123 1124		$this->controlsMap["oldLayout"] = $this->isOldLayout();1125		$this->controlsMap["layoutVersion"] = $this->getLayoutVersion();1126		$this->controlsMap["layoutName"] = $this->getLayoutName();1127		$this->controlsMap["pageTable"] = $this->pSet->pageTable();1128 1129		$this->settingsMap["fieldSettings"] = array();1130		$this->settingsMap["fieldSettings"]["UseTimestamp"] = array("default"=>false,"jsName"=>"isUseTimeStamp");1131		$this->settingsMap["fieldSettings"]["strName"] = array("default"=>"","jsName"=>"strName");1132		$this->settingsMap["fieldSettings"]["ShowTime"] = array("default"=>false,"jsName"=>"showTime");1133		$this->settingsMap["fieldSettings"]["EditFormat"] = array("default"=>"","jsName"=>"editFormat");1134		$this->settingsMap["fieldSettings"]["DateEditType"] = array("default"=>EDIT_DATE_SIMPLE,"jsName"=>"dateEditType");1135		$this->settingsMap["fieldSettings"]["RTEType"] = array("default"=>"","jsName"=>"RTEType");1136		$this->settingsMap["fieldSettings"]["ViewFormat"] = array("default"=>"","jsName"=>"viewFormat");1137		$this->settingsMap["fieldSettings"]["validateAs"] = array("default"=>null,"jsName"=>"validation");1138		$this->settingsMap["fieldSettings"]["strEditMask"] = array("default"=>null,"jsName"=>"mask");1139		$this->settingsMap["fieldSettings"]["LastYearFactor"] = array("default"=>10,"jsName"=>"lastYear");1140		$this->settingsMap["fieldSettings"]["InitialYearFactor"] = array("default"=>100,"jsName"=>"initialYear");1141		$this->settingsMap["fieldSettings"]["ShowListOfThumbnails"] = array("default"=>false,"jsName"=>"showListOfThumbnails");1142		$this->settingsMap["fieldSettings"]["ImageWidth"] = array("default"=>0,"jsName"=>"imageWidth");1143		$this->settingsMap["fieldSettings"]["ImageHeight"] = array("default"=>0,"jsName"=>"imageHeight");1144		$this->settingsMap["fieldSettings"]["ResizeImage"] = array("default"=>false,"jsName"=>"resizeImage");1145		$this->settingsMap["fieldSettings"]["NewSize"] = array("default" => 0,"jsName"=>"resizeImageSize");1146 1147		$this->settingsMap["fieldSettings"]["weekdays"] = array("default"=>"","jsName"=>"weekdays");1148		$this->settingsMap["fieldSettings"]["weekdayMessage"] = array("default"=>"","jsName"=>"weekdayMessage");1149 1150		if( $this->pageType == PAGE_VIEW )1151			$this->settingsMap["fieldSettings"]["fieldViewEvents"] = array("default"=>false,"jsName"=>"events");1152		else1153			$this->settingsMap["fieldSettings"]["fieldEvents"] = array("default"=>false,"jsName"=>"events");1154 1155		$this->jsSettings["tableSettings"][$this->tName]["strCaption"] = $this->strCaption;1156		$this->jsSettings["tableSettings"][$this->tName]["pageMode"] = $this->mode;1157 1158		$this->jsSettings["tableSettings"][$this->tName]["defaultPages"] = $this->pSet->getDefaultPages();1159 1160		if ($this->listAjax)1161			$this->jsSettings['tableSettings'][$this->tName]['pageMode'] = LIST_AJAX;1162 1163		if($this->lockingObj)1164			$this->jsSettings['tableSettings'][$this->tName]['locking'] = true;1165 1166		if( $this->warnLeavingPages && ($this->pageType ==PAGE_REGISTER || $this->pageType ==PAGE_ADD || $this->pageType ==PAGE_EDIT) )1167			$this->jsSettings['tableSettings'][$this->tName]['warnOnLeaving'] = true;1168 1169		//If current table has detail tables1170		if( count($this->allDetailsTablesArr) )1171		{1172			if($this->pageType==PAGE_LIST)1173				$this->jsSettings['tableSettings'][$this->tName]['detailTables'] = array();1174 1175			$this->jsSettings['tableSettings'][$this->tName]['isShowDetails'] = $this->isShowDetailTables;1176 1177			for($i = 0; $i < count($this->allDetailsTablesArr); $i ++)1178			{1179				$dTable = $this->allDetailsTablesArr[$i]['dDataSourceTable'];1180				$dPset = new ProjectSettings( $dTable, $this->allDetailsTablesArr[$i]['dType'], $this->pSet->detailsPageId( $dTable ) );1181				$this->settingsMap["globalSettings"]['shortTNames'][ $this->allDetailsTablesArr[$i]['dDataSourceTable'] ] = $this->allDetailsTablesArr[$i]['dShortTable'];1182				$dPermission = $this->getPermissions( $this->allDetailsTablesArr[$i]['dDataSourceTable'] );1183				$this->permis[$this->allDetailsTablesArr[$i]['dDataSourceTable']] = $dPermission;1184 1185				// field names of master keys of current table for passed details table name1186				$this->masterKeysByD[$i] = $this->allDetailsTablesArr[$i]['masterKeys'];1187 1188				if(($this->pageType == PAGE_LIST) || ($this->pageType == PAGE_REPORT) || ($this->pageType == PAGE_CHART))1189				{1190					unset($_SESSION[$this->allDetailsTablesArr[$i]['dDataSourceTable'].'_advsearch']);1191 1192					$dPermission = $this->getPermissions( $this->allDetailsTablesArr[$i]['dDataSourceTable'] );1193					if( $dPermission["search"] )1194					{1195						$this->jsSettings['tableSettings'][$this->tName]['detailTables'][ $this->allDetailsTablesArr[$i]['dDataSourceTable'] ] =1196							array(1197								'pageType' => $this->allDetailsTablesArr[$i]['dType'],1198								'dispChildCount' => $this->pSet->detailsShowCount( $dTable ),1199								'hideChild' => $this->pSet->detailsHideEmpty( $dTable ),1200								'listShowType'=> $this->pSet->detailsPreview( $dTable ),

Showing the first 1,200 of 8930 lines. Download the file for the rest.