/** * This work for gadget only * @param $gadgetName name of the gadget * @return array with list of html template */ public function getListTemplateForGadget($gadgetName) { $pathToGadget = $this->getPath($gadgetName); $kernel = $this->container->get('kernel'); // test good gadget type $config = $this->getConfigPackage($pathToGadget); if ($config['type'] !== $this::TYPE_PACKAGE_GADGET) { throw new \LogicException('This action works only on gadget type package'); } // get list of template $ret = array(); $templates = scandir($pathToGadget . '/templates'); $templatesGadgetFolder = $kernel->getRootDir() . $this::ROOT_DIR_TEMPLATE . $gadgetName . '/'; if (!is_dir($templatesGadgetFolder)) { mkdir($templatesGadgetFolder); } foreach ($templates as $t) { if ($t == '.' || $t == '..') { continue; } if (StringUtil::endsWith($t, '.html')) { $ret[$t] = $t; } } return $ret; }
public function setSplashscreenA960x720(File $splashscreen) { if (StringUtil::endsWith($splashscreen->getClientOriginalName(), '.9.png')) { $splashscreen->move($this->getUploadRootDir("android"), "splashscreenA960x720.9.png"); } else { $splashscreen->move($this->getUploadRootDir("android"), "splashscreenA960x720.png"); } }