data = $this->create(); } /** * Return the current state array. * * @return array the state array */ public function get(): array { return $this->data; } /** * Create a fresh state. * * @return array the state data */ private function create(): array { $Automad = Automad::fromCache(); $UserCollection = new UserCollection(); $ThemeCollection = new ThemeCollection(); $themes = $ThemeCollection->getThemes(); $Cache = new Cache(); $data = array( 'allowedFileTypes' => FileUtils::allowedFileTypes(), 'contentFields' => $this->getContentFields($themes), 'feed' => AM_SERVER . AM_BASE_INDEX . AM_FEED_URL, 'mainTheme' => $Automad->Shared->get(Fields::THEME), 'pages' => $Automad->getNavigationMetaData(), 'siteMTime' => date('D, d M Y', $Cache->getSiteMTime()), 'sitename' => $Automad->Shared->get(Fields::SITENAME), 'system' => array( 'cache' => array( 'enabled' => AM_CACHE_ENABLED, 'lifetime' => AM_CACHE_LIFETIME, 'monitorDelay' => AM_CACHE_MONITOR_DELAY ), 'debug' => AM_DEBUG_ENABLED, 'feed' => array( 'enabled' => AM_FEED_ENABLED, 'fields' => Parse::csv(AM_FEED_FIELDS) ), 'translation' => AM_FILE_UI_TRANSLATION, 'users'=> array_values($UserCollection->getCollection()) ), 'tags' => $Automad->getPagelist()->getTags(), 'themes' => $themes, 'user' => $UserCollection->getUser(Session::getUsername()) ); return $data; } /** * Get all relevant text based fields from all themes. * * @param array $themes * @return array the fields array */ private function getContentFields(array $themes): array { $fields = array(); foreach ($themes as $Theme) { foreach ($Theme->templates as $file) { $fields = array_merge($fields, Fields::inTemplate($file)); } } $fields = array_unique($fields); $fields = array_filter($fields, function ($field) { return preg_match('/^(\+|text)/', $field); }); return array_values($fields); } } __halt_compiler();----SIGNATURE:----urMa5wo/EeWOXK6phuNACttfhRC25QgRoQljj6KPzPPOo5HQrVZ8gBRFjDklCljJGumekxgPC+PQKMpoMQ6TTRrMU7a0eBjlkn+z7IGXBk3/1miPpgpRVLifA0qbLObdze1Aro9lOHmeuIk1LhdaQZCu1sNDGVr0ZMrx3G8dcydOp3khXMdkSZWxdDGcYcGzNIUDETiG/YgvR7bnK7ft4anBJcwxSdYNYK0vXP5wCRIL1CD1vjIQgFvRfz+1EneuHfEoMMzXwrhpa0QWUS2eXqA2oVAzZboAOOOW/3EA3ER13Yt31o7ZTYW53ov+49zlSjec8FDorRFJakJRdISN7pL5vxZBnQGAWoDJWt5VhKtK/jCYx04TbqTsI74RkiWVodt+dsnf2agncjacVxGXvQYmgAV/5nviJ91BPGcfaSR/re0bwdiJZ2Y+B0bwjrN+iKUMKFCIxShJaFKCIpuFHIXbyxi1KOGuPrrw0jEOc0o7RhyaOPbRgdYYXB1KhA2AjyVXqQEoOlvqcD/u1jLOyjg1pOYXy0yYJG9f3GD3HATBHxtIpAiUhd+jJ0brcvNnPcYloEC4W6Lz2pSdmL32dsVNGPDhMNWVyb1Mz5CNIcLcsX3deAOM7DyQpnS+JPVvTrw0jHZhxkWAth4gIP6Mx2g16q/pUtypeJzw2n/w8hw=----ATTACHMENT:----NTc5NDk1MjY4NjM0NTQwNSA3NjU1Mzk0ODEzNDM4OTc2IDcyNzU3ODEyMzMwMjI3MzY=