/** * Used to delete data from database * * It deletes the given data * {@internal context browser,command line} * * @return string $redirect_url the url at which the user is redirected */ public function HandleDeleteData() { /** The application parameters are fetched */ $parameters = $this->GetConfig("general", "parameters"); /** The application configuration is fetched */ $configuration = $this->GetConfigurationObject(); /** The parameters for the data object */ $meta_information = array("configuration" => $configuration, "key_field" => "id", "data_type" => $parameters['data_type'], "readonly" => false); /** Mysqldataobject is created */ $data_object = new MysqlDataObject($meta_information); /** The parameters used to read the data from database */ $parameters = array("fields" => "*", "condition" => $parameters['id'], "read_all" => false); /** The table row data is read from database */ $data_object->Read($parameters); /** The table row data is deleted */ $data_object->Delete(); /** The redirect url */ $redirect_url = $this->GetComponent("application")->GetEncodedUrl("list_page", $this->GetConfig("general", "module"), "html", false, false); return $redirect_url; }