$client = new NDB_Client(); $client->initialize(); require_once "HelpFile.class.inc"; // create DB object $DB =& Database::singleton(); // store some request information if (!empty($_REQUEST['helpID'])) { $helpID = $_REQUEST['helpID']; } else { if (!empty($_REQUEST['test_name'])) { $helpID = HelpFile::hashToID(md5($_REQUEST['test_name'])); } if (!empty($_REQUEST['test_name']) && !empty($_REQUEST['subtest'])) { $helpID = HelpFile::hashToID(md5($_REQUEST['subtest'])); } } $help_file = HelpFile::factory($helpID); $data = $help_file->toArray(); $data['content'] = utf8_encode(trim($data['content'])); if (empty($data['content'])) { $data['content'] = 'Under Construction'; } if (empty($data['updated'])) { $data['updated'] = "-"; // if document was never updated should display date created if (!empty($data['created'])) { $data['updated'] = $data['created']; } } print json_encode($data); ob_end_flush();
/** * Run the application instance * @return Application */ public function run() { $this->init(); $browser = new Browser(); $isUnsupported = UnsupportedBrowserDetector::isUnsupported($browser->getBrowser(), (int) $browser->getMajorVersion()); $config = $this->getConfig(); if ($config['debugMode']) { $isUnsupported = true; } if ($isUnsupported) { $helpFile = new HelpFile($config['helpFilePath']); $view = new IeBarView(); $view->setJsFilePath($config['jsFileWebPath']); $view->render($helpFile->getText()); } return $this; }