IndexController.php 735 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace controllers;
  3. use Ubiquity\core\postinstall\Display;
  4. use Ubiquity\themes\ThemesManager;
  5. /**
  6. * Controller IndexController
  7. **/
  8. class IndexController extends ControllerBase{
  9. public function index(){
  10. $defaultPage=Display::getDefaultPage();
  11. $links=Display::getLinks();
  12. $infos=Display::getPageInfos();
  13. $activeTheme=ThemesManager::getActiveTheme();
  14. $themes=Display::getThemes();
  15. if(sizeof($themes)>0){
  16. $this->loadView('@activeTheme/main/vMenu.html',compact('themes','activeTheme'));
  17. }
  18. $this->loadView($defaultPage,compact('defaultPage','links','infos','activeTheme'));
  19. }
  20. public function ct($theme){
  21. $config=ThemesManager::saveActiveTheme($theme);
  22. header("Location: ".$config['siteUrl']);
  23. }
  24. }