Zeile 38 | Zeile 38 |
---|
$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);
|
if(!$theme['tid'] || $theme['tid'] == 1)
| if(!$theme || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 55 | Zeile 55 |
---|
$stylesheet = $db->fetch_array($query);
// Does the theme not exist?
|
$stylesheet = $db->fetch_array($query);
// Does the theme not exist?
|
if(!$stylesheet['sid'])
| if(!$stylesheet)
|
{ flash_message($lang->error_invalid_stylesheet, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_stylesheet, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 65 | Zeile 65 |
---|
$selector_list = get_selectors_as_options($css_array, $mybb->input['selector']); $editable_selector = $css_array[$mybb->input['selector']]; $properties = parse_css_properties($editable_selector['values']);
|
$selector_list = get_selectors_as_options($css_array, $mybb->input['selector']); $editable_selector = $css_array[$mybb->input['selector']]; $properties = parse_css_properties($editable_selector['values']);
|
| foreach(array('background', 'color', 'width', 'font-family', 'font-size', 'font-style', 'font-weight', 'text-decoration') as $_p) { if(!isset($properties[$_p])) { $properties[$_p] = ''; } }
|
$form = new Form("index.php?module=style-themes&action=stylesheet_properties", "post", "selector_form", 0, "", true); echo $form->generate_hidden_field("tid", $mybb->input['tid'], array('id' => "tid"))."\n";
| $form = new Form("index.php?module=style-themes&action=stylesheet_properties", "post", "selector_form", 0, "", true); echo $form->generate_hidden_field("tid", $mybb->input['tid'], array('id' => "tid"))."\n";
|
Zeile 145 | Zeile 153 |
---|
$page->output_nav_tabs($sub_tabs, 'browse_themes');
// Process search requests
|
$page->output_nav_tabs($sub_tabs, 'browse_themes');
// Process search requests
|
require_once MYBB_ROOT."inc/class_xml.php";
| |
$keywords = "";
|
$keywords = "";
|
if($mybb->input['keywords'])
| if(!empty($mybb->input['keywords']))
|
{ $keywords = "&keywords=".urlencode($mybb->input['keywords']); }
|
{ $keywords = "&keywords=".urlencode($mybb->input['keywords']); }
|
if($mybb->input['page'])
| if(!empty($mybb->input['page']))
|
{ $url_page = "&page=".$mybb->get_input('page', MyBB::INPUT_INT); }
| { $url_page = "&page=".$mybb->get_input('page', MyBB::INPUT_INT); }
|
Zeile 168 | Zeile 174 |
---|
// 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("https://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?api=2&type=themes&version={$search_version}{$keywords}{$url_page}");
|
if(!$contents) {
| if(!$contents) {
|
Zeile 181 | Zeile 187 |
---|
$table->construct_header($lang->themes, array('colspan' => 2)); $table->construct_header($lang->controls, array("class" => "align_center", 'width' => 125));
|
$table->construct_header($lang->themes, array('colspan' => 2)); $table->construct_header($lang->controls, array("class" => "align_center", 'width' => 125));
|
$parser = new XMLParser($contents);
| $parser = create_xml_parser($contents);
|
$tree = $parser->get_tree();
if(!is_array($tree) || !isset($tree['results']))
| $tree = $parser->get_tree();
if(!is_array($tree) || !isset($tree['results']))
|
Zeile 208 | Zeile 214 |
---|
$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['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['author']['url']['value'] = htmlspecialchars_uni($result['author']['url']['value']); $result['author']['name']['value'] = htmlspecialchars_uni($result['author']['name']['value']);
|
$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));
|
$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} <a href=\"{$result['author']['url']['value']}\" target=\"_blank\" rel=\"noopener\">{$result['author']['name']['value']}</a></small></i>");
|
$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_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(); }
|
Zeile 229 | Zeile 233 |
---|
$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;\">";
|
$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'])
| if(!empty($mybb->input['keywords']))
|
{ $default_class = ''; $value = htmlspecialchars_uni($mybb->input['keywords']);
| { $default_class = ''; $value = htmlspecialchars_uni($mybb->input['keywords']);
|
Zeile 291 | Zeile 295 |
---|
$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)); }
|
$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}");
| if(!empty($tree['results']['attributes']['total'])) { 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");
|
|
|
if($mybb->request_method == "post") { if(!$_FILES['local_file'] && !$mybb->input['url'])
|
if($mybb->request_method == "post") { if(!$_FILES['local_file'] && !$mybb->input['url'])
|
{
| {
|
$errors[] = $lang->error_missing_url; }
| $errors[] = $lang->error_missing_url; }
|
Zeile 323 | Zeile 330 |
---|
break; case 2: // UPLOAD_ERR_FORM_SIZE $errors[] = $lang->error_uploadfailed_php2;
|
break; case 2: // UPLOAD_ERR_FORM_SIZE $errors[] = $lang->error_uploadfailed_php2;
|
break;
| break;
|
case 3: // UPLOAD_ERR_PARTIAL $errors[] = $lang->error_uploadfailed_php3; break;
| case 3: // UPLOAD_ERR_PARTIAL $errors[] = $lang->error_uploadfailed_php3; break;
|
Zeile 343 | Zeile 350 |
---|
{ // Was the temporary file found? if(!is_uploaded_file($_FILES['local_file']['tmp_name']))
|
{ // Was the temporary file found? if(!is_uploaded_file($_FILES['local_file']['tmp_name']))
|
{
| {
|
$errors[] = $lang->error_uploadfailed_lost; } // Get the contents
| $errors[] = $lang->error_uploadfailed_lost; } // Get the contents
|
Zeile 364 | Zeile 371 |
---|
if(!$contents) { $errors[] = $lang->error_local_file;
|
if(!$contents) { $errors[] = $lang->error_local_file;
|
} }
| } }
|
else { // UPLOAD_ERR_NO_FILE $errors[] = $lang->error_uploadfailed_php4;
|
else { // UPLOAD_ERR_NO_FILE $errors[] = $lang->error_uploadfailed_php4;
|
}
| }
|
if(!$errors) { $options = array(
| if(!$errors) { $options = array(
|
Zeile 386 | Zeile 393 |
---|
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);
flash_message($lang->success_imported_theme, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid=".$theme_id);
|
// Log admin action log_admin_action($theme_id);
flash_message($lang->success_imported_theme, 'success'); admin_redirect("index.php?module=style-themes&action=edit&tid=".$theme_id);
|
}
| }
|
else { switch($theme_id)
| else { switch($theme_id)
|
Zeile 402 | Zeile 409 |
---|
break; case -2: $errors[] = $lang->error_invalid_version;
|
break; case -2: $errors[] = $lang->error_invalid_version;
|
break;
| break;
|
case -3: $errors[] = $lang->error_theme_already_exists; break; case -4: $errors[] = $lang->error_theme_security_problem;
|
case -3: $errors[] = $lang->error_theme_already_exists; break; case -4: $errors[] = $lang->error_theme_security_problem;
|
} } } } }
$query = $db->simple_select("themes", "tid, name"); while($theme = $db->fetch_array($query)) {
| } } } } }
$query = $db->simple_select("themes", "tid, name"); while($theme = $db->fetch_array($query)) {
|
$themes[$theme['tid']] = $theme['name']; }
$page->add_breadcrumb_item($lang->import_a_theme, "index.php?module=style-themes&action=import");
$page->output_header("{$lang->themes} - {$lang->import_a_theme}");
|
$themes[$theme['tid']] = $theme['name']; }
$page->add_breadcrumb_item($lang->import_a_theme, "index.php?module=style-themes&action=import");
$page->output_header("{$lang->themes} - {$lang->import_a_theme}");
|
|
|
$page->output_nav_tabs($sub_tabs, 'import_theme');
if($errors)
| $page->output_nav_tabs($sub_tabs, 'import_theme');
if($errors)
|
Zeile 442 | Zeile 449 |
---|
} } else
|
} } else
|
{
| {
|
$import_checked[1] = "checked=\"checked\""; $import_checked[2] = "";
| $import_checked[1] = "checked=\"checked\""; $import_checked[2] = "";
|
Zeile 487 | Zeile 494 |
---|
<dd style="margin-top: 0; margin-bottom: 0; width: 100%;" id="import_1" class="imports"> <table cellpadding="4"> <tr>
|
<dd style="margin-top: 0; margin-bottom: 0; width: 100%;" id="import_1" class="imports"> <table cellpadding="4"> <tr>
|
<td>'.$form->generate_text_box("url", $mybb->input['file']).'</td>
| <td>'.$form->generate_text_box("url", $mybb->get_input('file')).'</td>
|
</tr> </table></dd> </dl>
| </tr> </table></dd> </dl>
|
Zeile 497 | Zeile 504 |
---|
$form_container = new FormContainer($lang->import_a_theme); $form_container->output_row($lang->import_from, $lang->import_from_desc, $actions, 'file');
|
$form_container = new FormContainer($lang->import_a_theme); $form_container->output_row($lang->import_from, $lang->import_from_desc, $actions, 'file');
|
$form_container->output_row($lang->parent_theme, $lang->parent_theme_desc, $form->generate_select_box('tid', $themes, $mybb->input['tid'], array('id' => 'tid')), 'tid'); $form_container->output_row($lang->new_name, $lang->new_name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->advanced_options, "", $form->generate_check_box('version_compat', '1', $lang->ignore_version_compatibility, array('checked' => $mybb->input['version_compat'], 'id' => 'version_compat'))."<br /><small>{$lang->ignore_version_compat_desc}</small><br />".$form->generate_check_box('import_stylesheets', '1', $lang->import_stylesheets, array('checked' => $mybb->input['import_stylesheets'], 'id' => 'import_stylesheets'))."<br /><small>{$lang->import_stylesheets_desc}</small><br />".$form->generate_check_box('import_templates', '1', $lang->import_templates, array('checked' => $mybb->input['import_templates'], 'id' => 'import_templates'))."<br /><small>{$lang->import_templates_desc}</small>");
| $form_container->output_row($lang->parent_theme, $lang->parent_theme_desc, $form->generate_select_box('tid', $themes, $mybb->get_input('tid'), array('id' => 'tid')), 'tid'); $form_container->output_row($lang->new_name, $lang->new_name_desc, $form->generate_text_box('name', $mybb->get_input('name'), array('id' => 'name')), 'name'); $form_container->output_row($lang->advanced_options, "", $form->generate_check_box('version_compat', '1', $lang->ignore_version_compatibility, array('checked' => $mybb->get_input('version_compat'), 'id' => 'version_compat'))."<br /><small>{$lang->ignore_version_compat_desc}</small><br />".$form->generate_check_box('import_stylesheets', '1', $lang->import_stylesheets, array('checked' => $mybb->get_input('import_stylesheets'), 'id' => 'import_stylesheets'))."<br /><small>{$lang->import_stylesheets_desc}</small><br />".$form->generate_check_box('import_templates', '1', $lang->import_templates, array('checked' => $mybb->get_input('import_templates'), 'id' => 'import_templates'))."<br /><small>{$lang->import_templates_desc}</small>");
|
$form_container->end();
| $form_container->end();
|
Zeile 518 | Zeile 525 |
---|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
if(!$theme['tid'])
| if(!$theme)
|
{ 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 550 | Zeile 557 |
---|
// 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']);
|
|
|
$stylesheets = array(); $inherited_load = array();
| $stylesheets = array(); $inherited_load = array();
|
Zeile 567 | Zeile 574 |
---|
foreach($style as $stylesheet) { $stylesheets[$stylesheet]['applied_to'][$file][] = $action;
|
foreach($style as $stylesheet) { $stylesheets[$stylesheet]['applied_to'][$file][] = $action;
|
if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet, array_keys($file_stylesheets['inherited'][$file."_".$action])))
| $array = &$file_stylesheets['inherited'][$file."_".$action];
if(is_array($array) && array_key_exists($stylesheet, $array))
|
{ $stylesheets[$stylesheet]['inherited'] = $file_stylesheets['inherited'][$file."_".$action]; foreach($file_stylesheets['inherited'][$file."_".$action] as $value)
| { $stylesheets[$stylesheet]['inherited'] = $file_stylesheets['inherited'][$file."_".$action]; foreach($file_stylesheets['inherited'][$file."_".$action] as $value)
|
Zeile 575 | Zeile 585 |
---|
$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);
|
Zeile 594 | Zeile 604 |
---|
$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)) {
|
if(!$theme_stylesheets[$theme_stylesheet['cachefile']])
| if(empty($theme_stylesheets[$theme_stylesheet['cachefile']]))
|
{ $theme_stylesheets[$theme_stylesheet['cachefile']] = $theme_stylesheet; $theme_stylesheets[$theme_stylesheet['sid']] = $theme_stylesheet['cachefile'];
| { $theme_stylesheets[$theme_stylesheet['cachefile']] = $theme_stylesheet; $theme_stylesheets[$theme_stylesheet['sid']] = $theme_stylesheet['cachefile'];
|
Zeile 613 | Zeile 623 |
---|
else { $filename = basename($filename);
|
else { $filename = basename($filename);
|
$style['sid'] = $theme_stylesheets[$filename]['sid']; }
$style['tid'] = $theme_stylesheets[$filename]['tid'];
| if(isset($theme_stylesheets[$filename]['sid'])) { $style['sid'] = $theme_stylesheets[$filename]['sid']; } else { $style['sid'] = null; } }
if(isset($theme_stylesheets[$filename]['tid'])) { $style['tid'] = $theme_stylesheets[$filename]['tid']; } else { $style['tid'] = null; }
|
if($mybb->input['custom_theme'] == 1 && $style['tid'] != $mybb->input['tid']) { continue; }
|
if($mybb->input['custom_theme'] == 1 && $style['tid'] != $mybb->input['tid']) { continue; }
|
// Has the file on the file system been modified? resync_stylesheet($theme_stylesheets[$filename]);
$style['sid'] = $theme_stylesheets[$filename]['sid'];
$attachedto = $theme_stylesheets[$filename]['attachedto']; $stylesheet = $theme_stylesheets[$filename]['stylesheet']; $stylesheet = str_replace(']]>', ']]]]><![CDATA[>', $stylesheet);
if($attachedto) { $attachedto = "attachedto=\"{$attachedto}\" "; }
$filename = $theme_stylesheets[$filename]['name'];
| if(isset($theme_stylesheets[$filename])) { // Has the file on the file system been modified? resync_stylesheet($theme_stylesheets[$filename]);
$style['sid'] = $theme_stylesheets[$filename]['sid'];
$attachedto = $theme_stylesheets[$filename]['attachedto']; $stylesheet = $theme_stylesheets[$filename]['stylesheet']; $stylesheet = str_replace(']]>', ']]]]><![CDATA[>', $stylesheet);
if($attachedto) { $attachedto = "attachedto=\"{$attachedto}\" "; }
$filename = $theme_stylesheets[$filename]['name'];
|
|
|
$xml .= "\t\t<stylesheet name=\"{$filename}\" {$attachedto}version=\"{$mybb->version_code}\"><![CDATA[{$stylesheet}]]>\r\n\t\t</stylesheet>\r\n";
| $xml .= "\t\t<stylesheet name=\"{$filename}\" {$attachedto}version=\"{$mybb->version_code}\"><![CDATA[{$stylesheet}]]>\r\n\t\t</stylesheet>\r\n"; }
|
} $xml .= "\t</stylesheets>\r\n";
| } $xml .= "\t</stylesheets>\r\n";
|
Zeile 647 | Zeile 675 |
---|
if($mybb->input['include_templates'] != 0) { $xml .= "\t<templates>\r\n";
|
if($mybb->input['include_templates'] != 0) { $xml .= "\t<templates>\r\n";
|
$query = $db->simple_select("templates", "*", "sid='".$properties['templateset']."'");
| $query = $db->simple_select("templates", "*", "sid='".(int)$properties['templateset']."'");
|
while($template = $db->fetch_array($query)) { $template['template'] = str_replace(']]>', ']]]]><![CDATA[>', $template['template']);
| while($template = $db->fetch_array($query)) { $template['template'] = str_replace(']]>', ']]]]><![CDATA[>', $template['template']);
|
Zeile 711 | Zeile 739 |
---|
echo $form->generate_hidden_field("tid", $theme['tid']);
$form_container = new FormContainer($lang->export_theme.": ".htmlspecialchars_uni($theme['name']));
|
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->output_row($lang->include_custom_only, $lang->include_custom_only_desc, $form->generate_yes_no_radio('custom_theme', $mybb->get_input('custom_theme')), 'custom_theme'); $form_container->output_row($lang->include_templates, $lang->include_templates_desc, $form->generate_yes_no_radio('include_templates', $mybb->get_input('include_templates')), 'include_templates');
|
$form_container->end();
| $form_container->end();
|
Zeile 731 | Zeile 759 |
---|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
if(!$theme['tid'])
| if(!$theme)
|
{ 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 759 | Zeile 787 |
---|
if(!$errors) { $properties = my_unserialize($theme['properties']);
|
if(!$errors) { $properties = my_unserialize($theme['properties']);
|
$sid = $properties['templateset'];
| $sid = (int)$properties['templateset'];
|
$nprops = null;
|
$nprops = null;
|
if($mybb->input['duplicate_templates'])
| if($mybb->get_input('duplicate_templates'))
|
{
|
{
|
$nsid = $db->insert_query("templatesets", array('title' => $db->escape_string($mybb->input['name'])." Templates"));
| $nsid = $db->insert_query("templatesets", array('title' => $db->escape_string($mybb->get_input('name'))." Templates"));
|
// Copy all old Templates to our new templateset $query = $db->simple_select("templates", "*", "sid='{$sid}'");
| // Copy all old Templates to our new templateset $query = $db->simple_select("templates", "*", "sid='{$sid}'");
|
Zeile 795 | Zeile 823 |
---|
}
$nprops[$property] = $value;
|
}
$nprops[$property] = $value;
|
if($properties['inherited'][$property])
| if(!empty($properties['inherited'][$property]))
|
{ $nprops['inherited'][$property] = $properties['inherited'][$property]; }
| { $nprops['inherited'][$property] = $properties['inherited'][$property]; }
|
Zeile 806 | Zeile 834 |
---|
} $nprops['templateset'] = $nsid; }
|
} $nprops['templateset'] = $nsid; }
|
$tid = build_new_theme($mybb->input['name'], $nprops, $theme['tid']);
| $tid = build_new_theme($mybb->get_input('name'), $nprops, $theme['tid']);
|
update_theme_stylesheet_list($tid);
| update_theme_stylesheet_list($tid);
|
Zeile 820 | Zeile 848 |
---|
} }
|
} }
|
$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->get_input('tid')}");
|
$page->add_breadcrumb_item($lang->duplicate_theme, "index.php?module=style-themes&action=duplicate&tid={$theme['tid']}");
| $page->add_breadcrumb_item($lang->duplicate_theme, "index.php?module=style-themes&action=duplicate&tid={$theme['tid']}");
|
Zeile 828 | Zeile 856 |
---|
$sub_tabs['edit_stylesheets'] = array( 'title' => $lang->edit_stylesheets,
|
$sub_tabs['edit_stylesheets'] = array( 'title' => $lang->edit_stylesheets,
|
'link' => "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}", );
| 'link' => "index.php?module=style-themes&action=edit&tid={$mybb->get_input('tid')}", );
|
$sub_tabs['add_stylesheet'] = array( 'title' => $lang->add_stylesheet,
|
$sub_tabs['add_stylesheet'] = array( 'title' => $lang->add_stylesheet,
|
'link' => "index.php?module=style-themes&action=add_stylesheet&tid={$mybb->input['tid']}",
| 'link' => "index.php?module=style-themes&action=add_stylesheet&tid={$mybb->get_input('tid')}",
|
);
$sub_tabs['export_theme'] = array( 'title' => $lang->export_theme,
|
);
$sub_tabs['export_theme'] = array( 'title' => $lang->export_theme,
|
'link' => "index.php?module=style-themes&action=export&tid={$mybb->input['tid']}",
| 'link' => "index.php?module=style-themes&action=export&tid={$mybb->get_input('tid')}",
|
'description' => $lang->export_theme_desc );
$sub_tabs['duplicate_theme'] = array( 'title' => $lang->duplicate_theme,
|
'description' => $lang->export_theme_desc );
$sub_tabs['duplicate_theme'] = array( 'title' => $lang->duplicate_theme,
|
'link' => "index.php?module=style-themes&action=duplicate&tid={$mybb->input['tid']}",
| 'link' => "index.php?module=style-themes&action=duplicate&tid={$mybb->get_input('tid')}",
|
'description' => $lang->duplicate_theme_desc );
|
'description' => $lang->duplicate_theme_desc );
|
|
|
$page->output_nav_tabs($sub_tabs, 'duplicate_theme');
if($errors)
| $page->output_nav_tabs($sub_tabs, 'duplicate_theme');
if($errors)
|
Zeile 858 | Zeile 886 |
---|
{ $mybb->input['duplicate_templates'] = true; }
|
{ $mybb->input['duplicate_templates'] = true; }
|
|
|
$form = new Form("index.php?module=style-themes&action=duplicate&tid={$theme['tid']}", "post");
|
$form = new Form("index.php?module=style-themes&action=duplicate&tid={$theme['tid']}", "post");
|
|
|
$form_container = new FormContainer($lang->duplicate_theme);
|
$form_container = new FormContainer($lang->duplicate_theme);
|
$form_container->output_row($lang->new_name, $lang->new_name_duplicate_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->advanced_options, "", $form->generate_check_box('duplicate_templates', '1', $lang->duplicate_templates, array('checked' => $mybb->input['duplicate_templates'], 'id' => 'duplicate_templates'))."<br /><small>{$lang->duplicate_templates_desc}</small>");
| $form_container->output_row($lang->new_name, $lang->new_name_duplicate_desc, $form->generate_text_box('name', $mybb->get_input('name'), array('id' => 'name')), 'name'); $form_container->output_row($lang->advanced_options, "", $form->generate_check_box('duplicate_templates', '1', $lang->duplicate_templates, array('checked' => $mybb->get_input('duplicate_templates'), 'id' => 'duplicate_templates'))."<br /><small>{$lang->duplicate_templates_desc}</small>");
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->duplicate_theme);
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->duplicate_theme);
|
|
|
$form->output_submit_wrapper($buttons);
|
$form->output_submit_wrapper($buttons);
|
|
|
$form->end();
$page->output_footer();
| $form->end();
$page->output_footer();
|
Zeile 879 | Zeile 907 |
---|
if($mybb->input['action'] == "add") { $plugins->run_hooks("admin_style_themes_add");
|
if($mybb->input['action'] == "add") { $plugins->run_hooks("admin_style_themes_add");
|
|
|
$query = $db->simple_select("themes", "tid, name"); while($theme = $db->fetch_array($query))
|
$query = $db->simple_select("themes", "tid, name"); while($theme = $db->fetch_array($query))
|
{
| {
|
$themes[$theme['tid']] = $theme['name']; }
| $themes[$theme['tid']] = $theme['name']; }
|
Zeile 891 | Zeile 919 |
---|
if(!$mybb->input['name']) { $errors[] = $lang->error_missing_name;
|
if(!$mybb->input['name']) { $errors[] = $lang->error_missing_name;
|
} else if(in_array($mybb->input['name'], $themes))
| } else if(in_array($mybb->input['name'], $themes))
|
{ $errors[] = $lang->error_theme_already_exists; }
| { $errors[] = $lang->error_theme_already_exists; }
|
Zeile 925 | Zeile 953 |
---|
$form = new Form("index.php?module=style-themes&action=add", "post");
$form_container = new FormContainer($lang->create_a_theme);
|
$form = new Form("index.php?module=style-themes&action=add", "post");
$form_container = new FormContainer($lang->create_a_theme);
|
$form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name'); $form_container->output_row($lang->parent_theme, $lang->parent_theme_desc, $form->generate_select_box('tid', $themes, $mybb->input['tid'], array('id' => 'tid')), 'tid');
| $form_container->output_row($lang->name, $lang->name_desc, $form->generate_text_box('name', $mybb->get_input('name'), array('id' => 'name')), 'name'); $form_container->output_row($lang->parent_theme, $lang->parent_theme_desc, $form->generate_select_box('tid', $themes, $mybb->get_input('tid'), array('id' => 'tid')), 'tid');
|
$form_container->end();
| $form_container->end();
|
Zeile 945 | Zeile 973 |
---|
$theme = $db->fetch_array($query);
// Does the theme not exist? or are we trying to delete the master?
|
$theme = $db->fetch_array($query);
// Does the theme not exist? or are we trying to delete the master?
|
if(!$theme['tid'] || $theme['tid'] == 1)
| if(!$theme || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes"); }
// User clicked no
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes"); }
// User clicked no
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=style-themes"); }
| { admin_redirect("index.php?module=style-themes"); }
|
Zeile 968 | Zeile 996 |
---|
{ $theme2['stylesheets'] = my_unserialize($theme2['stylesheets']);
|
{ $theme2['stylesheets'] = my_unserialize($theme2['stylesheets']);
|
if(!$theme2['stylesheets']['inherited'])
| if(empty($theme2['stylesheets']['inherited']))
|
{ continue; }
| { continue; }
|
Zeile 991 | Zeile 1019 |
---|
} } }
|
} } }
|
}
| }
|
if($inherited_stylesheets == true)
|
if($inherited_stylesheets == true)
|
{
| {
|
flash_message($lang->error_inheriting_stylesheets, 'error'); admin_redirect("index.php?module=style-themes");
|
flash_message($lang->error_inheriting_stylesheets, 'error'); admin_redirect("index.php?module=style-themes");
|
}
| }
|
$query = $db->simple_select("themestylesheets", "cachefile", "tid='{$theme['tid']}'"); while($cachefile = $db->fetch_array($query)) { @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$cachefile['cachefile']}");
|
$query = $db->simple_select("themestylesheets", "cachefile", "tid='{$theme['tid']}'"); 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}");
|
$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");
| }
$path = MYBB_ROOT."cache/themes/theme{$theme['tid']}/index.html"; if(file_exists($path)) { @unlink($path); }
|
$db->delete_query("themestylesheets", "tid='{$theme['tid']}'");
|
$db->delete_query("themestylesheets", "tid='{$theme['tid']}'");
|
|
|
// Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid'], $theme, true);
|
// Update the CSS file list for this theme update_theme_stylesheet_list($theme['tid'], $theme, true);
|
|
|
$db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");
|
$db->update_query("users", array('style' => 0), "style='{$theme['tid']}'");
|
@rmdir(MYBB_ROOT."cache/themes/theme{$theme['tid']}/");
| $path = MYBB_ROOT."cache/themes/theme{$theme['tid']}/"; if(file_exists($path)) { @rmdir($path); }
|
$children = (array)make_child_theme_list($theme['tid']); $child_tids = array();
| $children = (array)make_child_theme_list($theme['tid']); $child_tids = array();
|
Zeile 1056 | Zeile 1093 |
---|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
if(!$theme['tid'] || $theme['tid'] == 1)
| if(!$theme || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 1068 | Zeile 1105 |
---|
{ $properties = array( 'templateset' => $mybb->get_input('templateset', MyBB::INPUT_INT),
|
{ $properties = array( 'templateset' => $mybb->get_input('templateset', MyBB::INPUT_INT),
|
'editortheme' => $mybb->input['editortheme'], 'imgdir' => $mybb->input['imgdir'], 'logo' => $mybb->input['logo'],
| 'editortheme' => $mybb->get_input('editortheme'), 'imgdir' => $mybb->get_input('imgdir'), 'logo' => $mybb->get_input('logo'),
|
'tablespace' => $mybb->get_input('tablespace', MyBB::INPUT_INT), 'borderwidth' => $mybb->get_input('borderwidth', MyBB::INPUT_INT),
|
'tablespace' => $mybb->get_input('tablespace', MyBB::INPUT_INT), 'borderwidth' => $mybb->get_input('borderwidth', MyBB::INPUT_INT),
|
'color' => $mybb->input['color']
| 'color' => $mybb->get_input('color')
|
);
if($properties['color'] == 'none')
| );
if($properties['color'] == 'none')
|
Zeile 1088 | Zeile 1125 |
---|
foreach($colors as $color) { $color = trim($color);
|
foreach($colors as $color) { $color = trim($color);
|
if(preg_match('/^[a-z0-9]+={1}[a-z0-9]+$/i', $color))
| if(preg_match('(^((\p{L}|\p{Nd}|_)+)={1}((\p{L}|\p{Nd}|_)+)$)u', $color))
|
{ $color = explode("=", $color); $properties['colors'][$color[0]] = $color[1];
| { $color = explode("=", $color); $properties['colors'][$color[0]] = $color[1];
|
Zeile 1141 | Zeile 1178 |
---|
'properties' => $db->escape_string(my_serialize($properties)) );
|
'properties' => $db->escape_string(my_serialize($properties)) );
|
// perform validation
| // Perform validation
|
if(!$update_array['name']) { $errors[] = $lang->error_missing_name;
| if(!$update_array['name']) { $errors[] = $lang->error_missing_name;
|
Zeile 1168 | Zeile 1205 |
---|
} if($properties['templateset']) {
|
} if($properties['templateset']) {
|
$query = $db->simple_select("templatesets", "sid", "sid='".$properties['templateset']."'");
| $query = $db->simple_select("templatesets", "sid", "sid='".(int)$properties['templateset']."'");
|
$ts_check = $db->fetch_field($query, "sid"); if(!$ts_check) {
| $ts_check = $db->fetch_field($query, "sid"); if(!$ts_check) {
|
Zeile 1223 | Zeile 1260 |
---|
foreach($style as $stylesheet) { $stylesheets[$stylesheet]['applied_to'][$file][] = $action;
|
foreach($style as $stylesheet) { $stylesheets[$stylesheet]['applied_to'][$file][] = $action;
|
if(is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet, array_keys($file_stylesheets['inherited'][$file."_".$action])))
| if(isset($file_stylesheets['inherited'][$file."_".$action]) && is_array($file_stylesheets['inherited'][$file."_".$action]) && in_array($stylesheet, array_keys($file_stylesheets['inherited'][$file."_".$action])))
|
{ $stylesheets[$stylesheet]['inherited'] = $file_stylesheets['inherited'][$file."_".$action]; foreach($file_stylesheets['inherited'][$file."_".$action] as $value)
| { $stylesheets[$stylesheet]['inherited'] = $file_stylesheets['inherited'][$file."_".$action]; foreach($file_stylesheets['inherited'][$file."_".$action] as $value)
|
Zeile 1297 | Zeile 1334 |
---|
$cache->update_default_theme(); }
|
$cache->update_default_theme(); }
|
// normalize for consistency
| // Normalize for consistency
|
update_theme_stylesheet_list($theme['tid'], false, true);
flash_message($lang->success_stylesheet_order_updated, 'success');
| update_theme_stylesheet_list($theme['tid'], false, true);
flash_message($lang->success_stylesheet_order_updated, 'success');
|
Zeile 1385 | Zeile 1422 |
---|
$inherited = ""; $inherited_ary = array();
|
$inherited = ""; $inherited_ary = array();
|
if(is_array($style['inherited']))
| if(isset($style['inherited']) && is_array($style['inherited']))
|
{ foreach($style['inherited'] as $tid) {
| { foreach($style['inherited'] as $tid) {
|
Zeile 1410 | Zeile 1447 |
---|
$sep = " {$lang->and} "; }
|
$sep = " {$lang->and} "; }
|
$inherited .= $sep.$file;
| $inherited .= $sep.htmlspecialchars_uni($file);
|
$sep = $lang->comma;
++$count;
| $sep = $lang->comma;
++$count;
|
Zeile 1429 | Zeile 1466 |
---|
$colors = array();
|
$colors = array();
|
if(!is_array($properties['colors']))
| if(!isset($properties['colors']) || !is_array($properties['colors']))
|
{ $properties['colors'] = array(); }
| { $properties['colors'] = array(); }
|
Zeile 1521 | Zeile 1558 |
---|
$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}')"); }
|
$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("<strong><a href=\"index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($filename)."&tid={$theme['tid']}\">".htmlspecialchars_uni($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_row();
| $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();
|
Zeile 1591 | Zeile 1628 |
---|
$form_container = new FormContainer($lang->colors_manage);
|
$form_container = new FormContainer($lang->colors_manage);
|
if(!$properties['colors'] || !is_array($properties['colors']))
| if(empty($properties['colors']) || !is_array($properties['colors']))
|
{ $color_setting = $lang->colors_no_color_setting; }
| { $color_setting = $lang->colors_no_color_setting; }
|
Zeile 1600 | Zeile 1637 |
---|
$colors = array('none' => $lang->colors_please_select); $colors = array_merge($colors, $properties['colors']);
|
$colors = array('none' => $lang->colors_please_select); $colors = array_merge($colors, $properties['colors']);
|
| if(!isset($properties['color'])) { $properties['color'] = 'none'; }
|
$color_setting = $form->generate_select_box('color', $colors, $properties['color'], array('class' => "select\" style=\"width: 200px;"));
$mybb->input['colors'] = '';
| $color_setting = $form->generate_select_box('color', $colors, $properties['color'], array('class' => "select\" style=\"width: 200px;"));
$mybb->input['colors'] = '';
|
Zeile 1609 | Zeile 1650 |
---|
{ $mybb->input['colors'] .= "\n"; }
|
{ $mybb->input['colors'] .= "\n"; }
|
|
|
$mybb->input['colors'] .= "{$key}={$color}"; } }
$form_container->output_row($lang->colors_setting, $lang->colors_setting_desc, $color_setting, 'color');
|
$mybb->input['colors'] .= "{$key}={$color}"; } }
$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_add, $lang->colors_add_desc, $form->generate_text_area('colors', $mybb->get_input('colors'), array('style' => 'width: 200px;', 'rows' => '5')));
|
$form_container->end();
$buttons = array();
| $form_container->end();
$buttons = array();
|
Zeile 1626 | Zeile 1667 |
---|
$page->output_footer(); }
|
$page->output_footer(); }
|
|
|
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', MyBB::INPUT_INT)."'"); $theme = $db->fetch_array($query);
|
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', MyBB::INPUT_INT)."'"); $theme = $db->fetch_array($query);
|
if(!$theme['tid'] || $theme['tid'] == 1)
| if(!$theme || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error');
|
{ flash_message($lang->error_invalid_theme, 'error');
|
admin_redirect("index.php?module=style-themes"); }
| admin_redirect("index.php?module=style-themes"); }
|
$plugins->run_hooks("admin_style_themes_stylesheet_properties");
|
$plugins->run_hooks("admin_style_themes_stylesheet_properties");
|
|
|
$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;
|
}
| }
|
$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?
|
$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'])
| if(!$stylesheet)
|
{ flash_message($lang->error_invalid_stylesheet, 'error'); admin_redirect("index.php?module=style-themes");
|
{ flash_message($lang->error_invalid_stylesheet, 'error'); admin_redirect("index.php?module=style-themes");
|
}
| }
|
// Fetch list of all of the stylesheets for this theme $stylesheets = fetch_theme_stylesheets($theme);
| // Fetch list of all of the stylesheets for this theme $stylesheets = fetch_theme_stylesheets($theme);
|
Zeile 1767 | Zeile 1808 |
---|
$filename_min = str_replace('.css', '.min.css', $stylesheet['cachefile']); @unlink(MYBB_ROOT."cache/themes/theme{$theme['tid']}/{$filename_min}");
|
$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);
|
Zeile 1796 | Zeile 1837 |
---|
// Show inherited warning if($stylesheet['tid'] == 1)
|
// Show inherited warning if($stylesheet['tid'] == 1)
|
{
| {
|
$page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent)); } else
|
$page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent)); } else
|
{
| {
|
$page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent)); } }
$applied_to = $this_stylesheet['applied_to']; unset($this_stylesheet);
|
$page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent)); } }
$applied_to = $this_stylesheet['applied_to']; unset($this_stylesheet);
|
|
|
if($errors) { $page->output_inline_error($errors);
| if($errors) { $page->output_inline_error($errors);
|
Zeile 1824 | Zeile 1865 |
---|
if($mybb->input['action_'.$id] == 1) { $applied_to[$value] = explode(',', $mybb->input['action_list_'.$id]);
|
if($mybb->input['action_'.$id] == 1) { $applied_to[$value] = explode(',', $mybb->input['action_list_'.$id]);
|
} } }
| } } }
|
} else {
| } else {
|
Zeile 1841 | Zeile 1882 |
---|
$specific_files = "<div id=\"attach_1\" class=\"attachs\">"; $count = 0;
|
$specific_files = "<div id=\"attach_1\" class=\"attachs\">"; $count = 0;
|
if(is_array($applied_to) && $applied_to['global'][0] != "global")
| if(is_array($applied_to) && (!isset($applied_to['global']) || $applied_to['global'][0] != "global"))
|
{ $check_actions = ""; $stylesheet['colors'] = array();
| { $check_actions = ""; $stylesheet['colors'] = array();
|
Zeile 1950 | Zeile 1991 |
---|
var checked = \'\';
$(\'.\'+id+\'s_check\').each(function(e, val)
|
var checked = \'\';
$(\'.\'+id+\'s_check\').each(function(e, val)
|
{
| {
|
if($(this).prop(\'checked\') == true) { checked = $(this).val();
| if($(this).prop(\'checked\') == true) { checked = $(this).val();
|
Zeile 2013 | Zeile 2054 |
---|
$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);
|
if(!$theme['tid'] || $theme['tid'] == 1)
| if(!$theme || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 2032 | Zeile 2073 |
---|
$stylesheet = $db->fetch_array($query);
// Does the theme not exist?
|
$stylesheet = $db->fetch_array($query);
// Does the theme not exist?
|
if(!$stylesheet['sid'])
| if(!$stylesheet)
|
{ flash_message($lang->error_invalid_stylesheet, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_stylesheet, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 2128 | Zeile 2169 |
---|
}
$css_array = css_to_array($stylesheet['stylesheet']);
|
}
$css_array = css_to_array($stylesheet['stylesheet']);
|
$selector_list = get_selectors_as_options($css_array, $mybb->input['selector']);
| $selector_list = get_selectors_as_options($css_array, $mybb->get_input('selector'));
|
// Do we not have any selectors? Send em to the full edit page if(!$selector_list)
| // Do we not have any selectors? Send em to the full edit page if(!$selector_list)
|
Zeile 2136 | Zeile 2177 |
---|
flash_message($lang->error_cannot_parse, 'error'); admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$theme['tid']}&file=".htmlspecialchars_uni($stylesheet['name'])."&mode=advanced"); exit;
|
flash_message($lang->error_cannot_parse, 'error'); admin_redirect("index.php?module=style-themes&action=edit_stylesheet&tid={$theme['tid']}&file=".htmlspecialchars_uni($stylesheet['name'])."&mode=advanced"); exit;
|
}
| }
|
// Fetch list of all of the stylesheets for this theme $stylesheets = fetch_theme_stylesheets($theme); $this_stylesheet = $stylesheets[$stylesheet['name']];
| // Fetch list of all of the stylesheets for this theme $stylesheets = fetch_theme_stylesheets($theme); $this_stylesheet = $stylesheets[$stylesheet['name']];
|
Zeile 2154 | Zeile 2195 |
---|
$page->output_header("{$lang->themes} - {$lang->edit_stylesheets}");
// If the stylesheet and theme do not match, we must be editing something that is inherited
|
$page->output_header("{$lang->themes} - {$lang->edit_stylesheets}");
// If the stylesheet and theme do not match, we must be editing something that is inherited
|
if($this_stylesheet['inherited'][$stylesheet['name']])
| if(!empty($this_stylesheet['inherited'][$stylesheet['name']]))
|
{ $query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'"); $stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));
|
{ $query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'"); $stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));
|
|
|
// Show inherited warning if($stylesheet['tid'] == 1)
|
// Show inherited warning if($stylesheet['tid'] == 1)
|
{
| {
|
$page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent), "ajax_alert");
|
$page->output_alert($lang->sprintf($lang->stylesheet_inherited_default, $stylesheet_parent), "ajax_alert");
|
} 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", 'description' => $lang->edit_stylesheet_simple_mode_desc
|
$sub_tabs['edit_stylesheet'] = array( 'title' => $lang->edit_stylesheet_simple_mode, 'link' => "index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&file=".htmlspecialchars_uni($mybb->input['file'])."&mode=simple", 'description' => $lang->edit_stylesheet_simple_mode_desc
|
);
| );
|
$sub_tabs['edit_stylesheet_advanced'] = array( 'title' => $lang->edit_stylesheet_advanced_mode, 'link' => "index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&file=".htmlspecialchars_uni($mybb->input['file'])."&mode=advanced", );
|
$sub_tabs['edit_stylesheet_advanced'] = array( 'title' => $lang->edit_stylesheet_advanced_mode, 'link' => "index.php?module=style-themes&action=edit_stylesheet&tid={$mybb->input['tid']}&file=".htmlspecialchars_uni($mybb->input['file'])."&mode=advanced", );
|
|
|
$page->output_nav_tabs($sub_tabs, 'edit_stylesheet');
// Output the selection box
| $page->output_nav_tabs($sub_tabs, 'edit_stylesheet');
// Output the selection box
|
Zeile 2191 | Zeile 2232 |
---|
echo $form->generate_hidden_field("file", htmlspecialchars_uni($mybb->input['file']))."\n";
echo "{$lang->selector}: <select id=\"selector\" name=\"selector\">\n{$selector_list}</select> <span id=\"mini_spinner\">".$form->generate_submit_button($lang->go)."</span><br /><br />\n";
|
echo $form->generate_hidden_field("file", htmlspecialchars_uni($mybb->input['file']))."\n";
echo "{$lang->selector}: <select id=\"selector\" name=\"selector\">\n{$selector_list}</select> <span id=\"mini_spinner\">".$form->generate_submit_button($lang->go)."</span><br /><br />\n";
|
|
|
$form->end();
// Haven't chosen a selector to edit, show the first one from the stylesheet
|
$form->end();
// Haven't chosen a selector to edit, show the first one from the stylesheet
|
if(!$mybb->input['selector'])
| if(!$mybb->get_input('selector'))
|
{ reset($css_array); uasort($css_array, "css_selectors_sort_cmp");
| { reset($css_array); uasort($css_array, "css_selectors_sort_cmp");
|
Zeile 2208 | Zeile 2249 |
---|
$editable_selector = $css_array[$mybb->input['selector']]; $selector = $mybb->input['selector']; }
|
$editable_selector = $css_array[$mybb->input['selector']]; $selector = $mybb->input['selector']; }
|
|
|
// Get the properties from this item $properties = parse_css_properties($editable_selector['values']);
foreach(array('background', 'color', 'width', 'font-family', 'font-size', 'font-style', 'font-weight', 'text-decoration') as $_p)
|
// Get the properties from this item $properties = parse_css_properties($editable_selector['values']);
foreach(array('background', 'color', 'width', 'font-family', 'font-size', 'font-style', 'font-weight', 'text-decoration') as $_p)
|
{
| {
|
if(!isset($properties[$_p])) { $properties[$_p] = '';
| if(!isset($properties[$_p])) { $properties[$_p] = '';
|
Zeile 2277 | Zeile 2318 |
---|
$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);
|
if(!$theme['tid'] || $theme['tid'] == 1)
| if(!$theme || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 2296 | Zeile 2337 |
---|
$stylesheet = $db->fetch_array($query);
// Does the theme not exist?
|
$stylesheet = $db->fetch_array($query);
// Does the theme not exist?
|
if(!$stylesheet['sid']) { flash_message($lang->error_invalid_stylesheet, 'error'); admin_redirect("index.php?module=style-themes"); }
| if($db->num_rows($query) == 0) { flash_message($lang->error_invalid_stylesheet, 'error'); admin_redirect("index.php?module=style-themes"); }
|
if($mybb->request_method == "post") {
| if($mybb->request_method == "post") {
|
Zeile 2310 | Zeile 2351 |
---|
if($theme['tid'] != $stylesheet['tid']) { $sid = copy_stylesheet_to_theme($stylesheet, $theme['tid']);
|
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']),
|
Zeile 2336 | Zeile 2377 |
---|
flash_message($lang->success_stylesheet_updated, 'success');
|
flash_message($lang->success_stylesheet_updated, 'success');
|
if(!$mybb->input['save_close'])
| if(!$mybb->get_input('save_close'))
|
{ admin_redirect("index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($stylesheet['name'])."&tid={$theme['tid']}&mode=advanced"); } else { admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
|
{ admin_redirect("index.php?module=style-themes&action=edit_stylesheet&file=".htmlspecialchars_uni($stylesheet['name'])."&tid={$theme['tid']}&mode=advanced"); } else { admin_redirect("index.php?module=style-themes&action=edit&tid={$theme['tid']}");
|
}
| }
|
}
// Fetch list of all of the stylesheets for this theme
| }
// Fetch list of all of the stylesheets for this theme
|
Zeile 2363 | Zeile 2404 |
---|
<script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/search.js?ver=1821"></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->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");
|
Zeile 2371 | Zeile 2412 |
---|
$page->output_header("{$lang->themes} - {$lang->edit_stylesheet_advanced_mode}");
// If the stylesheet and theme do not match, we must be editing something that is inherited
|
$page->output_header("{$lang->themes} - {$lang->edit_stylesheet_advanced_mode}");
// If the stylesheet and theme do not match, we must be editing something that is inherited
|
if($this_stylesheet['inherited'][$stylesheet['name']])
| if(!empty($this_stylesheet['inherited']) && $this_stylesheet['inherited'][$stylesheet['name']])
|
{ $query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'"); $stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));
| { $query = $db->simple_select("themes", "name", "tid='{$stylesheet['tid']}'"); $stylesheet_parent = htmlspecialchars_uni($db->fetch_field($query, 'name'));
|
Zeile 2385 | Zeile 2426 |
---|
{ $page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent)); }
|
{ $page->output_alert($lang->sprintf($lang->stylesheet_inherited, $stylesheet_parent)); }
|
}
| }
|
$sub_tabs['edit_stylesheet'] = array( 'title' => $lang->edit_stylesheet_simple_mode,
| $sub_tabs['edit_stylesheet'] = array( 'title' => $lang->edit_stylesheet_simple_mode,
|
Zeile 2447 | Zeile 2488 |
---|
$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);
|
if(!$theme['tid'] || $theme['tid'] == 1)
| if(!$theme || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 2466 | Zeile 2507 |
---|
$stylesheet = $db->fetch_array($query);
// Does the theme not exist? or are we trying to delete the master?
|
$stylesheet = $db->fetch_array($query);
// Does the theme not exist? or are we trying to delete the master?
|
if(!$stylesheet['sid'] || $stylesheet['tid'] == 1)
| if(!$stylesheet || $stylesheet['tid'] == 1)
|
{ flash_message($lang->error_invalid_stylesheet, 'error'); admin_redirect("index.php?module=style-themes"); }
// User clicked no
|
{ flash_message($lang->error_invalid_stylesheet, 'error'); admin_redirect("index.php?module=style-themes"); }
// User clicked no
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=style-themes"); }
| { admin_redirect("index.php?module=style-themes"); }
|
Zeile 2509 | Zeile 2550 |
---|
$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);
|
if(!$theme['tid'] || $theme['tid'] == 1)
| if(!$theme || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
}
$plugins->run_hooks("admin_style_themes_add_stylesheet");
| }
$plugins->run_hooks("admin_style_themes_add_stylesheet");
|
// Fetch list of all of the stylesheets for this theme $stylesheets = fetch_theme_stylesheets($theme);
| // Fetch list of all of the stylesheets for this theme $stylesheets = fetch_theme_stylesheets($theme);
|
Zeile 2644 | Zeile 2685 |
---|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}"); $page->add_breadcrumb_item($lang->add_stylesheet); $properties = my_unserialize($theme['properties']);
|
$page->add_breadcrumb_item(htmlspecialchars_uni($theme['name']), "index.php?module=style-themes&action=edit&tid={$mybb->input['tid']}"); $page->add_breadcrumb_item($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']}"
|
$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['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']}"
|
Zeile 2670 | Zeile 2711 |
---|
);
$page->output_nav_tabs($sub_tabs, 'add_stylesheet');
|
);
$page->output_nav_tabs($sub_tabs, 'add_stylesheet');
|
| $add_checked = array();
|
if($errors) {
| if($errors) {
|
Zeile 2704 | Zeile 2747 |
---|
} else {
|
} else {
|
$mybb->input['name'] = $stylesheet['name'];
| $stylesheet = $mybb->get_input('stylesheet', MyBB::INPUT_ARRAY); if(!isset($stylesheet['sid'])) { $stylesheet['sid'] = ''; } if(isset($stylesheet['name'])) { $mybb->input['name'] = $stylesheet['name']; }
$add_checked[1] = ""; $add_checked[2] = "";
|
}
$global_checked[1] = "checked=\"checked\""; $global_checked[2] = ""; $global_checked[3] = "";
|
}
$global_checked[1] = "checked=\"checked\""; $global_checked[2] = ""; $global_checked[3] = "";
|
|
|
$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;
|
$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;
|
| $check_actions = ""; $mybb->input['attach'] = $mybb->get_input('attach', MyBB::INPUT_INT); $stylesheet['colors'] = array(); $stylesheet['sid'] = null;
|
if($mybb->input['attach'] == 1 && is_array($mybb->input['applied_to']) && (!isset($mybb->input['applied_to']['global']) || $mybb->input['applied_to']['global'][0] != "global")) {
|
if($mybb->input['attach'] == 1 && is_array($mybb->input['applied_to']) && (!isset($mybb->input['applied_to']['global']) || $mybb->input['applied_to']['global'][0] != "global")) {
|
$check_actions = "";
| |
foreach($mybb->input['applied_to'] as $name => $actions) { $action_list = ""; if($actions[0] != "global") { $action_list = implode(',', $actions);
|
foreach($mybb->input['applied_to'] as $name => $actions) { $action_list = ""; if($actions[0] != "global") { $action_list = implode(',', $actions);
|
}
| }
|
if($actions[0] == "global") { $global_action_checked[1] = "checked=\"checked\""; $global_action_checked[2] = "";
|
if($actions[0] == "global") { $global_action_checked[1] = "checked=\"checked\""; $global_action_checked[2] = "";
|
}
| }
|
else { $global_action_checked[2] = "checked=\"checked\"";
| else { $global_action_checked[2] = "checked=\"checked\"";
|
Zeile 2771 | Zeile 2827 |
---|
$global_checked[3] = ""; $global_checked[2] = "checked=\"checked\""; $global_checked[1] = "";
|
$global_checked[3] = ""; $global_checked[2] = "checked=\"checked\""; $global_checked[1] = "";
|
}
| }
|
} else if($mybb->input['attach'] == 2) { // Colors
|
} else if($mybb->input['attach'] == 2) { // Colors
|
$stylesheet['colors'] = array();
| |
if(is_array($properties['colors'])) { // We might have colors here... foreach($mybb->input['color'] as $color)
|
if(is_array($properties['colors'])) { // We might have colors here... foreach($mybb->input['color'] as $color)
|
{
| {
|
// Verify this is a color for this theme if(array_key_exists($color, $properties['colors'])) {
| // Verify this is a color for this theme if(array_key_exists($color, $properties['colors'])) {
|
Zeile 2803 | Zeile 2858 |
---|
// Colors $specific_colors = $specific_colors_option = '';
|
// Colors $specific_colors = $specific_colors_option = '';
|
if(is_array($properties['colors']))
| if(isset($properties['colors']) && is_array($properties['colors']))
|
{ $specific_colors = "<br /><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>';
|
{ $specific_colors = "<br /><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>';
|
|
|
$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;"))." ";
|
$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>";
| $form_container = new FormContainer(); $form_container->output_row("", "", $specific_color); $specific_colors .= $form_container->end(true)."</div>";
|
Zeile 2855 | Zeile 2910 |
---|
echo $form->generate_hidden_field("sid", $stylesheet['sid'])."<br />\n";
$form_container = new FormContainer($lang->add_stylesheet_to.' '.htmlspecialchars_uni($theme['name']), 'tfixed');
|
echo $form->generate_hidden_field("sid", $stylesheet['sid'])."<br />\n";
$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->file_name, $lang->file_name_desc, $form->generate_text_box('name', $mybb->get_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->attached_to, $lang->attached_to_desc, $actions);
|
Zeile 2870 | Zeile 2925 |
---|
<dd style=\"margin-top: 4px;\" id=\"add_1\" class=\"adds\"> <table cellpadding=\"4\"> <tr>
|
<dd style=\"margin-top: 4px;\" id=\"add_1\" class=\"adds\"> <table cellpadding=\"4\"> <tr>
|
<td>".$form->generate_select_box('import', $sheetnames, $mybb->input['import'], array('id' => 'import'))."</td>
| <td>".$form->generate_select_box('import', $sheetnames, $mybb->get_input('import'), array('id' => 'import'))."</td>
|
</tr> </table> </dd> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"add_type\" value=\"2\" {$add_checked[2]} class=\"adds_check\" onclick=\"checkAction('add');\" style=\"vertical-align: middle;\" /> <strong>{$lang->write_own}</strong></label></dt>
|
</tr> </table> </dd> <dt><label style=\"display: block;\"><input type=\"radio\" name=\"add_type\" value=\"2\" {$add_checked[2]} class=\"adds_check\" onclick=\"checkAction('add');\" style=\"vertical-align: middle;\" /> <strong>{$lang->write_own}</strong></label></dt>
|
<span id=\"add_2\" class=\"adds\"><br />".$form->generate_text_area('stylesheet', $mybb->input['stylesheet'], array('id' => 'stylesheet', 'style' => 'width: 99%;', 'class' => '', 'rows' => '30'))."</span>
| <span id=\"add_2\" class=\"adds\"><br />".$form->generate_text_area('stylesheet', $mybb->get_input('stylesheet'), array('id' => 'stylesheet', 'style' => 'width: 99%;', 'class' => '', 'rows' => '30'))."</span>
|
</dl>";
$form_container->output_row("", "", $actions);
| </dl>";
$form_container->output_row("", "", $actions);
|
Zeile 2918 | Zeile 2973 |
---|
if($mybb->input['action'] == "set_default") {
|
if($mybb->input['action'] == "set_default") {
|
if(!verify_post_check($mybb->input['my_post_key']))
| if(!verify_post_check($mybb->get_input('my_post_key')))
|
{ flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 2928 | Zeile 2983 |
---|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
if(!$theme['tid'] || $theme['tid'] == 1)
| if(!$theme || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 2956 | Zeile 3011 |
---|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
$theme = $db->fetch_array($query);
// Does the theme not exist?
|
if(!$theme['tid'] || $theme['tid'] == 1)
| if(!$theme || $theme['tid'] == 1)
|
{ flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
| { flash_message($lang->error_invalid_theme, 'error'); admin_redirect("index.php?module=style-themes");
|
Zeile 2965 | Zeile 3020 |
---|
$plugins->run_hooks("admin_style_themes_force");
// User clicked no
|
$plugins->run_hooks("admin_style_themes_force");
// User clicked no
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=style-themes"); }
| { admin_redirect("index.php?module=style-themes"); }
|