Horde_Core_Ajax_Response_HordeCore::_jsonData PHP Méthode

_jsonData() protected méthode

The object may include a 'jsfiles' property, which is an array of URL-accessible javascript files to be loaded by the browser (since 2.10.0). The object may include a 'msgs' property, which is an array of notification message objects with 3 properties: flags, message, and type. The object may include a 'tasks' property, which is an array of keys (task names) / values (task data).
protected _jsonData ( ) : object
Résultat object HordeCore JSON object.
    protected function _jsonData()
    {
        global $notification, $page_output;
        $ob = new stdClass();
        $ob->response = $this->data;
        $stack = $notification->notify(array('listeners' => array('status', 'audio', 'webnotification'), 'raw' => true));
        if (!empty($stack)) {
            $ob->msgs = array();
            foreach ($stack as $val) {
                $ob->msgs[] = array_filter(array('flags' => $val->flags, 'message' => $val->message, 'type' => $val->type, 'webnotify' => isset($val->webnotify) ? $val->webnotify : null));
            }
        }
        foreach ($page_output->hsl as $val) {
            $this->jsfiles[] = strval($val->url);
        }
        $page_output->hsl->clear();
        foreach ($page_output->css->getStylesheetUrls(array('nobase' => true)) as $val) {
            $this->cssfiles[] = strval($val->url);
        }
        if (!empty($this->jsfiles)) {
            $ob->jsfiles = array_values(array_unique($this->jsfiles));
        }
        if (!empty($this->cssfiles)) {
            $ob->cssfiles = array_values(array_unique($this->cssfiles));
        }
        if (!empty($this->tasks)) {
            $ob->tasks = $this->tasks;
        }
        return $ob;
    }
Horde_Core_Ajax_Response_HordeCore