function attach_open() { // global $vars,$_attach_messages; foreach (array('refer', 'file', 'age') as $var) { ${$var} = array_key_exists($var, $this->root->vars) ? $this->root->vars[$var] : ''; } $obj = new XpWikiAttachFile($this->xpwiki, $refer, $file, $age); return $obj->getstatus() ? $obj->open() : array('header' => array('HTTP/1.0 404 Not Found', 'Status: 404 Not Found'), 'msg' => 'File Not Found.'); }