示例#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
 /**
  * @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
 /**
  * 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
 private function getBundle(Theme $theme)
 {
     $plugin = $theme->getPlugin();
     return $plugin ? $plugin->getSfName() : 'ClarolineCoreBundle';
 }
示例#5
0
 /**
  * @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);
 }