Vergleich admin/modules/style/templates.php - 1.8.14 - 1.8.27

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 102Zeile 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 157Zeile 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 186Zeile 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 210Zeile 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 242Zeile 242
			$sid = -1;
}


			$sid = -1;
}


 
		$template['title'] = "";

		$template['template'] = "";
$template['sid'] = $sid;
}

		$template['template'] = "";
$template['sid'] = $sid;
}

Zeile 264Zeile 265
<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>

<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/search/search.js?ver=1821"></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">
';

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

	}


	}


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





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

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





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

if($errors)

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

if($errors)

Zeile 300Zeile 301

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





	$form->output_submit_wrapper($buttons);

$form->end();

	$form->output_submit_wrapper($buttons);

$form->end();

Zeile 324Zeile 325

$page->output_footer();
}


$page->output_footer();
}





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&amp;sid={$sid}".$expand_str2);

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

Zeile 385Zeile 386
				}

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

				}

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

			}

			}

		}
}


		}
}


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


	if(!empty($mybb->input['sid']))
{
$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');


 
	$template_group = array();

	if($errors)

	if($errors)

	{
$template_group = array(

	{
$template_group = array(

			'prefix' => $prefix,
'title' => $title

			'prefix' => $prefix,
'title' => $title

		);


		);


		$page->output_inline_error($errors);
}

		$page->output_inline_error($errors);
}










	else
{
$template_group = array(
'prefix' => null,
'title' => null,
);
}


	$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 = 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->end();


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


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

Zeile 528Zeile 537
		{
$errors[] = $lang->error_security_problem;
}

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





		if(!$errors)
{
$query = $db->simple_select("templates", "*", "tid='{$mybb->input['tid']}'");

		if(!$errors)
{
$query = $db->simple_select("templates", "*", "tid='{$mybb->input['tid']}'");

Zeile 585Zeile 594
			if(!$group)
{
$group = "-1";

			if(!$group)
{
$group = "-1";

			}

			}


// Log admin action


// Log admin action

			log_admin_action($template['tid'], $mybb->input['title'], $mybb->input['sid'], $set['title']);











			if(!empty($set['title']))
{
$title = $set['title'];
}
else
{
$title = null;
}

log_admin_action($template['tid'], $mybb->get_input('title'), $mybb->get_input('sid'), $title);


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


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


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

			if($mybb->get_input('continue'))

			{

			{

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

				if($mybb->get_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."&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
{
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);

Zeile 605Zeile 623
			}
else
{

			}
else
{

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

				if($mybb->get_input('from') == "diff_report")

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

				{
admin_redirect("index.php?module=style-templates&amp;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 641Zeile 659
<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>

<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/search/search.js?ver=1821"></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>

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

Zeile 673Zeile 691
		$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",

Zeile 692Zeile 710
	if($errors)
{
$page->output_inline_error($errors);

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

$form_container = new FormContainer($lang->edit_template_breadcrumb.$template['title'], 'tfixed');

	if($mybb->input['from'] == "diff_report")
{
echo $form->generate_hidden_field('from', "diff_report");
}

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

	$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
if($template['sid'] == "-2")


// Force users to save the default template to a specific set, rather than the "global" templates - where they can delete it
if($template['sid'] == "-2")

Zeile 758Zeile 776
	{
flash_message($lang->error_default_template_group, 'error');
admin_redirect("index.php?module=style-templates&amp;sid={$sid}{$expand_str}");

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

	}

$plugins->run_hooks("admin_style_templates_edit_template_group");

	}

$plugins->run_hooks("admin_style_templates_edit_template_group");


$errors = array();
if($mybb->request_method == "post")
{
$prefix = trim($mybb->input['prefix']);
if(!$prefix)


$errors = array();
if($mybb->request_method == "post")
{
$prefix = trim($mybb->input['prefix']);
if(!$prefix)

		{

		{

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

if(strpos($prefix, "_") !== false)
{
$errors[] = $lang->error_invalid_group_title;

			$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 788Zeile 806
			{
$query = $db->simple_select("templategroups", "COUNT(gid) AS gid", "prefix = '".$db->escape_string($mybb->input['prefix'])."'");
$prefix_count = $db->fetch_field($query, 'gid');

			{
$query = $db->simple_select("templategroups", "COUNT(gid) AS gid", "prefix = '".$db->escape_string($mybb->input['prefix'])."'");
$prefix_count = $db->fetch_field($query, 'gid');





				if($prefix_count >= 1)
{
$errors[] = $lang->error_duplicate_group_prefix;

				if($prefix_count >= 1)
{
$errors[] = $lang->error_duplicate_group_prefix;

Zeile 808Zeile 826

$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&amp;sid={$sid}");
}

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

Zeile 841Zeile 859

$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 1189Zeile 1207
<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>

<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/search/search.js?ver=1821"></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>

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

Zeile 1207Zeile 1225
	echo $form->generate_hidden_field('type', "templates");

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

	echo $form->generate_hidden_field('type', "templates");

$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->search_for, "", $form->generate_text_area('find', $mybb->get_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->replace_with, "", $form->generate_text_area('replace', $mybb->get_input('replace'), array('id' => 'replace', 'class' => '', 'style' => 'width: 100%; height: 200px;')));

	$form_container->end();

$buttons[] = $form->generate_submit_button($lang->find_and_replace);

	$form_container->end();

$buttons[] = $form->generate_submit_button($lang->find_and_replace);

Zeile 1226Zeile 1244

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



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


	$form_container->output_row($lang->search_for, "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');

	$form_container->output_row($lang->search_for, "", $form->generate_text_box('title', $mybb->get_input('title'), array('id' => 'title')), 'title');


$form_container->end();



$form_container->end();


Zeile 1324Zeile 1342
		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 1333Zeile 1351

foreach($templates as $sid => $templates)
{


foreach($templates as $sid => $templates)
{

		if(!$done_set[$sid])

		if(empty($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 1354Zeile 1372
			$table->construct_row();
}


			$table->construct_row();
}


		if($done_set[$sid] && !$done_output[$sid])

		if(!empty($done_set[$sid]) && empty($done_output[$sid]))

		{
$done_output[$sid] = 1;
if($count == 1)

		{
$done_output[$sid] = 1;
if($count == 1)

Zeile 1383Zeile 1401
	}

// User clicked no

	}

// User clicked no

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

	if($mybb->get_input('no'))

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

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

Zeile 1400Zeile 1418
		$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&amp;sid={$sid}");


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

Zeile 1439Zeile 1457
	}

// User clicked no

	}

// User clicked no

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

	if($mybb->get_input('no'))

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

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

Zeile 1484Zeile 1502
	}

// User clicked no

	}

// User clicked no

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

	if($mybb->get_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 1541Zeile 1559
		'title' => $lang->diff_report,
'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

		'title' => $lang->diff_report,
'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");



$plugins->run_hooks("admin_style_templates_diff_report");


Zeile 1598Zeile 1616
	if($mybb->input['from'])
{
$table->construct_header("<ins>".$lang->master_updated_ins."</ins><br /><del>".$lang->master_updated_del."</del>");

	if($mybb->input['from'])
{
$table->construct_header("<ins>".$lang->master_updated_ins."</ins><br /><del>".$lang->master_updated_del."</del>");

	}

	}

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

Zeile 1608Zeile 1626
	$table->construct_row();

$table->output($lang->template_diff_analysis.": ".$template1['title']);

	$table->construct_row();

$table->output($lang->template_diff_analysis.": ".$template1['title']);





	$page->output_footer();
}

	$page->output_footer();
}





if($mybb->input['action'] == "revert")
{
$query = $db->query("

if($mybb->input['action'] == "revert")
{
$query = $db->query("

Zeile 1626Zeile 1644
	if(!$template)
{
flash_message($lang->error_invalid_template, 'error');

	if(!$template)
{
flash_message($lang->error_invalid_template, 'error');

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

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


// User clicked no


// User clicked no

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

	if($mybb->get_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 1646Zeile 1664

// Log admin action
log_admin_action($template['tid'], $template['title'], $template['sid'], $template['set_title']);


// Log admin action
log_admin_action($template['tid'], $template['title'], $template['sid'], $template['set_title']);





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

Zeile 1656Zeile 1674
		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
{

Zeile 1664Zeile 1682
	}
}


	}
}


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

if(!empty($mybb->input['sid']) && !$mybb->input['action'])

{
if(!isset($template_sets[$mybb->input['sid']]))
{

{
if(!isset($template_sets[$mybb->input['sid']]))
{

Zeile 1771Zeile 1789
		$exploded[0] = strtolower($exploded[0]);

if(isset($template_groups[$exploded[0]]))

		$exploded[0] = strtolower($exploded[0]);

if(isset($template_groups[$exploded[0]]))

		{

		{

			$group = $exploded[0];
}
else
{
$group = -1;

			$group = $exploded[0];
}
else
{
$group = -1;

		}

		}


$template['gid'] = -1;
if(isset($template_groups[$exploded[0]]['gid']))
{
$template['gid'] = $template_groups[$exploded[0]]['gid'];


$template['gid'] = -1;
if(isset($template_groups[$exploded[0]]['gid']))
{
$template['gid'] = $template_groups[$exploded[0]]['gid'];

		}

		}


// If this template is not a master template, we simple add it to the list
if($template['sid'] != -2)


// If this template is not a master template, we simple add it to the list
if($template['sid'] != -2)

		{

		{

			$template['original'] = false;

			$template['original'] = false;

			$template['modified'] = false;
$template_groups[$group]['templates'][$template['title']] = $template;

			$template['modified'] = false;
$template_groups[$group]['templates'][$template['title']] = $template;

		}
else if(!in_array($template['gid'], $expand_array) && !isset($expand_array[-1]))
{
$template['original'] = true;
$template['modified'] = false;
$template_groups[$group]['templates'][$template['title']] = $template;

		}
else if(!in_array($template['gid'], $expand_array) && !isset($expand_array[-1]))
{
$template['original'] = true;
$template['modified'] = false;
$template_groups[$group]['templates'][$template['title']] = $template;


// Save some memory!
unset($template_groups[$group]['templates'][$template['title']]['template']);
}


// Save some memory!
unset($template_groups[$group]['templates'][$template['title']]['template']);
}

		// Otherwise, if we are down to master templates we need to do a few extra things
else
{

		// Otherwise, if we are down to master templates we need to do a few extra things
else
{

Zeile 1828Zeile 1846
		{
$expand = $lang->collapse;
$expanded = true;

		{
$expand = $lang->collapse;
$expanded = true;





			$tmp_expand = $expand_array;
$unsetgid = array_search($group['gid'], $tmp_expand);
unset($tmp_expand[$unsetgid]);

			$tmp_expand = $expand_array;
$unsetgid = array_search($group['gid'], $tmp_expand);
unset($tmp_expand[$unsetgid]);

Zeile 1869Zeile 1887
			$table->construct_cell("<a href=\"index.php?module=style-templates&amp;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&amp;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 1886Zeile 1904
						if($sid > 0)
{
$popup->add_item($lang->diff_report, "index.php?module=style-templates&amp;action=diff_report&amp;title=".urlencode($template['title'])."&amp;sid2={$sid}");

						if($sid > 0)
{
$popup->add_item($lang->diff_report, "index.php?module=style-templates&amp;action=diff_report&amp;title=".urlencode($template['title'])."&amp;sid2={$sid}");





							$popup->add_item($lang->revert_to_orig, "index.php?module=style-templates&amp;action=revert&amp;title=".urlencode($template['title'])."&amp;sid={$sid}&amp;my_post_key={$mybb->post_code}{$expand_str}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_revertion}')");
}


							$popup->add_item($lang->revert_to_orig, "index.php?module=style-templates&amp;action=revert&amp;title=".urlencode($template['title'])."&amp;sid={$sid}&amp;my_post_key={$mybb->post_code}{$expand_str}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_revertion}')");
}


Zeile 1900Zeile 1918
						$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&amp;action=edit_template&amp;title=".urlencode($template['title'])."&amp;sid={$sid}{$expand_str}\" >{$template['pretty_title']}</a></span>");

					$table->construct_cell("<span style=\"padding-left: 20px;\"><a href=\"index.php?module=style-templates&amp;action=edit_template&amp;title=".urlencode($template['title'])."&amp;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 1967Zeile 1985
			continue;
}


			continue;
}


		if($themes[$set['sid']])

		if(!empty($themes[$set['sid']]))

		{
$used_by_note = $lang->used_by;
$comma = "";

		{
$used_by_note = $lang->used_by;
$comma = "";

Zeile 1995Zeile 2013
			{
$popup->add_item($lang->edit_template_set, "index.php?module=style-templates&amp;action=edit_set&amp;sid={$set['sid']}");


			{
$popup->add_item($lang->edit_template_set, "index.php?module=style-templates&amp;action=edit_set&amp;sid={$set['sid']}");


				if(!$themes[$set['sid']])

				if(empty($themes[$set['sid']]))

				{
$popup->add_item($lang->delete_template_set, "index.php?module=style-templates&amp;action=delete_set&amp;sid={$set['sid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_set_deletion}')");
}

				{
$popup->add_item($lang->delete_template_set, "index.php?module=style-templates&amp;action=delete_set&amp;sid={$set['sid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_template_set_deletion}')");
}

Zeile 2003Zeile 2021

$actions = $popup->fetch();
}


$actions = $popup->fetch();
}

 

$set['title'] = htmlspecialchars_uni($set['title']);


$table->construct_cell("<strong><a href=\"index.php?module=style-templates&amp;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&amp;sid={$set['sid']}\">{$set['title']}</a></strong><br /><small>{$used_by_note}</small>");
$table->construct_cell($actions, array("class" => "align_center"));