Zeile 102 | Zeile 102 |
---|
$query = $db->simple_select("templatesets", "*", "", array('order_by' => 'title', 'order_dir' => 'ASC')); while($template_set = $db->fetch_array($query)) {
|
$query = $db->simple_select("templatesets", "*", "", array('order_by' => 'title', 'order_dir' => 'ASC')); while($template_set = $db->fetch_array($query)) {
|
$template_sets[$template_set['sid']] = $template_set['title'];
| $template_sets[$template_set['sid']] = htmlspecialchars_uni($template_set['title']);
|
}
$plugins->run_hooks("admin_style_templates");
| }
$plugins->run_hooks("admin_style_templates");
|
Zeile 157 | Zeile 157 |
---|
$form = new Form("index.php?module=style-templates&action=add_set", "post", "add_set");
$form_container = new FormContainer($lang->add_set);
|
$form = new Form("index.php?module=style-templates&action=add_set", "post", "add_set");
$form_container = new FormContainer($lang->add_set);
|
$form_container->output_row($lang->title, "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
| $form_container->output_row($lang->title, "", $form->generate_text_box('title', htmlspecialchars_uni($mybb->input['title']), array('id' => 'title')), 'title');
|
$form_container->end();
$buttons = array(); $buttons[] = $form->generate_submit_button($lang->save);
$form->output_submit_wrapper($buttons);
|
$form_container->end();
$buttons = array(); $buttons[] = $form->generate_submit_button($lang->save);
$form->output_submit_wrapper($buttons);
|
|
|
$form->end();
$page->output_footer();
| $form->end();
$page->output_footer();
|
Zeile 177 | Zeile 177 |
---|
if($mybb->request_method == "post") { if(empty($mybb->input['title']))
|
if($mybb->request_method == "post") { if(empty($mybb->input['title']))
|
{
| {
|
$errors[] = $lang->error_missing_set_title; } else { $query = $db->simple_select("templates", "COUNT(tid) as count", "title='".$db->escape_string($mybb->input['title'])."' AND (sid = '-2' OR sid = '{$sid}')"); if($db->fetch_field($query, "count") > 0)
|
$errors[] = $lang->error_missing_set_title; } else { $query = $db->simple_select("templates", "COUNT(tid) as count", "title='".$db->escape_string($mybb->input['title'])."' AND (sid = '-2' OR sid = '{$sid}')"); if($db->fetch_field($query, "count") > 0)
|
{
| {
|
$errors[] = $lang->error_already_exists; } }
| $errors[] = $lang->error_already_exists; } }
|
Zeile 242 | Zeile 242 |
---|
$sid = -1; }
|
$sid = -1; }
|
| $template['title'] = "";
|
$template['template'] = ""; $template['sid'] = $sid; }
| $template['template'] = ""; $template['sid'] = $sid; }
|
Zeile 254 | Zeile 255 |
---|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js"></script> <script src="./jscripts/codemirror/mode/xml/xml.js"></script> <script src="./jscripts/codemirror/mode/javascript/javascript.js"></script> <script src="./jscripts/codemirror/mode/css/css.js"></script> <script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js"></script> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet"> <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/fold/foldcode.js"></script> <script src="./jscripts/codemirror/addon/fold/xml-fold.js"></script> <script src="./jscripts/codemirror/addon/fold/foldgutter.js"></script> <link href="./jscripts/codemirror/addon/fold/foldgutter.css" rel="stylesheet">
| <link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/xml/xml.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/javascript/javascript.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js?ver=1813"></script> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet"> <script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/search.js?ver=1821"></script> <script src="./jscripts/codemirror/addon/fold/foldcode.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/fold/xml-fold.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/fold/foldgutter.js?ver=1813"></script> <link href="./jscripts/codemirror/addon/fold/foldgutter.css?ver=1813" rel="stylesheet">
|
'; }
| '; }
|
Zeile 336 | Zeile 337 |
---|
$errors = array(); if($mybb->request_method == "post")
|
$errors = array(); if($mybb->request_method == "post")
|
{
| {
|
$prefix = trim($mybb->input['prefix']); if(!$prefix)
|
$prefix = trim($mybb->input['prefix']); if(!$prefix)
|
{
| {
|
$errors[] = $lang->error_missing_group_prefix;
|
$errors[] = $lang->error_missing_group_prefix;
|
| }
if(strpos($prefix, "_") !== false) { $errors[] = $lang->error_invalid_group_title;
|
}
$title = trim($mybb->input['title']);
| }
$title = trim($mybb->input['title']);
|
Zeile 384 | Zeile 390 |
---|
} }
|
} }
|
if($mybb->input['sid'])
| if(!empty($mybb->input['sid']))
|
{ $page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}"); }
$page->add_breadcrumb_item($lang->add_template_group); $page->output_header($lang->add_template_group);
|
{ $page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}"); }
$page->add_breadcrumb_item($lang->add_template_group); $page->output_header($lang->add_template_group);
|
$page->output_nav_tabs($sub_tabs, 'add_template_group');
| $page->output_nav_tabs($sub_tabs, 'add_template_group');
|
|
|
| $template_group = array();
|
if($errors)
|
if($errors)
|
{
| {
|
$template_group = array( 'prefix' => $prefix, 'title' => $title
|
$template_group = array( 'prefix' => $prefix, 'title' => $title
|
);
| );
|
$page->output_inline_error($errors); }
|
$page->output_inline_error($errors); }
|
| else { $template_group = array( 'prefix' => null, 'title' => null, ); }
|
$form = new Form("index.php?module=style-templates&action=add_template_group{$expand_str}", "post", "add_template_group"); echo $form->generate_hidden_field('sid', $sid);
|
$form = new Form("index.php?module=style-templates&action=add_template_group{$expand_str}", "post", "add_template_group"); echo $form->generate_hidden_field('sid', $sid);
|
|
|
$form_container = new FormContainer($lang->add_template_group); $form_container->output_row($lang->template_group_prefix, $lang->template_group_prefix_desc, $form->generate_text_box('prefix', $template_group['prefix'], array('id' => 'prefix')), 'prefix'); $form_container->output_row($lang->template_group_title, $lang->template_group_title_desc, $form->generate_text_box('title', $template_group['title'], array('id' => 'title')), 'title');
| $form_container = new FormContainer($lang->add_template_group); $form_container->output_row($lang->template_group_prefix, $lang->template_group_prefix_desc, $form->generate_text_box('prefix', $template_group['prefix'], array('id' => 'prefix')), 'prefix'); $form_container->output_row($lang->template_group_title, $lang->template_group_title_desc, $form->generate_text_box('title', $template_group['title'], array('id' => 'title')), 'title');
|
Zeile 413 | Zeile 427 |
---|
$buttons = array( $form->generate_submit_button($lang->add_template_group)
|
$buttons = array( $form->generate_submit_button($lang->add_template_group)
|
);
| );
|
$form->output_submit_wrapper($buttons); $form->end();
| $form->output_submit_wrapper($buttons); $form->end();
|
Zeile 426 | Zeile 440 |
---|
$query = $db->simple_select("templatesets", "*", "sid='{$sid}'"); $set = $db->fetch_array($query); if(!$set)
|
$query = $db->simple_select("templatesets", "*", "sid='{$sid}'"); $set = $db->fetch_array($query); if(!$set)
|
{
| {
|
flash_message($lang->error_invalid_input, 'error'); admin_redirect("index.php?module=style-templates"); }
| flash_message($lang->error_invalid_input, 'error'); admin_redirect("index.php?module=style-templates"); }
|
Zeile 440 | Zeile 454 |
---|
if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_set_title;
|
if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_set_title;
|
}
| }
|
if(!$errors) {
| if(!$errors) {
|
Zeile 495 | Zeile 509 |
---|
$buttons[] = $form->generate_submit_button($lang->save);
$form->output_submit_wrapper($buttons);
|
$buttons[] = $form->generate_submit_button($lang->save);
$form->output_submit_wrapper($buttons);
|
|
|
$form->end();
$page->output_footer();
| $form->end();
$page->output_footer();
|
Zeile 508 | Zeile 522 |
---|
flash_message($lang->error_missing_input, 'error'); admin_redirect("index.php?module=style-templates"); }
|
flash_message($lang->error_missing_input, 'error'); admin_redirect("index.php?module=style-templates"); }
|
|
|
$plugins->run_hooks("admin_style_templates_edit_template");
if($mybb->request_method == "post")
| $plugins->run_hooks("admin_style_templates_edit_template");
if($mybb->request_method == "post")
|
Zeile 522 | Zeile 536 |
---|
if(check_template($mybb->input['template'])) { $errors[] = $lang->error_security_problem;
|
if(check_template($mybb->input['template'])) { $errors[] = $lang->error_security_problem;
|
}
| }
|
if(!$errors) { $query = $db->simple_select("templates", "*", "tid='{$mybb->input['tid']}'"); $template = $db->fetch_array($query);
|
if(!$errors) { $query = $db->simple_select("templates", "*", "tid='{$mybb->input['tid']}'"); $template = $db->fetch_array($query);
|
|
|
$template_array = array( 'title' => $db->escape_string($mybb->input['title']), 'sid' => $sid,
| $template_array = array( 'title' => $db->escape_string($mybb->input['title']), 'sid' => $sid,
|
Zeile 550 | Zeile 564 |
---|
$query = $db->simple_select("templates", "sid", "title='".$db->escape_string($mybb->input['title'])."' AND (sid = '-2' OR sid = '{$sid}' OR sid='{$template['sid']}')", array('order_by' => 'sid', 'order_dir' => 'desc')); $existing_sid = $db->fetch_field($query, "sid"); $existing_rows = $db->num_rows($query);
|
$query = $db->simple_select("templates", "sid", "title='".$db->escape_string($mybb->input['title'])."' AND (sid = '-2' OR sid = '{$sid}' OR sid='{$template['sid']}')", array('order_by' => 'sid', 'order_dir' => 'desc')); $existing_sid = $db->fetch_field($query, "sid"); $existing_rows = $db->num_rows($query);
|
|
|
if(($existing_sid == -2 && $existing_rows == 1) || $existing_rows == 0) { $template['tid'] = $db->insert_query("templates", $template_array);
| if(($existing_sid == -2 && $existing_rows == 1) || $existing_rows == 0) { $template['tid'] = $db->insert_query("templates", $template_array);
|
Zeile 583 | Zeile 597 |
---|
}
// Log admin action
|
}
// Log admin action
|
log_admin_action($template['tid'], $mybb->input['title'], $mybb->input['sid'], $set['title']);
flash_message($lang->success_template_saved, 'success');
if($mybb->input['continue'])
| if(!empty($set['title'])) { $title = $set['title']; } else { $title = null; }
log_admin_action($template['tid'], $mybb->get_input('title'), $mybb->get_input('sid'), $title);
flash_message($lang->success_template_saved, 'success');
if($mybb->get_input('continue'))
|
{
|
{
|
if($mybb->input['from'] == "diff_report") {
| if($mybb->get_input('from') == "diff_report") {
|
admin_redirect("index.php?module=style-templates&action=edit_template&title=".urlencode($mybb->input['title'])."&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2."&from=diff_report");
|
admin_redirect("index.php?module=style-templates&action=edit_template&title=".urlencode($mybb->input['title'])."&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2."&from=diff_report");
|
} else
| } else
|
{ admin_redirect("index.php?module=style-templates&action=edit_template&title=".urlencode($mybb->input['title'])."&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2);
|
{ admin_redirect("index.php?module=style-templates&action=edit_template&title=".urlencode($mybb->input['title'])."&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2);
|
}
| }
|
} else {
|
} else {
|
if($mybb->input['from'] == "diff_report")
| if($mybb->get_input('from') == "diff_report")
|
{ admin_redirect("index.php?module=style-templates&action=find_updated");
|
{ admin_redirect("index.php?module=style-templates&action=find_updated");
|
} else { admin_redirect("index.php?module=style-templates&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2."#group_{$group}"); } } } }
if($errors) { $template = $mybb->input;
| } else { admin_redirect("index.php?module=style-templates&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2."#group_{$group}"); } } } }
if($errors) { $template = $mybb->input;
|
} else {
| } else {
|
Zeile 626 | Zeile 649 |
---|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js"></script> <script src="./jscripts/codemirror/mode/xml/xml.js"></script> <script src="./jscripts/codemirror/mode/javascript/javascript.js"></script> <script src="./jscripts/codemirror/mode/css/css.js"></script> <script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js"></script> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet"> <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/fold/foldcode.js"></script> <script src="./jscripts/codemirror/addon/fold/xml-fold.js"></script> <script src="./jscripts/codemirror/addon/fold/foldgutter.js"></script> <link href="./jscripts/codemirror/addon/fold/foldgutter.css" rel="stylesheet">
| <link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/xml/xml.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/javascript/javascript.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js?ver=1813"></script> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet"> <script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/search.js?ver=1821"></script> <script src="./jscripts/codemirror/addon/fold/foldcode.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/fold/xml-fold.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/fold/foldgutter.js?ver=1813"></script> <link href="./jscripts/codemirror/addon/fold/foldgutter.css?ver=1813" rel="stylesheet">
|
';
|
';
|
}
| }
|
$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}");
if(!isset($mybb->input['from']))
|
$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}");
if(!isset($mybb->input['from']))
|
{
| {
|
$mybb->input['from'] = ''; }
if($mybb->input['from'] == "diff_report") { $page->add_breadcrumb_item($lang->find_updated, "index.php?module=style-templates&action=find_updated");
|
$mybb->input['from'] = ''; }
if($mybb->input['from'] == "diff_report") { $page->add_breadcrumb_item($lang->find_updated, "index.php?module=style-templates&action=find_updated");
|
}
$page->add_breadcrumb_item($lang->edit_template_breadcrumb.$template['title'], "index.php?module=style-templates&sid={$sid}");
| }
$page->add_breadcrumb_item($lang->edit_template_breadcrumb.$template['title'], "index.php?module=style-templates&sid={$sid}");
|
$page->output_header($lang->sprintf($lang->editing_template, $template['title']));
|
$page->output_header($lang->sprintf($lang->editing_template, $template['title']));
|
|
|
$sub_tabs = array();
if($mybb->input['from'] == "diff_report")
| $sub_tabs = array();
if($mybb->input['from'] == "diff_report")
|
Zeile 680 | Zeile 703 |
---|
'title' => $lang->edit_template, 'link' => "index.php?module=style-templates&action=edit_template&title=".htmlspecialchars_uni($template['title']).$expand_str, 'description' => $lang->edit_template_desc
|
'title' => $lang->edit_template, 'link' => "index.php?module=style-templates&action=edit_template&title=".htmlspecialchars_uni($template['title']).$expand_str, 'description' => $lang->edit_template_desc
|
);
$page->output_nav_tabs($sub_tabs, 'edit_template');
if($errors)
| );
$page->output_nav_tabs($sub_tabs, 'edit_template');
if($errors)
|
{ $page->output_inline_error($errors); }
| { $page->output_inline_error($errors); }
|
Zeile 739 | Zeile 762 |
---|
}
if($mybb->input['action'] == "edit_template_group")
|
}
if($mybb->input['action'] == "edit_template_group")
|
{
| {
|
$query = $db->simple_select("templategroups", "*", "gid = '".$mybb->get_input('gid', MyBB::INPUT_INT)."'");
if(!$db->num_rows($query)) { flash_message($lang->error_missing_template_group, 'error');
|
$query = $db->simple_select("templategroups", "*", "gid = '".$mybb->get_input('gid', MyBB::INPUT_INT)."'");
if(!$db->num_rows($query)) { flash_message($lang->error_missing_template_group, 'error');
|
admin_redirect("index.php?module=style-templates&sid={$sid}{$expand_str}");
| admin_redirect("index.php?module=style-templates&sid={$sid}{$expand_str}");
|
}
$template_group = $db->fetch_array($query);
| }
$template_group = $db->fetch_array($query);
|
Zeile 754 | Zeile 777 |
---|
flash_message($lang->error_default_template_group, 'error'); admin_redirect("index.php?module=style-templates&sid={$sid}{$expand_str}"); }
|
flash_message($lang->error_default_template_group, 'error'); admin_redirect("index.php?module=style-templates&sid={$sid}{$expand_str}"); }
|
|
|
$plugins->run_hooks("admin_style_templates_edit_template_group");
$errors = array();
| $plugins->run_hooks("admin_style_templates_edit_template_group");
$errors = array();
|
Zeile 764 | Zeile 787 |
---|
if(!$prefix) { $errors[] = $lang->error_missing_group_prefix;
|
if(!$prefix) { $errors[] = $lang->error_missing_group_prefix;
|
| }
if(strpos($prefix, "_") !== false) { $errors[] = $lang->error_invalid_group_title;
|
}
$title = trim($mybb->input['title']);
| }
$title = trim($mybb->input['title']);
|
Zeile 798 | Zeile 826 |
---|
$db->update_query('templategroups', $update_array, "gid = '{$template_group['gid']}'");
|
$db->update_query('templategroups', $update_array, "gid = '{$template_group['gid']}'");
|
log_admin_action($template_group['gid'], htmlspecialchars_uni($title));
| log_admin_action($template_group['gid'], $title);
|
flash_message($lang->success_template_group_saved, 'success'); admin_redirect("index.php?module=style-templates&sid={$sid}"); }
| flash_message($lang->success_template_group_saved, 'success'); admin_redirect("index.php?module=style-templates&sid={$sid}"); }
|
Zeile 823 | Zeile 851 |
---|
$form = new Form("index.php?module=style-templates&action=edit_template_group", "post"); echo $form->generate_hidden_field('sid', $sid); echo $form->generate_hidden_field('gid', $template_group['gid']);
|
$form = new Form("index.php?module=style-templates&action=edit_template_group", "post"); echo $form->generate_hidden_field('sid', $sid); echo $form->generate_hidden_field('gid', $template_group['gid']);
|
|
|
$form_container = new FormContainer($lang->edit_template_group); $form_container->output_row($lang->template_group_prefix, $lang->template_group_prefix_desc, $form->generate_text_box('prefix', $template_group['prefix'], array('id' => 'prefix')), 'prefix'); $form_container->output_row($lang->template_group_title, $lang->template_group_title_desc, $form->generate_text_box('title', $template_group['title'], array('id' => 'title')), 'title');
| $form_container = new FormContainer($lang->edit_template_group); $form_container->output_row($lang->template_group_prefix, $lang->template_group_prefix_desc, $form->generate_text_box('prefix', $template_group['prefix'], array('id' => 'prefix')), 'prefix'); $form_container->output_row($lang->template_group_title, $lang->template_group_title_desc, $form->generate_text_box('title', $template_group['title'], array('id' => 'title')), 'title');
|
Zeile 850 | Zeile 878 |
---|
// Search and replace in templates
if(!$mybb->input['find'])
|
// Search and replace in templates
if(!$mybb->input['find'])
|
{
| {
|
flash_message($lang->search_noneset, "error"); admin_redirect("index.php?module=style-templates&action=search_replace"); } else { $page->add_breadcrumb_item($lang->search_replace);
|
flash_message($lang->search_noneset, "error"); admin_redirect("index.php?module=style-templates&action=search_replace"); } else { $page->add_breadcrumb_item($lang->search_replace);
|
|
|
$page->output_header($lang->search_replace);
$plugins->run_hooks("admin_style_templates_search_replace_find");
|
$page->output_header($lang->search_replace);
$plugins->run_hooks("admin_style_templates_search_replace_find");
|
|
|
$page->output_nav_tabs($sub_tabs, 'search_replace');
$templates_list = array();
| $page->output_nav_tabs($sub_tabs, 'search_replace');
$templates_list = array();
|
Zeile 878 | Zeile 906 |
---|
{ $template_sets[$set['sid']] = $set['title']; }
|
{ $template_sets[$set['sid']] = $set['title']; }
|
| $search_string = str_replace(array("\r\n", "\r"), "\n", $mybb->input['find']); $search_string = str_replace(array(" ", "\t"), "", $search_string);
|
// Select all templates with that search term $query = $db->query("
| // Select all templates with that search term $query = $db->query("
|
Zeile 885 | Zeile 916 |
---|
FROM ".TABLE_PREFIX."templates t LEFT JOIN ".TABLE_PREFIX."templatesets s ON (t.sid=s.sid) LEFT JOIN ".TABLE_PREFIX."templates t2 ON (t.title=t2.title AND t2.sid='1')
|
FROM ".TABLE_PREFIX."templates t LEFT JOIN ".TABLE_PREFIX."templatesets s ON (t.sid=s.sid) LEFT JOIN ".TABLE_PREFIX."templates t2 ON (t.title=t2.title AND t2.sid='1')
|
WHERE t.template LIKE '%".$db->escape_string_like($mybb->input['find'])."%' AND NOT (t.sid = -2 AND (t2.tid) IS NOT NULL)
| WHERE REPLACE(REPLACE(REPLACE(REPLACE(t.template, '\r\n', '\n'), '\r', '\n'), ' ', ''), '\t', '') LIKE '%".$db->escape_string_like($search_string)."%' AND NOT (t.sid = -2 AND (t2.tid) IS NOT NULL)
|
ORDER BY t.title ASC "); if($db->num_rows($query) == 0)
| ORDER BY t.title ASC "); if($db->num_rows($query) == 0)
|
Zeile 1166 | Zeile 1197 |
---|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
if($admin_options['codepress'] != 0) { $page->extra_header .= '
|
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1804" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js"></script> <script src="./jscripts/codemirror/mode/xml/xml.js"></script> <script src="./jscripts/codemirror/mode/javascript/javascript.js"></script> <script src="./jscripts/codemirror/mode/css/css.js"></script> <script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js"></script> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css" rel="stylesheet"> <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/fold/foldcode.js"></script> <script src="./jscripts/codemirror/addon/fold/xml-fold.js"></script> <script src="./jscripts/codemirror/addon/fold/foldgutter.js"></script> <link href="./jscripts/codemirror/addon/fold/foldgutter.css" rel="stylesheet">
| <link href="./jscripts/codemirror/lib/codemirror.css?ver=1813" rel="stylesheet"> <link href="./jscripts/codemirror/theme/mybb.css?ver=1813" rel="stylesheet"> <script src="./jscripts/codemirror/lib/codemirror.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/xml/xml.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/javascript/javascript.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/css/css.js?ver=1813"></script> <script src="./jscripts/codemirror/mode/htmlmixed/htmlmixed.js?ver=1813"></script> <link href="./jscripts/codemirror/addon/dialog/dialog-mybb.css?ver=1813" rel="stylesheet"> <script src="./jscripts/codemirror/addon/dialog/dialog.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/searchcursor.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/search/search.js?ver=1821"></script> <script src="./jscripts/codemirror/addon/fold/foldcode.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/fold/xml-fold.js?ver=1813"></script> <script src="./jscripts/codemirror/addon/fold/foldgutter.js?ver=1813"></script> <link href="./jscripts/codemirror/addon/fold/foldgutter.css?ver=1813" rel="stylesheet">
|
'; }
| '; }
|
Zeile 1194 | Zeile 1225 |
---|
echo $form->generate_hidden_field('type', "templates");
$form_container = new FormContainer($lang->search_replace, 'tfixed');
|
echo $form->generate_hidden_field('type', "templates");
$form_container = new FormContainer($lang->search_replace, 'tfixed');
|
$form_container->output_row($lang->search_for, "", $form->generate_text_area('find', $mybb->input['find'], array('id' => 'find', 'class' => '', 'style' => 'width: 100%; height: 200px;')));
| $form_container->output_row($lang->search_for, "", $form->generate_text_area('find', $mybb->get_input('find'), array('id' => 'find', 'class' => '', 'style' => 'width: 100%; height: 200px;')));
|
|
|
$form_container->output_row($lang->replace_with, "", $form->generate_text_area('replace', $mybb->input['replace'], array('id' => 'replace', 'class' => '', 'style' => 'width: 100%; height: 200px;')));
| $form_container->output_row($lang->replace_with, "", $form->generate_text_area('replace', $mybb->get_input('replace'), array('id' => 'replace', 'class' => '', 'style' => 'width: 100%; height: 200px;')));
|
$form_container->end();
$buttons[] = $form->generate_submit_button($lang->find_and_replace);
| $form_container->end();
$buttons[] = $form->generate_submit_button($lang->find_and_replace);
|
Zeile 1213 | Zeile 1244 |
---|
$form_container = new FormContainer($lang->search_template_names);
|
$form_container = new FormContainer($lang->search_template_names);
|
$form_container->output_row($lang->search_for, "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
| $form_container->output_row($lang->search_for, "", $form->generate_text_box('title', $mybb->get_input('title'), array('id' => 'title')), 'title');
|
$form_container->end();
| $form_container->end();
|
Zeile 1311 | Zeile 1342 |
---|
FROM ".TABLE_PREFIX."templates t LEFT JOIN ".TABLE_PREFIX."templates m ON (m.title=t.title AND m.sid=-2 AND m.version > t.version) WHERE t.sid > 0 AND m.template != t.template
|
FROM ".TABLE_PREFIX."templates t LEFT JOIN ".TABLE_PREFIX."templates m ON (m.title=t.title AND m.sid=-2 AND m.version > t.version) WHERE t.sid > 0 AND m.template != t.template
|
ORDER BY t.sid ASC, title ASC
| ORDER BY t.sid ASC, t.title ASC
|
"); while($template = $db->fetch_array($query)) {
| "); while($template = $db->fetch_array($query)) {
|
Zeile 1320 | Zeile 1351 |
---|
foreach($templates as $sid => $templates) {
|
foreach($templates as $sid => $templates) {
|
if(!$done_set[$sid])
| if(empty($done_set[$sid]))
|
{
|
{
|
$table->construct_header($templatesets[$sid]['title'], array("colspan" => 2));
| $table->construct_header(htmlspecialchars_uni($templatesets[$sid]['title']), array("colspan" => 2));
|
$done_set[$sid] = 1; ++$count;
| $done_set[$sid] = 1; ++$count;
|
Zeile 1341 | Zeile 1372 |
---|
$table->construct_row(); }
|
$table->construct_row(); }
|
if($done_set[$sid] && !$done_output[$sid])
| if(!empty($done_set[$sid]) && empty($done_output[$sid]))
|
{ $done_output[$sid] = 1; if($count == 1)
| { $done_output[$sid] = 1; if($count == 1)
|
Zeile 1370 | Zeile 1401 |
---|
}
// User clicked no
|
}
// User clicked no
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=style-templates&sid={$sid}"); }
| { admin_redirect("index.php?module=style-templates&sid={$sid}"); }
|
Zeile 1387 | Zeile 1418 |
---|
$plugins->run_hooks("admin_style_template_group_delete_commit");
// Log admin action
|
$plugins->run_hooks("admin_style_template_group_delete_commit");
// Log admin action
|
log_admin_action($template_group['gid'], htmlspecialchars_uni($template_group['title']));
| log_admin_action($template_group['gid'], $template_group['title']);
|
flash_message($lang->success_template_group_deleted, 'success'); admin_redirect("index.php?module=style-templates&sid={$sid}");
| flash_message($lang->success_template_group_deleted, 'success'); admin_redirect("index.php?module=style-templates&sid={$sid}");
|
Zeile 1426 | Zeile 1457 |
---|
}
// User clicked no
|
}
// User clicked no
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=style-templates"); }
| { admin_redirect("index.php?module=style-templates"); }
|
Zeile 1471 | Zeile 1502 |
---|
}
// User clicked no
|
}
// User clicked no
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=style-templates&sid={$template['sid']}{$expand_str2}"); }
| { admin_redirect("index.php?module=style-templates&sid={$template['sid']}{$expand_str2}"); }
|
Zeile 1537 | Zeile 1568 |
---|
$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".$mybb->get_input('sid2', MyBB::INPUT_INT)."'"); $template2 = $db->fetch_array($query);
|
$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".$mybb->get_input('sid2', MyBB::INPUT_INT)."'"); $template2 = $db->fetch_array($query);
|
|
|
if($mybb->input['sid2'] == -2) { $sub_tabs['full_edit'] = array(
| if($mybb->input['sid2'] == -2) { $sub_tabs['full_edit'] = array(
|
Zeile 1617 | Zeile 1648 |
---|
}
// User clicked no
|
}
// User clicked no
|
if($mybb->input['no'])
| if($mybb->get_input('no'))
|
{ admin_redirect("index.php?module=style-templates&sid={$template['sid']}{$expand_str2}");
|
{ admin_redirect("index.php?module=style-templates&sid={$template['sid']}{$expand_str2}");
|
}
| }
|
$plugins->run_hooks("admin_style_templates_revert");
| $plugins->run_hooks("admin_style_templates_revert");
|
Zeile 1651 | Zeile 1682 |
---|
} }
|
} }
|
if($mybb->input['sid'] && !$mybb->input['action'])
| if(!empty($mybb->input['sid']) && !$mybb->input['action'])
|
{ if(!isset($template_sets[$mybb->input['sid']])) {
| { if(!isset($template_sets[$mybb->input['sid']])) {
|
Zeile 1726 | Zeile 1757 |
---|
$template_groups[$templategroup['prefix']] = $templategroup; }
|
$template_groups[$templategroup['prefix']] = $templategroup; }
|
| /** * @param array $a * @param array $b * * @return int */
|
function sort_template_groups($a, $b) { return strcasecmp($a['title'], $b['title']);
| function sort_template_groups($a, $b) { return strcasecmp($a['title'], $b['title']);
|
Zeile 1758 | Zeile 1795 |
---|
else { $group = -1;
|
else { $group = -1;
|
}
| }
|
$template['gid'] = -1; if(isset($template_groups[$exploded[0]]['gid'])) {
| $template['gid'] = -1; if(isset($template_groups[$exploded[0]]['gid'])) {
|
Zeile 1770 | Zeile 1807 |
---|
if($template['sid'] != -2) { $template['original'] = false;
|
if($template['sid'] != -2) { $template['original'] = false;
|
$template['modified'] = false;
| $template['modified'] = false;
|
$template_groups[$group]['templates'][$template['title']] = $template; } else if(!in_array($template['gid'], $expand_array) && !isset($expand_array[-1]))
| $template_groups[$group]['templates'][$template['title']] = $template; } else if(!in_array($template['gid'], $expand_array) && !isset($expand_array[-1]))
|
Zeile 1787 | Zeile 1824 |
---|
{ // Master template that hasn't been customised in the set we have expanded if(!isset($template_groups[$group]['templates'][$template['title']]) || $template_groups[$group]['templates'][$template['title']]['template'] == $template['template'])
|
{ // Master template that hasn't been customised in the set we have expanded if(!isset($template_groups[$group]['templates'][$template['title']]) || $template_groups[$group]['templates'][$template['title']]['template'] == $template['template'])
|
{
| {
|
$template['original'] = true; $template_groups[$group]['templates'][$template['title']] = $template; }
| $template['original'] = true; $template_groups[$group]['templates'][$template['title']] = $template; }
|
Zeile 1801 | Zeile 1838 |
---|
unset($template_groups[$group]['templates'][$template['title']]['template']); } }
|
unset($template_groups[$group]['templates'][$template['title']]['template']); } }
|
|
|
foreach($template_groups as $prefix => $group) { $tmp_expand = "";
| foreach($template_groups as $prefix => $group) { $tmp_expand = "";
|
Zeile 1814 | Zeile 1851 |
---|
$unsetgid = array_search($group['gid'], $tmp_expand); unset($tmp_expand[$unsetgid]); $group['expand_str'] = implode("|", $tmp_expand);
|
$unsetgid = array_search($group['gid'], $tmp_expand); unset($tmp_expand[$unsetgid]); $group['expand_str'] = implode("|", $tmp_expand);
|
}
| }
|
else { $expand = $lang->expand;
| else { $expand = $lang->expand;
|
Zeile 1826 | Zeile 1863 |
---|
$group['expand_str'] .= "|"; } $group['expand_str'] .= $group['gid'];
|
$group['expand_str'] .= "|"; } $group['expand_str'] .= $group['gid'];
|
}
| }
|
if($group['expand_str']) { $group['expand_str'] = "&expand={$group['expand_str']}";
| if($group['expand_str']) { $group['expand_str'] = "&expand={$group['expand_str']}";
|
Zeile 1841 | Zeile 1878 |
---|
$popup->add_item($lang->delete_template_group, "index.php?module=style-templates&sid={$sid}&action=delete_template_group&gid={$group['gid']}&my_post_key={$mybb->post_code}{$group['expand_str']}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_group_delete}')");
$set_popup = "<div class=\"float_right\">{$popup->fetch()}</div>";
|
$popup->add_item($lang->delete_template_group, "index.php?module=style-templates&sid={$sid}&action=delete_template_group&gid={$group['gid']}&my_post_key={$mybb->post_code}{$group['expand_str']}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_group_delete}')");
$set_popup = "<div class=\"float_right\">{$popup->fetch()}</div>";
|
}
| }
|
if($expanded == true) { // Show templates in this group $table->construct_cell("{$set_popup}<strong><a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$group['title']}</a></strong>"); $table->construct_cell("<a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center")); $table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));
|
if($expanded == true) { // Show templates in this group $table->construct_cell("{$set_popup}<strong><a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$group['title']}</a></strong>"); $table->construct_cell("<a href=\"index.php?module=style-templates&sid={$sid}{$group['expand_str']}#group_{$group['gid']}\">{$expand}</a>", array("class" => "align_center")); $table->construct_row(array("class" => "alt_row", "id" => "group_".$group['gid'], "name" => "group_".$group['gid']));
|
if(isset($group['templates']) && count($group['templates']) > 0)
| if(isset($group['templates']) && is_array($group['templates']) && count($group['templates']) > 0)
|
{ $templates = $group['templates']; ksort($templates);
|
{ $templates = $group['templates']; ksort($templates);
|
|
|
foreach($templates as $template) { $template['pretty_title'] = $template['title'];
| foreach($templates as $template) { $template['pretty_title'] = $template['title'];
|
Zeile 1870 | Zeile 1907 |
---|
$popup->add_item($lang->revert_to_orig, "index.php?module=style-templates&action=revert&title=".urlencode($template['title'])."&sid={$sid}&my_post_key={$mybb->post_code}{$expand_str}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_revertion}')"); }
|
$popup->add_item($lang->revert_to_orig, "index.php?module=style-templates&action=revert&title=".urlencode($template['title'])."&sid={$sid}&my_post_key={$mybb->post_code}{$expand_str}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_revertion}')"); }
|
|
|
$template['pretty_title'] = "<span style=\"color: green;\">{$template['title']}</span>"; } // This template does not exist in the master list
| $template['pretty_title'] = "<span style=\"color: green;\">{$template['title']}</span>"; } // This template does not exist in the master list
|
Zeile 1881 | Zeile 1918 |
---|
$template['pretty_title'] = "<span style=\"color: blue;\">{$template['title']}</span>"; }
|
$template['pretty_title'] = "<span style=\"color: blue;\">{$template['title']}</span>"; }
|
$table->construct_cell("<span style=\"padding: 20px;\"><a href=\"index.php?module=style-templates&action=edit_template&title=".urlencode($template['title'])."&sid={$sid}{$expand_str}\" >{$template['pretty_title']}</a></span>");
| $table->construct_cell("<span style=\"padding-left: 20px;\"><a href=\"index.php?module=style-templates&action=edit_template&title=".urlencode($template['title'])."&sid={$sid}{$expand_str}\" >{$template['pretty_title']}</a></span>");
|
$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 1948 | Zeile 1985 |
---|
continue; }
|
continue; }
|
if($themes[$set['sid']])
| if(!empty($themes[$set['sid']]))
|
{ $used_by_note = $lang->used_by; $comma = "";
| { $used_by_note = $lang->used_by; $comma = "";
|
Zeile 1976 | Zeile 2013 |
---|
{ $popup->add_item($lang->edit_template_set, "index.php?module=style-templates&action=edit_set&sid={$set['sid']}");
|
{ $popup->add_item($lang->edit_template_set, "index.php?module=style-templates&action=edit_set&sid={$set['sid']}");
|
if(!$themes[$set['sid']])
| if(empty($themes[$set['sid']]))
|
{ $popup->add_item($lang->delete_template_set, "index.php?module=style-templates&action=delete_set&sid={$set['sid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_set_deletion}')"); }
| { $popup->add_item($lang->delete_template_set, "index.php?module=style-templates&action=delete_set&sid={$set['sid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_set_deletion}')"); }
|
Zeile 1984 | Zeile 2021 |
---|
$actions = $popup->fetch(); }
|
$actions = $popup->fetch(); }
|
| $set['title'] = htmlspecialchars_uni($set['title']);
|
$table->construct_cell("<strong><a href=\"index.php?module=style-templates&sid={$set['sid']}\">{$set['title']}</a></strong><br /><small>{$used_by_note}</small>"); $table->construct_cell($actions, array("class" => "align_center"));
| $table->construct_cell("<strong><a href=\"index.php?module=style-templates&sid={$set['sid']}\">{$set['title']}</a></strong><br /><small>{$used_by_note}</small>"); $table->construct_cell($actions, array("class" => "align_center"));
|