Редакция 238 | Редакция 245 | К новейшей редакции | Весь файл | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 238 | Редакция 244 | ||
---|---|---|---|
Строка 25... | Строка 25... | ||
25 | function getThemesList() { |
25 | function getThemesList() { |
26 | $result = array(); |
26 | $result = array(); |
27 | $handler = opendir('./themes/'); |
27 | $handler = opendir('./themes/'); |
28 | while ($file = readdir($handler)) { |
28 | while ($file = readdir($handler)) { |
29 | if ($file != '.' && $file != '..' && $file != '.svn') // && is_dir($file) |
29 | if ($file != '.' && $file != '..' && $file != '.svn') // && is_dir($file) |
30 | if (file_exists('./themes/'.$file.'/style.css')) $result[] = $file; |
30 | if (file_exists('./themes/styles/'.$file.'/style.css')) $result[] = $file; |
31 | }
|
31 | }
|
32 | closedir($handler); |
32 | closedir($handler); |
33 | return($result); |
33 | return($result); |
34 | }
|
34 | }
|
35 | 35 | ||
36 | function getThemeName($link,$dblink) { //TODO remove links |
36 | function getThemeName($link,$dblink) { //TODO remove links |
37 | $result=$link->getSetting('theme',$dblink); |
37 | $result=$link->getSetting('theme',$dblink); |
38 | if (!file_exists('./themes/'.$result.'/style.css')) $result='default'; |
38 | if (!file_exists('./themes/styles/'.$result.'/style.css')) $result='default'; |
39 | return $result; |
39 | return $result; |
40 | }
|
40 | }
|
41 | 41 | ||
42 | function setTheme($newtheme,$dblink){ |
42 | function setTheme($newtheme,$dblink){ |
43 | $req =& $dblink->query("UPDATE settings SET optvalue='$newtheme' WHERE opt='theme'"); |
43 | $req =& $dblink->query("UPDATE settings SET optvalue='$newtheme' WHERE opt='theme'"); |