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 368 | Zeile 373 |
---|
);
$gid = $db->insert_query('templategroups', $insert_array);
|
);
$gid = $db->insert_query('templategroups', $insert_array);
|
|
|
$plugins->run_hooks('admin_style_templates_add_template_group_commit');
log_admin_action($gid, $title);
| $plugins->run_hooks('admin_style_templates_add_template_group_commit');
log_admin_action($gid, $title);
|
Zeile 407 | Zeile 412 |
---|
echo $form->generate_hidden_field('sid', $sid);
$form_container = new FormContainer($lang->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_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_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();
|
$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');
if($errors) { $page->output_inline_error($errors);
| );
$page->output_nav_tabs($sub_tabs, 'edit_set');
if($errors) { $page->output_inline_error($errors);
|
} else {
| } else {
|
Zeile 493 | 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 510 | Zeile 515 |
---|
}
$plugins->run_hooks("admin_style_templates_edit_template");
|
}
$plugins->run_hooks("admin_style_templates_edit_template");
|
|
|
if($mybb->request_method == "post") { if(empty($mybb->input['title']))
| if($mybb->request_method == "post") { if(empty($mybb->input['title']))
|
Zeile 543 | Zeile 548 |
---|
$template['tid'] = $db->fetch_field($query, "tid");
$plugins->run_hooks("admin_style_templates_edit_template_commit_start");
|
$template['tid'] = $db->fetch_field($query, "tid");
$plugins->run_hooks("admin_style_templates_edit_template_commit_start");
|
|
|
if($sid > 0) { // Check to see if it's never been edited before (i.e. master) or if this a new template (i.e. we've renamed it) or if it's a custom template $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($sid > 0) { // Check to see if it's never been edited before (i.e. master) or if this a new template (i.e. we've renamed it) or if it's a custom template $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 563 | Zeile 568 |
---|
else { // Global template set
|
else { // Global template set
|
$db->update_query("templates", $template_array, "tid='{$template['tid']}' AND sid != '-2'"); }
| $db->update_query("templates", $template_array, "tid='{$template['tid']}' AND sid != '-2'"); }
|
$plugins->run_hooks("admin_style_templates_edit_template_commit");
$query = $db->simple_select("templatesets", "title", "sid='{$sid}'");
| $plugins->run_hooks("admin_style_templates_edit_template_commit");
$query = $db->simple_select("templatesets", "title", "sid='{$sid}'");
|
Zeile 580 | Zeile 585 |
---|
if(!$group) { $group = "-1";
|
if(!$group) { $group = "-1";
|
}
| }
|
// Log admin action log_admin_action($template['tid'], $mybb->input['title'], $mybb->input['sid'], $set['title']);
| // Log admin action log_admin_action($template['tid'], $mybb->input['title'], $mybb->input['sid'], $set['title']);
|
Zeile 603 | Zeile 608 |
---|
if($mybb->input['from'] == "diff_report") { admin_redirect("index.php?module=style-templates&action=find_updated");
|
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) {
|
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']); if(!$title) { $errors[] = $lang->error_missing_group_title;
|
}
$title = trim($mybb->input['title']); if(!$title) { $errors[] = $lang->error_missing_group_title;
|
}
| }
|
if(!$errors) { if($prefix != $template_group['prefix'])
| if(!$errors) { if($prefix != $template_group['prefix'])
|
Zeile 783 | Zeile 793 |
---|
{ $errors[] = $lang->error_duplicate_group_prefix; }
|
{ $errors[] = $lang->error_duplicate_group_prefix; }
|
}
| }
|
if(!$errors) {
| if(!$errors) {
|
Zeile 806 | Zeile 816 |
---|
}
$lang->editing_template_group = $lang->sprintf($lang->editing_template_group, htmlspecialchars_uni($template_group['title']));
|
}
$lang->editing_template_group = $lang->sprintf($lang->editing_template_group, htmlspecialchars_uni($template_group['title']));
|
|
|
$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);
|
$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) { $template_group['prefix'] = $prefix;
| if($errors) { $template_group['prefix'] = $prefix;
|
Zeile 828 | Zeile 838 |
---|
$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_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();
|
|
|
$buttons = array( $form->generate_submit_button($lang->save_template_group) );
| $buttons = array( $form->generate_submit_button($lang->save_template_group) );
|
Zeile 861 | Zeile 871 |
---|
$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");
|
|
|
$page->output_nav_tabs($sub_tabs, 'search_replace');
$templates_list = array();
| $page->output_nav_tabs($sub_tabs, 'search_replace');
$templates_list = array();
|
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)
|