Ejemplo n.º 1
0
    public function getAll()
    {
        foreach ($this->all as $k => $subject) {
            if (true === empty($subject)) {
                unset($this->all[$k]);
            }
        }
        if (true === isset($_GET['ajax'])) {
            $back = '';
            foreach ($this->all as $subject) {
                $back .= self::displayAjax($subject);
            }
            return $back;
        }
        return GWF_Template::templateMain('errors.tpl', array('messages' => $this->all));
    }
    private static function displayAjax(&$subject)
    {
        $back = '';
        foreach ($subject as $messages) {
            foreach ($messages as $msg) {
                $m = GWF_Debug::shortpath(self::decode($msg));
                $back .= sprintf('0:%d:%s', strlen($m), $m) . PHP_EOL;
            }
        }
        GWF_Website::addDefaultOutput($back);
        return $back;
    }
}
GWF_Error::getInstance();