setData(array( 'dashboard' => AM_BASE_INDEX . AM_PAGE_DASHBOARD, 'languages' => self::getLanguages(), 'reservedFields' => Fields::$reserved, 'sitename' => $Automad->Shared->get(Fields::SITENAME), 'text' => Text::getObject(), 'packageRepo' => AM_PACKAGE_REPO, 'version' => AM_VERSION )); }); return $ResponseCache->get(); } /** * Install or update the automad/language-packs package. * * @return Response the Response object */ public static function getLanguagePacks(): Response { session_write_close(); ignore_user_abort(true); $Response = new Response; $Composer = new Composer(); $package = Text::PACKAGE; if (!is_readable(Text::LANG_PACKS_DIR)) { if (!$Composer->run("require --prefer-install=dist {$package}:dev-master")) { $Response->setSuccess( 'Successfully installed the language pack extension! Reload the page in order to select another language in the system settings.' ); } } $Composer->run("update {$package}"); return $Response; } /** * Send updated dynamic data that is required to update the dashboard app state. * * @return Response the Response object */ public static function updateState(): Response { session_write_close(); $ResponseCache = new ResponseCache(function () { $Response = new Response(); $State = new State(); return $Response->setData($State->get()); }); return $ResponseCache->get(); } /** * Get the array of installed languages. * * @return array the array of languages */ private static function getLanguages(): array { $languages = array('English' => ''); foreach (glob(Text::LANG_PACKS_DIR . '/*.json') as $file) { $value = Str::stripStart($file, AM_BASE_DIR); $key = ucfirst(str_replace(array('_', '.json'), array(' ', ''), basename($file))); $languages[$key] = $value; } return $languages; } } __halt_compiler();----SIGNATURE:----Zz9FMMt+L/ahk6ZG5Bl4iTzpgN9KLcWTICrhaWOSjDUvalLrJWtO8MhxvSCvfhQJ89wzv57M8kwlAC1y3z27oL5XAlW62i/sgtHkoeGmif667Qiog26AztSNB0STXCO5TzGBbIXjmCqWTJC7KO9/wvwuo8krY3AxAeTTty9sr/MGys1XgtoP5VHZL4+mLvksZrfxGwj6ahYwbSzp6cYpmel24NuzPG1BRLuf4hOTnKlAdx4ujLl7eam0aOEbP7rljaQhqcGJfWzdS/oKcQ4NOeAztcD8sY8CFG7B1Ph1Xy4JDwGykZ3cWsZVSGMoxUPso99+g5RZI9dof3vTNM1XiFsodijtNWc7gngC50lKuRdhLcQhxyzuDy5IMAjWZDFLDa13DyjY44N9aP23ANWQ5JWqefsYA2ORud2Vbr2JkZW8Xuhh+HvejPrkq8ZX0HwEqZFVCJNpQ8s3hBILLzIg+O93ug3ZWVGs9TrYroiBqD8Y7nNK79+BFYSXEG0QmqgrUkh1bmJObSHirHduyp+srS7hNFNR6S/St+LgsKixXBDmlYAtS2w0QYU1W+MNVUuD/PociZTvKMuEKfVqbmB1vVGanFZdPKCZSNP0rGKxP4DwjRR7iFWEny0+AR29yijXUyawN8MJFKRe+rDH6cDNZ5IO0F1SahdjQBhQjmMSBA0=----ATTACHMENT:----OTM5MTY3NjU5NTU4OTU4IDQyNDI2OTY2OTU5NDQ5MTEgMTIwNTI0MDA3NjA5NDQx