22,12 → 22,24 |
|
class Theme { |
|
function getThemesList() { |
$result = array(); |
$handler = opendir('./themes/styles/'); |
function getThemesList($mode) { // $mode=(style)(icon) |
switch ($mode){ |
case 'style': |
$dr='styles'; |
$ief='style.css'; |
break; |
case 'icon': |
$dr='icons'; |
$ief='edit.png'; |
break; |
default: |
die('variable $mode must be "style" or "icon" !'); |
} |
$result = array(); |
$handler = opendir('./themes/'.$dr.'/'); |
while ($file = readdir($handler)) { |
if ($file != '.' && $file != '..' && $file != '.svn') // && is_dir($file) |
if (file_exists('./themes/styles/'.$file.'/style.css')) $result[] = $file; |
if (file_exists('./themes/'.$dr.'/'.$file.'/'.$ief)) $result[] = $file; |
} |
closedir($handler); |
return($result); |
38,9 → 50,11 |
if (!file_exists('./themes/styles/'.$result.'/style.css')) $result='default'; |
return $result; |
} |
|
function setTheme($newtheme,$dblink){ |
$req =& $dblink->query("UPDATE settings SET optvalue='$newtheme' WHERE opt='theme'"); |
} |
function setIcon($newtheme,$dblink){ |
$req =& $dblink->query("UPDATE settings SET optvalue='$newtheme' WHERE opt='icons'"); |
} |
} |
?> |