+
+ function loadDoc()
+ {
+ if (Event::handle('StartLoadDoc', array(&$this->title, &$this->output))) {
+
+ $paths = DocFile::defaultPaths();
+
+ $docfile = DocFile::forTitle($this->title, $paths);
+
+ if (empty($docfile)) {
+ // TRANS: Client exception thrown when requesting a document from the documentation that does not exist.
+ // TRANS: %s is the non-existing document.
+ throw new ClientException(sprintf(_('No such document "%s".'), $this->title), 404);
+ }
+
+ $this->output = $docfile->toHTML();
+
+ Event::handle('EndLoadDoc', array($this->title, &$this->output));
+ }
+ }