Vergleich admin/inc/functions_view_manager.php - 1.6.5 - 1.6.18

  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$

 */

/**

 */

/**

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

	



	if($mybb->input['do'] == "add")
{
if($mybb->request_method == "post")

	if($mybb->input['do'] == "add")
{
if($mybb->request_method == "post")

Zeile 60Zeile 61
			if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_missing_view_title;

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

			}

			}

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

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

			{

			{

				$mybb->input['fields'] = explode(",", $mybb->input['fields_js']);

				$mybb->input['fields'] = explode(",", $mybb->input['fields_js']);

			}

			}

			if(count($mybb->input['fields']) <= 0)
{
$errors[] = $lang->error_no_view_fields;

			if(count($mybb->input['fields']) <= 0)
{
$errors[] = $lang->error_no_view_fields;

			}


			}


			if(intval($mybb->input['perpage']) <= 0)
{
$errors[] = $lang->error_invalid_view_perpage;

			if(intval($mybb->input['perpage']) <= 0)
{
$errors[] = $lang->error_invalid_view_perpage;

Zeile 86Zeile 87
			}

if($mybb->input['visibility'] == 0)

			}

if($mybb->input['visibility'] == 0)

			{

			{

				$mybb->input['visibility'] = 2;
}


				$mybb->input['visibility'] = 2;
}


Zeile 111Zeile 112
				if($mybb->input['isdefault'])
{
set_default_view($type, $vid);

				if($mybb->input['isdefault'])
{
set_default_view($type, $vid);

				}

				}

				flash_message($lang->success_view_created, "success");
admin_redirect($base_url."&vid={$vid}");
}

				flash_message($lang->success_view_created, "success");
admin_redirect($base_url."&vid={$vid}");
}

Zeile 120Zeile 121
		{
$mybb->input = array(
"perpage" => 20,

		{
$mybb->input = array(
"perpage" => 20,

			);
}


			);
}


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

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

			



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

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

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

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

Zeile 137Zeile 139
		if($errors)
{
$page->output_inline_error($errors);

		if($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
{
$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))
);
$form_container->output_row($lang->visibility, "", implode("<br />", $visibility_options));

$form_container->output_row($lang->set_as_default_view, "", $form->generate_yes_no_radio("isdefault", $mybb->input['isdefault'], array('yes' => 1, 'no' => 0)));

if(count($sort_options) > 0)
{
$sort_directions = array(
"asc" => $lang->ascending,
"desc" => $lang->descending
);
$form_container->output_row($lang->sort_results_by, "", $form->generate_select_box('sortby', $sort_options, $mybb->input['sortby'], array('id' => 'sortby'))." {$lang->in} ".$form->generate_select_box('sortorder', $sort_directions, $mybb->input['sortorder'], array('id' => 'sortorder')), 'sortby');
}

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

if($type == "user")
{
$form_container->output_row($lang->display_results_as, "", $form->generate_radio_button('view_type', 'table', $lang->table, array('checked' => ($mybb->input['view_type'] != "card" ? true : false)))."<br />".$form->generate_radio_button('view_type', 'card', $lang->business_card, array('checked' => ($mybb->input['view_type'] == "card" ? true : false))));
}

$form_container->end();

$field_select .= "<div class=\"view_fields\">\n";
$field_select .= "<div class=\"enabled\"><div class=\"fields_title\">{$lang->enabled}</div><ul id=\"fields_enabled\">\n";
if(is_array($mybb->input['fields']))
{
foreach($mybb->input['fields'] as $field)
{


if($mybb->input['visibility'] == 2)
{
$visibility_public_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))
);
$form_container->output_row($lang->visibility, "", implode("<br />", $visibility_options));

$form_container->output_row($lang->set_as_default_view, "", $form->generate_yes_no_radio("isdefault", $mybb->input['isdefault'], array('yes' => 1, 'no' => 0)));

if(count($sort_options) > 0)
{
$sort_directions = array(
"asc" => $lang->ascending,
"desc" => $lang->descending
);
$form_container->output_row($lang->sort_results_by, "", $form->generate_select_box('sortby', $sort_options, $mybb->input['sortby'], array('id' => 'sortby'))." {$lang->in} ".$form->generate_select_box('sortorder', $sort_directions, $mybb->input['sortorder'], array('id' => 'sortorder')), 'sortby');
}

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

if($type == "user")
{
$form_container->output_row($lang->display_results_as, "", $form->generate_radio_button('view_type', 'table', $lang->table, array('checked' => ($mybb->input['view_type'] != "card" ? true : false)))."<br />".$form->generate_radio_button('view_type', 'card', $lang->business_card, array('checked' => ($mybb->input['view_type'] == "card" ? true : false))));
}

$form_container->end();

$field_select .= "<div class=\"view_fields\">\n";
$field_select .= "<div class=\"enabled\"><div class=\"fields_title\">{$lang->enabled}</div><ul id=\"fields_enabled\">\n";
if(is_array($mybb->input['fields']))
{
foreach($mybb->input['fields'] as $field)
{

				if($fields[$field])
{
$field_select .= "<li id=\"field-{$field}\">{$fields[$field]['title']}</li>";

				if($fields[$field])
{
$field_select .= "<li id=\"field-{$field}\">{$fields[$field]['title']}</li>";

Zeile 199Zeile 201
				continue;
}
$field_select .= "<li id=\"field-{$key}\">{$field['title']}</li>";

				continue;
}
$field_select .= "<li id=\"field-{$key}\">{$field['title']}</li>";

		}

		}

		$field_select .= "</div></ul>\n";
$field_select .= $form->generate_hidden_field("fields_js", @implode(",", @array_keys($active)), array('id' => 'fields_js'));
$field_select = str_replace("'", "\\'", $field_select);
$field_select = str_replace("\n", "", $field_select);

		$field_select .= "</div></ul>\n";
$field_select .= $form->generate_hidden_field("fields_js", @implode(",", @array_keys($active)), array('id' => 'fields_js'));
$field_select = str_replace("'", "\\'", $field_select);
$field_select = str_replace("\n", "", $field_select);

		



		$field_select = "<script type=\"text/javascript\">
//<![CDATA[
document.write('".str_replace("/", "\/", $field_select)."');
//]]>
</script>\n";

		$field_select = "<script type=\"text/javascript\">
//<![CDATA[
document.write('".str_replace("/", "\/", $field_select)."');
//]]>
</script>\n";

		



		foreach($fields as $key => $field)
{
$field_options[$key] = $field['title'];
}

		foreach($fields as $key => $field)
{
$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";

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

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

Zeile 225Zeile 227
		// Build the search conditions
if(function_exists($conditions_callback))
{

		// Build the search conditions
if(function_exists($conditions_callback))
{

			$conditions_callback($mybb->input, $form); 

			$conditions_callback($mybb->input, $form);

		}

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

		}

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

Zeile 238Zeile 240
	{
$query = $db->simple_select("adminviews", "*", "vid='".intval($mybb->input['vid'])."'");
$admin_view = $db->fetch_array($query);

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

		



		// Does the view not exist?
if(!$admin_view['vid'] || $admin_view['visibility'] == 1 && $mybb->user['uid'] != $admin_view['uid'])
{

		// Does the view not exist?
if(!$admin_view['vid'] || $admin_view['visibility'] == 1 && $mybb->user['uid'] != $admin_view['uid'])
{

Zeile 252Zeile 254
			{
$errors[] = $lang->error_missing_view_title;
}

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

			if($mybb->input['fields_js'])
{
$mybb->input['fields'] = explode(",", $mybb->input['fields_js']);
}

			if($mybb->input['fields_js'])
{
$mybb->input['fields'] = explode(",", $mybb->input['fields_js']);
}


if(count($mybb->input['fields']) <= 0)
{


if(count($mybb->input['fields']) <= 0)
{

Zeile 275Zeile 277
			if($mybb->input['sortorder'] != "asc" && $mybb->input['sortorder'] != "desc")
{
$errors[] = $lang->error_invalid_view_sortorder;

			if($mybb->input['sortorder'] != "asc" && $mybb->input['sortorder'] != "desc")
{
$errors[] = $lang->error_invalid_view_sortorder;

			}

			}


if($mybb->input['visibility'] == 0)
{


if($mybb->input['visibility'] == 0)
{

Zeile 307Zeile 309
				admin_redirect($base_url."&vid={$admin_view['vid']}");
}
}

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

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

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

$sub_tabs = array();

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->output_row($lang->view." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');

if($mybb->input['visibility'] == 2)

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

if($mybb->input['visibility'] == 2)

		{

		{

			$visibility_public_checked = true;
}
else
{
$visibility_private_checked = true;

			$visibility_public_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)),


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

Zeile 373Zeile 376
				"desc" => $lang->descending
);
$form_container->output_row($lang->sort_results_by, "", $form->generate_select_box('sortby', $sort_options, $mybb->input['sortby'], array('id' => 'sortby'))." {$lang->in} ".$form->generate_select_box('sortorder', $sort_directions, $mybb->input['sortorder'], array('id' => 'sortorder')), 'sortby');

				"desc" => $lang->descending
);
$form_container->output_row($lang->sort_results_by, "", $form->generate_select_box('sortby', $sort_options, $mybb->input['sortby'], array('id' => 'sortby'))." {$lang->in} ".$form->generate_select_box('sortorder', $sort_directions, $mybb->input['sortorder'], array('id' => 'sortorder')), 'sortby');

		}

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

		}

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


if($type == "user")
{
$form_container->output_row($lang->display_results_as, "", $form->generate_radio_button('view_type', 'table', $lang->table, array('checked' => ($mybb->input['view_type'] != "card" ? true : false)))."<br />".$form->generate_radio_button('view_type', 'card', $lang->business_card, array('checked' => ($mybb->input['view_type'] == "card" ? true : false))));
}


if($type == "user")
{
$form_container->output_row($lang->display_results_as, "", $form->generate_radio_button('view_type', 'table', $lang->table, array('checked' => ($mybb->input['view_type'] != "card" ? true : false)))."<br />".$form->generate_radio_button('view_type', 'card', $lang->business_card, array('checked' => ($mybb->input['view_type'] == "card" ? true : false))));
}





		$form_container->end();

		$form_container->end();

		



		$field_select .= "<div class=\"view_fields\">\n";
$field_select .= "<div class=\"enabled\"><div class=\"fields_title\">{$lang->enabled}</div><ul id=\"fields_enabled\">\n";
if(is_array($mybb->input['fields']))

		$field_select .= "<div class=\"view_fields\">\n";
$field_select .= "<div class=\"enabled\"><div class=\"fields_title\">{$lang->enabled}</div><ul id=\"fields_enabled\">\n";
if(is_array($mybb->input['fields']))

Zeile 394Zeile 397
				{
$field_select .= "<li id=\"field-{$field}\">{$fields[$field]['title']}</li>";
$active[$field] = 1;

				{
$field_select .= "<li id=\"field-{$field}\">{$fields[$field]['title']}</li>";
$active[$field] = 1;

				}

				}

			}
}
$field_select .= "</ul></div>\n";

			}
}
$field_select .= "</ul></div>\n";

Zeile 414Zeile 417
		$field_select .= $form->generate_hidden_field("fields_js", @implode(",", @array_keys($active)), array('id' => 'fields_js'));
$field_select = str_replace("'", "\\'", $field_select);
$field_select = str_replace("\n", "", $field_select);

		$field_select .= $form->generate_hidden_field("fields_js", @implode(",", @array_keys($active)), array('id' => 'fields_js'));
$field_select = str_replace("'", "\\'", $field_select);
$field_select = str_replace("\n", "", $field_select);

		



		$field_select = "<script type=\"text/javascript\">
//<![CDATA[
document.write('".str_replace("/", "\/", $field_select)."');
//]]></script>\n";

		$field_select = "<script type=\"text/javascript\">
//<![CDATA[
document.write('".str_replace("/", "\/", $field_select)."');
//]]></script>\n";

		



		foreach($fields as $key => $field)
{
$field_options[$key] = $field['title'];
}

		foreach($fields as $key => $field)
{
$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";

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

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

Zeile 435Zeile 438
		if(function_exists($conditions_callback))
{
$conditions_callback($mybb->input, $form);

		if(function_exists($conditions_callback))
{
$conditions_callback($mybb->input, $form);

		}



		}



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


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


Zeile 447Zeile 450

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


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

		if($mybb->input['no']) 
{
admin_redirect($base_url."&action=views");

		if($mybb->input['no'])
{
admin_redirect($base_url."&action=views");

		}

		}

		



		$query = $db->simple_select("adminviews", "COUNT(vid) as views");
$views = $db->fetch_field($query, "views");

		$query = $db->simple_select("adminviews", "COUNT(vid) as views");
$views = $db->fetch_field($query, "views");

		



		if($views == 0)
{
flash_message($lang->error_cannot_delete_view, 'error');

		if($views == 0)
{
flash_message($lang->error_cannot_delete_view, 'error');

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

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


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

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

		



		if($mybb->request_method == "post")
{
$db->delete_query("adminviews", "vid='{$admin_view['vid']}'");

		if($mybb->request_method == "post")
{
$db->delete_query("adminviews", "vid='{$admin_view['vid']}'");

Zeile 478Zeile 482
		}
else
{

		}
else
{

			$page->output_confirm_action($base_url."&amp;action=views&amp;do=delete&amp;vid={$admin_view['vid']}", $lang->confirm_view_deletion); 

			$page->output_confirm_action($base_url."&amp;action=views&amp;do=delete&amp;vid={$admin_view['vid']}", $lang->confirm_view_deletion);

		}
}


		}
}


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

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

 

$admin_view['title'] = str_replace(']]>', ']]]]><![CDATA[>', $admin_view['title']);
$admin_view['sortby'] = str_replace(']]>', ']]]]><![CDATA[>', $admin_view['sortby']);
$admin_view['sortorder'] = str_replace(']]>', ']]]]><![CDATA[>', $admin_view['sortorder']);
$admin_view['view_type'] = str_replace(']]>', ']]]]><![CDATA[>', $admin_view['view_type']);


			$xml .= "\t<view vid=\"{$admin_view['vid']}\" uid=\"{$admin_view['uid']}\" type=\"{$admin_view['type']}\" visibility=\"{$admin_view['visibility']}\">\n";
$xml .= "\t\t<title><![CDATA[{$admin_view['title']}]]></title>\n";
$xml .= "\t\t<fields>\n";
foreach($fields as $field)

			$xml .= "\t<view vid=\"{$admin_view['vid']}\" uid=\"{$admin_view['uid']}\" type=\"{$admin_view['type']}\" visibility=\"{$admin_view['visibility']}\">\n";
$xml .= "\t\t<title><![CDATA[{$admin_view['title']}]]></title>\n";
$xml .= "\t\t<fields>\n";
foreach($fields as $field)

			{

			{

				$xml .= "\t\t\t<field name=\"{$field}\" />\n";
}
$xml .= "\t\t</fields>\n";

				$xml .= "\t\t\t<field name=\"{$field}\" />\n";
}
$xml .= "\t\t</fields>\n";

Zeile 515Zeile 525
					$condition = serialize($condition);
$is_serialized = " is_serialized=\"1\"";
}

					$condition = serialize($condition);
$is_serialized = " is_serialized=\"1\"";
}

 
				$condition = str_replace(']]>', ']]]]><![CDATA[>', $condition);

				$xml .= "\t\t\t<condition name=\"{$name}\"{$is_serialized}><![CDATA[{$condition}]]></condition>\n";
}
$xml .= "\t\t</conditions>\n";

				$xml .= "\t\t\t<condition name=\"{$name}\"{$is_serialized}><![CDATA[{$condition}]]></condition>\n";
}
$xml .= "\t\t</conditions>\n";

Zeile 532Zeile 543
		header("Pragma: no-cache");
header("Expires: 0");
echo $xml;

		header("Pragma: no-cache");
header("Expires: 0");
echo $xml;

		exit;	

		exit;

	}

// Generate a listing of all current views
else
{
$page->output_header($lang->view_manager);

	}

// Generate a listing of all current views
else
{
$page->output_header($lang->view_manager);

		



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

$table = new Table;

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

$table = new Table;

Zeile 547Zeile 558
		$table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));

$default_view = fetch_default_view($type);

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

$default_view = fetch_default_view($type);

		



		$query = $db->simple_select("adminviews", "COUNT(vid) as views");
$views = $db->fetch_field($query, "views");

		$query = $db->simple_select("adminviews", "COUNT(vid) as views");
$views = $db->fetch_field($query, "views");

		



		$query = $db->query("
SELECT v.*, u.username
FROM ".TABLE_PREFIX."adminviews v

		$query = $db->query("
SELECT v.*, u.username
FROM ".TABLE_PREFIX."adminviews v

Zeile 565Zeile 576
			{
$view_type = "default";
$default_class = "grey";

			{
$view_type = "default";
$default_class = "grey";

			}

			}

			else if($view['visibility'] == 2)
{
$view_type = "group";

			else if($view['visibility'] == 2)
{
$view_type = "group";

Zeile 573Zeile 584
				{
$created = "<br /><small>{$lang->created_by} {$view['username']}</small>";
}

				{
$created = "<br /><small>{$lang->created_by} {$view['username']}</small>";
}

			}

			}

			else
{
$view_type = "user";

			else
{
$view_type = "user";

Zeile 581Zeile 592

$default_add = '';
if($default_view == $view['vid'])


$default_add = '';
if($default_view == $view['vid'])

			{

			{

				$default_add = " ({$lang->default})";
}

				$default_add = " ({$lang->default})";
}

			





			$title_string = "view_title_{$view['vid']}";

			$title_string = "view_title_{$view['vid']}";

			



			if($lang->$title_string)
{
$view['title'] = $lang->$title_string;

			if($lang->$title_string)
{
$view['title'] = $lang->$title_string;

			}


			}


			$table->construct_cell("<div class=\"float_right\"><img src=\"styles/{$page->style}/images/icons/{$view_type}.gif\" title=\"".$lang->sprintf($lang->this_is_a_view, $view_type)."\" alt=\"{$view_type}\" /></div><div class=\"{$default_class}\"><strong><a href=\"{$base_url}&amp;action=views&amp;do=edit&amp;vid={$view['vid']}\" >{$view['title']}</a></strong>{$default_add}{$created}</div>");

			$table->construct_cell("<div class=\"float_right\"><img src=\"styles/{$page->style}/images/icons/{$view_type}.gif\" title=\"".$lang->sprintf($lang->this_is_a_view, $view_type)."\" alt=\"{$view_type}\" /></div><div class=\"{$default_class}\"><strong><a href=\"{$base_url}&amp;action=views&amp;do=edit&amp;vid={$view['vid']}\" >{$view['title']}</a></strong>{$default_add}{$created}</div>");

			



			$popup = new PopupMenu("view_{$view['vid']}", $lang->options);
$popup->add_item($lang->edit_view, "{$base_url}&amp;action=views&amp;do=edit&amp;vid={$view['vid']}");
if($view['vid'] != $default_view)
{
$popup->add_item($lang->set_as_default, "{$base_url}&amp;action=views&amp;do=set_default&amp;vid={$view['vid']}");

			$popup = new PopupMenu("view_{$view['vid']}", $lang->options);
$popup->add_item($lang->edit_view, "{$base_url}&amp;action=views&amp;do=edit&amp;vid={$view['vid']}");
if($view['vid'] != $default_view)
{
$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}')");
}

Zeile 610Zeile 621
			$table->construct_cell($controls, array("class" => "align_center"));
$table->construct_row();
}

			$table->construct_cell($controls, array("class" => "align_center"));
$table->construct_row();
}

		



		$table->output($lang->view);

		$table->output($lang->view);

		



		echo <<<LEGEND
<br />
<fieldset>

		echo <<<LEGEND
<br />
<fieldset>

Zeile 621Zeile 632
<img src="styles/{$page->style}/images/icons/group.gif" alt="{$lang->public}" style="vertical-align: middle;" /> {$lang->public_view_desc}<br />
<img src="styles/{$page->style}/images/icons/user.gif" alt="{$lang->private}" style="vertical-align: middle;" /> {$lang->private_view_desc}</fieldset>
LEGEND;

<img src="styles/{$page->style}/images/icons/group.gif" alt="{$lang->public}" style="vertical-align: middle;" /> {$lang->public_view_desc}<br />
<img src="styles/{$page->style}/images/icons/user.gif" alt="{$lang->private}" style="vertical-align: middle;" /> {$lang->private_view_desc}</fieldset>
LEGEND;

		$page->output_footer();	

		$page->output_footer();

	}
}


	}
}