| 1 | <?php |
| 2 | /* |
| 3 | +--------------------------------------------------------------------+ |
| 4 | | Copyright CiviCRM LLC. All rights reserved. | |
| 5 | | | |
| 6 | | This work is published under the GNU AGPLv3 license with some | |
| 7 | | permitted exceptions and without any warranty. For full license | |
| 8 | | and copyright information, see https://civicrm.org/licensing | |
| 9 | +--------------------------------------------------------------------+ |
| 10 | */ |
| 11 | |
| 12 | /** |
| 13 | * |
| 14 | * @package CRM |
| 15 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
| 16 | */ |
| 17 | |
| 18 | /** |
| 19 | * Page for displaying list of site configuration tasks with links to each setting form. |
| 20 | */ |
| 21 | class CRM_Admin_Page_ConfigTaskList extends CRM_Core_Page { |
| 22 | |
| 23 | /** |
| 24 | * Run page. |
| 25 | * |
| 26 | * @return string |
| 27 | */ |
| 28 | public function run() { |
| 29 | Civi::resources()->addStyleFile('civicrm', 'css/admin.css'); |
| 30 | |
| 31 | CRM_Utils_System::setTitle(ts("Configuration Checklist")); |
| 32 | $this->assign('recentlyViewed', FALSE); |
| 33 | |
| 34 | $destination = CRM_Utils_System::url('civicrm/admin/configtask', |
| 35 | 'reset=1', |
| 36 | FALSE, NULL, FALSE |
| 37 | ); |
| 38 | |
| 39 | $destination = urlencode($destination); |
| 40 | $this->assign('destination', $destination); |
| 41 | |
| 42 | $this->assign('registerSite', htmlspecialchars('https://civicrm.org/register-your-site?src=iam&sid=' . CRM_Utils_System::getSiteID())); |
| 43 | |
| 44 | //Provide ability to optionally display some component checklist items when components are on |
| 45 | $result = civicrm_api3('Setting', 'get', [ |
| 46 | 'sequential' => 1, |
| 47 | 'return' => ["enable_components"], |
| 48 | ]); |
| 49 | $enabled = []; |
| 50 | foreach ($result['values'][0]['enable_components'] as $component) { |
| 51 | $enabled[$component] = 1; |
| 52 | } |
| 53 | |
| 54 | // Create an array of translated Component titles to use as part of links on the page. |
| 55 | $translatedComponents = CRM_Core_Component::getNames(TRUE); |
| 56 | $translatedTitles = []; |
| 57 | foreach (CRM_Core_Component::getNames() as $key => $component) { |
| 58 | $translatedTitles[$component] = $translatedComponents[$key]; |
| 59 | } |
| 60 | $this->assign('componentTitles', $translatedTitles); |
| 61 | $this->assign('enabledComponents', $enabled); |
| 62 | |
| 63 | return parent::run(); |
| 64 | } |
| 65 | |
| 66 | } |