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 240 | Zeile 240 |
---|
if(!$sid) { $sid = -1;
|
if(!$sid) { $sid = -1;
|
}
| }
|
$template['template'] = ""; $template['sid'] = $sid;
| $template['template'] = ""; $template['sid'] = $sid;
|
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 391 | Zeile 396 |
---|
$page->add_breadcrumb_item($lang->add_template_group); $page->output_header($lang->add_template_group);
|
$page->add_breadcrumb_item($lang->add_template_group); $page->output_header($lang->add_template_group);
|
$page->output_nav_tabs($sub_tabs, 'add_template_group');
if($errors)
| $page->output_nav_tabs($sub_tabs, 'add_template_group');
if($errors)
|
{ $template_group = array( 'prefix' => $prefix,
| { $template_group = array( 'prefix' => $prefix,
|
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']);
| }
$title = trim($mybb->input['title']);
|
Zeile 798 | 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 809 | Zeile 819 |
---|
$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)
|
Zeile 842 | Zeile 852 |
---|
if($mybb->input['action'] == "search_replace") { $plugins->run_hooks("admin_style_templates_search_replace");
|
if($mybb->input['action'] == "search_replace") { $plugins->run_hooks("admin_style_templates_search_replace");
|
|
|
if($mybb->request_method == "post") { if($mybb->input['type'] == "templates")
| if($mybb->request_method == "post") { if($mybb->input['type'] == "templates")
|
Zeile 850 | 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 { $page->add_breadcrumb_item($lang->search_replace);
$page->output_header($lang->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_nav_tabs($sub_tabs, 'search_replace');
| $plugins->run_hooks("admin_style_templates_search_replace_find");
$page->output_nav_tabs($sub_tabs, 'search_replace');
|
Zeile 868 | Zeile 878 |
---|
$table = new Table;
$template_sets = 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;
| // Get the names of all template sets $template_sets[-2] = $lang->master_templates; $template_sets[-1] = $lang->global_templates;
|
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 1322 | 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 1387 | 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 1534 | Zeile 1547 |
---|
$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".$mybb->get_input('sid1', MyBB::INPUT_INT)."'"); $template1 = $db->fetch_array($query);
|
$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".$mybb->get_input('sid1', MyBB::INPUT_INT)."'"); $template1 = $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);
| $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);
|
Zeile 1589 | Zeile 1602 |
---|
else { $table->construct_header("<ins>".$lang->master_updated_del."</ins><br /><del>".$lang->master_updated_ins."</del>");
|
else { $table->construct_header("<ins>".$lang->master_updated_del."</ins><br /><del>".$lang->master_updated_ins."</del>");
|
}
| }
|
$table->construct_cell("<pre class=\"differential\">".$renderer->render($diff)."</pre>"); $table->construct_row();
| $table->construct_cell("<pre class=\"differential\">".$renderer->render($diff)."</pre>"); $table->construct_row();
|
Zeile 1608 | Zeile 1621 |
---|
WHERE t.title='".$db->escape_string($mybb->input['title'])."' AND t.sid > 0 AND t.sid = '".$mybb->get_input('sid', MyBB::INPUT_INT)."' "); $template = $db->fetch_array($query);
|
WHERE t.title='".$db->escape_string($mybb->input['title'])."' AND t.sid > 0 AND t.sid = '".$mybb->get_input('sid', MyBB::INPUT_INT)."' "); $template = $db->fetch_array($query);
|
|
|
// Does the template not exist? if(!$template) {
| // Does the template not exist? if(!$template) {
|
Zeile 1618 | Zeile 1631 |
---|
// 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}"); }
|
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]])) {
|
Zeile 1756 | Zeile 1781 |
---|
$template['gid'] = -1; if(isset($template_groups[$exploded[0]]['gid']))
|
$template['gid'] = -1; if(isset($template_groups[$exploded[0]]['gid']))
|
{
| {
|
$template['gid'] = $template_groups[$exploded[0]]['gid']; }
| $template['gid'] = $template_groups[$exploded[0]]['gid']; }
|
Zeile 1784 | Zeile 1809 |
---|
{ $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 1894 | Zeile 1919 |
---|
$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']));
|
$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']));
|
} }
| } }
|
$table->output($template_sets[$sid]);
| $table->output($template_sets[$sid]);
|
Zeile 1950 | Zeile 1975 |
---|
{ $used_by_note .= $comma.$theme_name; $comma = $lang->comma;
|
{ $used_by_note .= $comma.$theme_name; $comma = $lang->comma;
|
}
| }
|
} else {
| } else {
|
Zeile 1978 | 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"));
|