protected function do_actions() { if (isset($_GET['action'])) { /* * The action name. */ $an = $_GET['action']; $amm = $this->get_action_method_map(); /* * The acton method name. */ if (isset($amm[$an])) { $amn = $amm[$an]; } else { throw new Exception("Unknown action '{$an}'!"); } /* * Do it. */ try { ObjectOrientation_NamedMethodCaller::call_method_by_name($this, $amn); /* * Is this actually necessary? * * They will all get set again when the user is taken * back to the page. * * Does no harm and the user might be returning to a page * other than the standard crud. */ if (isset($_SESSION['select-vars'])) { unset($_SESSION['select-vars']); } #} catch (ReflectionException $e) { # echo $e->getMessage(); # exit; } catch (Database_CRUDException $e) { /* * If there was a problem changing the database, * go back to whence we came. * * Hope that the session vars have been set for * any forms. * * Also hope that the browser isn't playing silly buggars with * the HTTP_REFERER field. */ $return_to = HTMLTags_URL::parse_and_make_url($_SERVER['HTTP_REFERER']); $return_to->set_get_variable('error', urlencode($e->getMessage())); #print_r($return_to); exit; $this->set_return_to($return_to->get_as_string()); } } else { throw new Exception('No action set for Database_CRUDAdminRedirectScript!'); } }
public static function get_link_a_with_span($node) { $span = new HTMLTags_Span(); $span->append($node['url_title']); $a = new HTMLTags_A(); $a->append($span); $a->set_href(HTMLTags_URL::parse_and_make_url($node['url_href'])); $a->set_attribute_str('title', $node['url_title']); if ($node['open_in_new_window'] == 'Yes') { #echo ' target="_blank" '; $a->set_attribute_str('target', '_blank'); } return $a; }
protected function set_return_to($return_to) { #$this->return_to_url = $return_to; $this->set_return_to_url(HTMLTags_URL::parse_and_make_url($return_to)); }
private static function apply_attributes_from_page_element_to_page_object($page_element, Admin_NXFPage $page_object) { if ($page_element->hasAttribute('url')) { $url = HTMLTags_URL::parse_and_make_url($page_element->getAttribute('url')); $page_object->set_url($url); } if ($page_element->hasAttribute('special_page')) { $page_object->set_special_page($page_element->getAttribute('special_page')); } if ($page_element->hasAttribute('page_class')) { $page_object->set_page_class($page_element->getAttribute('page_class')); } }
public static function get_current_url() { $url = HTMLTags_URL::parse_and_make_url($_SERVER['REQUEST_URI']); $url->make_absolute_for_current_server(); return $url; }
public function set_value($value) { $url = HTMLTags_URL::parse_and_make_url($value); $this->set_url($url); }
/** * Takes the local part of a URL * and turns it into an absolute URL (by looking at the current HTTP env) * and redirects the browser to the URL. */ public static function redirect_to_absolute_location($local_part) { #$url = new HTMLTags_URL($local_part); $url = HTMLTags_URL::parse_and_make_url($local_part); self::redirect_to_url($url); }