xpath("replace") as $replacedNode) { $replaced[] = (string) $replacedNode['id']; } $url = (string) $node['url']; list($extension, $controller, $action) = explode('/', trim($url, '/')); return new static([ 'id' => (string) $node['id'], 'title' => (string) $node['title'], 'label' => (string) $node['label'], 'desc' => (string) $node->description, 'url' => $url, 'extension' => $extension, 'controller' => $controller, 'action' => $action, 'replace' => $replaced ]); } public function __construct($data, $version = self::SERIAL_VERSION) { $this->data = $data; } public function getId() { return $this->data['id']; } public function getTitle() { return $this->data['title']; } public function getLabel() { return $this->data['label']; } public function getDescription() { return $this->data['desc']; } public function getUrl() { return _url($this->getAction(), $this->getController(), $this->getExtensionId()); } public function getExtensionId() { return $this->data['extension']; } public function getController() { return $this->data['controller']; } public function getAction() { return $this->data['action']; } public function getReplacedIds() { return $this->data['replace']; } public function hasAccess() { list($ext, $mod, $act) = explode('/', trim($this->data['url'], '/')); return tao_models_classes_accessControl_AclProxy::hasAccess($act, $mod, $ext); } public function __toPhpCode() { return "new " . __CLASS__ . "(" . \common_Utils::toPHPVariableString($this->data) . ',' . \common_Utils::toPHPVariableString(self::SERIAL_VERSION) . ")"; } }