Vergleich admin/inc/functions_view_manager.php - 1.6.0 - 1.6.9

  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 5016 2010-06-12 00:24:02Z RyanGordon $

 * $Id$

 */

/**

 */

/**

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

		set_default_view($type, $admin_view['vid']);

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

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

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


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


Zeile 99Zeile 100
					"visibility" => intval($mybb->input['visibility']),
"fields" => $db->escape_string(serialize($mybb->input['fields'])),
"conditions" => $db->escape_string(serialize($mybb->input['conditions'])),

					"visibility" => intval($mybb->input['visibility']),
"fields" => $db->escape_string(serialize($mybb->input['fields'])),
"conditions" => $db->escape_string(serialize($mybb->input['conditions'])),

 
					"custom_profile_fields" => $db->escape_string(serialize($mybb->input['profile_fields'])),

					"sortby" => $db->escape_string($mybb->input['sortby']),
"sortorder" => $db->escape_string($mybb->input['sortorder']),
"perpage" => intval($mybb->input['perpage']),

					"sortby" => $db->escape_string($mybb->input['sortby']),
"sortorder" => $db->escape_string($mybb->input['sortorder']),
"perpage" => intval($mybb->input['perpage']),

Zeile 125Zeile 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 134Zeile 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;
}
else


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

		{
$visibility_private_checked = true;
}

		{
$visibility_private_checked = true;
}

Zeile 215Zeile 218
			$field_options[$key] = $field['title'];
}


			$field_options[$key] = $field['title'];
}


		$field_select .= "<noscript>".$form->generate_select_box('fields', $field_options, $mybb->input['fields'], array('id' => 'fields', 'multiple' => true))."</noscript>\n";

		$field_select .= "<noscript>".$form->generate_select_box('fields[]', $field_options, $mybb->input['fields'], array('id' => 'fields', 'multiple' => true))."</noscript>\n";


$form_container = new FormContainer($lang->fields_to_show);
$form_container->output_row($lang->fields_to_show_desc, $description, $field_select);


$form_container = new FormContainer($lang->fields_to_show);
$form_container->output_row($lang->fields_to_show_desc, $description, $field_select);

Zeile 242Zeile 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 289Zeile 292
					"visibility" => intval($mybb->input['visibility']),
"fields" => $db->escape_string(serialize($mybb->input['fields'])),
"conditions" => $db->escape_string(serialize($mybb->input['conditions'])),

					"visibility" => intval($mybb->input['visibility']),
"fields" => $db->escape_string(serialize($mybb->input['fields'])),
"conditions" => $db->escape_string(serialize($mybb->input['conditions'])),

 
					"custom_profile_fields" => $db->escape_string(serialize($mybb->input['profile_fields'])),

					"sortby" => $db->escape_string($mybb->input['sortby']),
"sortorder" => $db->escape_string($mybb->input['sortorder']),
"perpage" => intval($mybb->input['perpage']),

					"sortby" => $db->escape_string($mybb->input['sortby']),
"sortorder" => $db->escape_string($mybb->input['sortorder']),
"perpage" => intval($mybb->input['perpage']),

Zeile 303Zeile 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;

 
			}
}

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





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

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

Zeile 340Zeile 337
		{
$admin_view['conditions'] = unserialize($admin_view['conditions']);
$admin_view['fields'] = unserialize($admin_view['fields']);

		{
$admin_view['conditions'] = unserialize($admin_view['conditions']);
$admin_view['fields'] = unserialize($admin_view['fields']);

 
			$admin_view['profile_fields'] = unserialize($admin_view['custom_profile_fields']);

			$mybb->input = $admin_view;

			$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 422Zeile 428
			$field_options[$key] = $field['title'];
}


			$field_options[$key] = $field['title'];
}


		$field_select .= "<noscript>".$form->generate_select_box('fields', $field_options, $mybb->input['fields'], array('id' => 'fields', 'multiple' => true))."</noscript>\n";

		$field_select .= "<noscript>".$form->generate_select_box('fields[]', $field_options, $mybb->input['fields'], array('id' => 'fields', 'multiple' => true))."</noscript>\n";


$form_container = new FormContainer($lang->fields_to_show);
$form_container->output_row($lang->fields_to_show_desc, $description, $field_select);


$form_container = new FormContainer($lang->fields_to_show);
$form_container->output_row($lang->fields_to_show_desc, $description, $field_select);

Zeile 458Zeile 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 599Zeile 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}')");
}