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();
| $form_container->end();
$buttons = array();
|
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?ver=1808"></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 620 | Zeile 620 |
---|
if($errors) { $template = $mybb->input;
|
if($errors) { $template = $mybb->input;
|
} else
| } else
|
{ $query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND (sid='-2' OR sid='{$sid}')", array('order_by' => 'sid', 'order_dir' => 'DESC', 'limit' => 1)); $template = $db->fetch_array($query); } $template['title'] = htmlspecialchars_uni($template['title']);
|
{ $query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND (sid='-2' OR sid='{$sid}')", array('order_by' => 'sid', 'order_dir' => 'DESC', 'limit' => 1)); $template = $db->fetch_array($query); } $template['title'] = htmlspecialchars_uni($template['title']);
|
|
|
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?ver=1808"></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">
|
';
|
';
|
}
$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}");
|
if(!isset($mybb->input['from'])) { $mybb->input['from'] = '';
| if(!isset($mybb->input['from'])) { $mybb->input['from'] = '';
|
Zeile 659 | Zeile 659 |
---|
if($mybb->input['from'] == "diff_report") { $page->add_breadcrumb_item($lang->find_updated, "index.php?module=style-templates&action=find_updated");
|
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 685 | 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');
if($errors) {
| );
$page->output_nav_tabs($sub_tabs, 'edit_template');
if($errors) {
|
$page->output_inline_error($errors); }
| $page->output_inline_error($errors); }
|
Zeile 700 | Zeile 700 |
---|
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");
|
}
| }
|
$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") {
| // 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") {
|
Zeile 718 | Zeile 718 |
---|
$buttons[] = $form->generate_submit_button($lang->save_continue, array('name' => 'continue')); $buttons[] = $form->generate_submit_button($lang->save_close, array('name' => 'close'));
|
$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();
| $form->output_submit_wrapper($buttons);
$form->end();
|
Zeile 742 | Zeile 742 |
---|
$page->output_footer(); }
|
$page->output_footer(); }
|
|
|
if($mybb->input['action'] == "edit_template_group") { $query = $db->simple_select("templategroups", "*", "gid = '".$mybb->get_input('gid', MyBB::INPUT_INT)."'");
|
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');
|
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) { flash_message($lang->error_default_template_group, 'error'); 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) { 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 774 | Zeile 774 |
---|
if(strpos($prefix, "_") !== false) { $errors[] = $lang->error_invalid_group_title;
|
if(strpos($prefix, "_") !== false) { $errors[] = $lang->error_invalid_group_title;
|
}
| }
|
$title = trim($mybb->input['title']); if(!$title)
| $title = trim($mybb->input['title']); if(!$title)
|
Zeile 808 | Zeile 808 |
---|
$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 860 | Zeile 860 |
---|
// 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");
| { flash_message($lang->search_noneset, "error"); admin_redirect("index.php?module=style-templates&action=search_replace");
|
} else {
| } else {
|
Zeile 1179 | 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?ver=1808"></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 1325 | Zeile 1325 |
---|
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
|
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
|
"); while($template = $db->fetch_array($query))
| "); while($template = $db->fetch_array($query))
|
{ $templates[$template['sid']][] = $template; }
| { $templates[$template['sid']][] = $template; }
|
Zeile 1335 | Zeile 1335 |
---|
{ if(!$done_set[$sid]) {
|
{ if(!$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 1400 | Zeile 1400 |
---|
$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 1777 | Zeile 1777 |
---|
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 1789 | Zeile 1789 |
---|
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 1806 | Zeile 1806 |
---|
{ // 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;
|
}
| }
|
// Template has been modified in the set we have expanded (it doesn't match the master) else if($template_groups[$group]['templates'][$template['title']]['template'] != $template['template'] && $template_groups[$group]['templates'][$template['title']]['sid'] != -2) {
| // Template has been modified in the set we have expanded (it doesn't match the master) else if($template_groups[$group]['templates'][$template['title']]['template'] != $template['template'] && $template_groups[$group]['templates'][$template['title']]['sid'] != -2) {
|
Zeile 1833 | Zeile 1833 |
---|
$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
| } else
|
{ $expand = $lang->expand; $expanded = false;
| { $expand = $lang->expand; $expanded = false;
|
Zeile 1946 | Zeile 1946 |
---|
$template_sets = array(); $template_sets[-1]['title'] = $lang->global_templates; $template_sets[-1]['sid'] = -1;
|
$template_sets = array(); $template_sets[-1]['title'] = $lang->global_templates; $template_sets[-1]['sid'] = -1;
|
|
|
$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)) {
|
Zeile 2003 | Zeile 2003 |
---|
$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"));
|