tab($this->getKey(), is_a($this, Page::class) ? _t('@', 'General') : $this->getTitle()); } /** * Fill settings form * @param Form $form * @return void */ public function settingsForm($form) { } /** * Block admin settings to values map * @return array */ public function settings() { return []; } /** * Fill settings (from settings form) * @param bool $force * @return void */ public function fillSettings($force = false) { if ($this->settingsFilled && ! $force) { return; } $parent = $this->getParentPage(); if (! $parent) { return; } if (! $parent->settingsFillAllowed()) { return; } $this->settingsFilled = true; $settings = $parent->getBlockSettings($this->getKey()); if ($settings) { $this->setSettings($settings); } $this->onSettingsFilled(); } /** * Handle settings fill event */ protected function onSettingsFilled() { } /** * Hide/show block settings * @param bool|null $hide * @return bool */ public function noSettings(?bool $hide = true) { if (! is_null($hide)) { $this->noSettings = $hide; } return $this->noSettings; } }