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 186 | Zeile 186 |
---|
if($db->fetch_field($query, "count") > 0) { $errors[] = $lang->error_already_exists;
|
if($db->fetch_field($query, "count") > 0) { $errors[] = $lang->error_already_exists;
|
}
| }
|
}
if(!isset($template_sets[$sid])) { $errors[] = $lang->error_invalid_set;
|
}
if(!isset($template_sets[$sid])) { $errors[] = $lang->error_invalid_set;
|
}
| }
|
// Are we trying to do malicious things in our template? if(check_template($mybb->input['template']))
|
// Are we trying to do malicious things in our template? if(check_template($mybb->input['template']))
|
{
| {
|
$errors[] = $lang->error_security_problem; }
|
$errors[] = $lang->error_security_problem; }
|
|
|
if(!$errors) { $template_array = array(
| if(!$errors) { $template_array = array(
|
Zeile 210 | Zeile 210 |
---|
'status' => '', 'dateline' => TIME_NOW );
|
'status' => '', 'dateline' => TIME_NOW );
|
|
|
$tid = $db->insert_query("templates", $template_array);
|
$tid = $db->insert_query("templates", $template_array);
|
|
|
$plugins->run_hooks("admin_style_templates_add_template_commit");
|
$plugins->run_hooks("admin_style_templates_add_template_commit");
|
|
|
// Log admin action log_admin_action($tid, $mybb->input['title'], $sid, $template_sets[$sid]);
| // Log admin action log_admin_action($tid, $mybb->input['title'], $sid, $template_sets[$sid]);
|
Zeile 270 | Zeile 270 |
---|
<script src="./jscripts/codemirror/addon/fold/foldgutter.js?ver=1813"></script> <link href="./jscripts/codemirror/addon/fold/foldgutter.css?ver=1813" rel="stylesheet"> ';
|
<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($lang->add_template);
$page->output_header($lang->add_template);
| $page->add_breadcrumb_item($lang->add_template);
$page->output_header($lang->add_template);
|
Zeile 328 | Zeile 328 |
---|
if($mybb->input['action'] == "add_template_group") { $plugins->run_hooks("admin_style_templates_add_template_group");
|
if($mybb->input['action'] == "add_template_group") { $plugins->run_hooks("admin_style_templates_add_template_group");
|
|
|
if($mybb->get_input('sid', MyBB::INPUT_INT) == -1) { admin_redirect("index.php?module=style-templates&sid={$sid}".$expand_str2);
| if($mybb->get_input('sid', MyBB::INPUT_INT) == -1) { admin_redirect("index.php?module=style-templates&sid={$sid}".$expand_str2);
|
Zeile 385 | Zeile 385 |
---|
}
admin_redirect('index.php?module=style-templates');
|
}
admin_redirect('index.php?module=style-templates');
|
} } }
| } } }
|
if($mybb->input['sid']) {
| if($mybb->input['sid']) {
|
Zeile 439 | Zeile 439 |
---|
$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($mybb->request_method == "post") {
|
if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_set_title;
| if(!trim($mybb->input['title'])) { $errors[] = $lang->error_missing_set_title;
|
Zeile 498 | 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 555 | Zeile 555 |
---|
$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 572 | Zeile 572 |
---|
}
$plugins->run_hooks("admin_style_templates_edit_template_commit");
|
}
$plugins->run_hooks("admin_style_templates_edit_template_commit");
|
|
|
$query = $db->simple_select("templatesets", "title", "sid='{$sid}'"); $set = $db->fetch_array($query);
|
$query = $db->simple_select("templatesets", "title", "sid='{$sid}'"); $set = $db->fetch_array($query);
|
|
|
$exploded = explode("_", $template_array['title'], 2); $prefix = $exploded[0];
| $exploded = explode("_", $template_array['title'], 2); $prefix = $exploded[0];
|
Zeile 583 | Zeile 583 |
---|
$group = $db->fetch_field($query, "gid");
if(!$group)
|
$group = $db->fetch_field($query, "gid");
if(!$group)
|
{
| {
|
$group = "-1"; }
| $group = "-1"; }
|
Zeile 593 | Zeile 593 |
---|
flash_message($lang->success_template_saved, 'success');
if($mybb->input['continue'])
|
flash_message($lang->success_template_saved, 'success');
if($mybb->input['continue'])
|
{ if($mybb->input['from'] == "diff_report")
| { if($mybb->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 { 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 { 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 { if($mybb->input['from'] == "diff_report") { admin_redirect("index.php?module=style-templates&action=find_updated");
|
} else { if($mybb->input['from'] == "diff_report") { 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}");
|
else { admin_redirect("index.php?module=style-templates&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2."#group_{$group}");
|
} } } }
if($errors) {
| } } } }
if($errors) {
|
$template = $mybb->input; } else
| $template = $mybb->input; } else
|
Zeile 664 | Zeile 664 |
---|
$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->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']));
|
$sub_tabs = array();
if($mybb->input['from'] == "diff_report") {
|
$sub_tabs = array();
if($mybb->input['from'] == "diff_report") {
|
$sub_tabs['find_updated'] = array( 'title' => $lang->find_updated, 'link' => "index.php?module=style-templates&action=find_updated"
| $sub_tabs['find_updated'] = array( 'title' => $lang->find_updated, 'link' => "index.php?module=style-templates&action=find_updated"
|
Zeile 755 | Zeile 755 |
---|
$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)
|
{
| {
|
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}"); }
|
Zeile 841 | Zeile 841 |
---|
$buttons = array( $form->generate_submit_button($lang->save_template_group)
|
$buttons = array( $form->generate_submit_button($lang->save_template_group)
|
);
$form->output_submit_wrapper($buttons); $form->end();
$page->output_footer(); }
| );
$form->output_submit_wrapper($buttons); $form->end();
$page->output_footer(); }
|
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 867 | Zeile 867 |
---|
else { $page->add_breadcrumb_item($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_header($lang->search_replace);
$plugins->run_hooks("admin_style_templates_search_replace_find");
|
Zeile 875 | 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();
| $table = new Table;
$template_sets = array();
|
// Get the names of all template sets $template_sets[-2] = $lang->master_templates;
| // Get the names of all template sets $template_sets[-2] = $lang->master_templates;
|
Zeile 885 | Zeile 885 |
---|
$query = $db->simple_select("templatesets", "sid, title"); while($set = $db->fetch_array($query))
|
$query = $db->simple_select("templatesets", "sid, title"); while($set = $db->fetch_array($query))
|
{
| {
|
$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);
| $search_string = str_replace(array("\r\n", "\r"), "\n", $mybb->input['find']); $search_string = str_replace(array(" ", "\t"), "", $search_string);
|
Zeile 904 | Zeile 904 |
---|
if($db->num_rows($query) == 0) { $table->construct_cell($lang->sprintf($lang->search_noresults, htmlspecialchars_uni($mybb->input['find'])), array("class" => "align_center"));
|
if($db->num_rows($query) == 0) { $table->construct_cell($lang->sprintf($lang->search_noresults, htmlspecialchars_uni($mybb->input['find'])), array("class" => "align_center"));
|
$table->construct_row();
| $table->construct_row();
|
$table->output($lang->search_results); } else
| $table->output($lang->search_results); } else
|
Zeile 934 | Zeile 934 |
---|
{ // If the template is different, that means the search term has been found. if(trim($mybb->input['replace']) != "")
|
{ // If the template is different, that means the search term has been found. if(trim($mybb->input['replace']) != "")
|
{ if($template['sid'] == -2)
| { if($template['sid'] == -2)
|
{ // The template is a master template. We have to make a new custom template. $new_template = array(
| { // The template is a master template. We have to make a new custom template. $new_template = array(
|
Zeile 993 | Zeile 993 |
---|
$table->construct_cell($label, array("width" => "85%"));
if($sid == -2)
|
$table->construct_cell($label, array("width" => "85%"));
if($sid == -2)
|
{
| {
|
$popup = new PopupMenu("template_{$template['tid']}", $lang->options);
foreach($template_sets as $set_sid => $title)
| $popup = new PopupMenu("template_{$template['tid']}", $lang->options);
foreach($template_sets as $set_sid => $title)
|
Zeile 1078 | Zeile 1078 |
---|
if(!$template['customtid']) { $template['original'] = true;
|
if(!$template['customtid']) { $template['original'] = true;
|
} else
| } else
|
{ $template['modified'] = true; }
| { $template['modified'] = true; }
|
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 1541 | Zeile 1541 |
---|
'title' => $lang->diff_report, 'link' => "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), 'description' => $lang->diff_report_desc
|
'title' => $lang->diff_report, 'link' => "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), 'description' => $lang->diff_report_desc
|
);
| );
|
$plugins->run_hooks("admin_style_templates_diff_report");
| $plugins->run_hooks("admin_style_templates_diff_report");
|
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"));
|