Ejemplo n.º 1
0
 public function __construct()
 {
     global $dataDir, $page, $addonFolderName, $langmessage;
     if (defined('multi_site_unique')) {
         message($langmessage['not root install']);
         return;
     }
     gpPlugin::css('multi_site.less', false);
     //$page->css_user[] = '/data/_addoncode/'.$addonFolderName.'/multi_site.css';
     //$page->head_js[] = '/data/_addoncode/'.$addonFolderName.'/multi_site.js';
     $page->head_js[] = '/include/js/admin_users.js';
     $page->admin_links[] = array('Admin_Site_Setup', 'Multi-Site Home');
     $page->admin_links[] = array('Admin_Site_Setup', 'New Installation', 'cmd=new');
     $page->admin_links[] = array('Admin_Site_Setup', 'Settings', 'cmd=settings');
     $page->admin_links[] = array('Admin_Site_Setup', 'About', 'cmd=about');
     $_REQUEST += array('install' => array());
     //ftp setup
     $this->GetSiteData();
     $hide = false;
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'about':
             $this->About(true);
             $hide = true;
             break;
         case 'installed':
             $this->ShowSites();
             $hide = true;
             break;
             /* settings */
         /* settings */
         case 'settings':
             $this->SettingsForm($this->siteData);
             $hide = true;
             break;
         case 'Save Settings':
             if (!$this->SaveSettings()) {
                 $this->SettingsForm($_POST);
                 $hide = true;
             }
             break;
         case 'save_options':
         case 'options':
             $this->Options($cmd);
             $hide = true;
             break;
         case 'uninstall':
             $this->UninstallSite();
             break;
             /*
              * New Installation
              */
         /*
          * New Installation
          */
         case 'new':
         case 'Install Now':
         case 'new_plugins':
         case 'new_install':
         case 'new_destination':
         case 'new_themes':
         case 'Continue':
             $this->InstallStatus($cmd);
             $hide = true;
             break;
         case 'subfolder':
             $this->SubFolder();
             $this->InstallStatus($cmd);
             $hide = true;
             break;
         case 'expandfolder':
             $this->ExpandFolder();
             $hide = true;
             return;
         case 'newfolder':
             $this->NewFolder();
             $hide = true;
             break;
         case 'Delete Folder':
             $hide = true;
             $this->RemoveDir();
             break;
         case 'rmdir':
             $hide = true;
             $this->RemoveDirPrompt();
             break;
     }
     if (!$hide) {
         $this->FrontPage();
     }
 }