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 72 | Zeile 72 |
---|
echo $form->generate_hidden_field("selector", htmlspecialchars_uni($mybb->input['selector']), array('id' => 'hidden_selector'))."\n";
$table = new Table;
|
echo $form->generate_hidden_field("selector", htmlspecialchars_uni($mybb->input['selector']), array('id' => 'hidden_selector'))."\n";
$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%;'));
| if($lang->settings['rtl'] === true) { $div_align = "left"; } else { $div_align = "right"; }
$table->construct_cell("<div style=\"float: {$div_align};\">".$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("<strong>{$lang->extra_css_atribs}</strong><br /><div style=\"align: center;\">".$form->generate_text_area('css_bits[extra]', $properties['extra'], array('id' => 'css_bits[extra]', 'style' => 'width: 98%;', 'rows' => '19'))."</div>", array('rowspan' => 8)); $table->construct_row();
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_family]', $properties['font-family'], array('id' => 'css_bits[font_family]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_family}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_style]', $properties['font-style'], array('id' => 'css_bits[font_style]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_style}</strong></div>", array('style' => 'width: 40%;'));
| $table->construct_cell("<div style=\"float: {$div_align};\">".$form->generate_text_box('css_bits[color]', $properties['color'], array('id' => 'css_bits[color]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->color}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: {$div_align};\">".$form->generate_text_box('css_bits[width]', $properties['width'], array('id' => 'css_bits[width]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->width}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: {$div_align};\">".$form->generate_text_box('css_bits[font_family]', $properties['font-family'], array('id' => 'css_bits[font_family]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_family}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: {$div_align};\">".$form->generate_text_box('css_bits[font_size]', $properties['font-size'], array('id' => 'css_bits[font_size]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_size}</strong></div>", array('style' => 'width: 40%;')); $table->construct_row(); $table->construct_cell("<div style=\"float: {$div_align};\">".$form->generate_text_box('css_bits[font_style]', $properties['font-style'], array('id' => 'css_bits[font_style]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_style}</strong></div>", array('style' => 'width: 40%;'));
|
$table->construct_row();
|
$table->construct_row();
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[font_weight]', $properties['font-weight'], array('id' => 'css_bits[font_weight]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_weight}</strong></div>", array('style' => 'width: 40%;'));
| $table->construct_cell("<div style=\"float: {$div_align};\">".$form->generate_text_box('css_bits[font_weight]', $properties['font-weight'], array('id' => 'css_bits[font_weight]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->font_weight}</strong></div>", array('style' => 'width: 40%;'));
|
$table->construct_row();
|
$table->construct_row();
|
$table->construct_cell("<div style=\"float: right;\">".$form->generate_text_box('css_bits[text_decoration]', $properties['text-decoration'], array('id' => 'css_bits[text_decoration]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->text_decoration}</strong></div>", array('style' => 'width: 40%;'));
| $table->construct_cell("<div style=\"float: {$div_align};\">".$form->generate_text_box('css_bits[text_decoration]', $properties['text-decoration'], array('id' => 'css_bits[text_decoration]', 'style' => 'width: 260px;'))."</div><div><strong>{$lang->text_decoration}</strong></div>", array('style' => 'width: 40%;'));
|
$table->construct_row();
$table->output(htmlspecialchars_uni($editable_selector['class_name'])."<span id=\"saved\" style=\"color: #FEE0C6;\"></span>"); exit; }
|
$table->construct_row();
$table->output(htmlspecialchars_uni($editable_selector['class_name'])."<span id=\"saved\" style=\"color: #FEE0C6;\"></span>"); exit; }
|
|
|
$page->add_breadcrumb_item($lang->themes, "index.php?module=style-themes");
if($mybb->input['action'] == "add" || $mybb->input['action'] == "import" || $mybb->input['action'] == "browse" || !$mybb->input['action'])
| $page->add_breadcrumb_item($lang->themes, "index.php?module=style-themes");
if($mybb->input['action'] == "add" || $mybb->input['action'] == "import" || $mybb->input['action'] == "browse" || !$mybb->input['action'])
|
Zeile 102 | Zeile 111 |
---|
'title' => $lang->themes, 'link' => "index.php?module=style-themes", 'description' => $lang->themes_desc
|
'title' => $lang->themes, 'link' => "index.php?module=style-themes", 'description' => $lang->themes_desc
|
);
| );
|
$sub_tabs['create_theme'] = array( 'title' => $lang->create_new_theme, 'link' => "index.php?module=style-themes&action=add", 'description' => $lang->create_new_theme_desc
|
$sub_tabs['create_theme'] = array( 'title' => $lang->create_new_theme, 'link' => "index.php?module=style-themes&action=add", 'description' => $lang->create_new_theme_desc
|
);
| );
|
$sub_tabs['import_theme'] = array( 'title' => $lang->import_a_theme, 'link' => "index.php?module=style-themes&action=import", 'description' => $lang->import_a_theme_desc
|
$sub_tabs['import_theme'] = array( 'title' => $lang->import_a_theme, 'link' => "index.php?module=style-themes&action=import", 'description' => $lang->import_a_theme_desc
|
);
| );
|
$sub_tabs['browse_themes'] = array( 'title' => $lang->browse_themes, 'link' => "index.php?module=style-themes&action=browse",
| $sub_tabs['browse_themes'] = array( 'title' => $lang->browse_themes, 'link' => "index.php?module=style-themes&action=browse",
|
Zeile 132 | Zeile 141 |
---|
$page->add_breadcrumb_item($lang->browse_themes);
$page->output_header($lang->browse_themes);
|
$page->add_breadcrumb_item($lang->browse_themes);
$page->output_header($lang->browse_themes);
|
|
|
$page->output_nav_tabs($sub_tabs, 'browse_themes');
// Process search requests require_once MYBB_ROOT."inc/class_xml.php";
|
$page->output_nav_tabs($sub_tabs, 'browse_themes');
// Process search requests require_once MYBB_ROOT."inc/class_xml.php";
|
|
|
$keywords = ""; if($mybb->input['keywords']) { $keywords = "&keywords=".urlencode($mybb->input['keywords']);
|
$keywords = ""; if($mybb->input['keywords']) { $keywords = "&keywords=".urlencode($mybb->input['keywords']);
|
}
| }
|
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 158 | Zeile 167 |
---|
$major_version_code = round($mybb->version_code/100, 0)*100; // Convert to mods site version codes $search_version = ($major_version_code/100).'x';
|
$major_version_code = round($mybb->version_code/100, 0)*100; // 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)
|
{ $page->output_inline_error($lang->error_communication_problem); $page->output_footer(); exit; }
| { $page->output_inline_error($lang->error_communication_problem); $page->output_footer(); exit; }
|
$table = new Table; $table->construct_header($lang->themes, array('colspan' => 2));
|
$table = new Table; $table->construct_header($lang->themes, array('colspan' => 2));
|
$table->construct_header($lang->controls, array("class" => "align_center", 'width' => 125));
| $table->construct_header($lang->controls, array("class" => "align_center", 'width' => 125));
|
$parser = new XMLParser($contents); $tree = $parser->get_tree();
| $parser = new XMLParser($contents); $tree = $parser->get_tree();
|
Zeile 190 | 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) {
|
$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));
| $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=\"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\">{$lang->download}</a></strong>", array("class" => "align_center"));
|
$table->construct_row(); } }
| $table->construct_row(); } }
|
Zeile 204 | Zeile 225 |
---|
{ $table->construct_cell($lang->error_no_results_found, array("colspan" => 3)); $table->construct_row();
|
{ $table->construct_cell($lang->error_no_results_found, array("colspan" => 3)); $table->construct_row();
|
}
| }
|
$search = new Form("index.php?module=style-themes&action=browse", 'post', 'search_form'); echo "<div style=\"padding-bottom: 3px; margin-top: -9px; text-align: right;\">"; if($mybb->input['keywords'])
| $search = new Form("index.php?module=style-themes&action=browse", 'post', 'search_form'); echo "<div style=\"padding-bottom: 3px; margin-top: -9px; text-align: right;\">"; if($mybb->input['keywords'])
|
Zeile 265 | Zeile 286 |
---|
// Recommended themes = Default; Otherwise search results & pagination if($mybb->request_method == "post") {
|
// Recommended themes = Default; Otherwise search results & pagination if($mybb->request_method == "post") {
|
$table->output("<span style=\"float: right;\"><small><a href=\"http://mods.mybb.com/themes\" target=\"_blank\">{$lang->browse_all_themes}</a></small></span>".$lang->sprintf($lang->browse_results_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\">{$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://mods.mybb.com/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\">{$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}");
|
Zeile 335 | Zeile 356 |
---|
if(!trim($contents)) { $errors[] = $lang->error_uploadfailed_nocontents;
|
if(!trim($contents)) { $errors[] = $lang->error_uploadfailed_nocontents;
|
} } }
| } } }
|
else if(!empty($mybb->input['url'])) { // Get the contents
| else if(!empty($mybb->input['url'])) { // Get the contents
|
Zeile 358 | 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 426 | Zeile 447 |
---|
{ $import_checked[1] = "checked=\"checked\""; $import_checked[2] = "";
|
{ $import_checked[1] = "checked=\"checked\""; $import_checked[2] = "";
|
|
|
$mybb->input['import_stylesheets'] = true; $mybb->input['import_templates'] = true; }
| $mybb->input['import_stylesheets'] = true; $mybb->input['import_templates'] = true; }
|
Zeile 495 | 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 520 | 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 555 | Zeile 576 |
---|
{ $inherited_load[] = $value; }
|
{ $inherited_load[] = $value; }
|
} }
| } }
|
} }
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
} }
$inherited_load[] = $mybb->input['tid']; $inherited_load = array_unique($inherited_load);
|
|
|
$inherited_themes = array(); if(count($inherited_load) > 0) {
| $inherited_themes = array(); if(count($inherited_load) > 0) {
|
Zeile 570 | Zeile 591 |
---|
while($inherited_theme = $db->fetch_array($query)) { $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];
|
while($inherited_theme = $db->fetch_array($query)) { $inherited_themes[$inherited_theme['tid']] = $inherited_theme['name'];
|
} }
$theme_stylesheets = array();
| } }
$theme_stylesheets = array();
|
if(count($inherited_load) > 0) {
| if(count($inherited_load) > 0) {
|
Zeile 593 | 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 = basename($filename); $style['sid'] = $theme_stylesheets[$filename]['sid'];
|
$filename = $theme_stylesheets[$style['sid']]; } else { $filename = basename($filename); $style['sid'] = $theme_stylesheets[$filename]['sid'];
|
}
| }
|
$style['tid'] = $theme_stylesheets[$filename]['tid'];
| $style['tid'] = $theme_stylesheets[$filename]['tid'];
|
Zeile 713 | 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 730 | Zeile 751 |
---|
if($mybb->input['name'] == "") { $errors[] = $lang->error_missing_name;
|
if($mybb->input['name'] == "") { $errors[] = $lang->error_missing_name;
|
}
| }
|
else { $query = $db->simple_select("themes", "COUNT(tid) as numthemes", "name = '".$db->escape_string($mybb->get_input('name'))."'"); $numthemes = $db->fetch_field($query, 'numthemes');
|
else { $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; } }
|
Zeile 745 | Zeile 766 |
---|
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 754 | Zeile 775 |
---|
// 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))
|
{
| {
|
$insert = array( "title" => $db->escape_string($template['title']), "template" => $db->escape_string($template['template']),
| $insert = array( "title" => $db->escape_string($template['title']), "template" => $db->escape_string($template['template']),
|
Zeile 776 | Zeile 797 |
---|
foreach($properties as $property => $value) { if($property == "inherited")
|
foreach($properties as $property => $value) { if($property == "inherited")
|
{ continue; }
| { continue; }
|
$nprops[$property] = $value; if($properties['inherited'][$property]) {
| $nprops[$property] = $value; if($properties['inherited'][$property]) {
|
Zeile 921 | Zeile 942 |
---|
$form->output_submit_wrapper($buttons);
$form->end();
|
$form->output_submit_wrapper($buttons);
$form->end();
|
|
|
$page->output_footer(); }
if($mybb->input['action'] == "delete") {
|
$page->output_footer(); }
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) { flash_message($lang->error_invalid_theme, 'error');
|
$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');
|
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'])
|
{
| {
|
admin_redirect("index.php?module=style-themes"); }
| admin_redirect("index.php?module=style-themes"); }
|
Zeile 948 | Zeile 969 |
---|
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 957 | 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)
|
{
| {
|
foreach($inherited as $file => $value) { foreach($value as $filepath => $val)
| foreach($inherited as $file => $value) { foreach($value as $filepath => $val)
|
Zeile 977 | Zeile 998 |
---|
} } }
|
} } }
|
}
| }
|
if($inherited_stylesheets == true) {
| if($inherited_stylesheets == true) {
|
Zeile 989 | 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");
| } @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html");
|
Zeile 1004 | Zeile 1028 |
---|
$children = make_child_theme_list($theme['tid']); $child_tid = $children[0];
|
$children = make_child_theme_list($theme['tid']); $child_tid = $children[0];
|
$db->update_query("themes", array('pid' => $theme['pid']), "tid='{$child_tid}'");
| if($child_tid != 0) { $db->update_query("themes", array('pid' => $theme['pid']), "tid='{$child_tid}'"); }
|
$db->delete_query("themes", "tid='{$theme['tid']}'", 1);
| $db->delete_query("themes", "tid='{$theme['tid']}'", 1);
|
Zeile 1014 | Zeile 1041 |
---|
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
flash_message($lang->success_theme_deleted, 'success');
|
log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
flash_message($lang->success_theme_deleted, 'success');
|
admin_redirect("index.php?module=style-themes"); }
| 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 1024 | Zeile 1051 |
---|
if($mybb->input['action'] == "edit") {
|
if($mybb->input['action'] == "edit") {
|
$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 1033 | Zeile 1060 |
---|
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_edit");
if($mybb->request_method == "post" && !$mybb->input['do']) { $properties = array(
|
$plugins->run_hooks("admin_style_themes_edit");
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'] );
|
Zeile 1054 | Zeile 1081 |
---|
}
if($mybb->input['colors'])
|
}
if($mybb->input['colors'])
|
{
| {
|
$colors = explode("\n", $mybb->input['colors']);
foreach($colors as $color)
| $colors = explode("\n", $mybb->input['colors']);
foreach($colors as $color)
|
Zeile 1063 | Zeile 1090 |
---|
$properties['colors'][$color[0]] = $color[1]; }
|
$properties['colors'][$color[0]] = $color[1]; }
|
}
| }
|
if($properties['templateset'] <= 0) { $errors[] = $lang->error_invalid_templateset;
|
if($properties['templateset'] <= 0) { $errors[] = $lang->error_invalid_templateset;
|
}
| }
|
$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 1097 | Zeile 1128 |
---|
$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 1147 | Zeile 1178 |
---|
if(empty($errors)) {
|
if(empty($errors)) {
|
| $plugins->run_hooks("admin_style_themes_edit_commit");
|
$db->update_query("themes", $update_array, "tid='{$theme['tid']}'");
|
$db->update_query("themes", $update_array, "tid='{$theme['tid']}'");
|
| update_theme_stylesheet_list($theme['tid']);
|
if($theme['def'] == 1) { $cache->update_default_theme(); }
|
if($theme['def'] == 1) { $cache->update_default_theme(); }
|
$plugins->run_hooks("admin_style_themes_edit_commit");
| |
// Log admin action log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
| // Log admin action log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
|
Zeile 1252 | Zeile 1284 |
---|
$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 1261 | Zeile 1293 |
---|
{ $cache->update_default_theme(); }
|
{ $cache->update_default_theme(); }
|
| // normalize for consistency update_theme_stylesheet_list($theme['tid'], false, true);
|
flash_message($lang->success_stylesheet_order_updated, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}"); }
| flash_message($lang->success_stylesheet_order_updated, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}"); }
|
Zeile 1312 | Zeile 1348 |
---|
foreach($stylesheets as $filename => $style) { if(strpos($filename, 'css.php?stylesheet=') !== false)
|
foreach($stylesheets as $filename => $style) { 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 1330 | Zeile 1366 |
---|
{ 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 = basename($filename); $style['sid'] = $theme_stylesheets[$filename]['sid'];
|
$filename = $theme_stylesheets[$style['sid']]; } else { $filename = basename($filename); $style['sid'] = $theme_stylesheets[$filename]['sid'];
|
}
| }
|
// Has the file on the file system been modified? resync_stylesheet($theme_stylesheets[$filename]);
$filename = $theme_stylesheets[$filename]['name'];
|
// Has the file on the file system been modified? resync_stylesheet($theme_stylesheets[$filename]);
$filename = $theme_stylesheets[$filename]['name'];
|
|
|
$inherited = ""; $inherited_ary = array(); if(is_array($style['inherited']))
| $inherited = ""; $inherited_ary = array(); if(is_array($style['inherited']))
|
Zeile 1353 | Zeile 1389 |
---|
if($inherited_themes[$tid]) { $inherited_ary[$tid] = $inherited_themes[$tid];
|
if($inherited_themes[$tid]) { $inherited_ary[$tid] = $inherited_themes[$tid];
|
} } }
| } } }
|
if(!empty($inherited_ary)) { $inherited = " <small>({$lang->inherited_from}"; $sep = " "; $inherited_count = count($inherited_ary);
|
if(!empty($inherited_ary)) { $inherited = " <small>({$lang->inherited_from}"; $sep = " "; $inherited_count = count($inherited_ary);
|
$count = 0;
| $count = 0;
|
foreach($inherited_ary as $tid => $file) { if(isset($applied_to_count) && $count == $applied_to_count && $count != 0)
|
foreach($inherited_ary as $tid => $file) { if(isset($applied_to_count) && $count == $applied_to_count && $count != 0)
|
{
| {
|
$sep = " {$lang->and} "; }
| $sep = " {$lang->and} "; }
|
Zeile 1382 | Zeile 1418 |
---|
if(is_array($style['applied_to']) && (!isset($style['applied_to']['global']) || $style['applied_to']['global'][0] != "global")) { $attached_to = '';
|
if(is_array($style['applied_to']) && (!isset($style['applied_to']['global']) || $style['applied_to']['global'][0] != "global")) { $attached_to = '';
|
$got_color = false;
|
|
$applied_to_count = count($style['applied_to']); $count = 0; $sep = " "; $name = "";
|
$applied_to_count = count($style['applied_to']); $count = 0; $sep = " "; $name = "";
|
| $colors = array();
if(!is_array($properties['colors'])) { $properties['colors'] = array(); }
|
foreach($style['applied_to'] as $name => $actions) {
|
foreach($style['applied_to'] as $name => $actions) {
|
if(strpos($name, ".php") === false) { $got_color = true; // Maybe...
| if(!$name) {
|
continue; }
|
continue; }
|
if(!$name)
| if(array_key_exists($name, $properties['colors'])) { $colors[] = $properties['colors'][$name]; }
if(count($colors))
|
{
|
{
|
| // Colors override files and are handled below.
|
continue;
|
continue;
|
}
| }
// It's a file:
|
++$count;
|
++$count;
|
|
|
if($actions[0] != "global") { $name = "{$name} ({$lang->actions}: ".implode(',', $actions).")";
| if($actions[0] != "global") { $name = "{$name} ({$lang->actions}: ".implode(',', $actions).")";
|
Zeile 1412 | Zeile 1460 |
---|
if($count == $applied_to_count && $count > 1) { $sep = " {$lang->and} ";
|
if($count == $applied_to_count && $count > 1) { $sep = " {$lang->and} ";
|
}
| }
|
$attached_to .= $sep.$name;
$sep = $lang->comma;
|
$attached_to .= $sep.$name;
$sep = $lang->comma;
|
}
| }
|
if($attached_to)
|
if($attached_to)
|
{
| {
|
$attached_to = "<small>{$lang->attached_to} {$attached_to}</small>"; }
|
$attached_to = "<small>{$lang->attached_to} {$attached_to}</small>"; }
|
$colors = array(); if($got_color == true && is_array($properties['colors']))
| if(count($colors))
|
{
|
{
|
// We might have colors here... foreach($style['applied_to'] as $name => $actions) { if(strpos($name, ".php") !== false) { continue; }
// Verify this is a color for this theme if(array_key_exists($name, $properties['colors'])) { $colors[] = $properties['colors'][$name]; } }
| // Attached to color instead of files.
|
$count = 1;
|
$count = 1;
|
$plural = 's';
| |
$color_list = $sep = '';
|
$color_list = $sep = '';
|
if(count($colors == 1)) { $plural = ''; }
| |
foreach($colors as $color) {
| foreach($colors as $color) {
|
Zeile 1462 | Zeile 1490 |
---|
$sep = ', '; }
|
$sep = ', '; }
|
$attached_to = "<small>{$lang->attached_to} ".$lang->sprintf($lang->colors_attached_to, $plural)." {$color_list}</small>";
| $attached_to = "<small>{$lang->attached_to} ".$lang->sprintf($lang->colors_attached_to)." {$color_list}</small>";
|
}
if($attached_to == '')
| }
if($attached_to == '')
|
Zeile 1487 | Zeile 1515 |
---|
}
$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_text_box("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 1495 | Zeile 1523 |
---|
$table->output("{$lang->stylesheets_in} ".htmlspecialchars_uni($theme['name']));
$buttons = array($form->generate_submit_button($lang->save_stylesheet_order));
|
$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();
| $form->output_submit_wrapper($buttons); $form->end();
|
echo '<br />';
| echo '<br />';
|
Zeile 1549 | Zeile 1577 |
---|
$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_text_box('tablespace', $properties['tablespace'], array('id' => 'tablespace')), 'tablespace'); $form_container->output_row($lang->inner_border, $lang->inner_border_desc, $form->generate_text_box('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 1581 | Zeile 1609 |
---|
$form_container->output_row($lang->colors_setting, $lang->colors_setting_desc, $color_setting, 'color'); $form_container->output_row($lang->colors_add, $lang->colors_add_desc, $form->generate_text_area('colors', $mybb->input['colors'], array('style' => 'width: 200px;', 'rows' => '5')));
|
$form_container->output_row($lang->colors_setting, $lang->colors_setting_desc, $color_setting, 'color'); $form_container->output_row($lang->colors_add, $lang->colors_add_desc, $form->generate_text_area('colors', $mybb->input['colors'], array('style' => 'width: 200px;', 'rows' => '5')));
|
|
|
$form_container->end();
$buttons = array();
| $form_container->end();
$buttons = array();
|
Zeile 1595 | Zeile 1623 |
---|
if($mybb->input['action'] == "stylesheet_properties") { // Fetch the theme we want to edit this stylesheet in
|
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)."'");
| $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 1666 | Zeile 1694 |
---|
{ $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 1676 | Zeile 1704 |
---|
{ // We have custom actions for attached files $actions_list = $mybb->input['action_list_'.$attached_id];
|
{ // We have custom actions for attached files $actions_list = $mybb->input['action_list_'.$attached_id];
|
}
| }
|
if($actions_list) { $attached_to .= "?".$actions_list; }
|
if($actions_list) { $attached_to .= "?".$actions_list; }
|
|
|
$attached[] = $attached_to; } }
| $attached[] = $attached_to; } }
|
Zeile 1698 | Zeile 1726 |
---|
$attached = $mybb->input['color']; } }
|
$attached = $mybb->input['color']; } }
|
|
|
// Update Stylesheet $update_array = array( 'name' => $db->escape_string($mybb->input['name']),
| // Update Stylesheet $update_array = array( 'name' => $db->escape_string($mybb->input['name']),
|
Zeile 1708 | Zeile 1736 |
---|
if($stylesheet['name'] != $mybb->input['name']) { $update_array['cachefile'] = $db->escape_string(str_replace('/', '', $mybb->input['name']));
|
if($stylesheet['name'] != $mybb->input['name']) { $update_array['cachefile'] = $db->escape_string(str_replace('/', '', $mybb->input['name']));
|
}
| }
|
$db->update_query("themestylesheets", $update_array, "sid='{$stylesheet['sid']}'", 1);
| $db->update_query("themestylesheets", $update_array, "sid='{$stylesheet['sid']}'", 1);
|
Zeile 1721 | Zeile 1749 |
---|
$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 the CSS file list for this theme
|
Zeile 1802 | Zeile 1833 |
---|
$count = 0; if(is_array($applied_to) && $applied_to['global'][0] != "global") {
|
$count = 0; if(is_array($applied_to) && $applied_to['global'][0] != "global") {
|
$got_color = false;
| |
$check_actions = "";
|
$check_actions = "";
|
| $stylesheet['colors'] = array();
if(!is_array($properties['colors'])) { $properties['colors'] = array(); }
|
foreach($applied_to as $name => $actions) {
|
foreach($applied_to as $name => $actions) {
|
if(strpos($name, ".php") === false)
| // Verify this is a color for this theme if(array_key_exists($name, $properties['colors'])) { $stylesheet['colors'][] = $name; }
if(count($stylesheet['colors']))
|
{
|
{
|
$got_color = true; // Maybe...
| // Colors override files and are handled below.
|
continue; }
|
continue; }
|
$short_name = substr($name, 0, -4);
| // It's a file:
|
$action_list = ""; if($actions[0] != "global") { $action_list = implode(',', $actions);
|
$action_list = ""; if($actions[0] != "global") { $action_list = implode(',', $actions);
|
}
| }
|
if($actions[0] == "global") {
| if($actions[0] == "global") {
|
Zeile 1831 | Zeile 1872 |
---|
$global_action_checked[2] = "checked=\"checked\""; $global_action_checked[1] = ""; }
|
$global_action_checked[2] = "checked=\"checked\""; $global_action_checked[1] = ""; }
|
|
|
$specific_file = "<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\"> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"0\" {$global_action_checked[1]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->globally}</label></dt> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"1\" {$global_action_checked[2]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->specific_actions}</label></dt>
| $specific_file = "<dl style=\"margin-top: 0; margin-bottom: 0; width: 100%;\"> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"0\" {$global_action_checked[1]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->globally}</label></dt> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"action_{$count}\" value=\"1\" {$global_action_checked[2]} class=\"action_{$count}s_check\" onclick=\"checkAction('action_{$count}');\" style=\"vertical-align: middle;\" /> {$lang->specific_actions}</label></dt>
|
Zeile 1840 | Zeile 1881 |
---|
<table cellpadding=\"4\"> <tr> <td>".$form->generate_text_box('action_list_'.$count, $action_list, array('id' => 'action_list_'.$count, 'style' => 'width: 190px;'))."</td>
|
<table cellpadding=\"4\"> <tr> <td>".$form->generate_text_box('action_list_'.$count, $action_list, array('id' => 'action_list_'.$count, 'style' => 'width: 190px;'))."</td>
|
</tr> </table> </dd> </dl>";
$form_container = new FormContainer();
| </tr> </table> </dd> </dl>";
$form_container = new FormContainer();
|
$form_container->output_row("", "", "<span style=\"float: right;\"><a href=\"\" id=\"delete_img_{$count}\"><img src=\"styles/{$page->style}/images/icons/cross.png\" alt=\"{$lang->delete}\" title=\"{$lang->delete}\" /></a></span>{$lang->file} ".$form->generate_text_box("attached_{$count}", $name, array('id' => "attached_{$count}", 'style' => 'width: 200px;')), "attached_{$count}");
$form_container->output_row("", "", $specific_file);
| $form_container->output_row("", "", "<span style=\"float: right;\"><a href=\"\" id=\"delete_img_{$count}\"><img src=\"styles/{$page->style}/images/icons/cross.png\" alt=\"{$lang->delete}\" title=\"{$lang->delete}\" /></a></span>{$lang->file} ".$form->generate_text_box("attached_{$count}", $name, array('id' => "attached_{$count}", 'style' => 'width: 200px;')), "attached_{$count}");
$form_container->output_row("", "", $specific_file);
|
Zeile 1853 | Zeile 1894 |
---|
$specific_files .= "<div id=\"attached_form_{$count}\">".$form_container->end(true)."</div><div id=\"attach_box_".($count+1)."\"></div>";
$check_actions .= "\n\tcheckAction('action_{$count}');";
|
$specific_files .= "<div id=\"attached_form_{$count}\">".$form_container->end(true)."</div><div id=\"attach_box_".($count+1)."\"></div>";
$check_actions .= "\n\tcheckAction('action_{$count}');";
|
|
|
++$count;
|
++$count;
|
}
| }
|
if($check_actions)
|
if($check_actions)
|
{
| {
|
$global_checked[3] = ""; $global_checked[2] = "checked=\"checked\""; $global_checked[1] = ""; }
|
$global_checked[3] = ""; $global_checked[2] = "checked=\"checked\""; $global_checked[1] = ""; }
|
$stylesheet['colors'] = array(); if($got_color == true && is_array($properties['colors']))
| if(!empty($stylesheet['colors']))
|
{
|
{
|
// We might have colors here... foreach($applied_to as $name => $actions) { if(strpos($name, ".php") !== false) { continue; }
// Verify this is a color for this theme if(array_key_exists($name, $properties['colors'])) { $stylesheet['colors'][] = $name; } }
if(!empty($stylesheet['colors'])) { $global_checked[3] = "checked=\"checked\""; $global_checked[2] = ""; $global_checked[1] = ""; }
| $global_checked[3] = "checked=\"checked\""; $global_checked[2] = ""; $global_checked[1] = "";
|
} }
| } }
|
Zeile 1978 | Zeile 2000 |
---|
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 2223 | Zeile 2245 |
---|
$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=1808"></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 2242 | Zeile 2264 |
---|
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 2323 | Zeile 2345 |
---|
{ $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> <script src="./jscripts/codemirror/addon/dialog/dialog.js"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.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> <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>
| <script src="./jscripts/codemirror/addon/search/search.js?ver=1808"></script>
|
'; }
| '; }
|
Zeile 2383 | Zeile 2405 |
---|
$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 2394 | Zeile 2416 |
---|
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 2409 | Zeile 2434 |
---|
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 2447 | Zeile 2472 |
---|
{ $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 2468 | Zeile 2496 |
---|
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 2562 | Zeile 2590 |
---|
// 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 2593 | Zeile 2621 |
---|
{ $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> <script src="./jscripts/codemirror/addon/dialog/dialog.js"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.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> <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>
| <script src="./jscripts/codemirror/addon/search/search.js?ver=1808"></script>
|
'; }
| '; }
|
Zeile 2686 | Zeile 2714 |
---|
foreach($mybb->input['applied_to'] as $name => $actions) {
|
foreach($mybb->input['applied_to'] as $name => $actions) {
|
$short_name = substr($name, 0, -4);
| |
$action_list = ""; if($actions[0] != "global") {
| $action_list = ""; if($actions[0] != "global") {
|
Zeile 2818 | Zeile 2844 |
---|
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 2852 | Zeile 2878 |
---|
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=1808"></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 2875 | Zeile 2904 |
---|
$form->end();
$page->output_footer();
|
$form->end();
$page->output_footer();
|
}
| }
|
if($mybb->input['action'] == "set_default") { if(!verify_post_check($mybb->input['my_post_key']))
| if($mybb->input['action'] == "set_default") { if(!verify_post_check($mybb->input['my_post_key']))
|
Zeile 2885 | Zeile 2914 |
---|
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 2900 | Zeile 2929 |
---|
$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 2913 | Zeile 2942 |
---|
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?
|
Zeile 2936 | Zeile 2965 |
---|
$updated_users = array( "style" => $theme['tid'] );
|
$updated_users = array( "style" => $theme['tid'] );
|
$db->update_query("users", $updated_users);
| |
$plugins->run_hooks("admin_style_themes_force_commit");
|
$plugins->run_hooks("admin_style_themes_force_commit");
|
| $db->update_query("users", $updated_users);
|
// Log admin action log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
| // Log admin action log_admin_action($theme['tid'], htmlspecialchars_uni($theme['name']));
|