Пример #1
0
 /**
  * List themes
  */
 public function themes($theme = null)
 {
     $CroogoTheme = new CroogoTheme();
     $all = $this->params['all'];
     $current = Configure::read('Site.theme');
     $themes = $theme == null ? $CroogoTheme->getThemes() : array($theme);
     $this->out("Themes:", 2);
     $default = empty($current) || $current == 'default';
     $this->out(__d('croogo', '%-20s%-50s%s', __d('croogo', 'Theme'), __d('croogo', 'Author'), __d('croogo', 'Status')));
     $this->out(str_repeat('-', 80));
     foreach ($themes as $theme) {
         $active = $theme == $current || $default && $theme == 'default';
         $status = $active ? '<success>active</success>' : '<info>inactive</info>';
         if (!$active && !$all) {
             continue;
         }
         $data = $CroogoTheme->getThemeData($theme);
         $author = isset($data['author']) ? $data['author'] : '';
         $this->out(__d('croogo', '%-20s%-50s%s', $theme, $author, $status));
     }
 }