private function getOptions($templatesFolder) { $kernel = $this->container->get('kernel'); $deployBundle = $this->container->getParameter('red_kite_labs_theme_engine.deploy_bundle'); $deployBundleAsset = new Asset($kernel, $deployBundle, $this->container->getParameter('red_kite_labs_theme_engine.web_path')); $deployBundlePath = $deployBundleAsset->getRealPath(); $viewsDir = $deployBundlePath . '/Resources/views'; return array("deployBundle" => $deployBundle, "configDir" => $deployBundlePath . '/' . $this->container->getParameter('red_kite_cms.deploy_bundle.config_dir'), "assetsDir" => $deployBundlePath . '/' . $this->container->getParameter('red_kite_cms.deploy_bundle.assets_base_dir'), "viewsDir" => $viewsDir, "templatesDir" => $templatesFolder, "deployDir" => $viewsDir . '/' . $templatesFolder, "uploadAssetsFullPath" => $this->container->getParameter('red_kite_cms.upload_assets_full_path'), "uploadAssetsAbsolutePath" => AssetsPath::getAbsoluteUploadFolder($this->container), "deployBundleAssetsPath" => "/" . $deployBundleAsset->getAbsolutePath(), "deployController" => $this->container->getParameter('red_kite_cms.deploy_bundle.controller'), "webFolderPath" => $this->container->getParameter('red_kite_cms.web_folder_full_path'), "websiteUrl" => $this->container->getParameter('red_kite_cms.website_url'), "credits" => $this->container->getParameter('red_kite_cms.love'), "kernelDir" => $kernel->getRootDir()); }
private function locate($asset) { $asset = new Asset($this->kernel, $asset); $assetPath = $asset->getRealPath(); return $assetPath; }
protected function getSkin() { $asset = new Asset($this->kernel, '@RedKiteCmsBundle'); return $asset->getAbsolutePath() . '/css/skins/' . $this->container->getParameter('red_kite_cms.skin'); }
protected function retrieveThemeInfo($theme, $buttons = true) { $themeName = $theme->getThemeName(); $asset = new Asset($this->container->get('kernel'), $themeName); $info = array('theme_title' => $themeName); $fileName = \sprintf('%s/Resources/data/info.yml', $asset->getRealPath()); if (file_exists($fileName)) { $t = Yaml::parse($fileName); $info["info"] = \array_intersect_key($t["info"], \array_flip($this->container->getParameter('red_kite_labs_theme_engine.info_valid_entries'))); } $screenshotPath = 'images/screenshot.png'; $fileName = \sprintf('%s/Resources/public/%s', $asset->getRealPath(), $screenshotPath); $info["screenshot"] = file_exists($fileName) ? "/" . $asset->getAbsolutePath() . "/" . $screenshotPath : $this->retriveDefaultScreenshot(); if ($buttons) { $info['buttons'] = $buttons; } return $info; }