From 9ed98afd3725f20305962b4f776c5b9c89ccdf4a Mon Sep 17 00:00:00 2001 From: nbm Date: Thu, 8 Dec 2005 11:20:58 +0000 Subject: [PATCH] Remove old PatternCreate and create.php. --- lib/visualpatterns/PatternCreate.inc | 157 ------------------------------------------------------------------------------------------------------------------------------------------------------------- presentation/lookAndFeel/knowledgeTree/create.php | 113 ----------------------------------------------------------------------------------------------------------------- 2 files changed, 0 insertions(+), 270 deletions(-) delete mode 100644 lib/visualpatterns/PatternCreate.inc delete mode 100644 presentation/lookAndFeel/knowledgeTree/create.php diff --git a/lib/visualpatterns/PatternCreate.inc b/lib/visualpatterns/PatternCreate.inc deleted file mode 100644 index e8c5f3e..0000000 --- a/lib/visualpatterns/PatternCreate.inc +++ /dev/null @@ -1,157 +0,0 @@ -sObject = $sNewObject; - $this->sObjectPath = $sNewObjectPath; - $this->sNewQuery = $sNewQuery; - $this->aDisplayRowNames = $aNewDisplayRowNames; - $this->aParameterNumbers = $aNewParameterNumbers; - $this->aDisplayColumnTypes = $aNewDisplayColumnTypes; - $this->aRequired = $aNewRequired; - $this->aDropDownListTableNames = $aNewDropDownListTableNames; - $this->aDropDownListValueColumns = $aNewDropDownListValueColumns; - $this->aDropDownListDisplayColumns = $aNewDropDownListDisplayColumns; - - } - - function setUniqueName($sNewValue) { - $this->sUniqueName = $sNewValue; - } - - function setDefaultValues($aNewValue) { - $this->aDefaultValues = $aNewValue; - } - - function render() { - global $default; - $this->sUniqueName .= KTUtil::randomString(); - $_SESSION["pelfq_" . $this->sUniqueName . "_object"] = $this->sObject; - $_SESSION["pelfq_" . $this->sUniqueName . "_fn"] = $this->sObjectPath; - $_SESSION["pageAccess"][$default->rootUrl . '/presentation/lookAndFeel/knowledgeTree/create.php'] = true; - - $sToRender = "\n"; - //unique_start marks the start of information to be parsed from the HTML page by create.php - $sToRender .= "sUniqueName . "\" />\n"; - //write the name of the object to be created - // $sToRender .= "sUniqueName . "_object\" value=\"" . $this->sObject . "\" />\n"; - //name of folder in lib directory in which object .inc file is located - // $sToRender .= "sUniqueName . "_fn\" value=\"" . $this->sObjectPath . "\" />\n"; - for ($i = 0; $i < count($this->aDisplayRowNames); $i++) { - $sToRender .= "\n"; - //write the parameter number of this value in the object's constructor - $sToRender .= "sUniqueName . "_" . $i . "_parnum\" value=\"" . $this->aParameterNumbers[$i] . "\" />\n"; - switch ($this->aDisplayColumnTypes[$i]) { - case 1: - //write the type (in this case text) - $sToRender .= "sUniqueName . "_" . $i . "_type\" value=\"1\" />\n"; - //write the value - $sToRender .= "\n"; - break; - case 2: - //write the type (in this case checkbox) - $sToRender .= "sUniqueName . "_" . $i . "_type\" value=\"2\" />\n"; - //write the value - $sToRender .= "\n"; - break; - case 3: - //write the type (in this case dropdown) - $sToRender .= "sUniqueName . "_" . $i . "_type\" value=\"3\" />\n"; - $sDisplayColumn; - $sValueColumn; - //write the value - if (isset($this->aDropDownListValueColumns[$i])) { - $sValueColumn = $this->aDropDownListValueColumns[$i]; - } else { - $sValueColumn = "id"; - } - - if (isset($this->aDropDownListDisplayColumns[$i])) { - $sDisplayColumn = $this->aDropDownListDisplayColumns[$i]; - } else { - $sDisplayColumn = "name"; - } - $oPatternListBox = & new PatternListBox($this->aDropDownListTableNames[$i], $sDisplayColumn, $sValueColumn, $this->sUniqueName . "_" . $i . "_value"); - $sToRender .= "\t\t\n"; - break; - default; - break; - } - - $sToRender .= "\n"; - } - //unique_end marks the end of information to be parsed from the HTML page by create.php - $sToRender .= "sUniqueName . "\" />\n"; - $sToRender .= "
" . $this->aDisplayRowNames[$i] . "sUniqueName . "_" . $i . "_value\" value=\"" . (isset($this->aDefaultValues[$i]) ? $this->aDefaultValues[$i] : "") . "\" />" . $this->aDisplayRowNames[$i] . "sUniqueName . "_" . $i . "_value\" value=\"1\" />" . $this->aDisplayRowNames[$i] . "" . $oPatternListBox->render() . "
\n"; - - $sToRender .= $this->generateRequiredFieldValidation(); - - return $sToRender; - } - - function generateRequiredFieldValidation() { - $sToRender .= "\n\n\n\n"; - - return $sToRender; - } -} -?> diff --git a/presentation/lookAndFeel/knowledgeTree/create.php b/presentation/lookAndFeel/knowledgeTree/create.php deleted file mode 100644 index e79489f..0000000 --- a/presentation/lookAndFeel/knowledgeTree/create.php +++ /dev/null @@ -1,113 +0,0 @@ -fileSystemRoot/presentation/Html.inc"); - -if (!checkSession()) { - exit(0); -} - -$aKeys = array_keys($_POST); -$aParameterValues = array(); -// $sObjectName; -// $sObjectFolderName; -//parse the information in the html page -for ($i = 0; $i < count($aKeys); $i++) { - $sRowStart = $aKeys[$i]; - $pos = strncasecmp("unique_start", $sRowStart, 12); - if ($pos == 0) { - $i++; - //get the object to create - //$sObjectName = $_POST[$aKeys[$i]]; - //$i++; - //get the object folder name - //$sObjectFolderName = $_POST[$aKeys[$i]]; - //$i++; - $sRandomString = substr($sRowStart, 13); - $sObjectName = $_SESSION["pelfq_" . $sRandomString . "_object"]; - $sObjectFolderName = $_SESSION["pelfq_" . $sRandomString . "_fn"]; - - while ((strncasecmp("unique_end", $sRowStart, 10) != 0) && ($i < count($aKeys))) { - //get the paramater number - $iParameterNumber = $_POST[$aKeys[$i]]; - $i++; - $iType = $_POST[$aKeys[$i]]; - $value; - switch ($iType) { - case 1: - $i++; - $value = $_POST[$aKeys[$i]]; - break; - case 2: - //check boxes don't post back any values if they are unchecked - //so we have to do a special check - if ((strpos($aKeys[$i + 1], "parnum") != 0) || (substr($aKeys[$i + 1],0,10) == "unique_end")) { - //if the next key is one of type parnum or is the end of the section, then the checkbox - //didn't post anything back and is obviously unchecked - $value = 0; - } else { - //the checkbox did post back a value and was therefore checked - //the checkbox posts back a value of "on" so don't actually use the postback - //value, rather just set value to true - $i++; - $value = 1; - } - break; - case 3: - $i++; - $value = $_POST[$aKeys[$i]]; - break; - } - $aParameterValues[$iParameterNumber] = $value; - $i++; - $sRowStart = $aKeys[$i]; - } - } -} - - -//include the correct file for the object -include_once("$default->fileSystemRoot/lib/$sObjectFolderName"); - -$oObject = call_user_func(strtolower($sObjectName) . "createFromArray",$aParameterValues); -if ($oObject->create()) { - $bSuccess = true; -} else { - $bSuccess = false; -} - -//redirect the user -if (array_key_exists('fRedirectURL', $_REQUEST)) { - redirect(strip_tags(urldecode($_REQUEST['fRedirectURL'])) . $oObject->iId . "&fSuccess=" . $bSuccess); -} else { - redirect("$default->rootUrl/control.php"); -} - -?> -- libgit2 0.21.4