Zeile 584 | Zeile 584 |
---|
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
$inherited_themes = array();
| $inherited_themes = $theme_stylesheets = array();
|
if(count($inherited_load) > 0) { $query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
| if(count($inherited_load) > 0) { $query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
|
Zeile 592 | Zeile 592 |
---|
{ $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name']; }
|
{ $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name']; }
|
}
$theme_stylesheets = array();
| |
|
|
if(count($inherited_load) > 0) {
| |
$query = $db->simple_select("themestylesheets", "*", "tid IN (".implode(",", $inherited_load).")", array('order_by' => 'tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
| $query = $db->simple_select("themestylesheets", "*", "tid IN (".implode(",", $inherited_load).")", array('order_by' => 'tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
|
Zeile 647 | Zeile 642 |
---|
$filename = $theme_stylesheets[$filename]['name'];
$xml .= "\t\t<stylesheet name=\"{$filename}\" {$attachedto}version=\"{$mybb->version_code}\"><![CDATA[{$stylesheet}]]>\r\n\t\t</stylesheet>\r\n";
|
$filename = $theme_stylesheets[$filename]['name'];
$xml .= "\t\t<stylesheet name=\"{$filename}\" {$attachedto}version=\"{$mybb->version_code}\"><![CDATA[{$stylesheet}]]>\r\n\t\t</stylesheet>\r\n";
|
}
| }
|
$xml .= "\t</stylesheets>\r\n";
if($mybb->input['include_templates'] != 0)
| $xml .= "\t</stylesheets>\r\n";
if($mybb->input['include_templates'] != 0)
|
Zeile 665 | Zeile 660 |
---|
$xml .= "</theme>";
$plugins->run_hooks("admin_style_themes_export_commit");
|
$xml .= "</theme>";
$plugins->run_hooks("admin_style_themes_export_commit");
|
|
|
// Log admin action log_admin_action($theme['tid'], $theme['name']);
| // Log admin action log_admin_action($theme['tid'], $theme['name']);
|
Zeile 682 | Zeile 677 |
---|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}");
$page->add_breadcrumb_item($lang->export_theme, "index.php?module=style-themes&action=export");
|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}");
$page->add_breadcrumb_item($lang->export_theme, "index.php?module=style-themes&action=export");
|
|
|
$page->output_header("{$lang->themes} - {$lang->export_theme}");
|
$page->output_header("{$lang->themes} - {$lang->export_theme}");
|
|
|
$sub_tabs['edit_stylesheets'] = array( 'title' => $lang->edit_stylesheets, 'link' => "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}",
|
$sub_tabs['edit_stylesheets'] = array( 'title' => $lang->edit_stylesheets, 'link' => "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}",
|
);
| );
|
$sub_tabs['add_stylesheet'] = array( 'title' => $lang->add_stylesheet,
| $sub_tabs['add_stylesheet'] = array( 'title' => $lang->add_stylesheet,
|
Zeile 699 | Zeile 694 |
---|
'title' => $lang->export_theme, 'link' => "index.php?module=style-themes&action=export&tid={$mybb->input['tid']}", 'description' => $lang->export_theme_desc
|
'title' => $lang->export_theme, 'link' => "index.php?module=style-themes&action=export&tid={$mybb->input['tid']}", 'description' => $lang->export_theme_desc
|
);
| );
|
$sub_tabs['duplicate_theme'] = array( 'title' => $lang->duplicate_theme,
| $sub_tabs['duplicate_theme'] = array( 'title' => $lang->duplicate_theme,
|
Zeile 713 | Zeile 708 |
---|
{ $page->output_inline_error($errors); }
|
{ $page->output_inline_error($errors); }
|
|
|
$form = new Form("index.php?module=style-themes&action=export", "post"); echo $form->generate_hidden_field("tid", $theme['tid']);
|
$form = new Form("index.php?module=style-themes&action=export", "post"); echo $form->generate_hidden_field("tid", $theme['tid']);
|
|
|
$form_container = new FormContainer($lang->export_theme.": ".htmlspecialchars_uni($theme['name'])); $form_container->output_row($lang->include_custom_only, $lang->include_custom_only_desc, $form->generate_yes_no_radio('custom_theme', $mybb->input['custom_theme']), 'custom_theme'); $form_container->output_row($lang->include_templates, $lang->include_templates_desc, $form->generate_yes_no_radio('include_templates', $mybb->input['include_templates']), 'include_templates');
|
$form_container = new FormContainer($lang->export_theme.": ".htmlspecialchars_uni($theme['name'])); $form_container->output_row($lang->include_custom_only, $lang->include_custom_only_desc, $form->generate_yes_no_radio('custom_theme', $mybb->input['custom_theme']), 'custom_theme'); $form_container->output_row($lang->include_templates, $lang->include_templates_desc, $form->generate_yes_no_radio('include_templates', $mybb->input['include_templates']), 'include_templates');
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->export_theme);
| $form_container->end();
|
|
|
$form->output_submit_wrapper($buttons);
| $buttons[] = $form->generate_submit_button($lang->export_theme);
|
|
|
$form->end();
| $form->output_submit_wrapper($buttons);
$form->end();
|
$page->output_footer(); }
if($mybb->input['action'] == "duplicate")
|
$page->output_footer(); }
if($mybb->input['action'] == "duplicate")
|
{
| {
|
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'"); $theme = $db->fetch_array($query);
| $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'"); $theme = $db->fetch_array($query);
|
Zeile 1003 | Zeile 998 |
---|
if($inherited_stylesheets == true) { flash_message($lang->error_inheriting_stylesheets, 'error');
|
if($inherited_stylesheets == true) { flash_message($lang->error_inheriting_stylesheets, 'error');
|
admin_redirect("index.php?module=style-themes"); }
| admin_redirect("index.php?module=style-themes"); }
|
$query = $db->simple_select("themestylesheets", "cachefile", "tid='{$theme['tid']}'"); while($cachefile = $db->fetch_array($query)) {
| $query = $db->simple_select("themestylesheets", "cachefile", "tid='{$theme['tid']}'"); while($cachefile = $db->fetch_array($query)) {
|
Zeile 1070 | Zeile 1065 |
---|
}
$plugins->run_hooks("admin_style_themes_edit");
|
}
$plugins->run_hooks("admin_style_themes_edit");
|
|
|
if($mybb->request_method == "post" && !$mybb->input['do']) { $properties = array(
| if($mybb->request_method == "post" && !$mybb->input['do']) { $properties = array(
|
Zeile 1086 | Zeile 1081 |
---|
if($properties['color'] == 'none') { unset($properties['color']);
|
if($properties['color'] == 'none') { unset($properties['color']);
|
}
| }
|
if($mybb->input['colors']) { $colors = explode("\n", $mybb->input['colors']);
| if($mybb->input['colors']) { $colors = explode("\n", $mybb->input['colors']);
|
Zeile 1096 | Zeile 1091 |
---|
{ $color = trim($color); if(preg_match('/^[a-z0-9]+={1}[a-z0-9]+$/i', $color))
|
{ $color = trim($color); if(preg_match('/^[a-z0-9]+={1}[a-z0-9]+$/i', $color))
|
{
| {
|
$color = explode("=", $color); $properties['colors'][$color[0]] = $color[1]; } else { $errors[] = $lang->sprintf($lang->error_invalid_color, $color);
|
$color = explode("=", $color); $properties['colors'][$color[0]] = $color[1]; } else { $errors[] = $lang->sprintf($lang->error_invalid_color, $color);
|
} }
| } }
|
}
if($properties['templateset'] <= 0)
| }
if($properties['templateset'] <= 0)
|
Zeile 1120 | Zeile 1115 |
---|
else { $errors[] = $lang->error_no_display_order;
|
else { $errors[] = $lang->error_no_display_order;
|
}
| }
|
$allowedgroups = array(); if(is_array($mybb->input['allowedgroups']))
|
$allowedgroups = array(); if(is_array($mybb->input['allowedgroups']))
|
{
| {
|
foreach($mybb->input['allowedgroups'] as $gid) { if($gid == "all")
| foreach($mybb->input['allowedgroups'] as $gid) { if($gid == "all")
|
Zeile 1139 | Zeile 1134 |
---|
if(is_array($allowedgroups)) { $allowedgroups = implode(",", $allowedgroups);
|
if(is_array($allowedgroups)) { $allowedgroups = implode(",", $allowedgroups);
|
}
$update_array = array(
| }
$update_array = array(
|
'name' => $db->escape_string($mybb->input['name']), 'pid' => $mybb->get_input('pid', MyBB::INPUT_INT), 'allowedgroups' => $allowedgroups,
| 'name' => $db->escape_string($mybb->input['name']), 'pid' => $mybb->get_input('pid', MyBB::INPUT_INT), 'allowedgroups' => $allowedgroups,
|
Zeile 1169 | Zeile 1164 |
---|
$query = $db->simple_select("themes", "tid", "tid='".$update_array['pid']."'"); $parent_check = $db->fetch_field($query, "tid"); if(!$parent_check)
|
$query = $db->simple_select("themes", "tid", "tid='".$update_array['pid']."'"); $parent_check = $db->fetch_field($query, "tid"); if(!$parent_check)
|
{
| {
|
$errors[] = $lang->error_invalid_parent_theme;
|
$errors[] = $lang->error_invalid_parent_theme;
|
} }
| } }
|
if($properties['templateset'])
|
if($properties['templateset'])
|
{
| {
|
$query = $db->simple_select("templatesets", "sid", "sid='".$properties['templateset']."'"); $ts_check = $db->fetch_field($query, "sid"); if(!$ts_check)
| $query = $db->simple_select("templatesets", "sid", "sid='".$properties['templateset']."'"); $ts_check = $db->fetch_field($query, "sid"); if(!$ts_check)
|
Zeile 1183 | Zeile 1178 |
---|
} } if(!$properties['templateset'])
|
} } if(!$properties['templateset'])
|
{
| {
|
$errors[] = $lang->error_invalid_templateset; } if(!$properties['editortheme'] || !file_exists(MYBB_ROOT."jscripts/sceditor/editor_themes/".$properties['editortheme']) || is_dir(MYBB_ROOT."jscripts/sceditor/editor_themes/".$properties['editortheme']))
| $errors[] = $lang->error_invalid_templateset; } if(!$properties['editortheme'] || !file_exists(MYBB_ROOT."jscripts/sceditor/editor_themes/".$properties['editortheme']) || is_dir(MYBB_ROOT."jscripts/sceditor/editor_themes/".$properties['editortheme']))
|
Zeile 1197 | Zeile 1192 |
---|
$db->update_query("themes", $update_array, "tid='{$theme['tid']}'"); update_theme_stylesheet_list($theme['tid']);
|
$db->update_query("themes", $update_array, "tid='{$theme['tid']}'"); update_theme_stylesheet_list($theme['tid']);
|
|
|
if($theme['def'] == 1) { $cache->update_default_theme();
| if($theme['def'] == 1) { $cache->update_default_theme();
|
Zeile 1239 | Zeile 1234 |
---|
} } }
|
} } }
|
} }
| } }
|
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
$inherited_themes = array(); if(count($inherited_load) > 0) {
| $inherited_themes = $theme_stylesheets = array(); if(count($inherited_load) > 0) {
|
$query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")"); while($inherited_theme = $db->fetch_array($query)) { $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name']; }
|
$query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")"); while($inherited_theme = $db->fetch_array($query)) { $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name']; }
|
}
$theme_stylesheets = array();
| |
|
|
if(count($inherited_load) > 0) {
| |
$query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
| $query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
|
Zeile 1418 | Zeile 1408 |
---|
foreach($inherited_ary as $tid => $file) { if(isset($applied_to_count) && $count == $applied_to_count && $count != 0)
|
foreach($inherited_ary as $tid => $file) { if(isset($applied_to_count) && $count == $applied_to_count && $count != 0)
|
{ $sep = " {$lang->and} "; }
| { $sep = " {$lang->and} "; }
|
$inherited .= $sep.$file; $sep = $lang->comma;
| $inherited .= $sep.$file; $sep = $lang->comma;
|
Zeile 1433 | Zeile 1423 |
---|
if(is_array($style['applied_to']) && (!isset($style['applied_to']['global']) || $style['applied_to']['global'][0] != "global")) { $attached_to = '';
|
if(is_array($style['applied_to']) && (!isset($style['applied_to']['global']) || $style['applied_to']['global'][0] != "global")) { $attached_to = '';
|
|
|
$applied_to_count = count($style['applied_to']); $count = 0; $sep = " ";
| $applied_to_count = count($style['applied_to']); $count = 0; $sep = " ";
|
Zeile 1445 | Zeile 1435 |
---|
{ $properties['colors'] = array(); }
|
{ $properties['colors'] = array(); }
|
|
|
foreach($style['applied_to'] as $name => $actions) { if(!$name)
|
foreach($style['applied_to'] as $name => $actions) { if(!$name)
|
{ continue; }
| { continue; }
|
if(array_key_exists($name, $properties['colors'])) { $colors[] = $properties['colors'][$name];
| if(array_key_exists($name, $properties['colors'])) { $colors[] = $properties['colors'][$name];
|
Zeile 1466 | Zeile 1456 |
---|
// It's a file: ++$count;
|
// It's a file: ++$count;
|
| $name = htmlspecialchars_uni($name);
|
if($actions[0] != "global") {
|
if($actions[0] != "global") {
|
| $actions = array_map('htmlspecialchars_uni', $actions);
|
$name = "{$name} ({$lang->actions}: ".implode(',', $actions).")"; }
| $name = "{$name} ({$lang->actions}: ".implode(',', $actions).")"; }
|
Zeile 1690 | Zeile 1684 |
---|
if(get_extension($mybb->input['name']) != "css") { // Does not end with '.css'
|
if(get_extension($mybb->input['name']) != "css") { // Does not end with '.css'
|
$errors[] = $lang->sprintf($lang->error_missing_stylesheet_extension, $mybb->input['name']);
| $errors[] = $lang->sprintf( $lang->error_missing_stylesheet_extension, htmlspecialchars_uni($mybb->input['name']) );
|
}
if(!$errors)
| }
if(!$errors)
|
Zeile 1998 | Zeile 1995 |
---|
echo <<<EOF
|
echo <<<EOF
|
<script type="text/javascript" src="./jscripts/theme_properties.js"></script>
| <script type="text/javascript" src="./jscripts/theme_properties.js?ver=1820"></script>
|
<script type="text/javascript"> <!--- themeProperties.setup('{$count}');
| <script type="text/javascript"> <!--- themeProperties.setup('{$count}');
|
Zeile 2263 | Zeile 2260 |
---|
echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></script>'; echo '<script type="text/javascript">
|
echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></script>'; echo '<script type="text/javascript">
|
$(document).ready(function() {
| $(function() {
|
//<![CDATA[ ThemeSelector.init("./index.php?module=style-themes&action=xmlhttp_stylesheet", "./index.php?module=style-themes&action=edit_stylesheet", $("#selector"), $("#stylesheet"), "'.htmlspecialchars_uni($mybb->input['file']).'", $("#selector_form"), "'.$mybb->input['tid'].'"); lang.saving = "'.$lang->saving.'";
| //<![CDATA[ ThemeSelector.init("./index.php?module=style-themes&action=xmlhttp_stylesheet", "./index.php?module=style-themes&action=edit_stylesheet", $("#selector"), $("#stylesheet"), "'.htmlspecialchars_uni($mybb->input['file']).'", $("#selector_form"), "'.$mybb->input['tid'].'"); lang.saving = "'.$lang->saving.'";
|
Zeile 2906 | Zeile 2903 |
---|
}
echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></script>';
|
}
echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></script>';
|
echo '<script type="text/javascript" src="./jscripts/theme_properties.js"></script>';
| echo '<script type="text/javascript" src="./jscripts/theme_properties.js?ver=1820"></script>';
|
echo '<script type="text/javascript"> $(function() { //<![CDATA[
| echo '<script type="text/javascript"> $(function() { //<![CDATA[
|