Vergleich admin/modules/style/templates.php - 1.8.1 - 1.8.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 16Zeile 16

$page->add_breadcrumb_item($lang->template_sets, "index.php?module=style-templates");



$page->add_breadcrumb_item($lang->template_sets, "index.php?module=style-templates");


$sid = $mybb->get_input('sid', 1);

$sid = $mybb->get_input('sid', MyBB::INPUT_INT);


$expand_str = "";
$expand_str2 = "";


$expand_str = "";
$expand_str2 = "";

Zeile 42Zeile 42
		'link' => "index.php?module=style-templates&action=add_set".$expand_str
);


		'link' => "index.php?module=style-templates&action=add_set".$expand_str
);


	if($mybb->get_input('sid', 1) != -1)

	if($mybb->get_input('sid', MyBB::INPUT_INT) != -1)

	{
$sub_tabs['add_template_group'] = array(
'title' => $lang->add_template_group,

	{
$sub_tabs['add_template_group'] = array(
'title' => $lang->add_template_group,

Zeile 86Zeile 86
		'description' => $lang->add_template_desc
);


		'description' => $lang->add_template_desc
);


	if($mybb->get_input('sid', 1) != -1)

	if($mybb->get_input('sid', MyBB::INPUT_INT) != -1)

	{
$sub_tabs['add_template_group'] = array(
'title' => $lang->add_template_group,

	{
$sub_tabs['add_template_group'] = array(
'title' => $lang->add_template_group,

Zeile 255Zeile 255
	{
$page->extra_header .= '
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">

	{
$page->extra_header .= '
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">

<link href="./jscripts/codemirror/theme/mybb.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>

<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" >

<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/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/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">

';
}


';
}


Zeile 288Zeile 292

$form = new Form("index.php?module=style-templates&amp;action=add_template{$expand_str}", "post", "add_template");



$form = new Form("index.php?module=style-templates&amp;action=add_template{$expand_str}", "post", "add_template");


	$form_container = new FormContainer($lang->add_template);

	$form_container = new FormContainer($lang->add_template, '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->output_row($lang->template_set, $lang->template_set_desc, $form->generate_select_box('sid', $template_sets, $sid), 'sid');
$form_container->output_row("", "", $form->generate_text_area('template', $template['template'], array('id' => 'template', 'class' => '', 'style' => 'width: 100%; height: 500px;')), 'template');

	$form_container->output_row($lang->template_name, $lang->template_name_desc, $form->generate_text_box('title', $template['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->template_set, $lang->template_set_desc, $form->generate_select_box('sid', $template_sets, $sid), 'sid');
$form_container->output_row("", "", $form->generate_text_area('template', $template['template'], array('id' => 'template', 'class' => '', 'style' => 'width: 100%; height: 500px;')), 'template');

Zeile 303Zeile 307

if($admin_options['codepress'] != 0)
{


if($admin_options['codepress'] != 0)
{

		echo "<script type=\"text/javascript\">
var editor = CodeMirror.fromTextArea(document.getElementById(\"template\"), {

		echo '<script type="text/javascript">
var editor = CodeMirror.fromTextArea(document.getElementById("template"), {

				lineNumbers: true,
lineWrapping: true,

				lineNumbers: true,
lineWrapping: true,

				mode: \"text/html\",
tabMode: \"indent\",
theme: \"mybb\"





				foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
viewportMargin: Infinity,
indentWithTabs: true,
indentUnit: 4,
mode: "text/html",
theme: "mybb"

			});

			});

		</script>";

		</script>';

	}

$page->output_footer();

	}

$page->output_footer();

Zeile 321Zeile 329
{
$plugins->run_hooks("admin_style_templates_add_template_group");


{
$plugins->run_hooks("admin_style_templates_add_template_group");


	if($mybb->get_input('sid', 1) == -1)

	if($mybb->get_input('sid', MyBB::INPUT_INT) == -1)

	{
admin_redirect("index.php?module=style-templates&amp;sid={$sid}".$expand_str2);
}

	{
admin_redirect("index.php?module=style-templates&amp;sid={$sid}".$expand_str2);
}

Zeile 333Zeile 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 373Zeile 386

admin_redirect('index.php?module=style-templates');
}


admin_redirect('index.php?module=style-templates');
}

		}
}


		}
}


	if($mybb->input['sid'])

	if($mybb->input['sid'])

	{

	{

		$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&amp;sid={$sid}{$expand_str}");

		$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&amp;sid={$sid}{$expand_str}");

	}

	}


$page->add_breadcrumb_item($lang->add_template_group);
$page->output_header($lang->add_template_group);
$page->output_nav_tabs($sub_tabs, '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)
{
$template_group = array(
'prefix' => $prefix,
'title' => $title
);

	if($errors)
{
$template_group = array(
'prefix' => $prefix,
'title' => $title
);


$page->output_inline_error($errors);
}



$page->output_inline_error($errors);
}


	$form = new Form("index.php?module=style-templates&amp;action=add_template_group{$expand_str}", "post", "add_template_group");
echo $form->generate_hidden_field('sid', $sid);

	$form = new Form("index.php?module=style-templates&amp;action=add_template_group{$expand_str}", "post", "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 = 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();





	$buttons = array(
$form->generate_submit_button($lang->add_template_group)
);

$form->output_submit_wrapper($buttons);
$form->end();

	$buttons = array(
$form->generate_submit_button($lang->add_template_group)
);

$form->output_submit_wrapper($buttons);
$form->end();





	$page->output_footer();
}

if($mybb->input['action'] == "edit_set")

	$page->output_footer();
}

if($mybb->input['action'] == "edit_set")

{

{

	$query = $db->simple_select("templatesets", "*", "sid='{$sid}'");
$set = $db->fetch_array($query);
if(!$set)

	$query = $db->simple_select("templatesets", "*", "sid='{$sid}'");
$set = $db->fetch_array($query);
if(!$set)

Zeile 456Zeile 469
	$page->add_breadcrumb_item($lang->edit_set);

$page->output_header($lang->edit_set);

	$page->add_breadcrumb_item($lang->edit_set);

$page->output_header($lang->edit_set);





	$sub_tabs = array();
$sub_tabs['edit_set'] = array(
'title' => $lang->edit_set,

	$sub_tabs = array();
$sub_tabs['edit_set'] = array(
'title' => $lang->edit_set,

Zeile 498Zeile 511
	if(!$mybb->input['title'] || !$sid || !isset($template_sets[$sid]))
{
flash_message($lang->error_missing_input, 'error');

	if(!$mybb->input['title'] || !$sid || !isset($template_sets[$sid]))
{
flash_message($lang->error_missing_input, 'error');

		admin_redirect("index.php?module=style-templates");
}

$plugins->run_hooks("admin_style_templates_edit_template");


		admin_redirect("index.php?module=style-templates");
}

$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 555Zeile 568
			else
{
// Global template set

			else
{
// Global template set

				$db->update_query("templates", $template_array, "tid='{$template['tid']}' AND sid != '-2'");
}

$plugins->run_hooks("admin_style_templates_edit_template_commit");


				$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}'");
$set = $db->fetch_array($query);


			$query = $db->simple_select("templatesets", "title", "sid='{$sid}'");
$set = $db->fetch_array($query);


Zeile 583Zeile 596
			{
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', 1).$expand_str2."&amp;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."&amp;from=diff_report");

				}
else
{

				}
else
{

					admin_redirect("index.php?module=style-templates&action=edit_template&title=".urlencode($mybb->input['title'])."&sid=".$mybb->get_input('sid', 1).$expand_str2);

					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

				}
}
else

Zeile 598Zeile 611
				}
else
{

				}
else
{

					admin_redirect("index.php?module=style-templates&sid=".$mybb->get_input('sid', 1).$expand_str2."#group_{$group}");

					admin_redirect("index.php?module=style-templates&sid=".$mybb->get_input('sid', MyBB::INPUT_INT).$expand_str2."#group_{$group}");

				}
}
}

				}
}
}

	}

	}


if($errors)
{


if($errors)
{

Zeile 613Zeile 626
		$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);
}

		$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 .= '
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">


if($admin_options['codepress'] != 0)
{
$page->extra_header .= '
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">

<link href="./jscripts/codemirror/theme/mybb.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>

<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" >

<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/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/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">

';
}


';
}


Zeile 646Zeile 664
	$page->add_breadcrumb_item($lang->edit_template_breadcrumb.$template['title'], "index.php?module=style-templates&amp;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&amp;sid={$sid}");

$page->output_header($lang->sprintf($lang->editing_template, $template['title']));






$sub_tabs = array();



$sub_tabs = array();


Zeile 655Zeile 673
		$sub_tabs['find_updated'] = array(
'title' => $lang->find_updated,
'link' => "index.php?module=style-templates&amp;action=find_updated"

		$sub_tabs['find_updated'] = array(
'title' => $lang->find_updated,
'link' => "index.php?module=style-templates&amp;action=find_updated"

		);

		);


$sub_tabs['diff_report'] = array(
'title' => $lang->diff_report,
'link' => "index.php?module=style-templates&amp;action=diff_report&amp;title=".$db->escape_string($template['title'])."&amp;sid1=".(int)$template['sid']."&amp;sid2=-2",
);


$sub_tabs['diff_report'] = array(
'title' => $lang->diff_report,
'link' => "index.php?module=style-templates&amp;action=diff_report&amp;title=".$db->escape_string($template['title'])."&amp;sid1=".(int)$template['sid']."&amp;sid2=-2",
);

	}


	}


	$sub_tabs['edit_template'] = array(
'title' => $lang->edit_template,
'link' => "index.php?module=style-templates&amp;action=edit_template&amp;title=".htmlspecialchars_uni($template['title']).$expand_str,
'description' => $lang->edit_template_desc

	$sub_tabs['edit_template'] = array(
'title' => $lang->edit_template,
'link' => "index.php?module=style-templates&amp;action=edit_template&amp;title=".htmlspecialchars_uni($template['title']).$expand_str,
'description' => $lang->edit_template_desc

	);

$page->output_nav_tabs($sub_tabs, 'edit_template');

if($errors)
{
$page->output_inline_error($errors);
}


	);

$page->output_nav_tabs($sub_tabs, 'edit_template');

if($errors)
{
$page->output_inline_error($errors);
}


	$form = new Form("index.php?module=style-templates&amp;action=edit_template{$expand_str}", "post", "edit_template");
echo $form->generate_hidden_field('tid', $template['tid'])."\n";

	$form = new Form("index.php?module=style-templates&amp;action=edit_template{$expand_str}", "post", "edit_template");
echo $form->generate_hidden_field('tid', $template['tid'])."\n";





	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']);

	}

$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

	$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

Zeile 692Zeile 710
	{
unset($template_sets[-1]);
}

	{
unset($template_sets[-1]);
}





	$form_container->output_row($lang->template_set, $lang->template_set_desc, $form->generate_select_box('sid', $template_sets, $sid));

$form_container->output_row("", "", $form->generate_text_area('template', $template['template'], array('id' => 'template', 'class' => '', 'style' => 'width: 100%; height: 500px;')));

	$form_container->output_row($lang->template_set, $lang->template_set_desc, $form->generate_select_box('sid', $template_sets, $sid));

$form_container->output_row("", "", $form->generate_text_area('template', $template['template'], array('id' => 'template', 'class' => '', 'style' => 'width: 100%; height: 500px;')));

	$form_container->end();


	$form_container->end();


	$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'));


Zeile 707Zeile 725

if($admin_options['codepress'] != 0)
{


if($admin_options['codepress'] != 0)
{

		echo "<script type=\"text/javascript\">
var editor = CodeMirror.fromTextArea(document.getElementById(\"template\"), {

		echo '<script type="text/javascript">
var editor = CodeMirror.fromTextArea(document.getElementById("template"), {

				lineNumbers: true,
lineWrapping: true,

				lineNumbers: true,
lineWrapping: true,

				mode: \"text/html\",
tabMode: \"indent\",
theme: \"mybb\"





				foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
viewportMargin: Infinity,
indentWithTabs: true,
indentUnit: 4,
mode: "text/html",
theme: "mybb"

			});

			});

		</script>";

		</script>';

	}

$page->output_footer();

	}

$page->output_footer();

Zeile 723Zeile 745

if($mybb->input['action'] == "edit_template_group")
{


if($mybb->input['action'] == "edit_template_group")
{

	$query = $db->simple_select("templategroups", "*", "gid = '".(int)$mybb->input['gid']."'");

	$query = $db->simple_select("templategroups", "*", "gid = '".$mybb->get_input('gid', MyBB::INPUT_INT)."'");


if(!$db->num_rows($query))
{


if(!$db->num_rows($query))
{

Zeile 747Zeile 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)

		}

$title = trim($mybb->input['title']);
if(!$title)

		{

		{

			$errors[] = $lang->error_missing_group_title;
}


			$errors[] = $lang->error_missing_group_title;
}


Zeile 766Zeile 793
				{
$errors[] = $lang->error_duplicate_group_prefix;
}

				{
$errors[] = $lang->error_duplicate_group_prefix;
}

			}


			}


			if(!$errors)
{
// Add template group

			if(!$errors)
{
// Add template group

Zeile 781Zeile 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'], $title);

				log_admin_action($template_group['gid'], htmlspecialchars_uni($title));

				flash_message($lang->success_template_group_saved, 'success');
admin_redirect("index.php?module=style-templates&amp;sid={$sid}");
}
}
}


				flash_message($lang->success_template_group_saved, 'success');
admin_redirect("index.php?module=style-templates&amp;sid={$sid}");
}
}
}


	$lang->editing_template_group = $lang->sprintf($lang->editing_template_group, $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&amp;sid={$sid}{$expand_str}");
$page->add_breadcrumb_item($lang->editing_template_group, "index.php?module=style-templates&amp;sid={$sid}");


$page->add_breadcrumb_item($template_sets[$sid], "index.php?module=style-templates&amp;sid={$sid}{$expand_str}");
$page->add_breadcrumb_item($lang->editing_template_group, "index.php?module=style-templates&amp;sid={$sid}");

Zeile 811Zeile 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 848Zeile 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();

// Get the names of all template sets

				$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;

				$template_sets[-2] = $lang->master_templates;
$template_sets[-1] = $lang->global_templates;





				$query = $db->simple_select("templatesets", "sid, title");
while($set = $db->fetch_array($query))
{
$template_sets[$set['sid']] = $set['title'];
}

				$query = $db->simple_select("templatesets", "sid, title");
while($set = $db->fetch_array($query))
{
$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 868Zeile 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 1150Zeile 1180
	{
$page->extra_header .= '
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">

	{
$page->extra_header .= '
<link href="./jscripts/codemirror/lib/codemirror.css" rel="stylesheet">

<link href="./jscripts/codemirror/theme/mybb.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>

<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" >

<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/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/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">

';
}


';
}


Zeile 1172Zeile 1206
	$form = new Form("index.php?module=style-templates&amp;action=search_replace", "post", "do_template");
echo $form->generate_hidden_field('type', "templates");


	$form = new Form("index.php?module=style-templates&amp;action=search_replace", "post", "do_template");
echo $form->generate_hidden_field('type', "templates");


	$form_container = new FormContainer($lang->search_replace);

	$form_container = new FormContainer($lang->search_replace, 'tfixed');

	$form_container->output_row($lang->search_for, "", $form->generate_text_area('find', $mybb->input['find'], array('id' => 'find', 'class' => '', 'style' => 'width: 100%; height: 200px;')));

$form_container->output_row($lang->replace_with, "", $form->generate_text_area('replace', $mybb->input['replace'], array('id' => 'replace', 'class' => '', 'style' => 'width: 100%; height: 200px;')));

	$form_container->output_row($lang->search_for, "", $form->generate_text_area('find', $mybb->input['find'], array('id' => 'find', 'class' => '', 'style' => 'width: 100%; height: 200px;')));

$form_container->output_row($lang->replace_with, "", $form->generate_text_area('replace', $mybb->input['replace'], array('id' => 'replace', 'class' => '', 'style' => 'width: 100%; height: 200px;')));

Zeile 1206Zeile 1240

if($admin_options['codepress'] != 0)
{


if($admin_options['codepress'] != 0)
{

		echo "<script type=\"text/javascript\">
var editor1 = CodeMirror.fromTextArea(document.getElementById(\"find\"), {

		echo '<script type="text/javascript">
var editor1 = CodeMirror.fromTextArea(document.getElementById("find"), {

				lineNumbers: true,
lineWrapping: true,

				lineNumbers: true,
lineWrapping: true,

				mode: \"text/html\",
tabMode: \"indent\",
theme: \"mybb\"





				foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
viewportMargin: Infinity,
indentWithTabs: true,
indentUnit: 4,
mode: "text/html",
theme: "mybb"

			});


			});


			var editor2 = CodeMirror.fromTextArea(document.getElementById(\"replace\"), {

			var editor2 = CodeMirror.fromTextArea(document.getElementById("replace"), {

				lineNumbers: true,
lineWrapping: true,

				lineNumbers: true,
lineWrapping: true,

				mode: \"text/html\",
tabMode: \"indent\",
theme: \"mybb\"





				foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"],
viewportMargin: Infinity,
indentWithTabs: true,
indentUnit: 4,
mode: "text/html",
theme: "mybb"

			});

			});

		</script>";

		</script>';

	}

$page->output_footer();

	}

$page->output_footer();

Zeile 1331Zeile 1373

if($mybb->input['action'] == "delete_template_group")
{


if($mybb->input['action'] == "delete_template_group")
{

	$gid = (int)$mybb->input['gid'];

	$gid = $mybb->get_input('gid', MyBB::INPUT_INT);

	$query = $db->simple_select("templategroups", "*", "gid='{$gid}'");

if(!$db->num_rows($query))

	$query = $db->simple_select("templategroups", "*", "gid='{$gid}'");

if(!$db->num_rows($query))

Zeile 1358Zeile 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'], $template_group['title']);

		log_admin_action($template_group['gid'], htmlspecialchars_uni($template_group['title']));


flash_message($lang->success_template_group_deleted, 'success');
admin_redirect("index.php?module=style-templates&amp;sid={$sid}");


flash_message($lang->success_template_group_deleted, 'success');
admin_redirect("index.php?module=style-templates&amp;sid={$sid}");

Zeile 1497Zeile 1539

$sub_tabs['diff_report'] = array(
'title' => $lang->diff_report,


$sub_tabs['diff_report'] = array(
'title' => $lang->diff_report,

		'link' => "index.php?module=style-templates&amp;action=diff_report&amp;title=".$db->escape_string($mybb->input['title'])."&amp;from=".$mybb->input['from']."sid1=".(int)$mybb->input['sid1']."&amp;sid2=".(int)$mybb->input['sid2'],

		'link' => "index.php?module=style-templates&amp;action=diff_report&amp;title=".$db->escape_string($mybb->input['title'])."&amp;from=".htmlspecialchars_uni($mybb->input['from'])."sid1=".$mybb->get_input('sid1', MyBB::INPUT_INT)."&amp;sid2=".$mybb->get_input('sid2', MyBB::INPUT_INT),

		'description' => $lang->diff_report_desc
);

$plugins->run_hooks("admin_style_templates_diff_report");


		'description' => $lang->diff_report_desc
);

$plugins->run_hooks("admin_style_templates_diff_report");


	$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".(int)$mybb->input['sid1']."'");

	$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);


	$template1 = $db->fetch_array($query);


	$query = $db->simple_select("templates", "*", "title='".$db->escape_string($mybb->input['title'])."' AND sid='".(int)$mybb->input['sid2']."'");

	$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);

if($mybb->input['sid2'] == -2)
{
$sub_tabs['full_edit'] = array(
'title' => $lang->full_edit,

	$template2 = $db->fetch_array($query);

if($mybb->input['sid2'] == -2)
{
$sub_tabs['full_edit'] = array(
'title' => $lang->full_edit,

			'link' => "index.php?module=style-templates&action=edit_template&title=".urlencode($template1['title'])."&sid=".(int)$mybb->input['sid1']."&amp;from=diff_report",

			'link' => "index.php?module=style-templates&action=edit_template&title=".urlencode($template1['title'])."&sid=".$mybb->get_input('sid1', MyBB::INPUT_INT)."&amp;from=diff_report",

		);
}

if($template1['template'] == $template2['template'])
{
flash_message($lang->templates_the_same, 'error');

		);
}

if($template1['template'] == $template2['template'])
{
flash_message($lang->templates_the_same, 'error');

		admin_redirect("index.php?module=style-templates&sid=".(int)$mybb->input['sid2'].$expand_str);

		admin_redirect("index.php?module=style-templates&sid=".$mybb->get_input('sid2', MyBB::INPUT_INT).$expand_str);

	}

$template1['template'] = explode("\n", $template1['template']);

	}

$template1['template'] = explode("\n", $template1['template']);

Zeile 1543Zeile 1585
	if($mybb->input['sid2'] == -2)
{
$page->add_breadcrumb_item($lang->find_updated, "index.php?module=style-templates&amp;action=find_updated");

	if($mybb->input['sid2'] == -2)
{
$page->add_breadcrumb_item($lang->find_updated, "index.php?module=style-templates&amp;action=find_updated");

	}

	}





	$page->add_breadcrumb_item($lang->diff_report.": ".$template1['title'], "index.php?module=style-templates&amp;action=diff_report&amp;title=".$db->escape_string($mybb->input['title'])."&amp;from=".$mybb->input['from']."&amp;sid1=".(int)$mybb->input['sid1']."&amp;sid2=".(int)$mybb->input['sid2']);

	$page->add_breadcrumb_item($lang->diff_report.": ".htmlspecialchars_uni($template1['title']), "index.php?module=style-templates&amp;action=diff_report&amp;title=".$db->escape_string($mybb->input['title'])."&amp;from=".htmlspecialchars_uni($mybb->input['from'])."&amp;sid1=".$mybb->get_input('sid1', MyBB::INPUT_INT)."&amp;sid2=".$mybb->get_input('sid2', MyBB::INPUT_INT));


$page->output_header($lang->template_sets);



$page->output_header($lang->template_sets);


Zeile 1576Zeile 1618
		SELECT t.*, s.title as set_title
FROM ".TABLE_PREFIX."templates t
LEFT JOIN ".TABLE_PREFIX."templatesets s ON(s.sid=t.sid)

		SELECT t.*, s.title as set_title
FROM ".TABLE_PREFIX."templates t
LEFT JOIN ".TABLE_PREFIX."templatesets s ON(s.sid=t.sid)

		WHERE t.title='".$db->escape_string($mybb->input['title'])."' AND t.sid > 0 AND t.sid = '".$mybb->get_input('sid', 1)."'

		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);


	");
$template = $db->fetch_array($query);


Zeile 1608Zeile 1650
		flash_message($lang->success_template_reverted, 'success');

if($mybb->input['from'] == "diff_report")

		flash_message($lang->success_template_reverted, 'success');

if($mybb->input['from'] == "diff_report")

		{

		{

			admin_redirect("index.php?module=style-templates&action=find_updated");

			admin_redirect("index.php?module=style-templates&action=find_updated");

		}

		}

		else
{
admin_redirect("index.php?module=style-templates&sid={$template['sid']}{$expand_str2}");
}

		else
{
admin_redirect("index.php?module=style-templates&sid={$template['sid']}{$expand_str2}");
}

	}

	}

	else

	else

	{

	{

		$page->output_confirm_action("index.php?module=style-templates&amp;sid={$template['sid']}{$expand_str}", $lang->confirm_template_revertion);
}
}

		$page->output_confirm_action("index.php?module=style-templates&amp;sid={$template['sid']}{$expand_str}", $lang->confirm_template_revertion);
}
}

Zeile 1628Zeile 1670
	{
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_set");

$table = new Table;

	$plugins->run_hooks("admin_style_templates_set");

$table = new Table;

Zeile 1671Zeile 1713
	}

if(!isset($mybb->input['expand']))

	}

if(!isset($mybb->input['expand']))

	{

	{

		$mybb->input['expand'] = '';
}
if($mybb->input['expand'] == 'all')

		$mybb->input['expand'] = '';
}
if($mybb->input['expand'] == 'all')

Zeile 1685Zeile 1727
	$template_groups = array();
while($templategroup = $db->fetch_array($query))
{

	$template_groups = array();
while($templategroup = $db->fetch_array($query))
{

		$templategroup['title'] = $lang->parse($templategroup['title'])." ".$lang->templates;

		$templategroup['title'] = $lang->sprintf($lang->templates, htmlspecialchars_uni($lang->parse($templategroup['title'])));

		if($mybb->input['expand'] == 'all')
{
$expand_array[] = $templategroup['gid'];

		if($mybb->input['expand'] == 'all')
{
$expand_array[] = $templategroup['gid'];

Zeile 1697Zeile 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 1709Zeile 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


// Load the list of templates

	$query = $db->simple_select("templates", "*", "sid='".$mybb->get_input('sid', 1)."' OR sid='-2'", array('order_by' => 'sid DESC, title', 'order_dir' => 'ASC'));

	$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);

	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]]))
{