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

  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 5823 2012-05-03 15:40:09Z Tomm $

 * $Id$

 */

/**

 */

/**

Zeile 53Zeile 53
		flash_message($lang->succuss_view_set_as_default, 'success');
admin_redirect($base_url."&action=views");
}

		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 69Zeile 69
			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)

			if(intval($mybb->input['perpage']) <= 0)

			{

			{

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

if(!in_array($mybb->input['sortby'], array_keys($sort_options)))
{
$errors[] = $lang->error_invalid_view_sortby;

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

if(!in_array($mybb->input['sortby'], array_keys($sort_options)))
{
$errors[] = $lang->error_invalid_view_sortby;

			}


			}


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

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

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

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

			{

			{

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


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


Zeile 121Zeile 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";

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

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





		// If we have any error messages, show them
if($errors)
{
$page->output_inline_error($errors);
}


		// If we have any error messages, show them
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');

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>";
$active[$field] = 1;
}
}

		$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($fields[$field])
{
$field_select .= "<li id=\"field-{$field}\">{$fields[$field]['title']}</li>";
$active[$field] = 1;
}
}

		}
$field_select .= "</ul></div>\n";
$field_select .= "<div class=\"disabled\"><div class=\"fields_title\">{$lang->disabled}</div><ul id=\"fields_disabled\">\n";

		}
$field_select .= "</ul></div>\n";
$field_select .= "<div class=\"disabled\"><div class=\"fields_title\">{$lang->disabled}</div><ul id=\"fields_disabled\">\n";

Zeile 199Zeile 199
			if($active[$key])
{
continue;

			if($active[$key])
{
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 .= "<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 = "<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";


$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 226Zeile 226

// 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);
$form->output_submit_wrapper($buttons);


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

Zeile 240Zeile 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 255Zeile 255
				$errors[] = $lang->error_missing_view_title;
}
if($mybb->input['fields_js'])

				$errors[] = $lang->error_missing_view_title;
}
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)

			if(intval($mybb->input['perpage']) <= 0)

			{

			{

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

if(!in_array($mybb->input['sortby'], array_keys($sort_options)))
{
$errors[] = $lang->error_invalid_view_sortby;

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

if(!in_array($mybb->input['sortby'], array_keys($sort_options)))
{
$errors[] = $lang->error_invalid_view_sortby;

			}


			}


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

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

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

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

			{

			{

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


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


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

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

		



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

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

$sub_tabs = array();

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

$sub_tabs = array();

Zeile 330Zeile 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);
}

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

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

		else
{
$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['isdefault'] = 0;
$default_view = fetch_default_view($type);


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


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


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

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

Zeile 376Zeile 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 417Zeile 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 438Zeile 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 450Zeile 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');
admin_redirect($base_url."&action=views");
}

		if($views == 0)
{
flash_message($lang->error_cannot_delete_view, 'error');
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);

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

		



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

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

		



		if($mybb->request_method == "post")
{
$db->delete_query("adminviews", "vid='{$admin_view['vid']}'");
flash_message($lang->success_view_deleted, 'success');
admin_redirect($base_url."&action=views");

		if($mybb->request_method == "post")
{
$db->delete_query("adminviews", "vid='{$admin_view['vid']}'");
flash_message($lang->success_view_deleted, 'success');
admin_redirect($base_url."&action=views");

		}

		}

		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 502Zeile 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 519Zeile 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 536Zeile 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;
$table->construct_header($lang->view);
$table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));

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

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





		$default_view = fetch_default_view($type);

		$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 577Zeile 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 585Zeile 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 && $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}')");

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

Zeile 614Zeile 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 625Zeile 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();

	}
}


	}
}