/** * Get dynamic option data for the editor * * @return array */ protected function getDynamicOption() { $data = array_except($this->config->all(), 'tools'); $data['fontFamily'] = isset($data['fontFamily']) ? array_map(function ($v) { return trim($v); }, explode(',', $data['fontFamily'])) : []; $data['extensions'] = isset($data['extensions']) ? array_map(function ($v) { return trim($v); }, explode(',', $data['extensions'])) : []; $data['extensions'] = array_search('*', $data['extensions']) !== false ? ['*'] : $data['extensions']; $instance = new Instance($this->editors->getPermKey($this->instanceId)); $data['perms'] = ['html' => $this->gate->allows('html', $instance), 'tool' => $this->gate->allows('tool', $instance), 'upload' => $this->gate->allows('upload', $instance)]; $data['files'] = $this->files; return $data; }
/** * Get all of the items in the config entity. * * @return array */ public function all() { $parentAttributes = $this->parent !== null ? $this->parent->all() : []; return array_merge($parentAttributes, $this->vo->getAttributes()); }