コード例 #1
0
 public function load(ObjectManager $manager)
 {
     $themes = $this->container->get('claroline.manager.theme_manager')->listStockThemeNames();
     foreach ($themes as $name) {
         $theme = new Theme();
         $theme->setName($name);
         $manager->persist($theme);
     }
 }
コード例 #2
0
ファイル: DatabaseWriter.php プロジェクト: ChMat/CoreBundle
 /**
  * @param array  $themeConfiguration
  * @param Plugin $plugin
  * @param Theme  $theme
  */
 private function persistTheme($themeConfiguration, Plugin $plugin, Theme $theme)
 {
     $theme->setName($themeConfiguration['name']);
     $theme->setPath('ClarolineCoreBundle:less:claroline/theme.html.twig');
     if ($themeConfiguration['path']) {
         $theme->setPath($plugin->getVendorName() . $plugin->getBundleName() . ":" . substr_replace($themeConfiguration['path'], ":", strpos($themeConfiguration['path'], "/"), 1));
     }
     $theme->setPlugin($plugin);
     $this->em->persist($theme);
 }
コード例 #3
0
ファイル: ThemeManager.php プロジェクト: ngydat/CoreBundle
 /**
  * Creates a custom theme based on a css file.
  *
  * @param string    $name
  * @param File      $file
  */
 public function createCustomTheme($name, File $file)
 {
     $theme = new Theme();
     $theme->setName($name);
     $themeDir = "{$this->themeDir}/{$theme->getNormalizedName()}";
     $fs = new Filesystem();
     $fs->mkdir($themeDir);
     $file->move($themeDir, 'bootstrap.css');
     $this->om->persist($theme);
     $this->om->flush();
 }
コード例 #4
0
ファイル: DatabaseWriter.php プロジェクト: ngydat/CoreBundle
 /**
  * @param array  $themeConfiguration
  * @param Plugin $plugin
  * @param Theme  $theme
  */
 private function persistTheme($themeConfiguration, Plugin $plugin, Theme $theme)
 {
     $theme->setName($themeConfiguration['name']);
     $theme->setPlugin($plugin);
     $this->em->persist($theme);
 }