/** * */ function _doProcess() { $mod =& x_getModuleManager(); $ss = $mod->invokeAll('xh_documentStylesheets', array(&$this->m_path)); $this->m_component_view->m_stylesheets = $ss->getValidValues(true); $this->m_component_view->m_language = $this->m_path->m_lang; foreach ($this->m_components as $k => $v) { $this->m_components[$k]->_process(); if ($this->m_components[$k]->isReadyToDisplay()) { $this->m_component_view->m_components[$k] =& $this->m_components[$k]->m_component_view; if (xanth_instanceof($this->m_components[$k], 'xContentController')) { $this->m_component_view->m_title = $this->m_components[$k]->m_component_view->m_title; $this->m_component_view->m_keywords = $this->m_components[$k]->m_component_view->m_keywords; $this->m_component_view->m_description = $this->m_components[$k]->m_component_view->m_description; } } } return true; }
/** * @return bool */ function isA($class_name) { return xanth_instanceof($this, $class_name); }
/** * Make a method call to all modules. * <br><strong>Note</strong>: if a xBypassObject is received hook invocation * is immediately interrupted and results returned. * * @param string $function The method to call * @param args An array containing the arguments to pass to the function * @static * @return xResultSet */ function invokeAll($hook, $args = array()) { $rs = new xResultSet(); if (isset($this->m_hooks[$hook])) { foreach ($this->m_hooks[$hook] as $k => $v) { $result = call_user_func_array(array(&$this->m_hooks[$hook][$k][0], $this->m_hooks[$hook][$k][1]), $args); if (xanth_instanceof($result, 'xBypassObject')) { if ($result->m_data !== NULL) { $rs->m_results[] = $result->m_data; } break; } elseif ($result !== NULL) { $rs->m_results[] = $result; } } } return $rs; }
/** * Returns true if the given object represent an error. */ function isError(&$obj) { return xanth_instanceof($obj, 'xError'); }
/** * Return an xValidationData object */ function validate_input() { $data = new xValidationData(); //first validate the token if (!(isset($_SESSION['form_token']) && isset($_POST['form_token']) && $_POST['form_token'] == $_SESSION['form_token'])) { return $data; } $token_age = time() - $_SESSION['form_token_time']; if ($token_age > 300) { return $data; } foreach ($this->elements as $element) { $ret = $element->validate(); if (xanth_instanceof($element, 'xFormGroup')) { $data->errors = array_merge($ret->errors, $data->errors); $data->valid_data = array_merge($ret->valid_data, $data->valid_data); } else { if ($ret === NULL) { $data->errors[] = $element->last_error; } else { $data->valid_data[$element->name] = $ret; } } } return $data; }