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); } }
/** * @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); }
/** * 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(); }
/** * @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); }