/** * Fonction qui test la localistation des fichiers template par rapports aux thèmes langues et pays */ public function testThemeWithoutI18N() { $prefix = CopixUrl::get(); CopixConfig::Instance()->i18n_path_enabled = false; $this->assertEquals($prefix . 'themes/testtheme/img/testthemefrFR.jpg', CopixUrl::getResource('img/testthemefrFR.jpg')); $this->assertEquals($prefix . 'themes/testtheme/img/testthemefr.jpg', CopixUrl::getResource('img/testthemefr.jpg')); CopixTpl::setTheme('themenonexistant'); $this->assertEquals($prefix . 'themes/default/img/testdefaultfrFR.jpg', CopixUrl::getResource('img/testdefaultfrFR.jpg')); $this->assertEquals($prefix . 'themes/default/img/testdefaultfr.jpg', CopixUrl::getResource('img/testdefaultfr.jpg')); $this->assertEquals($prefix . 'img/notFound.jpg', CopixUrl::getResource('img/notFound.jpg')); }
public function beforeProcess() { if (($theme = CopixAJAX::getSession()->get('currentTheme')) != null) { CopixTpl::setTheme($theme); //Ajout d'une gestion de tpl par thème $config = CopixConfig::instance(); $theme = CopixTpl::getThemeInformations(CopixTpl::getTheme()); if ($theme->tpl != null) { $config->mainTemplate = $theme->tpl; } } }
public function beforeProcess(&$pExecParams) { if ($theme = $this->config->getThemeFor(CopixRequest::get('module'))) { CopixTpl::setTheme($theme); } //Ajout d'une gestion de tpl par thème $config = CopixConfig::instance(); $theme = CopixTpl::getThemeInformations(CopixTpl::getTheme()); if ($theme->tpl != null) { $config->mainTemplate = $theme->tpl; } }
public function beforeProcess() { if (in_array(CopixSession::get('themechooser|theme'), $this->config->getThemeList())) { CopixTpl::setTheme(CopixSession::get('themechooser|theme')); } }
public function beforeProcess(&$execParam) { CopixTpl::setTheme(Kernel::getTheme()); }
/** * Teste CopixTpl->getFilePath() avec un thème inexistant. * */ public function testGetFilePathUnknownTheme() { $tpl = new CopixTpl(); CopixTpl::setTheme('themenonexistant'); $this->assertFalse($tpl->getFilePath('copixtest|testtheme.tpl')); // N'existe pas $this->assertFalse($tpl->getFilePath('copixtest|testthemefr.tpl')); // N'existe pas $this->assertFalse($tpl->getFilePath('copixtest|testthemefrfr.tpl')); // N'existe pas $this->assertPathEquals($this->defaultDir . 'copixtest/testdefault.tpl', $tpl->getFilePath('copixtest|testdefault.tpl')); $this->assertPathEquals($this->defaultDir . 'copixtest/fr/testdefaultfr.tpl', $tpl->getFilePath('copixtest|testdefaultfr.tpl')); $this->assertPathEquals($this->defaultDir . 'copixtest/fr_FR/testdefaultfrfr.tpl', $tpl->getFilePath('copixtest|testdefaultfrfr.tpl')); $this->assertPathEquals($this->moduleDir . 'testmodule.tpl', $tpl->getFilePath('copixtest|testmodule.tpl')); $this->assertPathEquals($this->moduleDir . 'fr/testmodulefr.tpl', $tpl->getFilePath('copixtest|testmodulefr.tpl')); $this->assertPathEquals($this->moduleDir . 'fr_FR/testmodulefrfr.tpl', $tpl->getFilePath('copixtest|testmodulefrfr.tpl')); $this->assertPathEquals($this->defaultDir . 'copixtest/testmoduleoverload.tpl', $tpl->getFilePath('copixtest|testmoduleoverload.tpl')); }