Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: themes.php 5117 2010-07-26 04:09:21Z RyanGordon $
| * $Id$
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 36 | Zeile 36 |
---|
$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
if(!$theme['tid'])
| if(!$theme['tid'] || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error');
|
{ flash_message($lang->error_invalid_theme, 'error');
|
admin_redirect("index.php?module=style-themes"); }
| admin_redirect("index.php?module=style-themes"); }
|
$parent_list = make_parent_theme_list($theme['tid']); $parent_list = implode(',', $parent_list); if(!$parent_list)
|
$parent_list = make_parent_theme_list($theme['tid']); $parent_list = implode(',', $parent_list); if(!$parent_list)
|
{
| {
|
$parent_list = 1; }
| $parent_list = 1; }
|
Zeile 74 | Zeile 74 |
---|
$table->construct_cell("<strong>{$lang->extra_css_atribs}</strong><br /><div style=\"align: center;\">".$form->generate_text_area('css_bits[extra]', $properties['extra'], array('id' => 'css_bits[extra]', 'style' => 'width: 98%;', 'rows' => '19'))."</div>", array('rowspan' => 8)); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;'));
|
$table->construct_cell("<strong>{$lang->extra_css_atribs}</strong><br /><div style=\"align: center;\">".$form->generate_text_area('css_bits[extra]', $properties['extra'], array('id' => 'css_bits[extra]', 'style' => 'width: 98%;', 'rows' => '19'))."</div>", array('rowspan' => 8)); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;'));
|
$table->construct_row();
| $table->construct_row();
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;'));
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;'));
|
$table->construct_row();
| $table->construct_row();
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_family]', $properties['font-family'], array('id' => 'css_bits[font_family]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_family}</strong></div>", array('style' => 'width: 40%;'));
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_family]', $properties['font-family'], array('id' => 'css_bits[font_family]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_family}</strong></div>", array('style' => 'width: 40%;'));
|
$table->construct_row();
| $table->construct_row();
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_style]', $properties['font-style'], array('id' => 'css_bits[font_style]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_style}</strong></div>", array('style' => 'width: 40%;'));
| $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_style]', $properties['font-style'], array('id' => 'css_bits[font_style]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_style}</strong></div>", array('style' => 'width: 40%;'));
|
Zeile 112 | Zeile 112 |
---|
'title' => $lang->import_a_theme, 'link' => "index.php?module=style-themes&action=import", 'description' => $lang->import_a_theme_desc
|
'title' => $lang->import_a_theme, 'link' => "index.php?module=style-themes&action=import", 'description' => $lang->import_a_theme_desc
|
);
| );
|
$sub_tabs['browse_themes'] = array( 'title' => $lang->browse_themes, 'link' => "index.php?module=style-themes&action=browse",
| $sub_tabs['browse_themes'] = array( 'title' => $lang->browse_themes, 'link' => "index.php?module=style-themes&action=browse",
|
Zeile 178 | Zeile 178 |
---|
$parser = new XMLParser($contents); $tree = $parser->get_tree();
|
$parser = new XMLParser($contents); $tree = $parser->get_tree();
|
if(!array_key_exists("results", $tree))
| if(!is_array($tree) || !isset($tree['results']))
|
{ $page->output_inline_error($lang->error_communication_problem); $page->output_footer();
| { $page->output_inline_error($lang->error_communication_problem); $page->output_footer();
|
Zeile 192 | Zeile 192 |
---|
$only_theme = $tree['results']['result']; unset($tree['results']['result']); $tree['results']['result'][0] = $only_theme;
|
$only_theme = $tree['results']['result']; unset($tree['results']['result']); $tree['results']['result'][0] = $only_theme;
|
}
| }
|
foreach($tree['results']['result'] as $result) {
| foreach($tree['results']['result'] as $result) {
|
Zeile 201 | Zeile 201 |
---|
$table->construct_cell("<strong><a href=\"http://mods.mybb.com/view/{$result['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center")); $table->construct_row(); }
|
$table->construct_cell("<strong><a href=\"http://mods.mybb.com/view/{$result['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center")); $table->construct_row(); }
|
}
| }
|
if($table->num_rows() == 0) {
| if($table->num_rows() == 0) {
|
Zeile 231 | Zeile 231 |
---|
{ search.focus(); return false;
|
{ search.focus(); return false;
|
}
| }
|
}
var search = document.getElementById('search_keywords');
| }
var search = document.getElementById('search_keywords');
|
Zeile 349 | Zeile 349 |
---|
{ // UPLOAD_ERR_NO_FILE $errors[] = $lang->error_uploadfailed_php4;
|
{ // UPLOAD_ERR_NO_FILE $errors[] = $lang->error_uploadfailed_php4;
|
}
| }
|
if(!$errors) {
| if(!$errors) {
|
Zeile 363 | Zeile 363 |
---|
$theme_id = import_theme_xml($contents, $options); if($theme_id > -1)
|
$theme_id = import_theme_xml($contents, $options); if($theme_id > -1)
|
{
| {
|
$plugins->run_hooks("admin_style_themes_import_commit"); // Log admin action
| $plugins->run_hooks("admin_style_themes_import_commit"); // Log admin action
|
Zeile 371 | Zeile 371 |
---|
flash_message($lang->success_imported_theme, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid=".$theme_id);
|
flash_message($lang->success_imported_theme, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid=".$theme_id);
|
}
| }
|
else { switch($theme_id)
| else { switch($theme_id)
|
Zeile 385 | Zeile 385 |
---|
case -3: $errors[] = $lang->error_theme_already_exists; break;
|
case -3: $errors[] = $lang->error_theme_already_exists; break;
|
} }
| case -4: $errors[] = $lang->error_theme_security_problem; } }
|
} } }
| } } }
|
Zeile 535 | Zeile 537 |
---|
foreach($action_stylesheet as $action => $style) { foreach($style as $stylesheet)
|
foreach($action_stylesheet as $action => $style) { foreach($style as $stylesheet)
|
{
| {
|
$stylesheets[$stylesheet]['applied_to'][$file][] = $action; if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet, array_keys($file_stylesheets['inherited'][$file."_".$action]))) {
| $stylesheets[$stylesheet]['applied_to'][$file][] = $action; if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet, array_keys($file_stylesheets['inherited'][$file."_".$action]))) {
|
Zeile 609 | Zeile 611 |
---|
if($attachedto) { $attachedto = "attachedto=\"{$attachedto}\" ";
|
if($attachedto) { $attachedto = "attachedto=\"{$attachedto}\" ";
|
}
| }
|
$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";
| } $xml .= "\t</stylesheets>\r\n";
|
Zeile 633 | Zeile 635 |
---|
$plugins->run_hooks("admin_style_themes_export_commit"); // Log admin action
|
$plugins->run_hooks("admin_style_themes_export_commit"); // Log admin action
|
log_admin_action($theme['tid'], $theme['name']);
| log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
|
$theme['name'] = rawurlencode($theme['name']); header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml"); header("Content-type: application/octet-stream");
| $theme['name'] = rawurlencode($theme['name']); header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml"); header("Content-type: application/octet-stream");
|
Zeile 648 | Zeile 650 |
---|
$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}"); $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, 'link' => "index.php?module=style-themes&action=add_stylesheet&tid={$mybb->input['tid']}", ); $sub_tabs['export_theme'] = array( 'title' => $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['add_stylesheet'] = array( 'title' => $lang->add_stylesheet, 'link' => "index.php?module=style-themes&action=add_stylesheet&tid={$mybb->input['tid']}", ); $sub_tabs['export_theme'] = array( 'title' => $lang->export_theme,
|
'link' => "index.php?module=style-themes&action=export&tid={$mybb->input['tid']}", 'description' => $lang->export_theme_desc );
| 'link' => "index.php?module=style-themes&action=export&tid={$mybb->input['tid']}", 'description' => $lang->export_theme_desc );
|
Zeile 682 | Zeile 684 |
---|
$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();
|
$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->output_submit_wrapper($buttons);
| $buttons[] = $form->generate_submit_button($lang->export_theme);
$form->output_submit_wrapper($buttons);
|
Zeile 699 | Zeile 701 |
---|
if($mybb->request_method == "post") { if(!$mybb->input['name'])
|
if($mybb->request_method == "post") { if(!$mybb->input['name'])
|
{ $errors[] = $lang->error_missing_name; }
| { $errors[] = $lang->error_missing_name; }
|
if(!$errors) { $tid = build_new_theme($mybb->input['name'], null, $mybb->input['tid']);
|
if(!$errors) { $tid = build_new_theme($mybb->input['name'], null, $mybb->input['tid']);
|
|
|
$plugins->run_hooks("admin_style_themes_add_commit"); // Log admin action
|
$plugins->run_hooks("admin_style_themes_add_commit"); // Log admin action
|
log_admin_action($mybb->input['name'], $tid);
| log_admin_action(htmlspecialchars_uni($mybb->input['name']), $tid);
|
flash_message($lang->success_theme_created, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid=".$tid);
| flash_message($lang->success_theme_created, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid=".$tid);
|
Zeile 721 | Zeile 723 |
---|
while($theme = $db->fetch_array($query)) { $themes[$theme['tid']] = $theme['name'];
|
while($theme = $db->fetch_array($query)) { $themes[$theme['tid']] = $theme['name'];
|
}
| }
|
$page->add_breadcrumb_item($lang->create_new_theme, "index.php?module=style-themes&action=add"); $page->output_header("{$lang->themes} - {$lang->create_new_theme}");
| $page->add_breadcrumb_item($lang->create_new_theme, "index.php?module=style-themes&action=add"); $page->output_header("{$lang->themes} - {$lang->create_new_theme}");
|
Zeile 741 | Zeile 743 |
---|
$form_container->output_row($lang->parent_theme, $lang->parent_theme_desc, $form->generate_select_box('tid', $themes, $mybb->input['tid'], array('id' => 'tid')), 'tid'); $form_container->end();
|
$form_container->output_row($lang->parent_theme, $lang->parent_theme_desc, $form->generate_select_box('tid', $themes, $mybb->input['tid'], array('id' => 'tid')), 'tid'); $form_container->end();
|
|
|
$buttons[] = $form->generate_submit_button($lang->create_new_theme);
$form->output_submit_wrapper($buttons);
| $buttons[] = $form->generate_submit_button($lang->create_new_theme);
$form->output_submit_wrapper($buttons);
|
Zeile 819 | Zeile 821 |
---|
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html"); $db->delete_query("themestylesheets", "tid='{$theme['tid']}'");
|
@unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html"); $db->delete_query("themestylesheets", "tid='{$theme['tid']}'");
|
|
|
// Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid']); $db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");
|
// Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid']); $db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");
|
|
|
@rmdir(MYBB_ROOT."cache/themes/theme{$theme['tid']}/"); $children = make_child_theme_list($theme['tid']);
| @rmdir(MYBB_ROOT."cache/themes/theme{$theme['tid']}/"); $children = make_child_theme_list($theme['tid']);
|
Zeile 833 | Zeile 835 |
---|
$db->update_query("themes", array('pid' => $theme['pid']), "tid='{$child_tid}'"); $db->delete_query("themes", "tid='{$theme['tid']}'", 1);
|
$db->update_query("themes", array('pid' => $theme['pid']), "tid='{$child_tid}'"); $db->delete_query("themes", "tid='{$theme['tid']}'", 1);
|
|
|
$plugins->run_hooks("admin_style_themes_delete_commit"); // Log admin action
|
$plugins->run_hooks("admin_style_themes_delete_commit"); // Log admin action
|
log_admin_action($theme['tid'], $theme['name']);
| log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
|
flash_message($lang->success_theme_deleted, 'success'); admin_redirect("index.php?module=style-themes");
| flash_message($lang->success_theme_deleted, 'success'); admin_redirect("index.php?module=style-themes");
|
Zeile 856 | Zeile 858 |
---|
$theme = $db->fetch_array($query); // Does the theme not exist?
|
$theme = $db->fetch_array($query); // Does the theme not exist?
|
if(!$theme['tid'])
| if(!$theme['tid'] || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 944 | Zeile 946 |
---|
$plugins->run_hooks("admin_style_themes_edit_commit"); // Log admin action
|
$plugins->run_hooks("admin_style_themes_edit_commit"); // Log admin action
|
log_admin_action($theme['tid'], $theme['name']);
| log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
|
flash_message($lang->success_theme_properties_updated, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
| flash_message($lang->success_theme_properties_updated, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
|
Zeile 973 | Zeile 975 |
---|
if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet, array_keys($file_stylesheets['inherited'][$file."_".$action]))) { $stylesheets[$stylesheet]['inherited'] = $file_stylesheets['inherited'][$file."_".$action];
|
if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet, array_keys($file_stylesheets['inherited'][$file."_".$action]))) { $stylesheets[$stylesheet]['inherited'] = $file_stylesheets['inherited'][$file."_".$action];
|
foreach($file_stylesheets['inherited'][$file."_".$action] as $value) { $inherited_load[] = $value; } }
| foreach($file_stylesheets['inherited'][$file."_".$action] as $value) { $inherited_load[] = $value; } }
|
} } }
| } } }
|
Zeile 1002 | Zeile 1004 |
---|
$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)) {
|
if(!$theme_stylesheets[$theme_stylesheet['cachefile']] && in_array($theme_stylesheet['tid'], $inherited_load))
| if(!isset($theme_stylesheets[$theme_stylesheet['cachefile']]) && in_array($theme_stylesheet['tid'], $inherited_load))
|
{ $theme_stylesheets[$theme_stylesheet['cachefile']] = $theme_stylesheet; }
| { $theme_stylesheets[$theme_stylesheet['cachefile']] = $theme_stylesheet; }
|
Zeile 1077 | Zeile 1079 |
---|
foreach($inherited_ary as $tid => $file) {
|
foreach($inherited_ary as $tid => $file) {
|
if($count == $applied_to_count && $count != 0)
| if(isset($applied_to_count) && $count == $applied_to_count && $count != 0)
|
{ $sep = ", {$lang->and} "; }
| { $sep = ", {$lang->and} "; }
|
Zeile 1090 | Zeile 1092 |
---|
$inherited .= ")</small>"; }
|
$inherited .= ")</small>"; }
|
if(is_array($style['applied_to']) && $style['applied_to']['global'][0] != "global")
| if(is_array($style['applied_to']) && (!isset($style['applied_to']['global']) || $style['applied_to']['global'][0] != "global"))
|
{ $attached_to = "<small>{$lang->attached_to}";
| { $attached_to = "<small>{$lang->attached_to}";
|
Zeile 1136 | Zeile 1138 |
---|
if($inherited == "") { $popup->add_item($lang->delete_revert, "index.php?module=style-themes&action=delete_stylesheet&file=".htmlspecialchars_uni($filename)."&tid={$theme['tid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_stylesheet_deletion}')");
|
if($inherited == "") { $popup->add_item($lang->delete_revert, "index.php?module=style-themes&action=delete_stylesheet&file=".htmlspecialchars_uni($filename)."&tid={$theme['tid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_stylesheet_deletion}')");
|
}
| }
|
$table->construct_cell("<strong><a href=\"index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($filename)."&tid={$theme['tid']}\">{$filename}</a></strong>{$inherited}<br />{$attached_to}"); $table->construct_cell($popup->fetch(), array("class" => "align_center"));
| $table->construct_cell("<strong><a href=\"index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($filename)."&tid={$theme['tid']}\">{$filename}</a></strong>{$inherited}<br />{$attached_to}"); $table->construct_cell($popup->fetch(), array("class" => "align_center"));
|
Zeile 1214 | Zeile 1216 |
---|
// Fetch the theme we want to edit this stylesheet in $query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
// Fetch the theme we want to edit this stylesheet in $query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
if(!$theme['tid'])
| if(!$theme['tid'] || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error');
|
{ flash_message($lang->error_invalid_theme, 'error');
|
admin_redirect("index.php?module=style-themes"); }
| admin_redirect("index.php?module=style-themes"); }
|
$parent_list = make_parent_theme_list($theme['tid']); $parent_list = implode(',', $parent_list); if(!$parent_list)
|
$parent_list = make_parent_theme_list($theme['tid']); $parent_list = implode(',', $parent_list); if(!$parent_list)
|
{
| {
|
$parent_list = 1; }
| $parent_list = 1; }
|
Zeile 1253 | Zeile 1255 |
---|
} foreach($action_stylesheet as $action => $style)
|
} foreach($action_stylesheet as $action => $style)
|
{
| {
|
foreach($style as $stylesheet2) { $stylesheets[$stylesheet2]['applied_to'][$file][] = $action;
| foreach($style as $stylesheet2) { $stylesheets[$stylesheet2]['applied_to'][$file][] = $action;
|
Zeile 1265 | Zeile 1267 |
---|
$inherited_load[] = $value; } }
|
$inherited_load[] = $value; } }
|
} }
| } }
|
} foreach($stylesheets as $file => $stylesheet2)
| } foreach($stylesheets as $file => $stylesheet2)
|
Zeile 1290 | Zeile 1292 |
---|
} $this_stylesheet = $stylesheets[$stylesheet['cachefile']];
|
} $this_stylesheet = $stylesheets[$stylesheet['cachefile']];
|
unset($stylesheets); if($mybb->request_method == "post")
| unset($stylesheets); if($mybb->request_method == "post")
|
{
|
{
|
if(!$mybb->input['name'])
| // Do we not have a name, or is it just an extension? if(!$mybb->input['name'] || $mybb->input['name'] == ".css")
|
{ $errors[] = $lang->error_missing_stylesheet_name;
|
{ $errors[] = $lang->error_missing_stylesheet_name;
|
}
| }
|
if(substr($mybb->input['name'], -4) != ".css") {
| if(substr($mybb->input['name'], -4) != ".css") {
|
Zeile 1312 | Zeile 1315 |
---|
{ $stylesheet['sid'] = copy_stylesheet_to_theme($stylesheet, $theme['tid']); }
|
{ $stylesheet['sid'] = copy_stylesheet_to_theme($stylesheet, $theme['tid']); }
|
|
|
$attached = array(); if($mybb->input['attach'] == 1)
| $attached = array(); if($mybb->input['attach'] == 1)
|
Zeile 1332 | Zeile 1335 |
---|
{ // We have custom actions for attached files $actions_list = $mybb->input['action_list_'.$attached_id];
|
{ // We have custom actions for attached files $actions_list = $mybb->input['action_list_'.$attached_id];
|
}
| }
|
if($actions_list) {
| if($actions_list) {
|
Zeile 1374 | Zeile 1377 |
---|
$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit"); // Log admin action
|
$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit"); // Log admin action
|
log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], $theme['name']);
| log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));
|
flash_message($lang->success_stylesheet_properties_updated, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
| flash_message($lang->success_stylesheet_properties_updated, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
|
Zeile 1450 | Zeile 1453 |
---|
$action_list = ""; if($actions[0] != "global")
|
$action_list = ""; if($actions[0] != "global")
|
{
| {
|
$action_list = implode(',', $actions); }
| $action_list = implode(',', $actions); }
|
Zeile 1464 | Zeile 1467 |
---|
$global_action_checked[2] = "checked=\"checked\""; $global_action_checked[1] = ""; }
|
$global_action_checked[2] = "checked=\"checked\""; $global_action_checked[1] = ""; }
|
|
|
$specific_file = "<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\"> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"0\" {$global_action_checked[1]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->globally}</label></dt> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"1\" {$global_action_checked[2]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->specific_actions}</label></dt>
| $specific_file = "<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\"> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"0\" {$global_action_checked[1]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->globally}</label></dt> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"1\" {$global_action_checked[2]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->specific_actions}</label></dt>
|
Zeile 1488 | Zeile 1491 |
---|
$check_actions .= "\n\tcheckAction('action_{$count}');"; ++$count;
|
$check_actions .= "\n\tcheckAction('action_{$count}');"; ++$count;
|
} }
| } }
|
else { $global_checked[1] = "checked=\"checked\"";
| else { $global_checked[1] = "checked=\"checked\"";
|
Zeile 1504 | Zeile 1507 |
---|
var checked = \'\'; $$(\'.\'+id+\'s_check\').each(function(e)
|
var checked = \'\'; $$(\'.\'+id+\'s_check\').each(function(e)
|
{
| {
|
if(e.checked == true) { checked = e.value; }
|
if(e.checked == true) { checked = e.value; }
|
});
| });
|
$$(\'.\'+id+\'s\').each(function(e) { Element.hide(e);
| $$(\'.\'+id+\'s\').each(function(e) { Element.hide(e);
|
Zeile 1528 | Zeile 1531 |
---|
<script type="text/javascript"> checkAction(\'attach\');'.$check_actions.' </script>';
|
<script type="text/javascript"> checkAction(\'attach\');'.$check_actions.' </script>';
|
|
|
echo $form->generate_hidden_field("file", htmlspecialchars_uni($stylesheet['name']))."<br />\n"; echo $form->generate_hidden_field("tid", $theme['tid'])."<br />\n";
| echo $form->generate_hidden_field("file", htmlspecialchars_uni($stylesheet['name']))."<br />\n"; echo $form->generate_hidden_field("tid", $theme['tid'])."<br />\n";
|
Zeile 1559 | Zeile 1562 |
---|
}
// Shows the page where you can actually edit a particular selector or the whole stylesheet
|
}
// Shows the page where you can actually edit a particular selector or the whole stylesheet
|
if($mybb->input['action'] == "edit_stylesheet" && (!$mybb->input['mode'] || $mybb->input['mode'] == "simple"))
| if($mybb->input['action'] == "edit_stylesheet" && (!isset($mybb->input['mode']) || $mybb->input['mode'] == "simple"))
|
{ $plugins->run_hooks("admin_style_themes_edit_stylesheet_simple"); // Fetch the theme we want to edit this stylesheet in $query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
{ $plugins->run_hooks("admin_style_themes_edit_stylesheet_simple"); // Fetch the theme we want to edit this stylesheet in $query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
if(!$theme['tid']) {
| if(!$theme['tid'] || $theme['tid'] == 1) {
|
flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes"); }
| flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes"); }
|
Zeile 1578 | Zeile 1581 |
---|
if(!$parent_list) { $parent_list = 1;
|
if(!$parent_list) { $parent_list = 1;
|
}
| }
|
$query = $db->simple_select("themestylesheets", "*", "name='".$db->escape_string($mybb->input['file'])."' AND tid IN ({$parent_list})", array('order_by' => 'tid', 'order_dir' => 'desc', 'limit' => 1)); $stylesheet = $db->fetch_array($query);
| $query = $db->simple_select("themestylesheets", "*", "name='".$db->escape_string($mybb->input['file'])."' AND tid IN ({$parent_list})", array('order_by' => 'tid', 'order_dir' => 'desc', 'limit' => 1)); $stylesheet = $db->fetch_array($query);
|
Zeile 1593 | Zeile 1596 |
---|
if($mybb->request_method == "post") { $sid = $stylesheet['sid'];
|
if($mybb->request_method == "post") { $sid = $stylesheet['sid'];
|
|
|
// Theme & stylesheet theme ID do not match, editing inherited - we copy to local theme if($theme['tid'] != $stylesheet['tid']) {
| // Theme & stylesheet theme ID do not match, editing inherited - we copy to local theme if($theme['tid'] != $stylesheet['tid']) {
|
Zeile 1606 | Zeile 1609 |
---|
if($mybb->input['serialized'] == 1) { $mybb->input['css_bits'] = unserialize($mybb->input['css_bits']);
|
if($mybb->input['serialized'] == 1) { $mybb->input['css_bits'] = unserialize($mybb->input['css_bits']);
|
}
| }
|
$css_to_insert = ''; foreach($mybb->input['css_bits'] as $field => $value) {
| $css_to_insert = ''; foreach($mybb->input['css_bits'] as $field => $value) {
|
Zeile 1649 | Zeile 1652 |
---|
$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple_commit"); // Log admin action
|
$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple_commit"); // Log admin action
|
log_admin_action($theme['name'], $stylesheet['name']);
| log_admin_action(htmlspecialchars_uni($theme['name']), $stylesheet['name']);
|
if(!$mybb->input['ajax']) {
| if(!$mybb->input['ajax']) {
|
Zeile 1673 | Zeile 1676 |
---|
// Has the file on the file system been modified? if(resync_stylesheet($stylesheet))
|
// Has the file on the file system been modified? if(resync_stylesheet($stylesheet))
|
{
| {
|
// Need to refetch new stylesheet as it was modified $query = $db->simple_select("themestylesheets", "stylesheet", "sid='{$stylesheet['sid']}'"); $stylesheet['stylesheet'] = $db->fetch_field($query, 'stylesheet');
|
// Need to refetch new stylesheet as it was modified $query = $db->simple_select("themestylesheets", "stylesheet", "sid='{$stylesheet['sid']}'"); $stylesheet['stylesheet'] = $db->fetch_field($query, 'stylesheet');
|
}
| }
|
$css_array = css_to_array($stylesheet['stylesheet']); $selector_list = get_selectors_as_options($css_array, $mybb->input['selector']);
|
$css_array = css_to_array($stylesheet['stylesheet']); $selector_list = get_selectors_as_options($css_array, $mybb->input['selector']);
|
|
|
// Do we not have any selectors? Send em to the full edit page if(!$selector_list) {
| // Do we not have any selectors? Send em to the full edit page if(!$selector_list) {
|
Zeile 1689 | Zeile 1692 |
---|
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$theme['tid']}&file=".htmlspecialchars_uni($stylesheet['name'])."&mode=advanced"); exit; }
|
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$theme['tid']}&file=".htmlspecialchars_uni($stylesheet['name'])."&mode=advanced"); exit; }
|
|
|
// Fetch list of all of the stylesheets for this theme $file_stylesheets = unserialize($theme['stylesheets']);
| // Fetch list of all of the stylesheets for this theme $file_stylesheets = unserialize($theme['stylesheets']);
|
Zeile 1705 | Zeile 1708 |
---|
} foreach($action_stylesheet as $action => $style)
|
} foreach($action_stylesheet as $action => $style)
|
{
| {
|
foreach($style as $stylesheet2) { $stylesheets[$stylesheet2]['applied_to'][$file][] = $action;
| foreach($style as $stylesheet2) { $stylesheets[$stylesheet2]['applied_to'][$file][] = $action;
|
Zeile 1770 | Zeile 1773 |
---|
'title' => $lang->edit_stylesheet_simple_mode, 'link' => "index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&file=".htmlspecialchars_uni($mybb->input['file'])."&mode=simple", 'description' => $lang->edit_stylesheet_simple_mode_desc
|
'title' => $lang->edit_stylesheet_simple_mode, 'link' => "index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&file=".htmlspecialchars_uni($mybb->input['file'])."&mode=simple", 'description' => $lang->edit_stylesheet_simple_mode_desc
|
);
| );
|
$sub_tabs['edit_stylesheet_advanced'] = array( 'title' => $lang->edit_stylesheet_advanced_mode,
| $sub_tabs['edit_stylesheet_advanced'] = array( 'title' => $lang->edit_stylesheet_advanced_mode,
|
Zeile 1807 | Zeile 1810 |
---|
// Get the properties from this item $properties = parse_css_properties($editable_selector['values']);
|
// Get the properties from this item $properties = parse_css_properties($editable_selector['values']);
|
| foreach(array('background', 'color', 'width', 'font-family', 'font-size', 'font-style', 'font-weight', 'text-decoration') as $_p) { if(!isset($properties[$_p])) { $properties[$_p] = ''; } }
|
$form = new Form("index.php?module=style-themes&action=edit_stylesheet", "post"); echo $form->generate_hidden_field("tid", $mybb->input['tid'], array('id' => "tid"))."\n"; echo $form->generate_hidden_field("file", htmlspecialchars_uni($mybb->input['file']), array('id' => "file"))."\n";
| $form = new Form("index.php?module=style-themes&action=edit_stylesheet", "post"); echo $form->generate_hidden_field("tid", $mybb->input['tid'], array('id' => "tid"))."\n"; echo $form->generate_hidden_field("file", htmlspecialchars_uni($mybb->input['file']), array('id' => "file"))."\n";
|
Zeile 1817 | Zeile 1828 |
---|
$table = new Table; $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[background]', $properties['background'], array('id' => 'css_bits[background]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->background}</strong></div>", array('style' => 'width: 20%;')); $table->construct_cell("<strong>{$lang->extra_css_atribs}</strong><br /><div style=\"align: center;\">".$form->generate_text_area('css_bits[extra]', $properties['extra'], array('id' => 'css_bits[extra]', 'style' => 'width: 98%;', 'rows' => '19'))."</div>", array('rowspan' => 8));
|
$table = new Table; $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[background]', $properties['background'], array('id' => 'css_bits[background]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->background}</strong></div>", array('style' => 'width: 20%;')); $table->construct_cell("<strong>{$lang->extra_css_atribs}</strong><br /><div style=\"align: center;\">".$form->generate_text_area('css_bits[extra]', $properties['extra'], array('id' => 'css_bits[extra]', 'style' => 'width: 98%;', 'rows' => '19'))."</div>", array('rowspan' => 8));
|
$table->construct_row();
| $table->construct_row();
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;'));
| $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;'));
|
Zeile 1827 | Zeile 1838 |
---|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_style]', $properties['font-style'], array('id' => 'css_bits[font_style]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_style}</strong></div>", array('style' => 'width: 40%;'));
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_style]', $properties['font-style'], array('id' => 'css_bits[font_style]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_style}</strong></div>", array('style' => 'width: 40%;'));
|
$table->construct_row();
| $table->construct_row();
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_weight]', $properties['font-weight'], array('id' => 'css_bits[font_weight]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_weight}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[text_decoration]', $properties['text-decoration'], array('id' => 'css_bits[text_decoration]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->text_decoration}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->output(htmlspecialchars_uni($editable_selector['class_name'])."<span id=\"saved\" style=\"color: #FEE0C6;\"></span>");
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_weight]', $properties['font-weight'], array('id' => 'css_bits[font_weight]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_weight}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[text_decoration]', $properties['text-decoration'], array('id' => 'css_bits[text_decoration]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->text_decoration}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->output(htmlspecialchars_uni($editable_selector['class_name'])."<span id=\"saved\" style=\"color: #FEE0C6;\"></span>");
|
|
|
echo "</div>"; $buttons[] = $form->generate_reset_button($lang->reset);
| echo "</div>"; $buttons[] = $form->generate_reset_button($lang->reset);
|
Zeile 1842 | Zeile 1853 |
---|
$buttons[] = $form->generate_submit_button($lang->save_changes_and_close, array('id' => 'save_close', 'name' => 'save_close'));
$form->output_submit_wrapper($buttons);
|
$buttons[] = $form->generate_submit_button($lang->save_changes_and_close, array('id' => 'save_close', 'name' => 'save_close'));
$form->output_submit_wrapper($buttons);
|
|
|
echo '<script type="text/javascript" src="./jscripts/themes.js"></script>'; echo '<script type="text/javascript">
| echo '<script type="text/javascript" src="./jscripts/themes.js"></script>'; echo '<script type="text/javascript">
|
Zeile 1854 | Zeile 1865 |
---|
</script>';
$form->end();
|
</script>';
$form->end();
|
|
|
$page->output_footer(); }
| $page->output_footer(); }
|
Zeile 1866 | Zeile 1877 |
---|
$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
if(!$theme['tid'])
| if(!$theme['tid'] || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 1919 | Zeile 1930 |
---|
$plugins->run_hooks("admin_style_themes_edit_stylesheet_advanced_commit"); // Log admin action
|
$plugins->run_hooks("admin_style_themes_edit_stylesheet_advanced_commit"); // Log admin action
|
log_admin_action($theme['name'], $stylesheet['name']);
| log_admin_action(htmlspecialchars_uni($theme['name']), $stylesheet['name']);
|
flash_message($lang->success_stylesheet_updated, 'success');
| flash_message($lang->success_stylesheet_updated, 'success');
|
Zeile 1985 | Zeile 1996 |
---|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" />
| <link type="text/css" href="./jscripts/codepress/languages/css.css" rel="stylesheet" id="cp-lang-style" />
|
<script type="text/javascript" src="./jscripts/codepress/codepress.js"></script> <script type="text/javascript"> CodePress.language = \'css\';
| <script type="text/javascript" src="./jscripts/codepress/codepress.js"></script> <script type="text/javascript"> CodePress.language = \'css\';
|
Zeile 2078 | Zeile 2089 |
---|
$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
if(!$theme['tid'])
| if(!$theme['tid'] || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 2103 | Zeile 2114 |
---|
// User clicked no if($mybb->input['no'])
|
// User clicked no if($mybb->input['no'])
|
{ admin_redirect("index.php?module=style-themes"); }
| { admin_redirect("index.php?module=style-themes"); }
|
if($mybb->request_method == "post") {
| if($mybb->request_method == "post") {
|
Zeile 2118 | Zeile 2129 |
---|
$plugins->run_hooks("admin_style_themes_delete_stylesheet_commit"); // Log admin action
|
$plugins->run_hooks("admin_style_themes_delete_stylesheet_commit"); // Log admin action
|
log_admin_action($stylesheet['sid'], $stylesheet['name'], $theme['tid'], $theme['name']);
| log_admin_action($stylesheet['sid'], $stylesheet['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));
|
flash_message($lang->success_stylesheet_deleted, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
| flash_message($lang->success_stylesheet_deleted, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
|
Zeile 2137 | Zeile 2148 |
---|
$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
$query = $db->simple_select("themes", "*", "tid='".intval($mybb->input['tid'])."'"); $theme = $db->fetch_array($query);
|
if(!$theme['tid'])
| if(!$theme['tid'] || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes"); }
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes"); }
|
|
|
// Fetch list of all of the stylesheets for this theme $file_stylesheets = unserialize($theme['stylesheets']);
|
// Fetch list of all of the stylesheets for this theme $file_stylesheets = unserialize($theme['stylesheets']);
|
|
|
$stylesheets = array(); $inherited_load = array();
|
$stylesheets = array(); $inherited_load = array();
|
|
|
// Now we loop through the list of stylesheets for each file foreach($file_stylesheets as $file => $action_stylesheet) {
| // Now we loop through the list of stylesheets for each file foreach($file_stylesheets as $file => $action_stylesheet) {
|
Zeile 2191 | Zeile 2202 |
---|
if($mybb->request_method == "post") {
|
if($mybb->request_method == "post") {
|
if(!$mybb->input['name'])
| // Remove special characters $mybb->input['name'] = preg_replace('#([^a-z0-9-_\.]+)#i', '', $mybb->input['name']); if(!$mybb->input['name'] || $mybb->input['name'] == ".css")
|
{ $errors[] = $lang->error_missing_stylesheet_name; }
| { $errors[] = $lang->error_missing_stylesheet_name; }
|
Zeile 2274 | Zeile 2287 |
---|
$plugins->run_hooks("admin_style_themes_add_stylesheet_commit"); // Log admin action
|
$plugins->run_hooks("admin_style_themes_add_stylesheet_commit"); // Log admin action
|
log_admin_action($sid, $mybb->input['name'], $theme['tid'], $theme['name']);
| log_admin_action($sid, $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));
|
flash_message($lang->success_stylesheet_added, 'success'); admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name']));
| flash_message($lang->success_stylesheet_added, 'success'); admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&sid={$sid}&file=".urlencode($mybb->input['name']));
|
Zeile 2284 | Zeile 2297 |
---|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
<link type="text/css" href="./jscripts/codepress/languages/codepress-css.css" rel="stylesheet" id="cp-lang-style" />
| <link type="text/css" href="./jscripts/codepress/languages/css.css" rel="stylesheet" id="cp-lang-style" />
|
<script type="text/javascript" src="./jscripts/codepress/codepress.js"></script> <script type="text/javascript"> CodePress.language = \'css\';
| <script type="text/javascript" src="./jscripts/codepress/codepress.js"></script> <script type="text/javascript"> CodePress.language = \'css\';
|
Zeile 2357 | Zeile 2370 |
---|
$specific_files = "<div id=\"attach_1\" class=\"attachs\">"; $count = 0;
|
$specific_files = "<div id=\"attach_1\" class=\"attachs\">"; $count = 0;
|
if(is_array($mybb->input['applied_to']) && $mybb->input['applied_to']['global'][0] != "global")
| if(is_array($mybb->input['applied_to']) && (!isset($mybb->input['applied_to']['global']) || $mybb->input['applied_to']['global'][0] != "global"))
|
{ $check_actions = "";
| { $check_actions = "";
|
Zeile 2525 | Zeile 2538 |
---|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
if(!$theme['tid'])
| if(!$theme['tid'] || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 2537 | Zeile 2550 |
---|
$plugins->run_hooks("admin_style_themes_set_default_commit"); // Log admin action
|
$plugins->run_hooks("admin_style_themes_set_default_commit"); // Log admin action
|
log_admin_action($theme['tid'], $theme['name']);
| log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
|
flash_message($lang->success_theme_set_default, 'success'); admin_redirect("index.php?module=style-themes"); }
|
flash_message($lang->success_theme_set_default, 'success'); admin_redirect("index.php?module=style-themes"); }
|
|
|
if($mybb->input['action'] == "force") { $plugins->run_hooks("admin_style_themes_force");
| if($mybb->input['action'] == "force") { $plugins->run_hooks("admin_style_themes_force");
|
Zeile 2551 | Zeile 2564 |
---|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
if(!$theme['tid'])
| if(!$theme['tid'] || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 2574 | Zeile 2587 |
---|
$plugins->run_hooks("admin_style_themes_force_commit"); // Log admin action
|
$plugins->run_hooks("admin_style_themes_force_commit"); // Log admin action
|
log_admin_action($theme['tid'], $theme['name']);
| log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
|
flash_message($lang->success_theme_forced, 'success'); admin_redirect("index.php?module=style-themes");
| flash_message($lang->success_theme_forced, 'success'); admin_redirect("index.php?module=style-themes");
|