/** * Gets the URL arguments to append to a list redirect. * * @return string The arguments to append to the redirect URL. * * @since 12.2 */ protected function getRedirectToListAppend() { $append = parent::getRedirectToListAppend(); $component = $this->input->get('component', 0, 'int'); if ($component) { $append .= "&id=" . $component; } $table = $this->input->get('table', 0, 'int'); if ($table) { $append .= "&active=tables." . $table; } return $append; }
/** * Method to save a record. * * @param string $key The name of the primary key of the URL variable. * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). * * @return boolean True if successful, false otherwise. * * @since 12.2 */ public function save($key = null, $urlVar = null) { $result = parent::save(); if ($this->getTask() == "save") { $data = $this->input->get("jform", array(), "array"); $view = $data['type']; switch ($view) { case "": $view = $this->view_list; break; case "component.admin": case "component.site": case "table.admin": case "table.site": $view = "component"; break; default: break; } $this->setRedirect(JRoute::_("index.php?option=com_jdeveloper&view=" . $view . "&id=" . $data["item_id"], false)); } return $result; }
/** * Gets the URL arguments to append to a list redirect. * * @return string The arguments to append to the redirect URL. * * @since 12.2 */ protected function getRedirectToListAppend() { $append = parent::getRedirectToListAppend(); $data = $this->input->get("jform", array(), "array"); // Item has relation to table if (is_array($data) && isset($data["relation"]) && !empty($data["relation"])) { $parts = explode(".", $data["relation"]); if (is_array($parts) && count($parts) >= 2 && $parts[0] == "table") { $component = $this->getModel("Component")->getItem($this->getModel("Table")->getItem($parts[1])->component); $this->setRedirect(JRoute::_("index.php?option=com_jdeveloper&view=component&id=" . $component->id . "&active=forms", false)); $this->redirect(); } } $parent_id = $this->input->get('parent_id', 0, 'int'); if ($parent_id) { $append .= "&parent_id=" . $parent_id; } return $append; }