public function messageViewer(MessageStack $stack) { $content = new StringBuffer(); while (!$stack->isEmpty()) { $msg = $stack->pop(); $content->append($msg->getMessage()->toString()); } return $content; }
/** * Returns a buffered version of the printStackTrace method */ public function getStackTrace() { $sb = new StringBuffer("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td colspan=\"2\">"); $sb->append("<b>" . $this->classname . ": " . $this->getMessage() . "</b><br/>"); foreach ($this->getTrace() as $value) { $value['line'] = !isset($value['line']) ? '' : $value['line']; $value['file'] = !isset($value['file']) ? '' : $value['file']; $sb->append("</td></tr><tr><td width=\"25\"> </td><td>"); $sb->append("\tat " . $value['class'] . $value['type'] . $value['function'] . " ( " . Japha::getQualified($value['file']) . ":" . $value['line'] . " )<br/>"); } $sb->append("</tr></table>"); return $sb; }
/** * Completely Hardcoded. Eww. * * Formats links to all of the possible control panel areas, taking into * account the level of the current user, and the permissions allowed with * respect to that level. * * @return String The control panel menu */ function showPanel() { $c = new StringBuffer(); $c->append("\n<ul>\n"); $c->append($this->link('news&page=edit', $this->lang->message('showPanel', 'articles'), 1)); $c->append($this->link('news&page=add', $this->lang->message('showPanel', 'articles:add'), 1)); $c->append($this->link('category&page=add', $this->lang->message('showPanel', 'categories'), 3)); $c->append($this->link('template&page=main', $this->lang->message('showPanel', 'template'), 3)); $c->append($this->link('user&page=add', $this->lang->message('showPanel', 'users:add'), 2)); $c->append($this->link('user&page=remove', $this->lang->message('showPanel', 'users:edit'), 3)); $c->append($this->link('comments&page=viewPosts', $this->lang->message('showPanel', 'comments'), 2)); $c->append($this->link('configuration&page=edit', $this->lang->message('showPanel', 'configuration'), 3)); $c->append($this->link('user&page=edit', $this->lang->message('showPanel', 'profile'), 1)); $c->append($this->link('logout', $this->lang->message('showPanel', 'logout'), 1)); $c->append("\n</ul>\n"); $replacer = $this->template->setMethod('panel'); $replacer->addVariable('menu', $c->toString()); return $this->template->createViewer($replacer); }