summaryrefslogtreecommitdiff
path: root/mod.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-06-07 18:52:40 +1000
committerSavetheinternet <savetheinternet@tinyboard.org>2011-06-07 18:52:40 +1000
commitcec63231cfbe134cd917a8c3be4b0c8f7af1d072 (patch)
tree41f4f8d47b62a26fbde84bde34e315d75c3d2ca0 /mod.php
parent517167ea6f72ad7ed060e0531dec341aac3d78f9 (diff)
theme install functions
Diffstat (limited to 'mod.php')
-rw-r--r--mod.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/mod.php b/mod.php
index a2ebff26..4159ed84 100644
--- a/mod.php
+++ b/mod.php
@@ -360,13 +360,21 @@
$query->bindValue(':theme', $_theme);
$query->execute() or error(db_error($query));
+ $body = '';
+ if(isset($theme['install_callback'])) {
+ $ret = $theme['install_callback']($theme['config']);
+ if($ret && !empty($ret))
+ $body .= '<div style="border:1px dashed maroon;padding:20px;margin:auto;max-width:800px">' . $ret . '</div>';
+ }
+ $body .= '<p style="text-align:center">Successfully installed and built theme.</p>';
+
// Build themes
rebuildThemes('all');
echo Element('page.html', Array(
'config'=>$config,
'title'=>'Installed "' . htmlentities($theme['name']) . '"',
- 'body'=>'<p style="text-align:center">Successfully installed and built theme.</p>',
+ 'body'=>$body,
'mod'=>true
)
);
@@ -382,7 +390,10 @@
switch($c['type']) {
case 'text':
default:
- $body .= '<input type="text" name="' . $c['name'] . '" />';
+ $body .= '<input type="text" name="' . htmlentities($c['name']) . '" ' .
+ (isset($c['default']) ? 'value="' . htmlentities($c['default']) . '" ' :'') .
+ (isset($c['size']) ? 'size="' . (int)$c['size'] . '" ' :'') .
+ '/>';
}
if(isset($c['comment']))
$body .= ' <span class="unimportant">' . $c['comment'] . '</span>';