Vergleich admin/inc/functions_view_manager.php - 1.6.6 - 1.6.11

  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: functions_view_manager.php 5460 2011-05-10 11:21:21Z Tomm $

 * $Id: functions_view_manager.php 5823 2012-05-03 15:40:09Z Tomm $

 */

/**

 */

/**

Zeile 34Zeile 34
		'description' => $lang->create_new_view_desc
);


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


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

	$page->add_breadcrumb_item($lang->view_manager, 'index.php?module=user-users&action=views');


// Lang strings should be in global lang file

if($mybb->input['do'] == "set_default")
{


// Lang strings should be in global lang file

if($mybb->input['do'] == "set_default")
{

		$query = $db->simple_select("adminviews", "vid", "vid='".intval($mybb->input['vid'])."'");

		$query = $db->simple_select("adminviews", "vid, uid, visibility", "vid='".intval($mybb->input['vid'])."'");

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

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

		



		if(!$admin_view['vid'] || $admin_view['visibility'] == 1 && $mybb->user['uid'] != $admin_view['uid'])
{
flash_message($lang->error_invalid_admin_view, 'error');
admin_redirect($base_url."&action=views");
}

		if(!$admin_view['vid'] || $admin_view['visibility'] == 1 && $mybb->user['uid'] != $admin_view['uid'])
{
flash_message($lang->error_invalid_admin_view, 'error');
admin_redirect($base_url."&action=views");
}

 


		set_default_view($type, $admin_view['vid']);
flash_message($lang->succuss_view_set_as_default, 'success');
admin_redirect($base_url."&action=views");

		set_default_view($type, $admin_view['vid']);
flash_message($lang->succuss_view_set_as_default, 'success');
admin_redirect($base_url."&action=views");

Zeile 126Zeile 127
		// Write in our JS based field selector
$page->extra_header .= "<script src=\"../jscripts/scriptaculous.js?load=effects,dragdrop\" type=\"text/javascript\"></script>\n";
$page->extra_header .= "<script src=\"jscripts/view_manager.js\" type=\"text/javascript\"></script>\n";

		// Write in our JS based field selector
$page->extra_header .= "<script src=\"../jscripts/scriptaculous.js?load=effects,dragdrop\" type=\"text/javascript\"></script>\n";
$page->extra_header .= "<script src=\"jscripts/view_manager.js\" type=\"text/javascript\"></script>\n";

		



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

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

$form = new Form($base_url."&amp;action=views&amp;do=add", "post");

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

$form = new Form($base_url."&amp;action=views&amp;do=add", "post");

Zeile 135Zeile 137

// If we have any error messages, show them
if($errors)


// If we have any error messages, show them
if($errors)

		{

		{

			$page->output_inline_error($errors);

			$page->output_inline_error($errors);

		}

		}


$form_container = new FormContainer($lang->create_new_view);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');


$form_container = new FormContainer($lang->create_new_view);
$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');


if($mybb->input['visibility'] == 2)
{
$visibility_public_checked = true;
}


if($mybb->input['visibility'] == 2)
{
$visibility_public_checked = true;
}

		else
{
$visibility_private_checked = true;

		else
{
$visibility_private_checked = true;

Zeile 243Zeile 245
		if(!$admin_view['vid'] || $admin_view['visibility'] == 1 && $mybb->user['uid'] != $admin_view['uid'])
{
flash_message($lang->error_invalid_admin_view, 'error');

		if(!$admin_view['vid'] || $admin_view['visibility'] == 1 && $mybb->user['uid'] != $admin_view['uid'])
{
flash_message($lang->error_invalid_admin_view, 'error');

			admin_redirect($base_url."&action=views");
}

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

			admin_redirect($base_url."&action=views");
}

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

			}
if($mybb->input['fields_js'])
{

			}
if($mybb->input['fields_js'])
{

Zeile 305Zeile 307

flash_message($lang->success_view_updated, "success");
admin_redirect($base_url."&vid={$admin_view['vid']}");


flash_message($lang->success_view_updated, "success");
admin_redirect($base_url."&vid={$admin_view['vid']}");

			}
}
else
{
$default_view = fetch_default_view($type);
if($default_view = $view['vid'])
{
$mybb->input['isdefault'] = 1;

 
			}
}


			}
}


Zeile 320Zeile 314
		$page->extra_header .= "<script src=\"../jscripts/scriptaculous.js?load=effects,dragdrop\" type=\"text/javascript\"></script>\n";
$page->extra_header .= "<script src=\"jscripts/view_manager.js\" type=\"text/javascript\"></script>\n";


		$page->extra_header .= "<script src=\"../jscripts/scriptaculous.js?load=effects,dragdrop\" type=\"text/javascript\"></script>\n";
$page->extra_header .= "<script src=\"jscripts/view_manager.js\" type=\"text/javascript\"></script>\n";


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

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

$form = new Form($base_url."&amp;action=views&amp;do=edit&amp;vid={$admin_view['vid']}", "post");

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

$form = new Form($base_url."&amp;action=views&amp;do=edit&amp;vid={$admin_view['vid']}", "post");

Zeile 335Zeile 330

// If we have any error messages, show them
if($errors)


// If we have any error messages, show them
if($errors)

		{

		{

			$page->output_inline_error($errors);
}
else

			$page->output_inline_error($errors);
}
else

Zeile 344Zeile 339
			$admin_view['fields'] = unserialize($admin_view['fields']);
$admin_view['profile_fields'] = unserialize($admin_view['custom_profile_fields']);
$mybb->input = $admin_view;

			$admin_view['fields'] = unserialize($admin_view['fields']);
$admin_view['profile_fields'] = unserialize($admin_view['custom_profile_fields']);
$mybb->input = $admin_view;

 

$mybb->input['isdefault'] = 0;
$default_view = fetch_default_view($type);

if($default_view == $admin_view['vid'])
{
$mybb->input['isdefault'] = 1;
}

		}

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

		}

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

Zeile 352Zeile 355
		if($mybb->input['visibility'] == 2)
{
$visibility_public_checked = true;

		if($mybb->input['visibility'] == 2)
{
$visibility_public_checked = true;

		}
else
{
$visibility_private_checked = true;
}


		}
else
{
$visibility_private_checked = true;
}


		$visibility_options = array(
$form->generate_radio_button("visibility", "1", "<strong>{$lang->private}</strong> - {$lang->private_desc}", array("checked" => $visibility_private_checked)),
$form->generate_radio_button("visibility", "2", "<strong>{$lang->public}</strong> - {$lang->public_desc}", array("checked" => $visibility_public_checked))

		$visibility_options = array(
$form->generate_radio_button("visibility", "1", "<strong>{$lang->private}</strong> - {$lang->private_desc}", array("checked" => $visibility_private_checked)),
$form->generate_radio_button("visibility", "2", "<strong>{$lang->public}</strong> - {$lang->public_desc}", array("checked" => $visibility_public_checked))

Zeile 461Zeile 464
			admin_redirect($base_url."&action=views");
}


			admin_redirect($base_url."&action=views");
}


		$query = $db->simple_select("adminviews", "vid", "vid='".intval($mybb->input['vid'])."'");


		$vid = intval($mybb->input['vid']);
$query = $db->simple_select("adminviews", "vid, uid, visibility", "vid = '{$vid}'");

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


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


		if(!$admin_view['vid'] || $admin_view['visibility'] == 1 && $mybb->user['uid'] != $admin_view['uid'])

		if($vid == 1 || !$admin_view['vid'] || $admin_view['visibility'] == 1 && $mybb->user['uid'] != $admin_view['uid'])

		{
flash_message($lang->error_invalid_view_delete, 'error');
admin_redirect($base_url."&action=views");

		{
flash_message($lang->error_invalid_view_delete, 'error');
admin_redirect($base_url."&action=views");

Zeile 602Zeile 606
				$popup->add_item($lang->set_as_default, "{$base_url}&amp;action=views&amp;do=set_default&amp;vid={$view['vid']}");
}


				$popup->add_item($lang->set_as_default, "{$base_url}&amp;action=views&amp;do=set_default&amp;vid={$view['vid']}");
}


			if($views > 1)

			if($views > 1 && $view['vid'] != 1)

			{
$popup->add_item($lang->delete_view, "{$base_url}&amp;action=views&amp;do=delete&amp;vid={$view['vid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_view_deletion}')");
}

			{
$popup->add_item($lang->delete_view, "{$base_url}&amp;action=views&amp;do=delete&amp;vid={$view['vid']}&amp;my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_view_deletion}')");
}