protected function HTMLViewGroups()
 {
     global $wgTitle, $wgOut, $wgRequest, $wgExtensionsPath, $wgJsMimeType;
     $oTmpl = new EasyTemplate(dirname(__FILE__) . "/templates/");
     if ($wgRequest->getVal('action') == 'save') {
         $oGroup = new SponsorshipDashboardGroup();
         $oGroup->fillFromRequest();
         $oGroup->save();
     }
     $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$wgExtensionsPath}/wikia/SponsorshipDashboard/js/SponsorshipDashboardList.js\" ></script>\n");
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('extensions/wikia/SponsorshipDashboard/css/SponsorshipDashboardList.scss'));
     $this->HTMLAdminHeader('ViewGroups');
     $aGroups = new SponsorshipDashboardGroups();
     $oTmpl->set_vars(array("data" => $aGroups->getData(), "path" => $wgTitle->getFullURL()));
     $wgOut->addHTML($oTmpl->render('admin/viewGroups'));
     return false;
 }
 function getTabsForStaff($tabName)
 {
     $SDGroups = F::build('SponsorshipDashboardGroups');
     $SDGData = $SDGroups->getObjArray(true);
     $this->currentGroups = $SDGData;
     $exploded = explode('/', $tabName);
     $catId = $exploded[0];
     if (isset($exploded[1])) {
         $repId = $exploded[1];
     } else {
         $repId = 0;
     }
     $SDR = new SponsorshipDashboardGroup($catId);
     if (!$SDR->exist()) {
         $catId = 0;
     }
     if (empty($catId)) {
         $catKeys = array_keys($SDGData);
         if (!isset($catKeys[0])) {
             return false;
         }
         $catId = $catKeys[0];
     }
     $SDGroup = F::build('SponsorshipDashboardGroup', array($catId));
     $SDGroup->loadGroupParams();
     if (!isset($SDGroup->reports[$repId])) {
         $aKeys = array_keys($SDGroup->reports);
         if (!isset($aKeys[0])) {
             return false;
         }
         $repId = $aKeys[0];
     }
     $this->currentReports = $SDGroup->reports;
     $this->currentGroup = $catId;
     $this->currentReport = $SDGroup->reports[$repId];
     return true;
 }