Zeile 168 | Zeile 168 |
---|
// Convert to mods site version codes $search_version = ($major_version_code/100).'x';
|
// Convert to mods site version codes $search_version = ($major_version_code/100).'x';
|
$contents = fetch_remote_file("http://community.mybb.com/xmlbrowse.php?type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);
| $contents = fetch_remote_file("https://community.mybb.com/xmlbrowse.php?type=themes&version={$search_version}{$keywords}{$url_page}", $post_data);
|
if(!$contents) {
| if(!$contents) {
|
Zeile 214 | Zeile 214 |
---|
); $result['download_url']['value'] = htmlspecialchars_uni(html_entity_decode($result['download_url']['value']));
|
); $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("<img src=\"https://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>{$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("<strong><a href=\"https://community.mybb.com/{$result['download_url']['value']}\" target=\"_blank\" rel=\"noopener\">{$lang->download}</a></strong>", array("class" => "align_center"));
|
$table->construct_row(); } }
| $table->construct_row(); } }
|
Zeile 243 | Zeile 243 |
---|
echo "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n"; echo "<script type=\"text/javascript\"> var form = $(\"#search_form\");
|
echo "<input type=\"submit\" class=\"search_button\" value=\"{$lang->search}\" />\n"; echo "<script type=\"text/javascript\"> var form = $(\"#search_form\");
|
form.submit(function()
| form.on('submit', function()
|
{ var search = $('#search_keywords'); if(search.val() == '' || search.val() == '{$lang->search_for_themes}') {
|
{ var search = $('#search_keywords'); if(search.val() == '' || search.val() == '{$lang->search_for_themes}') {
|
search.focus();
| search.trigger('focus');
|
return false; } });
var search = $('#search_keywords');
|
return false; } });
var search = $('#search_keywords');
|
search.focus(function()
| search.on('focus', function()
|
{ var search_focus = $(this); if(search_focus.val() == '{$lang->search_for_themes}')
| { var search_focus = $(this); if(search_focus.val() == '{$lang->search_for_themes}')
|
Zeile 262 | Zeile 262 |
---|
search_focus.removeClass('search_default'); search_focus.val(''); }
|
search_focus.removeClass('search_default'); search_focus.val(''); }
|
});
search.blur(function()
| }).on('blur', function()
|
{ var search_blur = $(this); if(search_blur.val() == '')
| { var search_blur = $(this); if(search_blur.val() == '')
|
Zeile 284 | Zeile 282 |
---|
echo $search->end();
// Recommended themes = Default; Otherwise search results & pagination
|
echo $search->end();
// Recommended themes = Default; Otherwise search results & pagination
|
if($mybb->request_method == "post") { $table->output("<span style=\"float: right;\"><small><a href=\"http://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version)); }
| if($mybb->request_method == "post") { $table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_for_mybb, $mybb->version)); }
|
else {
|
else {
|
$table->output("<span style=\"float: right;\"><small><a href=\"http://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->recommended_themes_for_mybb, $mybb->version));
| $table->output("<span style=\"float: right;\"><small><a href=\"https://community.mybb.com/mods.php?action=browse&category=themes\" target=\"_blank\" rel=\"noopener\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->recommended_themes_for_mybb, $mybb->version));
|
}
|
}
|
|
|
echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=style-themes&action=browse{$keywords}&page={page}");
|
echo "<br />".draw_admin_pagination($mybb->input['page'], 15, $tree['results']['attributes']['total'], "index.php?module=style-themes&action=browse{$keywords}&page={page}");
|
|
|
$page->output_footer(); }
|
$page->output_footer(); }
|
|
|
if($mybb->input['action'] == "import") { $plugins->run_hooks("admin_style_themes_import");
| if($mybb->input['action'] == "import") { $plugins->run_hooks("admin_style_themes_import");
|
Zeile 307 | Zeile 305 |
---|
if(!$_FILES['local_file'] && !$mybb->input['url']) { $errors[] = $lang->error_missing_url;
|
if(!$_FILES['local_file'] && !$mybb->input['url']) { $errors[] = $lang->error_missing_url;
|
}
| }
|
if(!$errors) {
| if(!$errors) {
|
Zeile 316 | Zeile 314 |
---|
{ // Find out if there was an error with the uploaded file if($_FILES['local_file']['error'] != 0)
|
{ // Find out if there was an error with the uploaded file if($_FILES['local_file']['error'] != 0)
|
{
| {
|
$errors[] = $lang->error_uploadfailed.$lang->error_uploadfailed_detail; switch($_FILES['local_file']['error']) {
| $errors[] = $lang->error_uploadfailed.$lang->error_uploadfailed_detail; switch($_FILES['local_file']['error']) {
|
Zeile 331 | Zeile 329 |
---|
break; case 6: // UPLOAD_ERR_NO_TMP_DIR $errors[] = $lang->error_uploadfailed_php6;
|
break; case 6: // UPLOAD_ERR_NO_TMP_DIR $errors[] = $lang->error_uploadfailed_php6;
|
break;
| break;
|
case 7: // UPLOAD_ERR_CANT_WRITE $errors[] = $lang->error_uploadfailed_php7; break;
| case 7: // UPLOAD_ERR_CANT_WRITE $errors[] = $lang->error_uploadfailed_php7; break;
|
Zeile 347 | Zeile 345 |
---|
if(!is_uploaded_file($_FILES['local_file']['tmp_name'])) { $errors[] = $lang->error_uploadfailed_lost;
|
if(!is_uploaded_file($_FILES['local_file']['tmp_name'])) { $errors[] = $lang->error_uploadfailed_lost;
|
}
| }
|
// Get the contents $contents = @file_get_contents($_FILES['local_file']['tmp_name']); // Delete the temporary file if possible
| // Get the contents $contents = @file_get_contents($_FILES['local_file']['tmp_name']); // Delete the temporary file if possible
|
Zeile 357 | Zeile 355 |
---|
{ $errors[] = $lang->error_uploadfailed_nocontents; }
|
{ $errors[] = $lang->error_uploadfailed_nocontents; }
|
}
| }
|
} else if(!empty($mybb->input['url'])) {
| } else if(!empty($mybb->input['url'])) {
|
Zeile 367 | Zeile 365 |
---|
{ $errors[] = $lang->error_local_file; }
|
{ $errors[] = $lang->error_local_file; }
|
}
| }
|
else { // UPLOAD_ERR_NO_FILE
| else { // UPLOAD_ERR_NO_FILE
|
Zeile 388 | Zeile 386 |
---|
if($theme_id > -1) { $plugins->run_hooks("admin_style_themes_import_commit");
|
if($theme_id > -1) { $plugins->run_hooks("admin_style_themes_import_commit");
|
|
|
// Log admin action log_admin_action($theme_id);
| // Log admin action log_admin_action($theme_id);
|
Zeile 549 | Zeile 547 |
---|
$xml .= "\t\t<{$property}><![CDATA[{$value}]]></{$property}>\r\n"; } $xml .= "\t</properties>\r\n";
|
$xml .= "\t\t<{$property}><![CDATA[{$value}]]></{$property}>\r\n"; } $xml .= "\t</properties>\r\n";
|
|
|
// Fetch list of all of the stylesheets for this theme $file_stylesheets = my_unserialize($theme['stylesheets']);
| // Fetch list of all of the stylesheets for this theme $file_stylesheets = my_unserialize($theme['stylesheets']);
|
Zeile 578 | Zeile 576 |
---|
} } }
|
} } }
|
} }
| } }
|
$inherited_load[] = $mybb->input['tid'];
|
$inherited_load[] = $mybb->input['tid'];
|
$inherited_load = array_unique($inherited_load);
$inherited_themes = array(); if(count($inherited_load) > 0)
| $inherited_load = array_unique($inherited_load);
$inherited_themes = $theme_stylesheets = array(); if(count($inherited_load) > 0)
|
{ $query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")"); while($inherited_theme = $db->fetch_array($query)) { $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];
|
{ $query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")"); while($inherited_theme = $db->fetch_array($query)) { $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];
|
} }
$theme_stylesheets = array();
if(count($inherited_load) > 0) {
| }
|
$query = $db->simple_select("themestylesheets", "*", "tid IN (".implode(",", $inherited_load).")", array('order_by' => 'tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
| $query = $db->simple_select("themestylesheets", "*", "tid IN (".implode(",", $inherited_load).")", array('order_by' => 'tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
|
Zeile 614 | Zeile 607 |
---|
{ 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 667 | Zeile 660 |
---|
$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'], htmlspecialchars_uni($theme['name']));
| log_admin_action($theme['tid'], $theme['name']);
|
$theme['name'] = rawurlencode($theme['name']); header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml");
| $theme['name'] = rawurlencode($theme['name']); header("Content-disposition: attachment; filename=".$theme['name']."-theme.xml");
|
Zeile 677 | Zeile 670 |
---|
header("Expires: 0"); echo $xml; exit;
|
header("Expires: 0"); echo $xml; exit;
|
}
| }
|
$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($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}");
|
Zeile 716 | Zeile 709 |
---|
$form = new Form("index.php?module=style-themes&action=export", "post"); echo $form->generate_hidden_field("tid", $theme['tid']);
|
$form = new Form("index.php?module=style-themes&action=export", "post"); echo $form->generate_hidden_field("tid", $theme['tid']);
|
|
|
$form_container = new FormContainer($lang->export_theme.": ".htmlspecialchars_uni($theme['name'])); $form_container->output_row($lang->include_custom_only, $lang->include_custom_only_desc, $form->generate_yes_no_radio('custom_theme', $mybb->input['custom_theme']), 'custom_theme'); $form_container->output_row($lang->include_templates, $lang->include_templates_desc, $form->generate_yes_no_radio('include_templates', $mybb->input['include_templates']), 'include_templates');
| $form_container = new FormContainer($lang->export_theme.": ".htmlspecialchars_uni($theme['name'])); $form_container->output_row($lang->include_custom_only, $lang->include_custom_only_desc, $form->generate_yes_no_radio('custom_theme', $mybb->input['custom_theme']), 'custom_theme'); $form_container->output_row($lang->include_templates, $lang->include_templates_desc, $form->generate_yes_no_radio('include_templates', $mybb->input['include_templates']), 'include_templates');
|
Zeile 725 | Zeile 718 |
---|
$buttons[] = $form->generate_submit_button($lang->export_theme);
|
$buttons[] = $form->generate_submit_button($lang->export_theme);
|
$form->output_submit_wrapper($buttons);
| $form->output_submit_wrapper($buttons);
|
$form->end();
$page->output_footer();
| $form->end();
$page->output_footer();
|
Zeile 736 | Zeile 729 |
---|
{ $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'"); $theme = $db->fetch_array($query);
|
{ $query = $db->simple_select("themes", "*", "tid='".$mybb->get_input('tid', MyBB::INPUT_INT)."'"); $theme = $db->fetch_array($query);
|
|
|
// Does the theme not exist? if(!$theme['tid'])
|
// Does the theme not exist? if(!$theme['tid'])
|
{
| {
|
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 756 | Zeile 749 |
---|
{ $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) { $errors[] = $lang->error_theme_already_exists;
| if($numthemes) { $errors[] = $lang->error_theme_already_exists;
|
Zeile 766 | Zeile 759 |
---|
if(!$errors) { $properties = my_unserialize($theme['properties']);
|
if(!$errors) { $properties = my_unserialize($theme['properties']);
|
$sid = $properties['sid'];
| $sid = $properties['templateset'];
|
$nprops = null; if($mybb->input['duplicate_templates']) {
| $nprops = null; if($mybb->input['duplicate_templates']) {
|
Zeile 911 | Zeile 904 |
---|
$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(htmlspecialchars_uni($mybb->input['name']), $tid);
| log_admin_action($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 1010 | Zeile 1003 |
---|
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");
| } @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html");
|
Zeile 1021 | Zeile 1017 |
---|
$db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");
@rmdir(MYBB_ROOT."cache/themes/theme{$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']); $child_tid = $children[0];
$db->update_query("themes", array('pid' => $theme['pid']), "tid='{$child_tid}'");
| $children = (array)make_child_theme_list($theme['tid']); $child_tids = array();
foreach($children as $child_tid) { if($child_tid != 0) { $child_tids[] = $child_tid; } }
if(!empty($child_tids)) { $db->update_query("themes", array('pid' => $theme['pid']), "tid IN (".implode(',', $child_tids).")"); }
|
$db->delete_query("themes", "tid='{$theme['tid']}'", 1);
$plugins->run_hooks("admin_style_themes_delete_commit");
// Log admin action
|
$db->delete_query("themes", "tid='{$theme['tid']}'", 1);
$plugins->run_hooks("admin_style_themes_delete_commit");
// Log admin action
|
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($theme['tid'], $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 1040 | Zeile 1047 |
---|
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);
|
}
| }
|
}
if($mybb->input['action'] == "edit")
| }
if($mybb->input['action'] == "edit")
|
Zeile 1080 | Zeile 1087 |
---|
foreach($colors as $color) {
|
foreach($colors as $color) {
|
$color = explode("=", $color);
$properties['colors'][$color[0]] = $color[1];
| $color = trim($color); if(preg_match('/^[a-z0-9]+={1}[a-z0-9]+$/i', $color)) { $color = explode("=", $color); $properties['colors'][$color[0]] = $color[1]; } else { $errors[] = $lang->sprintf($lang->error_invalid_color, $color); }
|
} }
|
} }
|
if($properties['templateset'] <= 0) { $errors[] = $lang->error_invalid_templateset; }
$theme_properties = my_unserialize($theme['properties']); if($theme_properties['disporder']) { $properties['disporder'] = $theme_properties['disporder']; }
| if($properties['templateset'] <= 0) { $errors[] = $lang->error_invalid_templateset; }
$theme_properties = my_unserialize($theme['properties']); if(is_array($theme_properties['disporder'])) { $properties['disporder'] = $theme_properties['disporder']; } else { $errors[] = $lang->error_no_display_order; }
|
$allowedgroups = array(); if(is_array($mybb->input['allowedgroups'])) {
| $allowedgroups = array(); if(is_array($mybb->input['allowedgroups'])) {
|
Zeile 1122 | Zeile 1140 |
---|
'allowedgroups' => $allowedgroups, 'properties' => $db->escape_string(my_serialize($properties)) );
|
'allowedgroups' => $allowedgroups, 'properties' => $db->escape_string(my_serialize($properties)) );
|
|
|
// perform validation if(!$update_array['name']) { $errors[] = $lang->error_missing_name; } else
|
// perform validation if(!$update_array['name']) { $errors[] = $lang->error_missing_name; } else
|
{
| {
|
$query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($update_array['name'])."' AND tid != '{$theme['tid']}'"); $numthemes = $db->fetch_field($query, 'numthemes');
if($numthemes) { $errors[] = $lang->error_theme_already_exists;
|
$query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($update_array['name'])."' AND tid != '{$theme['tid']}'"); $numthemes = $db->fetch_field($query, 'numthemes');
if($numthemes) { $errors[] = $lang->error_theme_already_exists;
|
}
| }
|
}
if($update_array['pid'])
| }
if($update_array['pid'])
|
Zeile 1149 | Zeile 1167 |
---|
} } if($properties['templateset'])
|
} } if($properties['templateset'])
|
{
| {
|
$query = $db->simple_select("templatesets", "sid", "sid='".$properties['templateset']."'"); $ts_check = $db->fetch_field($query, "sid"); if(!$ts_check) { unset($properties['templateset']);
|
$query = $db->simple_select("templatesets", "sid", "sid='".$properties['templateset']."'"); $ts_check = $db->fetch_field($query, "sid"); if(!$ts_check) { unset($properties['templateset']);
|
}
| }
|
} if(!$properties['templateset'])
|
} if(!$properties['templateset'])
|
{
| {
|
$errors[] = $lang->error_invalid_templateset;
|
$errors[] = $lang->error_invalid_templateset;
|
} if(!$properties['editortheme'] || !file_exists(MYBB_ROOT."jscripts/sceditor/editor_themes/".$properties['editortheme']) || is_dir(MYBB_ROOT."jscripts/sceditor/editor_themes/".$properties['editortheme'])) {
| } if(!$properties['editortheme'] || !file_exists(MYBB_ROOT."jscripts/sceditor/themes/".$properties['editortheme']) || is_dir(MYBB_ROOT."jscripts/sceditor/themes/".$properties['editortheme'])) {
|
$errors[] = $lang->error_invalid_editortheme; }
|
$errors[] = $lang->error_invalid_editortheme; }
|
|
|
if(empty($errors)) { $plugins->run_hooks("admin_style_themes_edit_commit");
$db->update_query("themes", $update_array, "tid='{$theme['tid']}'");
|
if(empty($errors)) { $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) { $cache->update_default_theme();
|
if($theme['def'] == 1) { $cache->update_default_theme();
|
}
| }
|
// Log admin action
|
// Log admin action
|
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($theme['tid'], $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 1219 | Zeile 1238 |
---|
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
$inherited_themes = array();
| $inherited_themes = $theme_stylesheets = array();
|
if(count($inherited_load) > 0) { $query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
| if(count($inherited_load) > 0) { $query = $db->simple_select("themes", "tid, name", "tid IN (".implode(",", $inherited_load).")");
|
Zeile 1227 | Zeile 1246 |
---|
{ $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name']; }
|
{ $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name']; }
|
}
$theme_stylesheets = array();
| |
|
|
if(count($inherited_load) > 0) {
| |
$query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
| $query = $db->simple_select("themestylesheets", "*", "", array('order_by' => 'sid DESC, tid', 'order_dir' => 'desc')); while($theme_stylesheet = $db->fetch_array($query)) {
|
Zeile 1338 | Zeile 1352 |
---|
{ 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 1355 | Zeile 1369 |
---|
{ 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 1440 | Zeile 1454 |
---|
// It's a file: ++$count;
|
// It's a file: ++$count;
|
| $name = htmlspecialchars_uni($name);
|
if($actions[0] != "global") {
|
if($actions[0] != "global") {
|
| $actions = array_map('htmlspecialchars_uni', $actions);
|
$name = "{$name} ({$lang->actions}: ".implode(',', $actions).")"; }
| $name = "{$name} ({$lang->actions}: ".implode(',', $actions).")"; }
|
Zeile 1451 | Zeile 1469 |
---|
$sep = " {$lang->and} "; } $attached_to .= $sep.$name;
|
$sep = " {$lang->and} "; } $attached_to .= $sep.$name;
|
|
|
$sep = $lang->comma;
|
$sep = $lang->comma;
|
}
| }
|
if($attached_to) { $attached_to = "<small>{$lang->attached_to} {$attached_to}</small>"; }
if(count($colors))
|
if($attached_to) { $attached_to = "<small>{$lang->attached_to} {$attached_to}</small>"; }
if(count($colors))
|
{
| {
|
// Attached to color instead of files. $count = 1; $color_list = $sep = '';
|
// Attached to color instead of files. $count = 1; $color_list = $sep = '';
|
|
|
foreach($colors as $color) { if($count == count($colors) && $count > 1) { $sep = " {$lang->and} "; }
|
foreach($colors as $color) { if($count == count($colors) && $count > 1) { $sep = " {$lang->and} "; }
|
|
|
$color_list .= $sep.trim($color); ++$count;
|
$color_list .= $sep.trim($color); ++$count;
|
|
|
$sep = ', '; }
$attached_to = "<small>{$lang->attached_to} ".$lang->sprintf($lang->colors_attached_to)." {$color_list}</small>";
|
$sep = ', '; }
$attached_to = "<small>{$lang->attached_to} ".$lang->sprintf($lang->colors_attached_to)." {$color_list}</small>";
|
}
| }
|
if($attached_to == '') { // Orphaned! :( $attached_to = "<small>{$lang->attached_to_nothing}</small>"; }
|
if($attached_to == '') { // Orphaned! :( $attached_to = "<small>{$lang->attached_to_nothing}</small>"; }
|
}
| }
|
else
|
else
|
{
| {
|
$attached_to = "<small>{$lang->attached_to_all_pages}</small>"; }
|
$attached_to = "<small>{$lang->attached_to_all_pages}</small>"; }
|
|
|
$popup = new PopupMenu("style_{$style['sid']}", $lang->options);
$popup->add_item($lang->edit_style, "index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($filename)."&tid={$theme['tid']}");
| $popup = new PopupMenu("style_{$style['sid']}", $lang->options);
$popup->add_item($lang->edit_style, "index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($filename)."&tid={$theme['tid']}");
|
Zeile 1501 | Zeile 1519 |
---|
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($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_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;', 'min' => 0)), array("class" => "align_center")); $table->construct_cell($popup->fetch(), array("class" => "align_center"));
|
Zeile 1510 | Zeile 1528 |
---|
}
$table->output("{$lang->stylesheets_in} ".htmlspecialchars_uni($theme['name']));
|
}
$table->output("{$lang->stylesheets_in} ".htmlspecialchars_uni($theme['name']));
|
|
|
$buttons = array($form->generate_submit_button($lang->save_stylesheet_order)); $form->output_submit_wrapper($buttons); $form->end();
| $buttons = array($form->generate_submit_button($lang->save_stylesheet_order)); $form->output_submit_wrapper($buttons); $form->end();
|
Zeile 1521 | Zeile 1539 |
---|
if($errors) { $page->output_inline_error($errors);
|
if($errors) { $page->output_inline_error($errors);
|
}
| }
|
$form = new Form("index.php?module=style-themes&action=edit", "post", "edit"); echo $form->generate_hidden_field("tid", $theme['tid']); $form_container = new FormContainer($lang->edit_theme_properties);
| $form = new Form("index.php?module=style-themes&action=edit", "post", "edit"); echo $form->generate_hidden_field("tid", $theme['tid']); $form_container = new FormContainer($lang->edit_theme_properties);
|
Zeile 1549 | Zeile 1567 |
---|
$form_container->output_row($lang->template_set." <em>*</em>", $lang->template_set_desc, $form->generate_select_box('templateset', $options, $properties['templateset'], array('id' => 'templateset')), 'templateset');
$options = array();
|
$form_container->output_row($lang->template_set." <em>*</em>", $lang->template_set_desc, $form->generate_select_box('templateset', $options, $properties['templateset'], array('id' => 'templateset')), 'templateset');
$options = array();
|
$editor_theme_root = MYBB_ROOT."jscripts/sceditor/editor_themes/";
| $editor_theme_root = MYBB_ROOT."jscripts/sceditor/themes/";
|
if($dh = @opendir($editor_theme_root)) { while($dir = readdir($dh))
| if($dh = @opendir($editor_theme_root)) { while($dir = readdir($dh))
|
Zeile 1603 | Zeile 1621 |
---|
$buttons = array(); $buttons[] = $form->generate_submit_button($lang->save_theme_properties);
|
$buttons = array(); $buttons[] = $form->generate_submit_button($lang->save_theme_properties);
|
$form->output_submit_wrapper($buttons); $form->end();
| $form->output_submit_wrapper($buttons); $form->end();
|
$page->output_footer(); }
| $page->output_footer(); }
|
Zeile 1664 | Zeile 1682 |
---|
if(get_extension($mybb->input['name']) != "css") { // Does not end with '.css'
|
if(get_extension($mybb->input['name']) != "css") { // Does not end with '.css'
|
$errors[] = $lang->sprintf($lang->error_missing_stylesheet_extension, $mybb->input['name']);
| $errors[] = $lang->sprintf( $lang->error_missing_stylesheet_extension, htmlspecialchars_uni($mybb->input['name']) );
|
}
if(!$errors)
| }
if(!$errors)
|
Zeile 1738 | Zeile 1759 |
---|
$update_d = true;
$db->update_query("themestylesheets", array('lastmodified' => TIME_NOW), "sid='{$stylesheet['sid']}'", 1);
|
$update_d = true;
$db->update_query("themestylesheets", array('lastmodified' => TIME_NOW), "sid='{$stylesheet['sid']}'", 1);
|
if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $theme['stylesheet']))
| if(!cache_stylesheet($theme['tid'], str_replace('/', '', $mybb->input['name']), $stylesheet['stylesheet']))
|
{ $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");
|
$plugins->run_hooks("admin_style_themes_stylesheet_properties_commit");
|
|
|
// Log admin action
|
// Log admin action
|
log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($stylesheet['sid'], $mybb->input['name'], $theme['tid'], $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']);
| }
$properties = my_unserialize($theme['properties']);
|
Zeile 1831 | Zeile 1855 |
---|
{ // Verify this is a color for this theme if(array_key_exists($name, $properties['colors']))
|
{ // Verify this is a color for this theme if(array_key_exists($name, $properties['colors']))
|
{
| {
|
$stylesheet['colors'][] = $name; }
| $stylesheet['colors'][] = $name; }
|
Zeile 1908 | Zeile 1932 |
---|
{ $specific_colors = "<div id=\"attach_2\" class=\"attachs\">"; $specific_colors_option = '<dt><label style="display: block;"><input type="radio" name="attach" value="2" '.$global_checked[3].' class="attachs_check" onclick="checkAction(\'attach\');" style="vertical-align: middle;" /> '.$lang->colors_specific_color.'</label></dt><br />';
|
{ $specific_colors = "<div id=\"attach_2\" class=\"attachs\">"; $specific_colors_option = '<dt><label style="display: block;"><input type="radio" name="attach" value="2" '.$global_checked[3].' class="attachs_check" onclick="checkAction(\'attach\');" style="vertical-align: middle;" /> '.$lang->colors_specific_color.'</label></dt><br />';
|
$specific_color = " <small>{$lang->colors_add_edit_desc}</small> <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>"; }
$actions = '<script type="text/javascript"> function checkAction(id) { var checked = \'\';
$(\'.\'+id+\'s_check\').each(function(e, val) { if($(this).prop(\'checked\') == true) { checked = $(this).val(); } }); $(\'.\'+id+\'s\').each(function(e) { $(this).hide(); }); if($(\'#\'+id+\'_\'+checked))
| $specific_color = " <small>{$lang->colors_add_edit_desc}</small> <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>"; }
$actions = '<script type="text/javascript"> function checkAction(id) { var checked = \'\';
$(\'.\'+id+\'s_check\').each(function(e, val) { if($(this).prop(\'checked\') == true) { checked = $(this).val(); } }); $(\'.\'+id+\'s\').each(function(e) { $(this).hide(); }); if($(\'#\'+id+\'_\'+checked))
|
{ $(\'#\'+id+\'_\'+checked).show(); }
| { $(\'#\'+id+\'_\'+checked).show(); }
|
Zeile 1952 | Zeile 1976 |
---|
<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 1969 | Zeile 1993 |
---|
echo <<<EOF
|
echo <<<EOF
|
<script type="text/javascript" src="./jscripts/theme_properties.js"></script>
| <script type="text/javascript" src="./jscripts/theme_properties.js?ver=1821"></script>
|
<script type="text/javascript"> <!--- themeProperties.setup('{$count}'); // --> </script> EOF;
|
<script type="text/javascript"> <!--- themeProperties.setup('{$count}'); // --> </script> EOF;
|
$form->end();
$page->output_footer();
| $form->end();
$page->output_footer();
|
}
// 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
|
Zeile 1990 | Zeile 2014 |
---|
$theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1)
|
$theme = $db->fetch_array($query);
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"); }
$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple");
| admin_redirect("index.php?module=style-themes"); }
$plugins->run_hooks("admin_style_themes_edit_stylesheet_simple");
|
$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 2020 | Zeile 2044 |
---|
// 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'])
|
{
| {
|
$sid = copy_stylesheet_to_theme($stylesheet, $theme['tid']); }
| $sid = copy_stylesheet_to_theme($stylesheet, $theme['tid']); }
|
Zeile 2056 | Zeile 2080 |
---|
// Now we have the new stylesheet, save it $updated_stylesheet = array( "cachefile" => $db->escape_string($stylesheet['name']),
|
// Now we have the new stylesheet, save it $updated_stylesheet = array( "cachefile" => $db->escape_string($stylesheet['name']),
|
"stylesheet" => $db->escape_string(unfix_css_urls($new_stylesheet)),
| "stylesheet" => $db->escape_string($new_stylesheet),
|
"lastmodified" => TIME_NOW ); $db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");
| "lastmodified" => TIME_NOW ); $db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");
|
Zeile 2143 | Zeile 2167 |
---|
else { $page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent), "ajax_alert");
|
else { $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",
| $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",
|
Zeile 2231 | Zeile 2255 |
---|
$form->output_submit_wrapper($buttons);
|
$form->output_submit_wrapper($buttons);
|
echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1804"></script>';
| echo '<script type="text/javascript" src="./jscripts/themes.js?ver=1808"></script>';
|
echo '<script type="text/javascript">
|
echo '<script type="text/javascript">
|
$(document).ready(function() {
| $(function() {
|
//<![CDATA[ ThemeSelector.init("./index.php?module=style-themes&action=xmlhttp_stylesheet", "./index.php?module=style-themes&action=edit_stylesheet", $("#selector"), $("#stylesheet"), "'.htmlspecialchars_uni($mybb->input['file']).'", $("#selector_form"), "'.$mybb->input['tid'].'"); lang.saving = "'.$lang->saving.'";
| //<![CDATA[ ThemeSelector.init("./index.php?module=style-themes&action=xmlhttp_stylesheet", "./index.php?module=style-themes&action=edit_stylesheet", $("#selector"), $("#stylesheet"), "'.htmlspecialchars_uni($mybb->input['file']).'", $("#selector_form"), "'.$mybb->input['tid'].'"); lang.saving = "'.$lang->saving.'";
|
Zeile 2246 | Zeile 2270 |
---|
$page->output_footer(); }
|
$page->output_footer(); }
|
|
|
if($mybb->input['action'] == "edit_stylesheet" && $mybb->input['mode'] == "advanced")
|
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', MyBB::INPUT_INT)."'"); $theme = $db->fetch_array($query);
if(!$theme['tid'] || $theme['tid'] == 1) { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes"); }
$plugins->run_hooks("admin_style_themes_edit_stylesheet_advanced");
$parent_list = make_parent_theme_list($theme['tid']); $parent_list = implode(',', $parent_list); 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);
| { // 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'); admin_redirect("index.php?module=style-themes"); }
$plugins->run_hooks("admin_style_themes_edit_stylesheet_advanced");
$parent_list = make_parent_theme_list($theme['tid']); $parent_list = implode(',', $parent_list); 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);
|
// Does the theme not exist? if(!$stylesheet['sid']) {
| // Does the theme not exist? if(!$stylesheet['sid']) {
|
Zeile 2281 | Zeile 2305 |
---|
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']) { $sid = copy_stylesheet_to_theme($stylesheet, $theme['tid']);
|
// Theme & stylesheet theme ID do not match, editing inherited - we copy to local theme if($theme['tid'] != $stylesheet['tid']) { $sid = copy_stylesheet_to_theme($stylesheet, $theme['tid']);
|
}
| }
|
// Now we have the new stylesheet, save it $updated_stylesheet = array( "cachefile" => $db->escape_string($stylesheet['name']),
|
// Now we have the new stylesheet, save it $updated_stylesheet = array( "cachefile" => $db->escape_string($stylesheet['name']),
|
"stylesheet" => $db->escape_string(unfix_css_urls($mybb->input['stylesheet'])),
| "stylesheet" => $db->escape_string($mybb->input['stylesheet']),
|
"lastmodified" => TIME_NOW ); $db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");
| "lastmodified" => TIME_NOW ); $db->update_query("themestylesheets", $updated_stylesheet, "sid='{$sid}'");
|
Zeile 2313 | Zeile 2337 |
---|
flash_message($lang->success_stylesheet_updated, 'success');
if(!$mybb->input['save_close'])
|
flash_message($lang->success_stylesheet_updated, 'success');
if(!$mybb->input['save_close'])
|
{
| {
|
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($stylesheet['name'])."&tid={$theme['tid']}&mode=advanced");
|
admin_redirect("index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($stylesheet['name'])."&tid={$theme['tid']}&mode=advanced");
|
} else {
| } else {
|
admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}"); } }
| admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}"); } }
|
Zeile 2330 | Zeile 2354 |
---|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
<link href="./jscripts/codemirror/lib/codemirror.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> <script src="./jscripts/codemirror/addon/dialog/dialog.js"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.js"></script> <script src="./jscripts/codemirror/addon/search/search.js"></script>
| <link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet"> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/search.js?ver=1821"></script>
|
';
|
';
|
}
| }
|
$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}");
|
$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 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 2360 | Zeile 2384 |
---|
else { $page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent));
|
else { $page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent));
|
} }
| } }
|
$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"
| $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"
|
Zeile 2458 | Zeile 2482 |
---|
{ $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);
|
|
|
$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'], htmlspecialchars_uni($theme['name']));
| log_admin_action($stylesheet['sid'], $stylesheet['name'], $theme['tid'], $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']}");
|
}
| }
|
else { $page->output_confirm_action("index.php?module=style-themes&action=force&tid={$theme['tid']}", $lang->confirm_stylesheet_deletion); } }
|
else { $page->output_confirm_action("index.php?module=style-themes&action=force&tid={$theme['tid']}", $lang->confirm_stylesheet_deletion); } }
|
|
|
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
|
Zeile 2486 | Zeile 2513 |
---|
{ 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");
|
}
| }
|
$plugins->run_hooks("admin_style_themes_add_stylesheet");
// Fetch list of all of the stylesheets for this theme
| $plugins->run_hooks("admin_style_themes_add_stylesheet");
// Fetch list of all of the stylesheets for this theme
|
Zeile 2500 | Zeile 2527 |
---|
if(!$mybb->input['name'] || $mybb->input['name'] == ".css") { $errors[] = $lang->error_missing_stylesheet_name;
|
if(!$mybb->input['name'] || $mybb->input['name'] == ".css") { $errors[] = $lang->error_missing_stylesheet_name;
|
}
| }
|
// Get 30 chars only because we don't want more than that $mybb->input['name'] = my_substr($mybb->input['name'], 0, 30); if(get_extension($mybb->input['name']) != "css")
|
// Get 30 chars only because we don't want more than that $mybb->input['name'] = my_substr($mybb->input['name'], 0, 30); if(get_extension($mybb->input['name']) != "css")
|
{
| {
|
// Does not end with '.css' $errors[] = $lang->sprintf($lang->error_missing_stylesheet_extension, $mybb->input['name']); }
| // Does not end with '.css' $errors[] = $lang->sprintf($lang->error_missing_stylesheet_extension, $mybb->input['name']); }
|
Zeile 2520 | Zeile 2547 |
---|
$query = $db->simple_select("themestylesheets", "stylesheet", "name='".$db->escape_string($mybb->input['import'])."' AND tid IN ({$parent_list})", array('limit' => 1, 'order_by' => 'tid', 'order_dir' => 'desc')); $stylesheet = $db->fetch_field($query, "stylesheet");
|
$query = $db->simple_select("themestylesheets", "stylesheet", "name='".$db->escape_string($mybb->input['import'])."' AND tid IN ({$parent_list})", array('limit' => 1, 'order_by' => 'tid', 'order_dir' => 'desc')); $stylesheet = $db->fetch_field($query, "stylesheet");
|
}
| }
|
else { // Custom stylesheet $stylesheet = $mybb->input['stylesheet'];
|
else { // Custom stylesheet $stylesheet = $mybb->input['stylesheet'];
|
}
$attached = array();
| }
$attached = array();
|
if($mybb->input['attach'] == 1) { // Our stylesheet is attached to custom pages in MyBB
| if($mybb->input['attach'] == 1) { // Our stylesheet is attached to custom pages in MyBB
|
Zeile 2544 | Zeile 2571 |
---|
$attached_to = $value;
if($mybb->input['action_'.$attached_id] == 1)
|
$attached_to = $value;
if($mybb->input['action_'.$attached_id] == 1)
|
{
| {
|
// 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]; }
|
Zeile 2568 | Zeile 2595 |
---|
{ $attached = $mybb->input['color']; }
|
{ $attached = $mybb->input['color']; }
|
}
| }
|
// Add Stylesheet $insert_array = array( 'name' => $db->escape_string($mybb->input['name']),
| // Add Stylesheet $insert_array = array( 'name' => $db->escape_string($mybb->input['name']),
|
Zeile 2593 | Zeile 2620 |
---|
$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'], htmlspecialchars_uni($theme['name']));
| log_admin_action($sid, $mybb->input['name'], $theme['tid'], $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 2603 | Zeile 2630 |
---|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
<link href="./jscripts/codemirror/lib/codemirror.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> <script src="./jscripts/codemirror/addon/dialog/dialog.js"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.js"></script> <script src="./jscripts/codemirror/addon/search/search.js"></script>
| <link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet"> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/search.js?ver=1821"></script>
|
'; }
| '; }
|
Zeile 2619 | Zeile 2646 |
---|
$properties = my_unserialize($theme['properties']);
$page->output_header("{$lang->themes} - {$lang->add_stylesheet}");
|
$properties = my_unserialize($theme['properties']);
$page->output_header("{$lang->themes} - {$lang->add_stylesheet}");
|
|
|
$sub_tabs['edit_stylesheets'] = array( 'title' => $lang->edit_stylesheets, 'link' => "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}"
|
$sub_tabs['edit_stylesheets'] = array( 'title' => $lang->edit_stylesheets, 'link' => "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}"
|
);
| );
|
$sub_tabs['add_stylesheet'] = array( 'title' => $lang->add_stylesheet, 'link' => "index.php?module=style-themes&action=add_stylesheet&tid={$mybb->input['tid']}", 'description' => $lang->add_stylesheet_desc
|
$sub_tabs['add_stylesheet'] = array( 'title' => $lang->add_stylesheet, 'link' => "index.php?module=style-themes&action=add_stylesheet&tid={$mybb->input['tid']}", 'description' => $lang->add_stylesheet_desc
|
);
| );
|
$sub_tabs['export_theme'] = array( 'title' => $lang->export_theme, 'link' => "index.php?module=style-themes&action=export&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']}"
|
);
| );
|
$sub_tabs['duplicate_theme'] = array( 'title' => $lang->duplicate_theme,
| $sub_tabs['duplicate_theme'] = array( 'title' => $lang->duplicate_theme,
|
Zeile 2654 | Zeile 2681 |
---|
{ list(, $id) = explode('_', $name); $id = (int)$id;
|
{ list(, $id) = explode('_', $name); $id = (int)$id;
|
|
|
$mybb->input['applied_to'][$value] = array(0 => 'global');
if($mybb->input['action_'.$id] == 1) { $mybb->input['applied_to'][$value] = explode(',', $mybb->input['action_list_'.$id]);
|
$mybb->input['applied_to'][$value] = array(0 => 'global');
if($mybb->input['action_'.$id] == 1) { $mybb->input['applied_to'][$value] = explode(',', $mybb->input['action_list_'.$id]);
|
} }
| } }
|
}
if($mybb->input['add_type'] == 1)
| }
if($mybb->input['add_type'] == 1)
|
Zeile 2687 | Zeile 2714 |
---|
$form = new Form("index.php?module=style-themes&action=add_stylesheet", "post", "add_stylesheet");
echo $form->generate_hidden_field("tid", $mybb->input['tid'])."\n";
|
$form = new Form("index.php?module=style-themes&action=add_stylesheet", "post", "add_stylesheet");
echo $form->generate_hidden_field("tid", $mybb->input['tid'])."\n";
|
|
|
$specific_files = "<div id=\"attach_1\" class=\"attachs\">"; $count = 0;
| $specific_files = "<div id=\"attach_1\" class=\"attachs\">"; $count = 0;
|
Zeile 2701 | Zeile 2728 |
---|
if($actions[0] != "global") { $action_list = implode(',', $actions);
|
if($actions[0] != "global") { $action_list = implode(',', $actions);
|
}
| }
|
if($actions[0] == "global") { $global_action_checked[1] = "checked=\"checked\"";
| if($actions[0] == "global") { $global_action_checked[1] = "checked=\"checked\"";
|
Zeile 2873 | Zeile 2900 |
---|
});</script>'; }
|
});</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" src="./jscripts/themes.js?ver=1808"></script>'; echo '<script type="text/javascript" src="./jscripts/theme_properties.js?ver=1821"></script>';
|
echo '<script type="text/javascript"> $(function() { //<![CDATA[
| echo '<script type="text/javascript"> $(function() { //<![CDATA[
|
Zeile 2917 | Zeile 2944 |
---|
$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'], htmlspecialchars_uni($theme['name']));
| log_admin_action($theme['tid'], $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");
|
Zeile 2952 | Zeile 2979 |
---|
$plugins->run_hooks("admin_style_themes_force_commit");
$db->update_query("users", $updated_users);
|
$plugins->run_hooks("admin_style_themes_force_commit");
$db->update_query("users", $updated_users);
|
| // The theme has to be accessible to all usergroups in order to force on all users if($theme['allowedgroups'] !== "all") { $db->update_query("themes", array("allowedgroups" => "all"), "tid='{$theme['tid']}'"); }
|
// Log admin action
|
// Log admin action
|
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
| log_admin_action($theme['tid'], $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");
|