Beispiel #1
0
 /**
  * Create instance of theme based on name and settings
  *
  * @param string $name
  * @param array $settings
  * @return Theme
  */
 protected function createTheme($name, array $settings)
 {
     $result = new Theme($name);
     if (isset($settings['styles'])) {
         $result->setStyles((array) $settings['styles']);
     }
     if (isset($settings['label'])) {
         $result->setLabel($settings['label']);
     }
     if (isset($settings['icon'])) {
         $result->setIcon($settings['icon']);
     }
     if (isset($settings['logo'])) {
         $result->setLogo($settings['logo']);
     }
     if (isset($settings['screenshot'])) {
         $result->setScreenshot($settings['screenshot']);
     }
     return $result;
 }
Beispiel #2
0
 public function testStylesMethods()
 {
     $this->assertEquals(array(), $this->theme->getStyles());
     $this->theme->setStyles(array('styles.png'));
     $this->assertEquals(array('styles.png'), $this->theme->getStyles());
 }
Beispiel #3
0
 protected function outputTheme(OutputInterface $output, Theme $theme, $isActive)
 {
     if ($isActive) {
         $output->writeln(sprintf('<comment>%s</comment> (active)', $theme->getName()));
     } else {
         $output->writeln(sprintf('<comment>%s</comment>', $theme->getName()));
     }
     if ($theme->getLabel()) {
         $output->writeln(sprintf(' - <info>label:</info> %s', $theme->getLabel()));
     }
     if ($theme->getLogo()) {
         $output->writeln(sprintf(' - <info>logo:</info> %s', $theme->getLogo()));
     }
     if ($theme->getIcon()) {
         $output->writeln(sprintf(' - <info>icon:</info> %s', $theme->getIcon()));
     }
     if ($theme->getScreenshot()) {
         $output->writeln(sprintf(' - <info>screenshot:</info> %s', $theme->getScreenshot()));
     }
     if ($theme->getStyles()) {
         if (count($theme->getStyles()) > 1) {
             $output->writeln(' - <info>styles:</info>');
             foreach ($theme->getStyles() as $style) {
                 $output->writeln(sprintf('     - %s', $style));
             }
         } else {
             $output->writeln(sprintf(' - <info>styles:</info> %s', current($theme->getStyles())));
         }
     }
 }