public function StatsDashboard($Sender) {
      $StatsUrl = $this->AnalyticsServer;
      if (!StringBeginsWith($StatsUrl, 'http:') && !StringBeginsWith($StatsUrl, 'https:'))
         $StatsUrl = Gdn::Request()->Scheme()."://{$StatsUrl}";
      
      // Tell the page where to find the Vanilla Analytics provider
      $Sender->AddDefinition('VanillaStatsUrl', $StatsUrl);
      $Sender->SetData('VanillaStatsUrl', $StatsUrl);
      
      // Load javascript & css, check permissions, and load side menu for this page.
      $Sender->AddJsFile('settings.js');
      $Sender->Title(T('Dashboard'));
      $Sender->RequiredAdminPermissions[] = 'Garden.Settings.Manage';
      $Sender->RequiredAdminPermissions[] = 'Garden.Users.Add';
      $Sender->RequiredAdminPermissions[] = 'Garden.Users.Edit';
      $Sender->RequiredAdminPermissions[] = 'Garden.Users.Delete';
      $Sender->RequiredAdminPermissions[] = 'Garden.Users.Approve';
      $Sender->FireEvent('DefineAdminPermissions');
      $Sender->Permission($Sender->RequiredAdminPermissions, '', FALSE);
      $Sender->AddSideMenu('dashboard/settings');

      if (!Gdn_Statistics::CheckIsEnabled() && Gdn_Statistics::CheckIsLocalhost()) {
         $Sender->Render('dashboardlocalhost', '', 'plugins/VanillaStats');
      } else {
         $Sender->AddJsFile('plugins/VanillaStats/js/vanillastats.js');
         $Sender->AddJsFile('plugins/VanillaStats/js/picker.js');
         $Sender->AddCSSFile('plugins/VanillaStats/design/picker.css');

         $this->ConfigureRange($Sender);
         
         $VanillaID = Gdn::InstallationID();
         $Sender->SetData('VanillaID', $VanillaID);
         $Sender->SetData('VanillaVersion', APPLICATION_VERSION);
         $Sender->SetData('SecurityToken', $this->SecurityToken());
      
         // Render the custom dashboard view
         $Sender->Render('dashboard', '', 'plugins/VanillaStats');
      }
   }
public function StatsDashboard($Sender) {
      $StatsUrl = $this->AnalyticsServer;
      if (!StringBeginsWith($StatsUrl, 'http:') && !StringBeginsWith($StatsUrl, 'https:'))
         $StatsUrl = Gdn::Request()->Scheme()."://{$StatsUrl}";
      
      // Tell the page where to find the Vanilla Analytics provider
      $Sender->AddDefinition('VanillaStatsUrl', $StatsUrl);
      $Sender->SetData('VanillaStatsUrl', $StatsUrl);
      
      // Load javascript & css, check permissions, and load side menu for this page.
      $Sender->AddJsFile('settings.js');
      $Sender->Title(T('Dashboard'));
      $Sender->RequiredAdminPermissions[] = 'Garden.Settings.Manage';
      $Sender->RequiredAdminPermissions[] = 'Garden.Users.Add';
      $Sender->RequiredAdminPermissions[] = 'Garden.Users.Edit';
      $Sender->RequiredAdminPermissions[] = 'Garden.Users.Delete';
      $Sender->RequiredAdminPermissions[] = 'Garden.Users.Approve';
      $Sender->FireEvent('DefineAdminPermissions');
      $Sender->Permission($Sender->RequiredAdminPermissions, '', FALSE);
      $Sender->AddSideMenu('dashboard/settings');

      if (!Gdn_Statistics::CheckIsEnabled() && Gdn_Statistics::CheckIsLocalhost()) {
         $Sender->Render('dashboardlocalhost', '', 'plugins/VanillaStats');
      } else {
         $Sender->AddJsFile('plugins/VanillaStats/js/vanillastats.js');
         $Sender->AddJsFile('plugins/VanillaStats/js/picker.js');
         $Sender->AddCSSFile('plugins/VanillaStats/design/picker.css');

         $this->ConfigureRange($Sender);
         
         $VanillaID = Gdn::InstallationID();
         $Sender->SetData('VanillaID', $VanillaID);
         $Sender->SetData('VanillaVersion', APPLICATION_VERSION);
         $Sender->SetData('SecurityToken', $this->SecurityToken());
      
         // Render the custom dashboard view
         $Sender->Render('dashboard', '', 'plugins/VanillaStats');
      }
   }
public function StatsDashboard ( $ Sender ) { $ StatsUrl = $ this -> AnalyticsServer ; if ( ! StringBeginsWith ( $ StatsUrl , 'http:' ) && ! StringBeginsWith ( $ StatsUrl , 'https:' ) ) $ StatsUrl = Gdn :: Request ( ) -> Scheme ( ) . "://{$StatsUrl}" ; // Tell the page where to find the Vanilla Analytics provider
 $ Sender -> AddDefinition ( 'VanillaStatsUrl' , $ StatsUrl ) ; $ Sender -> SetData ( 'VanillaStatsUrl' , $ StatsUrl ) ; // Load javascript & css, check permissions, and load side menu for this page.
 $ Sender -> AddJsFile ( 'settings.js' ) ; $ Sender -> Title ( T ( 'Dashboard' ) ) ; $ Sender -> RequiredAdminPermissions [ ] = 'Garden.Settings.Manage' ; $ Sender -> RequiredAdminPermissions [ ] = 'Garden.Users.Add' ; $ Sender -> RequiredAdminPermissions [ ] = 'Garden.Users.Edit' ; $ Sender -> RequiredAdminPermissions [ ] = 'Garden.Users.Delete' ; $ Sender -> RequiredAdminPermissions [ ] = 'Garden.Users.Approve' ; $ Sender -> FireEvent ( 'DefineAdminPermissions' ) ; $ Sender -> Permission ( $ Sender -> RequiredAdminPermissions , '' , FALSE ) ; $ Sender -> AddSideMenu ( 'dashboard/settings' ) ; if ( ! Gdn_Statistics :: CheckIsEnabled ( ) && Gdn_Statistics :: CheckIsLocalhost ( ) ) { $ Sender -> Render ( 'dashboardlocalhost' , '' , 'plugins/VanillaStats' ) ; } else { $ Sender -> AddJsFile ( 'plugins/VanillaStats/js/vanillastats.js' ) ; $ Sender -> AddJsFile ( 'plugins/VanillaStats/js/picker.js' ) ; $ Sender -> AddCSSFile ( 'plugins/VanillaStats/design/picker.css' ) ; $ this -> ConfigureRange ( $ Sender ) ; $ VanillaID = Gdn :: InstallationID ( ) ; $ Sender -> SetData ( 'VanillaID' , $ VanillaID ) ; $ Sender -> SetData ( 'VanillaVersion' , APPLICATION_VERSION ) ; $ Sender -> SetData ( 'SecurityToken' , $ this -> SecurityToken ( ) ) ; // Render the custom dashboard view
 $ Sender -> Render ( 'dashboard' , '' , 'plugins/VanillaStats' ) ; } }
Override the default index method of the settings controller in the
dashboard application to render new statistics.
Override the default index method of the settings controller in the dashboard application to render new statistics .