// Automatically add themes available in /themes
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17691 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
7b4e94603a
commit
34b062074b
1 file changed
+12
@@ -357,6 +357,18 @@ class AdminThemesControllerCore extends AdminController
|
|||||||
|
|
||||||
public function initContent()
|
public function initContent()
|
||||||
{
|
{
|
||||||
|
$themes = array();
|
||||||
|
foreach (Theme::getThemes() as $theme)
|
||||||
|
$themes[] = $theme->directory;
|
||||||
|
|
||||||
|
foreach (scandir(_PS_ALL_THEMES_DIR_) as $theme_dir)
|
||||||
|
if ($theme_dir[0] != '.' && Validate::isDirName($theme_dir) && is_dir(_PS_ALL_THEMES_DIR_.$theme_dir) && file_exists(_PS_ALL_THEMES_DIR_.$theme_dir.'/preview.jpg') && !in_array($theme_dir, $themes))
|
||||||
|
{
|
||||||
|
$theme = new Theme();
|
||||||
|
$theme->name = $theme->directory = $theme_dir;
|
||||||
|
$theme->add();
|
||||||
|
}
|
||||||
|
|
||||||
$content = '';
|
$content = '';
|
||||||
if (file_exists(_PS_IMG_DIR_.'logo.jpg'))
|
if (file_exists(_PS_IMG_DIR_.'logo.jpg'))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user