$options["id"] = postvalue("id") ? postvalue("id") : 1; $options["mode"] = $mode; $options['xt'] =& $xt; $options['mainMasterPageType'] = postvalue("mainmasterpagetype"); $options['masterPageType'] = postvalue("masterpagetype"); $options["masterTable"] = postvalue("mastertable"); $options["masterId"] = postvalue("masterid"); $options["firstTime"] = postvalue("firsttime"); $i = 1; while (isset($_REQUEST["masterkey" . $i])) { $options["masterKeysReq"][$i] = $_REQUEST["masterkey" . $i]; $i++; } $pageObject = ListPage::createListPage($strTableName, $options); unset($_SESSION["message_add"]); unset($_SESSION["message_edit"]); // prepare code for build page $pageObject->prepareForBuildPage(); $includesArr = array(); $masterTablesInfoArr = GetMasterTablesArr($strTableName); for ($i = 0; $i < count($masterTablesInfoArr); $i++) { if ($masterTablesInfoArr[$i]['dispInfo']) { $includesArr[] = getabspath("include/" . $masterTablesInfoArr[$i]['mShortTable'] . "_masterlist.php"); } } //include files if need for ($i = 0; $i < count($includesArr); $i++) { include $includesArr[$i]; } // show page depends of mode $pageObject->showPage();
/** * display Back to Master link and master table info */ function displayMasterTableInfo() { $masterTablesInfoArr = GetMasterTablesArr($this->tName); for ($i = 0; $i < count($masterTablesInfoArr); $i++) { if ($this->masterTable == $masterTablesInfoArr[$i]['mDataSourceTable']) { if ($masterTablesInfoArr[$i]['dispInfo']) { $detailKeys = $masterTablesInfoArr[$i]['detailKeys']; for ($j = 0; $j < count($detailKeys); $j++) { $masterKeys[] = @$_SESSION[$this->sessionPrefix . "_masterkey" . ($j + 1)]; } $params = array("detailtable" => $this->tName, "keys" => $masterKeys); $master = array(); $master["func"] = "DisplayMasterTableInfo_" . $masterTablesInfoArr[$i]['mShortTable']; $master["params"] = $params; $this->xt->assignbyref("showmasterfile", $master); } $this->xt->assign("mastertable_block", true); $this->xt->assign("backtomasterlink_attrs", "href=\"" . $masterTablesInfoArr[$i]['mShortTable'] . "_list.php?a=return\""); $this->xt->assign("backtomasterlink_caption", GetTableCaption(GoodFieldName($masterTablesInfoArr[$i]['mDataSourceTable']))); } } }