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 382 | Zeile 387 |
---|
admin_redirect('index.php?module=style-templates'); } }
|
admin_redirect('index.php?module=style-templates'); } }
|
}
| }
|
if($mybb->input['sid']) { $page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}");
| if($mybb->input['sid']) { $page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}");
|
Zeile 399 | Zeile 404 |
---|
'prefix' => $prefix, 'title' => $title );
|
'prefix' => $prefix, 'title' => $title );
|
|
|
$page->output_inline_error($errors); }
|
$page->output_inline_error($errors); }
|
|
|
$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 = 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_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->end();
|
$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->end();
|
|
|
$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 429 | Zeile 434 |
---|
{ 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_edit_set");
|
$plugins->run_hooks("admin_style_templates_edit_set");
|
|
|
$sid = $set['sid'];
if($mybb->request_method == "post") { if(!trim($mybb->input['title']))
|
$sid = $set['sid'];
if($mybb->request_method == "post") { if(!trim($mybb->input['title']))
|
{
| {
|
$errors[] = $lang->error_missing_set_title; }
| $errors[] = $lang->error_missing_set_title; }
|
Zeile 454 | Zeile 459 |
---|
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); }
|
}
| }
|
if($sid) { $page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}"); }
|
if($sid) { $page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&sid={$sid}{$expand_str}"); }
|
|
|
$page->add_breadcrumb_item($lang->edit_set);
|
$page->add_breadcrumb_item($lang->edit_set);
|
|
|
$page->output_header($lang->edit_set);
|
$page->output_header($lang->edit_set);
|
|
|
$sub_tabs = array(); $sub_tabs['edit_set'] = array( 'title' => $lang->edit_set, 'link' => "index.php?module=style-templates&action=edit_set&sid=".$sid, 'description' => $lang->edit_set_desc
|
$sub_tabs = array(); $sub_tabs['edit_set'] = array( 'title' => $lang->edit_set, 'link' => "index.php?module=style-templates&action=edit_set&sid=".$sid, 'description' => $lang->edit_set_desc
|
);
$page->output_nav_tabs($sub_tabs, 'edit_set');
| );
$page->output_nav_tabs($sub_tabs, 'edit_set');
|
if($errors) {
| if($errors) {
|
Zeile 497 | Zeile 502 |
---|
$form->output_submit_wrapper($buttons);
$form->end();
|
$form->output_submit_wrapper($buttons);
$form->end();
|
|
|
$page->output_footer(); }
| $page->output_footer(); }
|
Zeile 537 | Zeile 542 |
---|
'status' => '', 'dateline' => TIME_NOW );
|
'status' => '', 'dateline' => TIME_NOW );
|
|
|
// Make sure we have the correct tid associated with this template. If the user double submits then the tid could originally be the master template tid, but because the form is sumbitted again, the tid doesn't get updated to the new modified template one. This then causes the master template to be overwritten $query = $db->simple_select("templates", "tid", "title='".$db->escape_string($template['title'])."' AND (sid = '-2' OR sid = '{$template['sid']}')", array('order_by' => 'sid', 'order_dir' => 'desc', 'limit' => 1)); $template['tid'] = $db->fetch_field($query, "tid");
| // Make sure we have the correct tid associated with this template. If the user double submits then the tid could originally be the master template tid, but because the form is sumbitted again, the tid doesn't get updated to the new modified template one. This then causes the master template to be overwritten $query = $db->simple_select("templates", "tid", "title='".$db->escape_string($template['title'])."' AND (sid = '-2' OR sid = '{$template['sid']}')", array('order_by' => 'sid', 'order_dir' => 'desc', 'limit' => 1)); $template['tid'] = $db->fetch_field($query, "tid");
|
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 680 | Zeile 685 |
---|
'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');
| );
$page->output_nav_tabs($sub_tabs, 'edit_template');
|
if($errors) {
| if($errors) {
|
Zeile 691 | Zeile 696 |
---|
$form = new Form("index.php?module=style-templates&action=edit_template{$expand_str}", "post", "edit_template"); echo $form->generate_hidden_field('tid', $template['tid'])."\n";
|
$form = new Form("index.php?module=style-templates&action=edit_template{$expand_str}", "post", "edit_template"); echo $form->generate_hidden_field('tid', $template['tid'])."\n";
|
|
|
if($mybb->input['from'] == "diff_report") { echo $form->generate_hidden_field('from', "diff_report");
| if($mybb->input['from'] == "diff_report") { echo $form->generate_hidden_field('from', "diff_report");
|
Zeile 699 | Zeile 704 |
---|
$form_container = new FormContainer($lang->edit_template_breadcrumb.$template['title'], 'tfixed'); $form_container->output_row($lang->template_name, $lang->template_name_desc, $form->generate_text_box('title', $template['title'], array('id' => 'title')), 'title');
|
$form_container = new FormContainer($lang->edit_template_breadcrumb.$template['title'], 'tfixed'); $form_container->output_row($lang->template_name, $lang->template_name_desc, $form->generate_text_box('title', $template['title'], array('id' => 'title')), 'title');
|
|
|
// Force users to save the default template to a specific set, rather than the "global" templates - where they can delete it if($template['sid'] == "-2") { unset($template_sets[-1]);
|
// Force users to save the default template to a specific set, rather than the "global" templates - where they can delete it if($template['sid'] == "-2") { unset($template_sets[-1]);
|
}
$form_container->output_row($lang->template_set, $lang->template_set_desc, $form->generate_select_box('sid', $template_sets, $sid));
| }
$form_container->output_row($lang->template_set, $lang->template_set_desc, $form->generate_select_box('sid', $template_sets, $sid));
|
$form_container->output_row("", "", $form->generate_text_area('template', $template['template'], array('id' => 'template', 'class' => '', 'style' => 'width: 100%; height: 500px;'))); $form_container->end();
|
$form_container->output_row("", "", $form->generate_text_area('template', $template['template'], array('id' => 'template', 'class' => '', 'style' => 'width: 100%; height: 500px;'))); $form_container->end();
|
|
|
$buttons[] = $form->generate_submit_button($lang->save_continue, array('name' => 'continue')); $buttons[] = $form->generate_submit_button($lang->save_close, array('name' => 'close'));
$form->output_submit_wrapper($buttons);
|
$buttons[] = $form->generate_submit_button($lang->save_continue, array('name' => 'continue')); $buttons[] = $form->generate_submit_button($lang->save_close, array('name' => 'close'));
$form->output_submit_wrapper($buttons);
|
|
|
$form->end();
if($admin_options['codepress'] != 0)
| $form->end();
if($admin_options['codepress'] != 0)
|
Zeile 745 | Zeile 750 |
---|
if(!$db->num_rows($query)) { flash_message($lang->error_missing_template_group, 'error');
|
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); if(isset($template_group['isdefault']) && $template_group['isdefault'] == 1) {
| $template_group = $db->fetch_array($query); if(isset($template_group['isdefault']) && $template_group['isdefault'] == 1) {
|
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']);
| }
$title = trim($mybb->input['title']);
|
Zeile 878 | Zeile 888 |
---|
{ $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 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 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']);
|