예제 #1
0
 /**
  * Provides a single block from the administration menu as a page.
  */
 public function translatorAdminMenuBlockPage()
 {
     $contents = $this->systemManager->getBlockContents();
     if (count($contents['#content']) === 1) {
         /** @var \Drupal\Core\Url $url */
         $url = reset($contents['#content'])['url'];
         return $this->redirect($url->getRouteName(), $url->getRouteParameters(), $url->getOptions());
     }
     return $contents;
 }
예제 #2
0
 protected function getSystemData()
 {
     if (!$this->systemManager) {
         return [];
     }
     $requirements = $this->systemManager->listRequirements();
     $systemData = [];
     foreach ($requirements as $key => $requirement) {
         if ($requirement['title'] instanceof \Drupal\Core\StringTranslation\TranslatableMarkup) {
             $title = $requirement['title']->render();
         } else {
             $title = $requirement['title'];
         }
         $systemData['system'][$title] = $requirement['value'];
     }
     if ($this->settings) {
         try {
             $hashSalt = $this->settings->getHashSalt();
         } catch (\Exception $e) {
             $hashSalt = '';
         }
         $systemData['system'][$this->trans('commands.site.status.messages.hash_salt')] = $hashSalt;
         $systemData['system'][$this->trans('commands.site.status.messages.console')] = $this->getApplication()->getVersion();
     }
     return $systemData;
 }
 /**
  * Displays the site status report.
  *
  * @return array
  *   A render array containing a list of system requirements for the Drupal
  *   installation and whether this installation meets the requirements.
  */
 public function status()
 {
     $requirements = $this->systemManager->listRequirements();
     return array('#theme' => 'status_report', '#requirements' => $requirements);
 }
예제 #4
0
 /**
  * Provides a single block from the administration menu as a page.
  */
 public function systemAdminMenuBlockPage()
 {
     return $this->systemManager->getBlockContents();
 }