Development > Site Configuration protected function generate() : void { $this->h1 = 'Site Configuration'; array_unshift($this->title, $this->h1); $this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]); parent::generate(); $this->addScript([SC_CSS_STRING, << $catName) { $rows = ''; foreach (Cfg::forCategory($idx) as $key => [$value, $flags, , $default, $comment]) $rows .= $this->buildRow($key, $value, $flags, $default, $comment); if ($idx == Cfg::CAT_MISCELLANEOUS) $rows .= 'new configuration'; if (!$rows) continue; $this->lvTabs->addDataTab(Profiler::urlize($catName), $catName, '' . $head . $rows . '
'); } } private function buildRow(string $key, string $value, int $flags, ?string $default, string $comment) : string { $buff = ''; $info = explode(' - ', $comment); $key = $flags & Cfg::FLAG_PHP ? strtolower($key) : strtoupper($key); // name if (!empty($info[0])) $buff .= ''.sprintf(Util::$dfnString, $info[0], $key).''; else $buff .= ''.$key.''; // value if ($flags & Cfg::FLAG_TYPE_BOOL) $buff .= '
'; else if ($flags & Cfg::FLAG_OPT_LIST && !empty($info[1])) { $buff .= ''; } else if ($flags & Cfg::FLAG_BITMASK && !empty($info[1])) { $buff .= '
'; foreach (explode(', ', $info[1]) as $option) { [$idx, $name] = explode(':', $option); $buff .= ''; } $buff .= '
'; } else $buff .= ''; // actions $buff .= ''; $buff .= ''; if ($default) $buff .= '|'; else $buff .= '|'; if (!($flags & Cfg::FLAG_PERSISTENT)) $buff .= '|'; $buff .= ''; return $buff; } } ?>