Zeile 254 | Zeile 254 |
---|
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=1813"></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 341 | Zeile 341 |
---|
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 385 | Zeile 390 |
---|
}
if($mybb->input['sid'])
|
}
if($mybb->input['sid'])
|
{
| {
|
$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}"); }
| $page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}"); }
|
Zeile 428 | Zeile 433 |
---|
if(!$set) { flash_message($lang->error_invalid_input, 'error');
|
if(!$set) { flash_message($lang->error_invalid_input, 'error');
|
admin_redirect("index.php?module=style-templates");
| admin_redirect("index.php?module=style-templates");
|
}
$plugins->run_hooks("admin_style_templates_edit_set");
$sid = $set['sid'];
|
}
$plugins->run_hooks("admin_style_templates_edit_set");
$sid = $set['sid'];
|
|
|
if($mybb->request_method == "post") { if(!trim($mybb->input['title']))
| if($mybb->request_method == "post") { if(!trim($mybb->input['title']))
|
Zeile 445 | Zeile 450 |
---|
if(!$errors) { $query = $db->update_query("templatesets", array('title' => $db->escape_string($mybb->input['title'])), "sid='{$sid}'");
|
if(!$errors) { $query = $db->update_query("templatesets", array('title' => $db->escape_string($mybb->input['title'])), "sid='{$sid}'");
|
|
|
$plugins->run_hooks("admin_style_templates_edit_set_commit");
// Log admin action log_admin_action($sid, $set['title']);
|
$plugins->run_hooks("admin_style_templates_edit_set_commit");
// Log admin action log_admin_action($sid, $set['title']);
|
|
|
flash_message($lang->success_template_set_saved, 'success'); admin_redirect("index.php?module=style-templates&sid=".$sid.$expand_str2); }
| flash_message($lang->success_template_set_saved, 'success'); admin_redirect("index.php?module=style-templates&sid=".$sid.$expand_str2); }
|
Zeile 471 | Zeile 476 |
---|
'link' => "index.php?module=style-templates&action=edit_set&sid=".$sid, 'description' => $lang->edit_set_desc );
|
'link' => "index.php?module=style-templates&action=edit_set&sid=".$sid, 'description' => $lang->edit_set_desc );
|
|
|
$page->output_nav_tabs($sub_tabs, 'edit_set');
if($errors) { $page->output_inline_error($errors);
|
$page->output_nav_tabs($sub_tabs, 'edit_set');
if($errors) { $page->output_inline_error($errors);
|
}
| }
|
else { $query = $db->simple_select("templatesets", "title", "sid='{$sid}'");
| else { $query = $db->simple_select("templatesets", "title", "sid='{$sid}'");
|
Zeile 493 | Zeile 498 |
---|
$buttons = array(); $buttons[] = $form->generate_submit_button($lang->save);
|
$buttons = array(); $buttons[] = $form->generate_submit_button($lang->save);
|
|
|
$form->output_submit_wrapper($buttons);
$form->end();
| $form->output_submit_wrapper($buttons);
$form->end();
|
Zeile 504 | Zeile 509 |
---|
if($mybb->input['action'] == "edit_template") { if(!$mybb->input['title'] || !$sid || !isset($template_sets[$sid]))
|
if($mybb->input['action'] == "edit_template") { if(!$mybb->input['title'] || !$sid || !isset($template_sets[$sid]))
|
{
| {
|
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"); }
|
Zeile 514 | Zeile 519 |
---|
if($mybb->request_method == "post") { if(empty($mybb->input['title']))
|
if($mybb->request_method == "post") { if(empty($mybb->input['title']))
|
{
| {
|
$errors[] = $lang->error_missing_title; }
| $errors[] = $lang->error_missing_title; }
|
Zeile 626 | Zeile 631 |
---|
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=1813"></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 764 | Zeile 769 |
---|
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']); if(!$title)
|
}
$title = trim($mybb->input['title']); if(!$title)
|
{
| {
|
$errors[] = $lang->error_missing_group_title; }
if(!$errors) { if($prefix != $template_group['prefix'])
|
$errors[] = $lang->error_missing_group_title; }
if(!$errors) { if($prefix != $template_group['prefix'])
|
{
| {
|
$query = $db->simple_select("templategroups", "COUNT(gid) AS gid", "prefix = '".$db->escape_string($mybb->input['prefix'])."'"); $prefix_count = $db->fetch_field($query, 'gid');
| $query = $db->simple_select("templategroups", "COUNT(gid) AS gid", "prefix = '".$db->escape_string($mybb->input['prefix'])."'"); $prefix_count = $db->fetch_field($query, 'gid');
|
Zeile 801 | Zeile 811 |
---|
log_admin_action($template_group['gid'], htmlspecialchars_uni($title)); flash_message($lang->success_template_group_saved, 'success'); admin_redirect("index.php?module=style-templates&sid={$sid}");
|
log_admin_action($template_group['gid'], htmlspecialchars_uni($title)); flash_message($lang->success_template_group_saved, 'success'); admin_redirect("index.php?module=style-templates&sid={$sid}");
|
}
| }
|
} }
$lang->editing_template_group = $lang->sprintf($lang->editing_template_group, htmlspecialchars_uni($template_group['title']));
|
} }
$lang->editing_template_group = $lang->sprintf($lang->editing_template_group, htmlspecialchars_uni($template_group['title']));
|
|
|
$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}"); $page->add_breadcrumb_item($lang->editing_template_group, "index.php?module=style-templates&sid={$sid}");
|
$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}"); $page->add_breadcrumb_item($lang->editing_template_group, "index.php?module=style-templates&sid={$sid}");
|
|
|
$page->output_header($lang->editing_template_group);
if($errors)
|
$page->output_header($lang->editing_template_group);
if($errors)
|
{
| {
|
$template_group['prefix'] = $prefix; $template_group['title'] = $title;
| $template_group['prefix'] = $prefix; $template_group['title'] = $title;
|
Zeile 865 | Zeile 875 |
---|
$page->output_nav_tabs($sub_tabs, 'search_replace');
$templates_list = array();
|
$page->output_nav_tabs($sub_tabs, 'search_replace');
$templates_list = array();
|
$table = new Table;
$template_sets = array();
// Get the names of all template sets $template_sets[-2] = $lang->master_templates; $template_sets[-1] = $lang->global_templates;
| $table = new Table;
$template_sets = array();
// Get the names of all template sets $template_sets[-2] = $lang->master_templates; $template_sets[-1] = $lang->global_templates;
|
$query = $db->simple_select("templatesets", "sid, title"); while($set = $db->fetch_array($query)) { $template_sets[$set['sid']] = $set['title']; }
|
$query = $db->simple_select("templatesets", "sid, title"); while($set = $db->fetch_array($query)) { $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 898 |
---|
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 1179 |
---|
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=1813"></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 1229 | Zeile 1242 |
---|
{ echo '<script type="text/javascript"> var editor1 = CodeMirror.fromTextArea(document.getElementById("find"), {
|
{ echo '<script type="text/javascript"> var editor1 = CodeMirror.fromTextArea(document.getElementById("find"), {
|
lineNumbers: true, lineWrapping: true,
| lineNumbers: true, lineWrapping: true,
|
foldGutter: true, gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], viewportMargin: Infinity,
| foldGutter: true, gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"], viewportMargin: Infinity,
|
Zeile 1572 | Zeile 1585 |
---|
if($mybb->input['sid2'] == -2) { $page->add_breadcrumb_item($lang->find_updated, "index.php?module=style-templates&action=find_updated");
|
if($mybb->input['sid2'] == -2) { $page->add_breadcrumb_item($lang->find_updated, "index.php?module=style-templates&action=find_updated");
|
}
| }
|
$page->add_breadcrumb_item($lang->diff_report.": ".htmlspecialchars_uni($template1['title']), "index.php?module=style-templates&action=diff_report&title=".$db->escape_string($mybb->input['title'])."&from=".htmlspecialchars_uni($mybb->input['from'])."&sid1=".$mybb->get_input('sid1', MyBB::INPUT_INT)."&sid2=".$mybb->get_input('sid2', MyBB::INPUT_INT));
| $page->add_breadcrumb_item($lang->diff_report.": ".htmlspecialchars_uni($template1['title']), "index.php?module=style-templates&action=diff_report&title=".$db->escape_string($mybb->input['title'])."&from=".htmlspecialchars_uni($mybb->input['from'])."&sid1=".$mybb->get_input('sid1', MyBB::INPUT_INT)."&sid2=".$mybb->get_input('sid2', MyBB::INPUT_INT));
|
Zeile 1613 | Zeile 1626 |
---|
if(!$template) { flash_message($lang->error_invalid_template, 'error');
|
if(!$template) { flash_message($lang->error_invalid_template, 'error');
|
admin_redirect("index.php?module=style-templates"); }
| admin_redirect("index.php?module=style-templates"); }
|
// User clicked no if($mybb->input['no'])
|
// User clicked no if($mybb->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");
if($mybb->request_method == "post")
| $plugins->run_hooks("admin_style_templates_revert");
if($mybb->request_method == "post")
|
Zeile 1637 | Zeile 1650 |
---|
flash_message($lang->success_template_reverted, 'success');
if($mybb->input['from'] == "diff_report")
|
flash_message($lang->success_template_reverted, 'success');
if($mybb->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={$template['sid']}{$expand_str2}"); }
|
else { admin_redirect("index.php?module=style-templates&sid={$template['sid']}{$expand_str2}"); }
|
}
| }
|
else
|
else
|
{
| {
|
$page->output_confirm_action("index.php?module=style-templates&sid={$template['sid']}{$expand_str}", $lang->confirm_template_revertion); } }
| $page->output_confirm_action("index.php?module=style-templates&sid={$template['sid']}{$expand_str}", $lang->confirm_template_revertion); } }
|
Zeile 1657 | Zeile 1670 |
---|
{ 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");
|
}
| }
|
$plugins->run_hooks("admin_style_templates_set");
$table = new Table;
| $plugins->run_hooks("admin_style_templates_set");
$table = new Table;
|
Zeile 1726 | Zeile 1739 |
---|
$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 1738 | Zeile 1757 |
---|
"title" => $lang->ungrouped_templates, "gid" => -1 );
|
"title" => $lang->ungrouped_templates, "gid" => -1 );
|
| // Set the template group keys to lowercase for case insensitive comparison. $template_groups = array_change_key_case($template_groups, CASE_LOWER);
|
// Load the list of templates $query = $db->simple_select("templates", "*", "sid='".$mybb->get_input('sid', MyBB::INPUT_INT)."' OR sid='-2'", array('order_by' => 'sid DESC, title', 'order_dir' => 'ASC')); while($template = $db->fetch_array($query)) { $exploded = explode("_", $template['title'], 2);
|
// Load the list of templates $query = $db->simple_select("templates", "*", "sid='".$mybb->get_input('sid', MyBB::INPUT_INT)."' OR sid='-2'", array('order_by' => 'sid DESC, title', 'order_dir' => 'ASC')); while($template = $db->fetch_array($query)) { $exploded = explode("_", $template['title'], 2);
|
| // Set the prefix to lowercase for case insensitive comparison. $exploded[0] = strtolower($exploded[0]);
|
if(isset($template_groups[$exploded[0]])) {
| if(isset($template_groups[$exploded[0]])) {
|