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) { $template = $mybb->input;
| if($errors) { $template = $mybb->input;
|
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,
| { $sub_tabs['find_updated'] = array( 'title' => $lang->find_updated,
|
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 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") {
| if($mybb->input['action'] == "search_replace") {
|
Zeile 1324 | Zeile 1324 |
---|
FROM ".TABLE_PREFIX."templates t 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
|
FROM ".TABLE_PREFIX."templates t 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
| ORDER BY t.sid ASC, t.title ASC
|
"); while($template = $db->fetch_array($query)) {
| "); while($template = $db->fetch_array($query)) {
|
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 1869 | Zeile 1869 |
---|
$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("<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']));
|
if(isset($group['templates']) && count($group['templates']) > 0)
| if(isset($group['templates']) && is_array($group['templates']) && count($group['templates']) > 0)
|
{ $templates = $group['templates']; ksort($templates);
| { $templates = $group['templates']; ksort($templates);
|
Zeile 1900 | Zeile 1900 |
---|
$template['pretty_title'] = "<span style=\"color: blue;\">{$template['title']}</span>"; }
|
$template['pretty_title'] = "<span style=\"color: blue;\">{$template['title']}</span>"; }
|
$table->construct_cell("<span style=\"padding: 20px;\"><a href=\"index.php?module=style-templates&action=edit_template&title=".urlencode($template['title'])."&sid={$sid}{$expand_str}\" >{$template['pretty_title']}</a></span>");
| $table->construct_cell("<span style=\"padding-left: 20px;\"><a href=\"index.php?module=style-templates&action=edit_template&title=".urlencode($template['title'])."&sid={$sid}{$expand_str}\" >{$template['pretty_title']}</a></span>");
|
$table->construct_cell($popup->fetch(), array("class" => "align_center"));
$table->construct_row();
| $table->construct_cell($popup->fetch(), array("class" => "align_center"));
$table->construct_row();
|
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"));
|