Example #1
0
 /**
  * @return string
  */
 function run()
 {
     $errorMessage = '';
     // ensure that all CiviCRM tables are InnoDB, else abort
     // this is not a very fast operation, so we do it randomly 10% of the times
     // but we do it for most / all tables
     // http://bugs.mysql.com/bug.php?id=43664
     if (rand(1, 10) == 3 && CRM_Core_DAO::isDBMyISAM(150)) {
         $errorMessage = ts('Your database is configured to use the MyISAM database engine. CiviCRM requires InnoDB. You will need to convert any MyISAM tables in your database to InnoDB. Using MyISAM tables will result in data integrity issues.');
         CRM_Core_Session::setStatus($errorMessage, ts('Warning'), "alert");
     }
     if (!CRM_Utils_System::isDBVersionValid($errorMessage)) {
         CRM_Core_Session::setStatus($errorMessage, ts('Warning'), "alert", array('expires' => 0));
     }
     $groups = array('Customize Data and Screens' => ts('Customize Data and Screens'), 'Communications' => ts('Communications'), 'Localization' => ts('Localization'), 'Users and Permissions' => ts('Users and Permissions'), 'System Settings' => ts('System Settings'));
     $config = CRM_Core_Config::singleton();
     if (in_array('CiviContribute', $config->enableComponents)) {
         $groups['CiviContribute'] = ts('CiviContribute');
     }
     if (in_array('CiviMember', $config->enableComponents)) {
         $groups['CiviMember'] = ts('CiviMember');
     }
     if (in_array('CiviEvent', $config->enableComponents)) {
         $groups['CiviEvent'] = ts('CiviEvent');
     }
     if (in_array('CiviMail', $config->enableComponents)) {
         $groups['CiviMail'] = ts('CiviMail');
     }
     if (in_array('CiviCase', $config->enableComponents)) {
         $groups['CiviCase'] = ts('CiviCase');
     }
     if (in_array('CiviReport', $config->enableComponents)) {
         $groups['CiviReport'] = ts('CiviReport');
     }
     if (in_array('CiviCampaign', $config->enableComponents)) {
         $groups['CiviCampaign'] = ts('CiviCampaign');
     }
     $values = CRM_Core_Menu::getAdminLinks();
     $this->_showHide = new CRM_Core_ShowHideBlocks();
     foreach ($groups as $group => $title) {
         $groupId = str_replace(' ', '_', $group);
         $this->_showHide->addShow("id_{$groupId}_show");
         $this->_showHide->addHide("id_{$groupId}");
         $v = CRM_Core_ShowHideBlocks::links($this, $groupId, '', '', FALSE);
         if (isset($values[$group])) {
             $adminPanel[$groupId] = $values[$group];
             $adminPanel[$groupId]['show'] = $v['show'];
             $adminPanel[$groupId]['hide'] = $v['hide'];
             $adminPanel[$groupId]['title'] = $title;
         } else {
             $adminPanel[$groupId] = array();
             $adminPanel[$groupId]['show'] = '';
             $adminPanel[$groupId]['hide'] = '';
             $adminPanel[$groupId]['title'] = $title;
         }
     }
     $this->assign('adminPanel', $adminPanel);
     $this->_showHide->addToTemplate();
     return parent::run();
 }
Example #2
0
 function run()
 {
     // ensure that all CiviCRM tables are InnoDB, else abort
     if (CRM_Core_DAO::isDBMyISAM()) {
         $errorMessage = 'Your database is configured to use the MyISAM database engine. CiviCRM  requires InnoDB. You will need to convert any MyISAM tables in your database to InnoDB. Using MyISAM tables will result in data integrity issues. This will be a fatal error in CiviCRM v2.1.';
         require_once 'CRM/Core/Session.php';
         CRM_Core_Session::setStatus($errorMessage);
     }
     if (!CRM_Utils_System::isDBVersionValid($errorMessage)) {
         CRM_Core_Session::setStatus($errorMessage);
     }
     $groups = array('Customize' => ts('Customize'), 'Configure' => ts('Configure'), 'Manage' => ts('Manage'), 'Option Lists' => ts('Option Lists'));
     $config = CRM_Core_Config::singleton();
     if (in_array("CiviContribute", $config->enableComponents)) {
         $groups['CiviContribute'] = ts('CiviContribute');
     }
     if (in_array("CiviMember", $config->enableComponents)) {
         $groups['CiviMember'] = ts('CiviMember');
     }
     if (in_array("CiviEvent", $config->enableComponents)) {
         $groups['CiviEvent'] = ts('CiviEvent');
     }
     if (in_array("CiviMail", $config->enableComponents)) {
         $groups['CiviMail'] = ts('CiviMail');
     }
     if (in_array("CiviCase", $config->enableComponents)) {
         $groups['CiviCase'] = ts('CiviCase');
     }
     if (in_array("CiviReport", $config->enableComponents)) {
         $groups['CiviReport'] = ts('CiviReport');
     }
     if (in_array("CiviCampaign", $config->enableComponents)) {
         $groups['CiviCampaign'] = ts('CiviCampaign');
     }
     require_once 'CRM/Core/Menu.php';
     $values =& CRM_Core_Menu::getAdminLinks();
     require_once 'CRM/Core/ShowHideBlocks.php';
     $this->_showHide = new CRM_Core_ShowHideBlocks();
     foreach ($groups as $group => $title) {
         $this->_showHide->addShow("id_{$group}_show");
         $this->_showHide->addHide("id_{$group}");
         $v = CRM_Core_ShowHideBlocks::links($this, $group, '', '', false);
         $adminPanel[$group] = $values[$group];
         $adminPanel[$group]['show'] = $v['show'];
         $adminPanel[$group]['hide'] = $v['hide'];
         $adminPanel[$group]['title'] = $title;
     }
     require_once 'CRM/Utils/VersionCheck.php';
     $versionCheck =& CRM_Utils_VersionCheck::singleton();
     $this->assign('newVersion', $versionCheck->newerVersion());
     $this->assign('localVersion', $versionCheck->localVersion);
     $this->assign('adminPanel', $adminPanel);
     $this->_showHide->addToTemplate();
     return parent::run();
 }