|
@ -317,17 +317,17 @@ |
|
|
echo Element('page.html', Array( |
|
|
echo Element('page.html', Array( |
|
|
'config'=>$config, |
|
|
'config'=>$config, |
|
|
'title'=>'No theme', |
|
|
'title'=>'No theme', |
|
|
'body'=>'<p style="text-align:center">Successfully stopped using any themes. You\'ll have to create a homepage manually if you want one.</p>', |
|
|
'body'=>'<p style="text-align:center">Successfully stopped using all themes.</p>', |
|
|
'mod'=>true |
|
|
'mod'=>true |
|
|
) |
|
|
) |
|
|
); |
|
|
); |
|
|
} elseif(preg_match('/^\/themes(\/(\w+))?$/', $query, $match)) { |
|
|
} elseif(preg_match('/^\/themes(\/(\w+))?$/', $query, $match)) { |
|
|
if($mod['type'] < $config['mod']['themes']) error($config['error']['noaccess']); |
|
|
if($mod['type'] < $config['mod']['themes']) error($config['error']['noaccess']); |
|
|
|
|
|
|
|
|
if(!is_dir($config['dir']['homepage'])) |
|
|
if(!is_dir($config['dir']['themes'])) |
|
|
error('Homepage directory doesn\'t exist!'); |
|
|
error('Themes directory doesn\'t exist!'); |
|
|
if(!$dir = opendir($config['dir']['homepage'])) |
|
|
if(!$dir = opendir($config['dir']['themes'])) |
|
|
error('Cannot open homepage directory; check permissions.'); |
|
|
error('Cannot open themes directory; check permissions.'); |
|
|
|
|
|
|
|
|
if(isset($match[2])) { |
|
|
if(isset($match[2])) { |
|
|
$_theme = &$match[2]; |
|
|
$_theme = &$match[2]; |
|
@ -406,7 +406,7 @@ |
|
|
// Scan directory for themes |
|
|
// Scan directory for themes |
|
|
$themes = Array(); |
|
|
$themes = Array(); |
|
|
while($file = readdir($dir)) { |
|
|
while($file = readdir($dir)) { |
|
|
if($file[0] != '.' && is_dir($config['dir']['homepage'] . '/' . $file)) { |
|
|
if($file[0] != '.' && is_dir($config['dir']['themes'] . '/' . $file)) { |
|
|
$themes[] = $file; |
|
|
$themes[] = $file; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -436,7 +436,7 @@ |
|
|
'</tr>' . |
|
|
'</tr>' . |
|
|
'<tr>' . |
|
|
'<tr>' . |
|
|
'<th class="minimal">Thumbnail</th>' . |
|
|
'<th class="minimal">Thumbnail</th>' . |
|
|
'<td><img style="float:none;margin:4px" src="' . $config['dir']['homepage_uri'] . '/' . $_theme . '/thumb.png" /></td>' . |
|
|
'<td><img style="float:none;margin:4px" src="' . $config['dir']['themes_uri'] . '/' . $_theme . '/thumb.png" /></td>' . |
|
|
'</tr>' . |
|
|
'</tr>' . |
|
|
'<tr>' . |
|
|
'<tr>' . |
|
|
'<th class="minimal">Actions</th>' . |
|
|
'<th class="minimal">Actions</th>' . |
|
|