Zeile 35 | Zeile 35 |
---|
if($mybb->input['action'] == "xmlhttp_stylesheet" && $mybb->request_method == "post") { // Fetch the theme we want to edit this stylesheet in
|
if($mybb->input['action'] == "xmlhttp_stylesheet" && $mybb->request_method == "post") { // Fetch the theme we want to edit this stylesheet in
|
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
| $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
|
$theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1)
| $theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1)
|
Zeile 155 | Zeile 155 |
---|
if($mybb->input['page']) {
|
if($mybb->input['page']) {
|
$url_page = "&page=".$mybb->get_input('page', 1);
| $url_page = "&page=".$mybb->get_input('page', MyBB::INPUT_INT);
|
} else {
| } else {
|
Zeile 199 | Zeile 199 |
---|
unset($tree['results']['result']); $tree['results']['result'][0] = $only_theme; }
|
unset($tree['results']['result']); $tree['results']['result'][0] = $only_theme; }
|
| require_once MYBB_ROOT . '/inc/class_parser.php'; $post_parser = new postParser();
|
foreach($tree['results']['result'] as $result) {
|
foreach($tree['results']['result'] as $result) {
|
| $result['thumbnail']['value'] = htmlspecialchars_uni($result['thumbnail']['value']); $result['name']['value'] = htmlspecialchars_uni($result['name']['value']); $result['description']['value'] = htmlspecialchars_uni($result['description']['value']); $result['author']['value'] = $post_parser->parse_message($result['author']['value'], array( 'allow_html' => true ) ); $result['download_url']['value'] = htmlspecialchars_uni(html_entity_decode($result['download_url']['value']));
|
$table->construct_cell("<img src=\"http://community.mybb.com/{$result['thumbnail']['value']}\" alt=\"{$lang->theme_thumbnail}\" title=\"{$lang->theme_thumbnail}\"/>", array("class" => "align_center", "width" => 100)); $table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} {$result['author']['value']}</small></i>"); $table->construct_cell("<strong><a href=\"http://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center"));
| $table->construct_cell("<img src=\"http://community.mybb.com/{$result['thumbnail']['value']}\" alt=\"{$lang->theme_thumbnail}\" title=\"{$lang->theme_thumbnail}\"/>", array("class" => "align_center", "width" => 100)); $table->construct_cell("<strong>{$result['name']['value']}</strong><br /><small>{$result['description']['value']}</small><br /><i><small>{$lang->created_by} {$result['author']['value']}</small></i>"); $table->construct_cell("<strong><a href=\"http://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\">{$lang->download}</a></strong>", array("class" => "align_center"));
|
Zeile 367 | Zeile 379 |
---|
$options = array( 'no_stylesheets' => ($mybb->input['import_stylesheets'] ? 0 : 1), 'no_templates' => ($mybb->input['import_templates'] ? 0 : 1),
|
$options = array( 'no_stylesheets' => ($mybb->input['import_stylesheets'] ? 0 : 1), 'no_templates' => ($mybb->input['import_templates'] ? 0 : 1),
|
'version_compat' => (int)$mybb->input['version_compat'], 'parent' => $mybb->get_input('tid', 1),
| 'version_compat' => $mybb->get_input('version_compat', MyBB::INPUT_INT), 'parent' => $mybb->get_input('tid', MyBB::INPUT_INT),
|
'force_name_check' => true, ); $theme_id = import_theme_xml($contents, $options);
| 'force_name_check' => true, ); $theme_id = import_theme_xml($contents, $options);
|
Zeile 504 | Zeile 516 |
---|
if($mybb->input['action'] == "export") {
|
if($mybb->input['action'] == "export") {
|
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
| $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
|
$theme = $db->fetch_array($query);
// Does the theme not exist?
| $theme = $db->fetch_array($query);
// Does the theme not exist?
|
Zeile 529 | Zeile 541 |
---|
if(is_array($value)) {
|
if(is_array($value)) {
|
$value = serialize($value);
| $value = my_serialize($value);
|
}
$value = str_replace(']]>', ']]]]><![CDATA[>', $value);
| }
$value = str_replace(']]>', ']]]]><![CDATA[>', $value);
|
Zeile 602 | Zeile 614 |
---|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);
| $style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);
|
$filename = $theme_stylesheets[$style['sid']]; } else
| $filename = $theme_stylesheets[$style['sid']]; } else
|
Zeile 722 | Zeile 734 |
---|
if($mybb->input['action'] == "duplicate") {
|
if($mybb->input['action'] == "duplicate") {
|
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
| $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
|
$theme = $db->fetch_array($query);
// Does the theme not exist?
| $theme = $db->fetch_array($query);
// Does the theme not exist?
|
Zeile 744 | Zeile 756 |
---|
{ $query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($mybb->get_input('name'))."'"); $numthemes = $db->fetch_field($query, 'numthemes');
|
{ $query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($mybb->get_input('name'))."'"); $numthemes = $db->fetch_field($query, 'numthemes');
|
|
|
if($numthemes)
|
if($numthemes)
|
{
| {
|
$errors[] = $lang->error_theme_already_exists; } }
|
$errors[] = $lang->error_theme_already_exists; } }
|
|
|
if(!$errors) { $properties = my_unserialize($theme['properties']);
|
if(!$errors) { $properties = my_unserialize($theme['properties']);
|
$sid = $properties['sid'];
| $sid = $properties['templateset'];
|
$nprops = null;
|
$nprops = null;
|
if($mybb->input['duplicate_templates']) { $nsid = $db->insert_query("templatesets", array('title' => $db->escape_string($mybb->input['name'])." Templates"));
| if($mybb->input['duplicate_templates']) { $nsid = $db->insert_query("templatesets", array('title' => $db->escape_string($mybb->input['name'])." Templates"));
|
// Copy all old Templates to our new templateset $query = $db->simple_select("templates", "*", "sid='{$sid}'"); while($template = $db->fetch_array($query))
| // Copy all old Templates to our new templateset $query = $db->simple_select("templates", "*", "sid='{$sid}'"); while($template = $db->fetch_array($query))
|
Zeile 863 | Zeile 875 |
---|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->duplicate_theme);
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->duplicate_theme);
|
|
|
$form->output_submit_wrapper($buttons);
$form->end();
| $form->output_submit_wrapper($buttons);
$form->end();
|
Zeile 880 | Zeile 892 |
---|
{ $themes[$theme['tid']] = $theme['name']; }
|
{ $themes[$theme['tid']] = $theme['name']; }
|
|
|
if($mybb->request_method == "post") { if(!$mybb->input['name'])
| if($mybb->request_method == "post") { if(!$mybb->input['name'])
|
Zeile 897 | Zeile 909 |
---|
$tid = build_new_theme($mybb->input['name'], null, $mybb->input['tid']);
$plugins->run_hooks("admin_style_themes_add_commit");
|
$tid = build_new_theme($mybb->input['name'], null, $mybb->input['tid']);
$plugins->run_hooks("admin_style_themes_add_commit");
|
|
|
// Log admin action 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); }
|
// Log admin action 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); }
|
}
$page->add_breadcrumb_item($lang->create_new_theme, "index.php?module=style-themes&action=add");
| }
$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->output_nav_tabs($sub_tabs, 'create_theme');
|
$page->output_header("{$lang->themes} - {$lang->create_new_theme}");
$page->output_nav_tabs($sub_tabs, 'create_theme');
|
|
|
if($errors) { $page->output_inline_error($errors);
| if($errors) { $page->output_inline_error($errors);
|
Zeile 924 | Zeile 936 |
---|
$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);
|
|
|
$form->end();
$page->output_footer();
|
$form->end();
$page->output_footer();
|
}
| }
|
if($mybb->input['action'] == "delete") {
|
if($mybb->input['action'] == "delete") {
|
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
| $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
|
$theme = $db->fetch_array($query);
// Does the theme not exist? or are we trying to delete the master? if(!$theme['tid'] || $theme['tid'] == 1)
|
$theme = $db->fetch_array($query);
// Does the theme not exist? or are we trying to delete the master? 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"); }
|
// User clicked no if($mybb->input['no']) {
| // User clicked no if($mybb->input['no']) {
|
Zeile 953 | Zeile 965 |
---|
}
$plugins->run_hooks("admin_style_themes_delete");
|
}
$plugins->run_hooks("admin_style_themes_delete");
|
|
|
if($mybb->request_method == "post") { $inherited_theme_cache = array();
|
if($mybb->request_method == "post") { $inherited_theme_cache = array();
|
|
|
$query = $db->simple_select("themes", "tid,stylesheets", "tid != '{$theme['tid']}'", array('order_by' => "pid, name")); while($theme2 = $db->fetch_array($query)) {
| $query = $db->simple_select("themes", "tid,stylesheets", "tid != '{$theme['tid']}'", array('order_by' => "pid, name")); while($theme2 = $db->fetch_array($query)) {
|
Zeile 966 | Zeile 978 |
---|
if(!$theme2['stylesheets']['inherited']) { continue;
|
if(!$theme2['stylesheets']['inherited']) { continue;
|
}
| }
|
$inherited_theme_cache[$theme2['tid']] = $theme2['stylesheets']['inherited'];
|
$inherited_theme_cache[$theme2['tid']] = $theme2['stylesheets']['inherited'];
|
}
$inherited_stylesheets = false;
| }
$inherited_stylesheets = false;
|
// Are any other themes relying on stylesheets from this theme? Get a list and show an error foreach($inherited_theme_cache as $tid => $inherited) {
| // Are any other themes relying on stylesheets from this theme? Get a list and show an error foreach($inherited_theme_cache as $tid => $inherited) {
|
Zeile 989 | Zeile 1001 |
---|
}
if($inherited_stylesheets == true)
|
}
if($inherited_stylesheets == true)
|
{
| {
|
flash_message($lang->error_inheriting_stylesheets, 'error'); admin_redirect("index.php?module=style-themes"); }
| flash_message($lang->error_inheriting_stylesheets, 'error'); admin_redirect("index.php?module=style-themes"); }
|
Zeile 998 | Zeile 1010 |
---|
while($cachefile = $db->fetch_array($query)) { @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$cachefile['cachefile']}");
|
while($cachefile = $db->fetch_array($query)) { @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$cachefile['cachefile']}");
|
| $filename_min = str_replace('.css', '.min.css', $cachefile['cachefile']); @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}");
|
} @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'], $theme, true);
|
// Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid'], $theme, true);
|
|
|
$db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");
|
$db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");
|
|
|
@rmdir(MYBB_ROOT."cache/themes/theme{$theme['tid']}/");
|
@rmdir(MYBB_ROOT."cache/themes/theme{$theme['tid']}/");
|
|
|
$children = make_child_theme_list($theme['tid']); $child_tid = $children[0];
$db->update_query("themes", array('pid' => $theme['pid']), "tid='{$child_tid}'");
$db->delete_query("themes", "tid='{$theme['tid']}'", 1);
|
$children = make_child_theme_list($theme['tid']); $child_tid = $children[0];
$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
|
Zeile 1024 | Zeile 1039 |
---|
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");
|
}
| }
|
else { $page->output_confirm_action("index.php?module=style-themes&action=delete&tid={$theme['tid']}", $lang->confirm_theme_deletion);
| else { $page->output_confirm_action("index.php?module=style-themes&action=delete&tid={$theme['tid']}", $lang->confirm_theme_deletion);
|
Zeile 1032 | Zeile 1047 |
---|
}
if($mybb->input['action'] == "edit")
|
}
if($mybb->input['action'] == "edit")
|
{ $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'"); $theme = $db->fetch_array($query);
// Does the theme not exist? if(!$theme['tid'] || $theme['tid'] == 1)
| { $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'"); $theme = $db->fetch_array($query);
// Does the theme not exist? 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 1048 | Zeile 1063 |
---|
if($mybb->request_method == "post" && !$mybb->input['do']) { $properties = array(
|
if($mybb->request_method == "post" && !$mybb->input['do']) { $properties = array(
|
'templateset' => (int)$mybb->input['templateset'],
| 'templateset' => $mybb->get_input('templateset', MyBB::INPUT_INT),
|
'editortheme' => $mybb->input['editortheme'], 'imgdir' => $mybb->input['imgdir'], 'logo' => $mybb->input['logo'],
|
'editortheme' => $mybb->input['editortheme'], 'imgdir' => $mybb->input['imgdir'], 'logo' => $mybb->input['logo'],
|
'tablespace' => (int)$mybb->input['tablespace'], 'borderwidth' => (int)$mybb->input['borderwidth'],
| 'tablespace' => $mybb->get_input('tablespace', MyBB::INPUT_INT), 'borderwidth' => $mybb->get_input('borderwidth', MyBB::INPUT_INT),
|
'color' => $mybb->input['color'] );
|
'color' => $mybb->input['color'] );
|
|
|
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 1080 | Zeile 1095 |
---|
}
$theme_properties = my_unserialize($theme['properties']);
|
}
$theme_properties = my_unserialize($theme['properties']);
|
if($theme_properties['disporder'])
| if(is_array($theme_properties['disporder']))
|
{ $properties['disporder'] = $theme_properties['disporder'];
|
{ $properties['disporder'] = $theme_properties['disporder'];
|
| } else { $errors[] = $lang->error_no_display_order;
|
}
$allowedgroups = array();
| }
$allowedgroups = array();
|
Zeile 1106 | Zeile 1125 |
---|
$update_array = array( 'name' => $db->escape_string($mybb->input['name']),
|
$update_array = array( 'name' => $db->escape_string($mybb->input['name']),
|
'pid' => $mybb->get_input('pid', 1),
| 'pid' => $mybb->get_input('pid', MyBB::INPUT_INT),
|
'allowedgroups' => $allowedgroups,
|
'allowedgroups' => $allowedgroups,
|
'properties' => $db->escape_string(serialize($properties))
| 'properties' => $db->escape_string(my_serialize($properties))
|
);
// perform validation
| );
// perform validation
|
Zeile 1159 | Zeile 1178 |
---|
$plugins->run_hooks("admin_style_themes_edit_commit");
$db->update_query("themes", $update_array, "tid='{$theme['tid']}'");
|
$plugins->run_hooks("admin_style_themes_edit_commit");
$db->update_query("themes", $update_array, "tid='{$theme['tid']}'");
|
| update_theme_stylesheet_list($theme['tid']);
|
if($theme['def'] == 1) {
| if($theme['def'] == 1) {
|
Zeile 1261 | Zeile 1281 |
---|
$properties['disporder'] = $orders;
$update_array = array(
|
$properties['disporder'] = $orders;
$update_array = array(
|
"properties" => $db->escape_string(serialize($properties))
| "properties" => $db->escape_string(my_serialize($properties))
|
);
$db->update_query("themes", $update_array, "tid = '{$theme['tid']}'");
| );
$db->update_query("themes", $update_array, "tid = '{$theme['tid']}'");
|
Zeile 1326 | Zeile 1346 |
---|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);
| $style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);
|
$filename = $theme_stylesheets[$style['sid']]; }
| $filename = $theme_stylesheets[$style['sid']]; }
|
Zeile 1343 | Zeile 1363 |
---|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
{ if(strpos($filename, 'css.php?stylesheet=') !== false) {
|
$style['sid'] = (integer)str_replace('css.php?stylesheet=', '', $filename);
| $style['sid'] = (int)str_replace('css.php?stylesheet=', '', $filename);
|
$filename = $theme_stylesheets[$style['sid']]; } else
| $filename = $theme_stylesheets[$style['sid']]; } else
|
Zeile 1492 | Zeile 1512 |
---|
}
$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("<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($form->generate_numeric_field("disporder[{$theme_stylesheets[$filename]['sid']}]", $properties['disporder'][$filename], array('style' => 'width: 80%; text-align: center;')), array("class" => "align_center"));
| $table->construct_cell($form->generate_numeric_field("disporder[{$theme_stylesheets[$filename]['sid']}]", $properties['disporder'][$filename], array('style' => 'width: 80%; text-align: center;', 'min' => 0)), array("class" => "align_center"));
|
$table->construct_cell($popup->fetch(), array("class" => "align_center")); $table->construct_row(); }
| $table->construct_cell($popup->fetch(), array("class" => "align_center")); $table->construct_row(); }
|
Zeile 1554 | Zeile 1574 |
---|
$form_container->output_row($lang->img_directory, $lang->img_directory_desc, $form->generate_text_box('imgdir', $properties['imgdir'], array('id' => 'imgdir')), 'imgdir'); $form_container->output_row($lang->logo, $lang->logo_desc, $form->generate_text_box('logo', $properties['logo'], array('id' => 'boardlogo')), 'logo');
|
$form_container->output_row($lang->img_directory, $lang->img_directory_desc, $form->generate_text_box('imgdir', $properties['imgdir'], array('id' => 'imgdir')), 'imgdir'); $form_container->output_row($lang->logo, $lang->logo_desc, $form->generate_text_box('logo', $properties['logo'], array('id' => 'boardlogo')), 'logo');
|
$form_container->output_row($lang->table_spacing, $lang->table_spacing_desc, $form->generate_numeric_field('tablespace', $properties['tablespace'], array('id' => 'tablespace')), 'tablespace'); $form_container->output_row($lang->inner_border, $lang->inner_border_desc, $form->generate_numeric_field('borderwidth', $properties['borderwidth'], array('id' => 'borderwidth')), 'borderwidth');
| $form_container->output_row($lang->table_spacing, $lang->table_spacing_desc, $form->generate_numeric_field('tablespace', $properties['tablespace'], array('id' => 'tablespace', 'min' => 0)), 'tablespace'); $form_container->output_row($lang->inner_border, $lang->inner_border_desc, $form->generate_numeric_field('borderwidth', $properties['borderwidth'], array('id' => 'borderwidth', 'min' => 0)), 'borderwidth');
|
$form_container->end();
| $form_container->end();
|
Zeile 1598 | Zeile 1618 |
---|
}
if($mybb->input['action'] == "stylesheet_properties")
|
}
if($mybb->input['action'] == "stylesheet_properties")
|
{ // Fetch the theme we want to edit this stylesheet in $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'"); $theme = $db->fetch_array($query);
| { // Fetch the theme we want to edit this stylesheet in $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'"); $theme = $db->fetch_array($query);
|
if(!$theme['tid'] || $theme['tid'] == 1) { flash_message($lang->error_invalid_theme, 'error');
| if(!$theme['tid'] || $theme['tid'] == 1) { flash_message($lang->error_invalid_theme, 'error');
|
Zeile 1671 | Zeile 1691 |
---|
{ $actions_list = ""; $attached_to = $value;
|
{ $actions_list = ""; $attached_to = $value;
|
|
|
if(strpos($id, 'attached_') !== false) { // We have a custom attached file
| if(strpos($id, 'attached_') !== false) { // We have a custom attached file
|
Zeile 1731 | Zeile 1751 |
---|
$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1); } @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");
|
$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$stylesheet['sid']}"), "sid='{$stylesheet['sid']}'", 1); } @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");
|
}
| $filename_min = str_replace('.css', '.min.css', $stylesheet['cachefile']); @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}"); }
|
// Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid'], $theme_c, $update_d);
|
// Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid'], $theme_c, $update_d);
|
|
|
$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");
// Log admin action log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));
|
$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");
// Log admin action 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']}");
|
} }
| } }
|
$properties = my_unserialize($theme['properties']); $page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}"); $page->add_breadcrumb_item(htmlspecialchars_uni($stylesheet['name'])." {$lang->properties}", "index.php?module=style-themes&action=edit_properties&tid={$mybb->input['tid']}");
|
$properties = my_unserialize($theme['properties']); $page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}"); $page->add_breadcrumb_item(htmlspecialchars_uni($stylesheet['name'])." {$lang->properties}", "index.php?module=style-themes&action=edit_properties&tid={$mybb->input['tid']}");
|
|
|
$page->output_header("{$lang->themes} - {$lang->stylesheet_properties}");
// If the stylesheet and theme do not match, we must be editing something that is inherited if($this_stylesheet['inherited'][$stylesheet['name']])
|
$page->output_header("{$lang->themes} - {$lang->stylesheet_properties}");
// If the stylesheet and theme do not match, we must be editing something that is inherited if($this_stylesheet['inherited'][$stylesheet['name']])
|
{
| {
|
$query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'"); $stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));
| $query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'"); $stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));
|
Zeile 1762 | Zeile 1785 |
---|
if($stylesheet['tid'] == 1) { $page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent));
|
if($stylesheet['tid'] == 1) { $page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent));
|
}
| }
|
else { $page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent));
| else { $page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent));
|
Zeile 1775 | Zeile 1798 |
---|
if($errors) { $page->output_inline_error($errors);
|
if($errors) { $page->output_inline_error($errors);
|
|
|
foreach($mybb->input as $name => $value) { if(strpos($name, "attached") !== false)
| foreach($mybb->input as $name => $value) { if(strpos($name, "attached") !== false)
|
Zeile 1784 | Zeile 1807 |
---|
$id = (int)$id;
$applied_to[$value] = array(0 => 'global');
|
$id = (int)$id;
$applied_to[$value] = array(0 => 'global');
|
|
|
if($mybb->input['action_'.$id] == 1) { $applied_to[$value] = explode(',', $mybb->input['action_list_'.$id]);
| if($mybb->input['action_'.$id] == 1) { $applied_to[$value] = explode(',', $mybb->input['action_list_'.$id]);
|
Zeile 1809 | Zeile 1832 |
---|
{ $check_actions = ""; $stylesheet['colors'] = array();
|
{ $check_actions = ""; $stylesheet['colors'] = array();
|
|
|
if(!is_array($properties['colors'])) { $properties['colors'] = array();
| if(!is_array($properties['colors'])) { $properties['colors'] = array();
|
Zeile 1876 | Zeile 1899 |
---|
{ $global_checked[3] = ""; $global_checked[2] = "checked=\"checked\"";
|
{ $global_checked[3] = ""; $global_checked[2] = "checked=\"checked\"";
|
$global_checked[1] = ""; }
| $global_checked[1] = ""; }
|
if(!empty($stylesheet['colors'])) { $global_checked[3] = "checked=\"checked\""; $global_checked[2] = ""; $global_checked[1] = ""; }
|
if(!empty($stylesheet['colors'])) { $global_checked[3] = "checked=\"checked\""; $global_checked[2] = ""; $global_checked[1] = ""; }
|
}
| }
|
$specific_files .= "</div>";
// Colors
| $specific_files .= "</div>";
// Colors
|
Zeile 1902 | Zeile 1925 |
---|
<br /><br /> ".$form->generate_select_box('color[]', $properties['colors'], $stylesheet['colors'], array('multiple' => true, 'size' => "5\" style=\"width: 200px;"))." ";
|
<br /><br /> ".$form->generate_select_box('color[]', $properties['colors'], $stylesheet['colors'], array('multiple' => true, 'size' => "5\" style=\"width: 200px;"))." ";
|
|
|
$form_container = new FormContainer(); $form_container->output_row("", "", $specific_color); $specific_colors .= $form_container->end(true)."</div>";
| $form_container = new FormContainer(); $form_container->output_row("", "", $specific_color); $specific_colors .= $form_container->end(true)."</div>";
|
Zeile 1910 | Zeile 1933 |
---|
$actions = '<script type="text/javascript"> function checkAction(id)
|
$actions = '<script type="text/javascript"> function checkAction(id)
|
{
| {
|
var checked = \'\';
$(\'.\'+id+\'s_check\').each(function(e, val)
| var checked = \'\';
$(\'.\'+id+\'s_check\').each(function(e, val)
|
Zeile 1974 | Zeile 1997 |
---|
if($mybb->input['action'] == "edit_stylesheet" && (!isset($mybb->input['mode']) || $mybb->input['mode'] == "simple")) { // Fetch the theme we want to edit this stylesheet in
|
if($mybb->input['action'] == "edit_stylesheet" && (!isset($mybb->input['mode']) || $mybb->input['mode'] == "simple")) { // Fetch the theme we want to edit this stylesheet in
|
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
| $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
|
$theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1)
| $theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1)
|
Zeile 2048 | Zeile 2071 |
---|
"lastmodified" => TIME_NOW ); $db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");
|
"lastmodified" => TIME_NOW ); $db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");
|
|
|
// Cache the stylesheet to the file if(!cache_stylesheet($theme['tid'], $stylesheet['name'], $new_stylesheet))
|
// Cache the stylesheet to the file if(!cache_stylesheet($theme['tid'], $stylesheet['name'], $new_stylesheet))
|
{
| {
|
$db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$sid}"), "sid='{$sid}'", 1); }
| $db->update_query("themestylesheets", array('cachefile' => "css.php?stylesheet={$sid}"), "sid='{$sid}'", 1); }
|
Zeile 2059 | Zeile 2082 |
---|
update_theme_stylesheet_list($theme['tid']);
$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple_commit");
|
update_theme_stylesheet_list($theme['tid']);
$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple_commit");
|
|
|
// Log admin action log_admin_action(htmlspecialchars_uni($theme['name']), $stylesheet['name']);
| // Log admin action log_admin_action(htmlspecialchars_uni($theme['name']), $stylesheet['name']);
|
Zeile 2075 | Zeile 2098 |
---|
{ admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$theme['tid']}&file={$stylesheet['name']}"); }
|
{ admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$theme['tid']}&file={$stylesheet['name']}"); }
|
}
| }
|
else { echo "1"; exit;
|
else { echo "1"; exit;
|
} }
| } }
|
// 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)) {
|
Zeile 2116 | Zeile 2139 |
---|
$page->add_breadcrumb_item("{$lang->editing} ".htmlspecialchars_uni($stylesheet['name']), "index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&file=".htmlspecialchars_uni($mybb->input['file'])."&mode=simple");
$page->output_header("{$lang->themes} - {$lang->edit_stylesheets}");
|
$page->add_breadcrumb_item("{$lang->editing} ".htmlspecialchars_uni($stylesheet['name']), "index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&file=".htmlspecialchars_uni($mybb->input['file'])."&mode=simple");
$page->output_header("{$lang->themes} - {$lang->edit_stylesheets}");
|
|
|
// If the stylesheet and theme do not match, we must be editing something that is inherited if($this_stylesheet['inherited'][$stylesheet['name']]) {
| // If the stylesheet and theme do not match, we must be editing something that is inherited if($this_stylesheet['inherited'][$stylesheet['name']]) {
|
Zeile 2125 | Zeile 2148 |
---|
// Show inherited warning if($stylesheet['tid'] == 1)
|
// Show inherited warning if($stylesheet['tid'] == 1)
|
{
| {
|
$page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent), "ajax_alert"); } else
| $page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent), "ajax_alert"); } else
|
Zeile 2133 | Zeile 2156 |
---|
$page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent), "ajax_alert"); } }
|
$page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent), "ajax_alert"); } }
|
|
|
$sub_tabs['edit_stylesheet'] = array( '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'] = array( '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 2146 | Zeile 2169 |
---|
);
$page->output_nav_tabs($sub_tabs, 'edit_stylesheet');
|
);
$page->output_nav_tabs($sub_tabs, 'edit_stylesheet');
|
|
|
// Output the selection box $form = new Form("index.php", "get", "selector_form"); echo $form->generate_hidden_field("module", "style/themes")."\n"; echo $form->generate_hidden_field("action", "edit_stylesheet")."\n";
|
// Output the selection box $form = new Form("index.php", "get", "selector_form"); echo $form->generate_hidden_field("module", "style/themes")."\n"; echo $form->generate_hidden_field("action", "edit_stylesheet")."\n";
|
echo $form->generate_hidden_field("tid", $mybb->input['tid'])."\n"; echo $form->generate_hidden_field("file", htmlspecialchars_uni($mybb->input['file']))."\n";
echo "{$lang->selector}: <select id=\"selector\" name=\"selector\">\n{$selector_list}</select> <span id=\"mini_spinner\">".$form->generate_submit_button($lang->go)."</span><br /><br />\n";
| echo $form->generate_hidden_field("tid", $mybb->input['tid'])."\n"; echo $form->generate_hidden_field("file", htmlspecialchars_uni($mybb->input['file']))."\n";
echo "{$lang->selector}: <select id=\"selector\" name=\"selector\">\n{$selector_list}</select> <span id=\"mini_spinner\">".$form->generate_submit_button($lang->go)."</span><br /><br />\n";
|
$form->end();
// Haven't chosen a selector to edit, show the first one from the stylesheet if(!$mybb->input['selector'])
|
$form->end();
// Haven't chosen a selector to edit, show the first one from the stylesheet if(!$mybb->input['selector'])
|
{
| {
|
reset($css_array); uasort($css_array, "css_selectors_sort_cmp"); $selector = key($css_array);
| reset($css_array); uasort($css_array, "css_selectors_sort_cmp"); $selector = key($css_array);
|
Zeile 2190 | Zeile 2213 |
---|
echo $form->generate_hidden_field("selector", htmlspecialchars_uni($selector), array('id' => 'hidden_selector'))."\n";
echo "<div id=\"stylesheet\">";
|
echo $form->generate_hidden_field("selector", htmlspecialchars_uni($selector), array('id' => 'hidden_selector'))."\n";
echo "<div id=\"stylesheet\">";
|
$table = new Table;
| $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_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();
|
Zeile 2219 | Zeile 2242 |
---|
$form->output_submit_wrapper($buttons);
|
$form->output_submit_wrapper($buttons);
|
echo '<script type="text/javascript" src="./jscripts/themes.js"></script>';
| echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1804"></script>';
|
echo '<script type="text/javascript">
$(document).ready(function() { //<![CDATA[
|
echo '<script type="text/javascript">
$(document).ready(function() { //<![CDATA[
|
new ThemeSelector("./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'].'");
| 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.'"; }); //]]>
| lang.saving = "'.$lang->saving.'"; }); //]]>
|
Zeile 2238 | Zeile 2261 |
---|
if($mybb->input['action'] == "edit_stylesheet" && $mybb->input['mode'] == "advanced") { // Fetch the theme we want to edit this stylesheet in
|
if($mybb->input['action'] == "edit_stylesheet" && $mybb->input['mode'] == "advanced") { // Fetch the theme we want to edit this stylesheet in
|
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
| $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
|
$theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1)
| $theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1)
|
Zeile 2261 | Zeile 2284 |
---|
// Does the theme not exist? if(!$stylesheet['sid'])
|
// Does the theme not exist? if(!$stylesheet['sid'])
|
{ flash_message($lang->error_invalid_stylesheet, 'error');
| { flash_message($lang->error_invalid_stylesheet, 'error');
|
admin_redirect("index.php?module=style-themes"); }
| admin_redirect("index.php?module=style-themes"); }
|
Zeile 2319 | Zeile 2342 |
---|
{ $page->extra_header .= ' <link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">
|
{ $page->extra_header .= ' <link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">
|
<link href="./jscripts/codemirror/theme/mybb.css" rel="stylesheet">
| <link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet">
|
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js"></script> <script src="./jscripts/codemirror/mode/css/css.js"></script>
| <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js"></script> <script src="./jscripts/codemirror/mode/css/css.js"></script>
|
Zeile 2331 | Zeile 2354 |
---|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}"); $page->add_breadcrumb_item("{$lang->editing} ".htmlspecialchars_uni($stylesheet['name']), "index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&file=".htmlspecialchars_uni($mybb->input['file'])."&mode=advanced");
|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}"); $page->add_breadcrumb_item("{$lang->editing} ".htmlspecialchars_uni($stylesheet['name']), "index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&file=".htmlspecialchars_uni($mybb->input['file'])."&mode=advanced");
|
|
|
$page->output_header("{$lang->themes} - {$lang->edit_stylesheet_advanced_mode}");
// If the stylesheet and theme do not match, we must be editing something that is inherited
| $page->output_header("{$lang->themes} - {$lang->edit_stylesheet_advanced_mode}");
// If the stylesheet and theme do not match, we must be editing something that is inherited
|
Zeile 2366 | Zeile 2389 |
---|
// 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');
|
Zeile 2379 | Zeile 2402 |
---|
$table = new Table; $table->construct_cell($form->generate_text_area('stylesheet', $stylesheet['stylesheet'], array('id' => 'stylesheet', 'style' => 'width: 99%;', 'class' => '', 'rows' => '30'))); $table->construct_row();
|
$table = new Table; $table->construct_cell($form->generate_text_area('stylesheet', $stylesheet['stylesheet'], array('id' => 'stylesheet', 'style' => 'width: 99%;', 'class' => '', 'rows' => '30'))); $table->construct_row();
|
$table->output("{$lang->full_stylesheet_for} ".htmlspecialchars_uni($stylesheet['name']));
| $table->output($lang->full_stylesheet_for.' '.htmlspecialchars_uni($stylesheet['name']), 1, 'tfixed');
|
$buttons[] = $form->generate_submit_button($lang->save_changes, array('id' => 'save', 'name' => 'save')); $buttons[] = $form->generate_submit_button($lang->save_changes_and_close, array('id' => 'save_close', 'name' => 'save_close'));
| $buttons[] = $form->generate_submit_button($lang->save_changes, array('id' => 'save', 'name' => 'save')); $buttons[] = $form->generate_submit_button($lang->save_changes_and_close, array('id' => 'save_close', 'name' => 'save_close'));
|
Zeile 2390 | Zeile 2413 |
---|
if($admin_options['codepress'] != 0) {
|
if($admin_options['codepress'] != 0) {
|
echo "<script type=\"text/javascript\"> var editor = CodeMirror.fromTextArea(document.getElementById(\"stylesheet\"), {
| echo '<script type="text/javascript"> var editor = CodeMirror.fromTextArea(document.getElementById("stylesheet"), {
|
lineNumbers: true,
|
lineNumbers: true,
|
tabMode: \"indent\", theme: \"mybb\", lineWrapping: true });</script>";
| lineWrapping: true, viewportMargin: Infinity, indentWithTabs: true, indentUnit: 4, mode: "text/css", theme: "mybb" });</script>';
|
}
$page->output_footer();
| }
$page->output_footer();
|
Zeile 2405 | Zeile 2431 |
---|
if($mybb->input['action'] == "delete_stylesheet") { // Fetch the theme we want to edit this stylesheet in
|
if($mybb->input['action'] == "delete_stylesheet") { // Fetch the theme we want to edit this stylesheet in
|
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
| $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
|
$theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1)
| $theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1)
|
Zeile 2443 | Zeile 2469 |
---|
{ $db->delete_query("themestylesheets", "sid='{$stylesheet['sid']}'", 1); @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");
|
{ $db->delete_query("themestylesheets", "sid='{$stylesheet['sid']}'", 1); @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$stylesheet['cachefile']}");
|
| $filename_min = str_replace('.css', '.min.css', $stylesheet['cachefile']); @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}");
|
// Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid'], $theme, true);
| // Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid'], $theme, true);
|
Zeile 2464 | Zeile 2493 |
---|
if($mybb->input['action'] == "add_stylesheet") { // Fetch the theme we want to edit this stylesheet in
|
if($mybb->input['action'] == "add_stylesheet") { // Fetch the theme we want to edit this stylesheet in
|
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
| $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
|
$theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1)
| $theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1)
|
Zeile 2558 | Zeile 2587 |
---|
// Add Stylesheet $insert_array = array( 'name' => $db->escape_string($mybb->input['name']),
|
// Add Stylesheet $insert_array = array( 'name' => $db->escape_string($mybb->input['name']),
|
'tid' => $mybb->get_input('tid', 1),
| 'tid' => $mybb->get_input('tid', MyBB::INPUT_INT),
|
'attachedto' => implode('|', array_map(array($db, "escape_string"), $attached)), 'stylesheet' => $db->escape_string($stylesheet), 'cachefile' => $db->escape_string(str_replace('/', '', $mybb->input['name'])),
| 'attachedto' => implode('|', array_map(array($db, "escape_string"), $attached)), 'stylesheet' => $db->escape_string($stylesheet), 'cachefile' => $db->escape_string(str_replace('/', '', $mybb->input['name'])),
|
Zeile 2589 | Zeile 2618 |
---|
{ $page->extra_header .= ' <link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">
|
{ $page->extra_header .= ' <link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">
|
<link href="./jscripts/codemirror/theme/mybb.css" rel="stylesheet">
| <link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet">
|
<link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js"></script> <script src="./jscripts/codemirror/mode/css/css.js"></script>
| <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js"></script> <script src="./jscripts/codemirror/mode/css/css.js"></script>
|
Zeile 2812 | Zeile 2841 |
---|
echo $form->generate_hidden_field("sid", $stylesheet['sid'])."<br />\n";
|
echo $form->generate_hidden_field("sid", $stylesheet['sid'])."<br />\n";
|
$form_container = new FormContainer("{$lang->add_stylesheet_to} ".htmlspecialchars_uni($theme['name']));
| $form_container = new FormContainer($lang->add_stylesheet_to.' '.htmlspecialchars_uni($theme['name']), 'tfixed');
|
$form_container->output_row($lang->file_name, $lang->file_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name', 'style' => 'width: 200px;')), 'name');
$form_container->output_row($lang->attached_to, $lang->attached_to_desc, $actions);
| $form_container->output_row($lang->file_name, $lang->file_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name', 'style' => 'width: 200px;')), 'name');
$form_container->output_row($lang->attached_to, $lang->attached_to_desc, $actions);
|
Zeile 2846 | Zeile 2875 |
---|
if($admin_options['codepress'] != 0) {
|
if($admin_options['codepress'] != 0) {
|
echo "<script type=\"text/javascript\"> var editor = CodeMirror.fromTextArea(document.getElementById(\"stylesheet\"), {
| echo '<script type="text/javascript"> var editor = CodeMirror.fromTextArea(document.getElementById("stylesheet"), {
|
lineNumbers: true,
|
lineNumbers: true,
|
tabMode: \"indent\", theme: \"mybb\", lineWrapping: true });</script>";
| lineWrapping: true, viewportMargin: Infinity, indentWithTabs: true, indentUnit: 4, mode: "text/css", theme: "mybb" });</script>';
|
}
|
}
|
echo '<script type="text/javascript" src="./jscripts/themes.js"></script>';
| echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1804"></script>';
|
echo '<script type="text/javascript" src="./jscripts/theme_properties.js"></script>'; echo '<script type="text/javascript"> $(function() {
| echo '<script type="text/javascript" src="./jscripts/theme_properties.js"></script>'; echo '<script type="text/javascript"> $(function() {
|
Zeile 2879 | Zeile 2911 |
---|
admin_redirect("index.php?module=style-themes"); }
|
admin_redirect("index.php?module=style-themes"); }
|
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
| $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
|
$theme = $db->fetch_array($query);
// Does the theme not exist?
| $theme = $db->fetch_array($query);
// Does the theme not exist?
|
Zeile 2894 | Zeile 2926 |
---|
$cache->update('default_theme', $theme);
$db->update_query("themes", array('def' => 0));
|
$cache->update('default_theme', $theme);
$db->update_query("themes", array('def' => 0));
|
$db->update_query("themes", array('def' => 1), "tid='".$mybb->get_input('tid', 1)."'");
| $db->update_query("themes", array('def' => 1), "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
|
$plugins->run_hooks("admin_style_themes_set_default_commit");
| $plugins->run_hooks("admin_style_themes_set_default_commit");
|
Zeile 2907 | Zeile 2939 |
---|
if($mybb->input['action'] == "force") {
|
if($mybb->input['action'] == "force") {
|
$query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', 1)."'");
| $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'");
|
$theme = $db->fetch_array($query);
// Does the theme not exist?
| $theme = $db->fetch_array($query);
// Does the theme not exist?
|