Vergleich admin/modules/style/templates.php - 1.6.3 - 1.6.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: templates.php 5380 2011-02-21 12:04:43Z Tomm $

 * $Id: templates.php 5390 2011-03-17 15:23:41Z Tomm $

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 60Zeile 60
		'description' => $lang->find_updated_desc
);
}

		'description' => $lang->find_updated_desc
);
}

else if(($sid && !$mybb->input['action']) || $mybb->input['action'] == "edit_set" || $mybb->input['action'] == "edit_template")

else if(($sid && !$mybb->input['action']) || $mybb->input['action'] == "edit_set" || $mybb->input['action'] == "check_set" || $mybb->input['action'] == "edit_template")

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

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

Zeile 385Zeile 385
		{
$errors[] = $lang->error_missing_title;
}

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

		








// Are we trying to do malicious things in our template?
if(check_template($mybb->input['template']))
{
$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 418Zeile 424
				else
{
$db->update_query("templates", $template_array, "tid='{$template['tid']}' AND sid != '-2'");

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

				}
}
else

				}
}
else

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


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


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


Zeile 438Zeile 444
			$group = $db->fetch_field($query, "gid");

if(!$group)

			$group = $db->fetch_field($query, "gid");

if(!$group)

			{

			{

				$group = "-1";
}


				$group = "-1";
}


Zeile 471Zeile 477
			}
}
}

			}
}
}

	
if($errors)
{
$page->output_inline_error($errors);
$template = $mybb->input;
}

	
if($errors)
{
$template = $mybb->input;
}


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

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

Zeile 491Zeile 496
	<script type="text/javascript">
CodePress.language = \'mybb\';
</script>';

	<script type="text/javascript">
CodePress.language = \'mybb\';
</script>';

	}

	}

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

	

	

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

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

	

	

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

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

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

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

	





	$sub_tabs = array();

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

	$sub_tabs = array();

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

Zeile 526Zeile 532
	);

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

	);

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


Zeile 692Zeile 703
									{
$label = $lang->sprintf($lang->search_found, $template['title']);
$url = "index.php?module=style-templates&amp;action=edit_template&amp;title=".urlencode($template['title'])."&amp;sid={$template['sid']}";

									{
$label = $lang->sprintf($lang->search_found, $template['title']);
$url = "index.php?module=style-templates&amp;action=edit_template&amp;title=".urlencode($template['title'])."&amp;sid={$template['sid']}";

									}
}
}

									}
}
}

							else
{
// Just show that the term was found

							else
{
// Just show that the term was found

Zeile 752Zeile 763
				
$page->output_footer();
exit;

				
$page->output_footer();
exit;

			}

			}

		}
else
{
if(!$mybb->input['title'])

		}
else
{
if(!$mybb->input['title'])

			{

			{

				flash_message($lang->search_noneset, "error");
admin_redirect("index.php?module=style-templates&action=search_replace");
}
else
{
// Search Template Titles

				flash_message($lang->search_noneset, "error");
admin_redirect("index.php?module=style-templates&action=search_replace");
}
else
{
// Search Template Titles

				

				

				$templatessets = array();

$templates_sets = array();
// Get the names of all template sets
$template_sets[-2] = $lang->master_templates;
$template_sets[-1] = $lang->global_templates;

				$templatessets = array();

$templates_sets = array();
// Get the names of all template sets
$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))

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

				{

				{

					$template_sets[$set['sid']] = $set['title'];
}


					$template_sets[$set['sid']] = $set['title'];
}


Zeile 791Zeile 802
				while($template = $db->fetch_array($query))
{
if($template['sid'] == -2)

				while($template = $db->fetch_array($query))
{
if($template['sid'] == -2)

					{

					{

						if(!$template['customtid'])
{
$template['original'] = true;

						if(!$template['customtid'])
{
$template['original'] = true;

Zeile 800Zeile 811
						{
$template['modified'] = true;
}

						{
$template['modified'] = true;
}

					}

					}

					else
{
$template['original'] = false;
$template['modified'] = false;
}
$templatessets[$template['sid']][$template['title']] = $template;

					else
{
$template['original'] = false;
$template['modified'] = false;
}
$templatessets[$template['sid']][$template['title']] = $template;

				}

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


				}

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


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

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

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

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

Zeile 829Zeile 840
				foreach($templatessets as $sid => $templates)
{
++$count;

				foreach($templatessets as $sid => $templates)
{
++$count;

					

					

					$table->construct_header($template_sets[$sid], array("colspan" => 2));

foreach($templates as $template)

					$table->construct_header($template_sets[$sid], array("colspan" => 2));

foreach($templates as $template)

Zeile 848Zeile 859
							}
}
else

							}
}
else

						{

						{

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


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


Zeile 1042Zeile 1053
		}

foreach($templates as $template)

		}

foreach($templates as $template)

		{		

		{

			$popup = new PopupMenu("template_{$template['tid']}", $lang->options);
$popup->add_item($lang->full_edit, "index.php?module=style-templates&amp;action=edit_template&amp;title=".urlencode($template['title'])."&amp;sid={$sid}&amp;from=diff_report");
$popup->add_item($lang->diff_report, "index.php?module=style-templates&amp;action=diff_report&amp;title=".urlencode($template['title'])."&amp;sid1=".$template['sid']."&amp;sid2=-2&amp;from=diff_report");

			$popup = new PopupMenu("template_{$template['tid']}", $lang->options);
$popup->add_item($lang->full_edit, "index.php?module=style-templates&amp;action=edit_template&amp;title=".urlencode($template['title'])."&amp;sid={$sid}&amp;from=diff_report");
$popup->add_item($lang->diff_report, "index.php?module=style-templates&amp;action=diff_report&amp;title=".urlencode($template['title'])."&amp;sid1=".$template['sid']."&amp;sid2=-2&amp;from=diff_report");

Zeile 1069Zeile 1080
	}

$page->output_footer();

	}

$page->output_footer();

}


}


if($mybb->input['action'] == "delete_set")
{
$plugins->run_hooks("admin_style_templates_delete_set");

if($mybb->input['action'] == "delete_set")
{
$plugins->run_hooks("admin_style_templates_delete_set");

Zeile 1096Zeile 1107
			admin_redirect("index.php?module=style-templates");
break;
}

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

	}

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

	}

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

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

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

Zeile 1112Zeile 1123
		$db->delete_query("templates", "sid='{$set['sid']}'");

$plugins->run_hooks("admin_style_templates_delete_set_commit");

		$db->delete_query("templates", "sid='{$set['sid']}'");

$plugins->run_hooks("admin_style_templates_delete_set_commit");


// Log admin action


// Log admin action

		log_admin_action($set['sid'], $set['title']);

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

		log_admin_action($set['sid'], $set['title']);

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

Zeile 1157Zeile 1168
		$db->delete_query("templates", "tid='{$template['tid']}'");

$plugins->run_hooks("admin_style_templates_delete_template_commit");

		$db->delete_query("templates", "tid='{$template['tid']}'");

$plugins->run_hooks("admin_style_templates_delete_template_commit");


// Log admin action


// Log admin action

		log_admin_action($template['tid'], $template['title'], $template['sid'], $template['set_title']);

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

		log_admin_action($template['tid'], $template['title'], $template['sid'], $template['set_title']);

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

Zeile 1467Zeile 1478
		{
$expand = $lang->expand;
$expanded = false;

		{
$expand = $lang->expand;
$expanded = false;

			

			

			$group['expand_str'] = implode("|", $expand_array);
if($group['expand_str'])
{

			$group['expand_str'] = implode("|", $expand_array);
if($group['expand_str'])
{

Zeile 1564Zeile 1575
	$table = new Table;
$table->construct_header($lang->template_set);
$table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));

	$table = new Table;
$table->construct_header($lang->template_set);
$table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));

	

	

	foreach($template_sets as $set)
{
if($set['sid'] == -1)

	foreach($template_sets as $set)
{
if($set['sid'] == -1)

Zeile 1583Zeile 1594
			{
$used_by_note .= $comma.$theme_name;
$comma = $lang->comma;

			{
$used_by_note .= $comma.$theme_name;
$comma = $lang->comma;

			}

			}

		}
else
{

		}
else
{

Zeile 1621Zeile 1632

$page->output_footer();
}


$page->output_footer();
}



 
?>

?>