| |
| 1 |
<?php |
| 2 |
require_once './include/common.inc.php'; |
| 3 |
require_once './include/admin.inc.php'; |
| 4 |
checkcreator(); |
| 5 |
!isset($get_action) && $get_action = ''; |
| 6 |
if($get_action == '') { |
| 7 |
$paths = readpathtoarray(AK_ROOT.'/themes', 1); |
| 8 |
$themes = ''; |
| 9 |
foreach($paths as $path) { |
| 10 |
if(substr($path, 0, 1) == '.' || !is_dir(AK_ROOT.'/themes/'.$path)) continue; |
| 11 |
$readme = readfromfile(AK_ROOT.'/themes/'.$path.'/readme.txt'); |
| 12 |
$readme = nl2br($readme); |
| 13 |
$themes .= "<tr><td width=\"50\" valign=\"top\">{$path}</td><td valign=\"top\"><b>{$lan['readme']}</b><br>{$readme}</td><td width=\"50\" align=\"center\" valign=\"middle\"><a href=\"theme.php?action=import&theme={$path}\">".$lan['install']."</a></td><td width=\"100\" align=\"center\" valign=\"middle\"><a href=\"theme.php?action=import&theme={$path}&sql=1\">".$lan['installandimportdata']."</a></td></tr>"; |
| 14 |
} |
| 15 |
$smarty->assign('themes', $themes); |
| 16 |
displaytemplate('admincp_themes.htm'); |
| 17 |
} elseif($get_action == 'import') { |
| 18 |
if(isset($get_theme)) $theme = $get_theme; |
| 19 |
if($theme == '') exit('error'); |
| 20 |
installtheme($theme, isset($get_sql)); |
| 21 |
adminmsg($lan['themeinstallsuccess'], 'http://www.akcms.com/themes/'.$theme.'.htm'); |
| 22 |
} |
| 23 |
aexit(); |
| 24 |
?> |
| |