Index: trunk/admin/include/themes.class.php =================================================================== --- trunk/admin/include/themes.class.php (revision 13168) +++ trunk/admin/include/themes.class.php (revision 13172) @@ -49,4 +49,6 @@ function perform_action($action, $theme_id) { + global $conf; + if (isset($this->db_themes_by_id[$theme_id])) { @@ -87,4 +89,10 @@ } + if ($this->fs_themes[$theme_id]['mobile'] and !empty($conf['mobile_theme'])) + { + array_push($errors, l10n('You can activate only one mobile theme.')); + break; + } + if (file_exists($file_to_include)) { @@ -106,4 +114,9 @@ ;'; pwg_query($query); + + if ($this->fs_themes[$theme_id]['mobile']) + { + conf_update_param('mobile_theme', $theme_id); + } } break; @@ -165,4 +178,9 @@ ;'; pwg_query($query); + + if ($this->fs_themes[$theme_id]['mobile']) + { + conf_update_param('mobile_theme', ''); + } break; @@ -326,4 +344,5 @@ 'description' => '', 'author' => '', + 'mobile' => false, ); $theme_data = implode( '', file($path.'/themeconf.inc.php') ); @@ -366,7 +385,11 @@ $theme['parent'] = $val[1]; } - if (preg_match('/["\']activable["\'].*?(true|false)/', $theme_data, $val)) + if (preg_match('/["\']activable["\'].*?(true|false)/i', $theme_data, $val)) { $theme['activable'] = get_boolean($val[1]); + } + if (preg_match('/["\']mobile["\'].*?(true|false)/i', $theme_data, $val)) + { + $theme['mobile'] = get_boolean($val[1]); } Index: trunk/admin/themes/default/template/themes_installed.tpl =================================================================== --- trunk/admin/themes/default/template/themes_installed.tpl (revision 13168) +++ trunk/admin/themes/default/template/themes_installed.tpl (revision 13172) @@ -18,5 +18,5 @@ {foreach from=$active_themes item=theme}