element found in W2ML markup. private $meta_content_type_element = NULL; # head and body elements found during processing, to insert TTW editor support private $head_html_element = NULL; private $body_html_element = NULL; # Array of TTW editor names that require support in HTML output. private $requested_editors = array(); private $templates = array(); # Getters function request_time() { return $this->request_time; } function last_modification_time() { return $this->last_modification_time; } function meta_content_type_element() { return $this->meta_content_type_element; } function head_html_element() { return $this->head_html_element; } function body_html_element() { return $this->body_html_element; } function requested_editors() { return $this->requested_editors; } function __construct() { $this->request_time = isset($_SERVER['REQUEST_TIME']) ? $_SERVER['REQUEST_TIME'] : time(); } function set_last_modification_time($timestamp) { $this->last_modification_time = $timestamp; } function notice_modification($timestamp) { if ($timestamp > $this->last_modification_time) { $this->last_modification_time = $timestamp; } } # Remember 'interesting' elements of output tree. function notice_out_html_element($element, $html_ns) { $element_name = $html_ns === NULL ? strtolower($element->localName) : $element->localName; switch ($element_name) { case 'head': $this->head_html_element = $element; break; case 'body': $this->body_html_element = $element; break; case 'meta': if ($html_ns === '') { $http_equiv = get_case_attribute($element, 'http-equiv'); } else { $http_equiv = $element->getAttributeNS(NULL, 'http-equiv'); } if (strtolower($http_equiv->value) === 'content-type') { $this->meta_content_type_element = $element; } break; } } # Store requested editor name if not already stored. function need_editor_support($editor_name) { if (!in_array($editor_name, $this->requested_editors, TRUE)) { $this->requested_editors[] = $editor_name; } } function store_template($element, $template_id) { $template = $element->cloneNode(TRUE); $template_attr = get_w2ml_attribute($template, 'template'); if ($template_attr !== NULL) { $template->removeAttributeNode($template_attr); } $this->templates[$template_id] = $template; } function get_template($id) { return $this->templates[$id]; } } ?>