protected function dispatchImpl() { $isHtml = $this->response->getMimetype()->isHtml(); $params = $this->request->getParams(); if (!(self::$transactionId = $params->get('ui-panel-tx'))) { self::$transactionId = \math\random_sha1_weak(); } self::$submittedPanelId = $params->get('ui-panel-submitted'); if (__CLASS__ !== get_class($this)) { $this->init(); if ($isHtml) { return $this->fetch(); } $panels = []; foreach ($this->panel->redrawPanels() as $panel) { $panels[$panel->id()] = $panel->fetch(); } return json_encode(['p' => $panels]); } // static callback if ($params->containsKey('ui-panel-callback')) { $callback = $params->get('ui-panel-callback'); if (false !== ($pos = strpos($callback, '::'))) { $type = substr($callback, 0, $pos); $method = substr($callback, $pos + 2); // TODO [CSH] Runtime_Classloader::lookupClass(class/name). if (class_exists($type) && method_exists($type, $method)) { return $type::$method(); } } } }
/** * @return string */ public function id() { if (null === $this->m_id) { if (null === $this->parent) { return $this->name; } $this->m_id = $this->parent->id() . '-' . $this->name; } return $this->m_id; }