Vergleich admin/inc/functions_view_manager.php - 1.8.3 - 1.8.30

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
/**
* Builds the "view management" interface allowing administrators to edit their custom designed "views"
*

/**
* Builds the "view management" interface allowing administrators to edit their custom designed "views"
*

 * @param string The base URL to this instance of the view manager
* @param string The internal type identifier for this view
* @param array Array of fields this view supports
* @param array Array of possible sort options this view supports if any
* @param string Optional callback function which generates list of "conditions" for this view

 * @param string $base_url The base URL to this instance of the view manager
* @param string $type The internal type identifier for this view
* @param array $fields Array of fields this view supports
* @param array $sort_options Array of possible sort options this view supports if any
* @param string $conditions_callback Optional callback function which generates list of "conditions" for this view

 */
function view_manager($base_url, $type, $fields, $sort_options=array(), $conditions_callback="")
{

 */
function view_manager($base_url, $type, $fields, $sort_options=array(), $conditions_callback="")
{

Zeile 39Zeile 39

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


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

		$query = $db->simple_select("adminviews", "vid, uid, visibility", "vid='".$mybb->get_input('vid', 1)."'");

		$query = $db->simple_select("adminviews", "vid, uid, visibility", "vid='".$mybb->get_input('vid', MyBB::INPUT_INT)."'");

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

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

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

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

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


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


 
	$errors = array();

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

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

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

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

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

			if(!isset($mybb->input['fields']) || !is_array($mybb->input['fields']) || count($mybb->input['fields']) <= 0)

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


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


			if($mybb->get_input('perpage', 1) <= 0)

			if($mybb->get_input('perpage', MyBB::INPUT_INT) <= 0)

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

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

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


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


			if(!$errors)

			if(empty($errors))

			{
$new_view = array(
"uid" => $mybb->user['uid'],
"title" => $db->escape_string($mybb->input['title']),
"type" => $type,

			{
$new_view = array(
"uid" => $mybb->user['uid'],
"title" => $db->escape_string($mybb->input['title']),
"type" => $type,

					"visibility" => $mybb->get_input('visibility', 1),
"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'])),

					"visibility" => $mybb->get_input('visibility', MyBB::INPUT_INT),
"fields" => $db->escape_string(my_serialize($mybb->input['fields'])),
"conditions" => $db->escape_string(my_serialize($mybb->input['conditions'])),
"custom_profile_fields" => $db->escape_string(my_serialize($mybb->input['profile_fields'])),

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

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

					"perpage" => $mybb->get_input('perpage', 1),

					"perpage" => $mybb->get_input('perpage', MyBB::INPUT_INT),

					"view_type" => $db->escape_string($mybb->input['view_type'])
);


					"view_type" => $db->escape_string($mybb->input['view_type'])
);


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

// If we have any error messages, show them

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

// If we have any error messages, show them

		if($errors)

		if(!empty($errors))

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

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

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





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

		$visibility_public_checked = $mybb->get_input('visibility') == 2;
$visibility_private_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))
);
$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)));



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


		if(count($sort_options) > 0)
{
$sort_directions = array(
"asc" => $lang->ascending,
"desc" => $lang->descending
);

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

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

$form_container->output_row($lang->results_per_page, "", $form->generate_numeric_field('perpage', $mybb->get_input('perpage'), array('id' => 'perpage', 'min' => 1)), 'perpage');


if($type == "user")
{


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->output_row($lang->display_results_as, "", $form->generate_radio_button('view_type', 'table', $lang->table, array('checked' => ($mybb->get_input('view_type') != "card" ? true : false)))."<br />".$form->generate_radio_button('view_type', 'card', $lang->business_card, array('checked' => ($mybb->get_input('view_type') == "card" ? true : false))));

		}

$form_container->end();


		}

$form_container->end();


		$field_select .= "<div class=\"view_fields\">\n";



		$active = array();

$field_select = "<div class=\"view_fields\">\n";

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

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

		if(is_array($mybb->input['fields']))

		if(isset($mybb->input['fields']) && is_array($mybb->input['fields']))

		{
foreach($mybb->input['fields'] as $field)
{

		{
foreach($mybb->input['fields'] as $field)
{

Zeile 191Zeile 188
		$field_select .= "<div class=\"disabled\"><div class=\"fields_title\">{$lang->disabled}</div><ul id=\"fields_disabled\">\n";
foreach($fields as $key => $field)
{

		$field_select .= "<div class=\"disabled\"><div class=\"fields_title\">{$lang->disabled}</div><ul id=\"fields_disabled\">\n";
foreach($fields as $key => $field)
{

			if($active[$key])

			if(!empty($active[$key]))

			{
continue;
}

			{
continue;
}

Zeile 208Zeile 205
//]]>
</script>\n";


//]]>
</script>\n";


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

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

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


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


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

		$form_container->output_row($lang->fields_to_show_desc, $description, $field_select);

		$form_container->output_row($lang->fields_to_show_desc, '', $field_select);

		$form_container->end();

// Build the search conditions

		$form_container->end();

// Build the search conditions

Zeile 233Zeile 230
	}
else if($mybb->input['do'] == "edit")
{

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

		$query = $db->simple_select("adminviews", "*", "vid='".$mybb->get_input('vid', 1)."'");

		$query = $db->simple_select("adminviews", "*", "vid='".$mybb->get_input('vid', MyBB::INPUT_INT)."'");

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

// Does the view not exist?

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

// Does the view not exist?

Zeile 252Zeile 249
			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(!is_array($mybb->input['fields']) || count($mybb->input['fields']) <= 0)

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


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


			if($mybb->get_input('perpage', 1) <= 0)

			if($mybb->get_input('perpage', MyBB::INPUT_INT) <= 0)

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

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

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

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


			if(!$errors)

			if(empty($errors))

			{
$updated_view = array(
"title" => $db->escape_string($mybb->input['title']),
"type" => $type,

			{
$updated_view = array(
"title" => $db->escape_string($mybb->input['title']),
"type" => $type,

					"visibility" => $mybb->get_input('visibility', 1),
"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'])),

					"visibility" => $mybb->get_input('visibility', MyBB::INPUT_INT),
"fields" => $db->escape_string(my_serialize($mybb->input['fields'])),
"conditions" => $db->escape_string(my_serialize($mybb->input['conditions'])),
"custom_profile_fields" => $db->escape_string(my_serialize($mybb->input['profile_fields'])),

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

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

					"perpage" => $mybb->get_input('perpage', 1),

					"perpage" => $mybb->get_input('perpage', MyBB::INPUT_INT),

					"view_type" => $db->escape_string($mybb->input['view_type'])
);
$db->update_query("adminviews", $updated_view, "vid='{$admin_view['vid']}'");

					"view_type" => $db->escape_string($mybb->input['view_type'])
);
$db->update_query("adminviews", $updated_view, "vid='{$admin_view['vid']}'");

Zeile 302Zeile 299

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

			}

			}

		}

// Write in our JS based field selector

		}

// Write in our JS based field selector

Zeile 323Zeile 320
		$page->output_nav_tabs($sub_tabs, 'edit_view');

// If we have any error messages, show them

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

// If we have any error messages, show them

		if($errors)

		if(!empty($errors))

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

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

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

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


		$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 = $mybb->input['visibility'] == 2;
$visibility_private_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)),


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

Zeile 362Zeile 353
		$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)));

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


if(is_array($sort_options) && 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');

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


		}

$form_container->output_row($lang->results_per_page, "", $form->generate_numeric_field('perpage', $mybb->input['perpage'], array('id' => 'perpage', 'min' => 1)), '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))));

Zeile 381Zeile 372

$form_container->end();



$form_container->end();


		$field_select .= "<div class=\"view_fields\">\n";

		$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 .= "<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}\">&#149; {$fields[$field]['title']}</li>";
$active[$field] = 1;
}

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

Zeile 400Zeile 391
		{
foreach($fields as $key => $field)
{

		{
foreach($fields as $key => $field)
{

				if($active[$key])

				if(!empty($active[$key]))

				{
continue;
}

				{
continue;
}

Zeile 411Zeile 402
		$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)."');

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

Zeile 425Zeile 416
		$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);

		$form_container->output_row($lang->fields_to_show_desc, $description, $field_select);

		$form_container->output_row($lang->fields_to_show_desc, '', $field_select);

		$form_container->end();

// Build the search conditions

		$form_container->end();

// Build the search conditions

Zeile 443Zeile 434

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


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

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

		if($mybb->get_input('no'))

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

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

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


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


		$vid = $mybb->get_input('vid', 1);

		$vid = $mybb->get_input('vid', MyBB::INPUT_INT);

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


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


Zeile 515Zeile 506
				if(!$conditions) continue;
if(is_array($condition))
{

				if(!$conditions) continue;
if(is_array($condition))
{

					$condition = serialize($condition);

					$condition = my_serialize($condition);

					$is_serialized = " is_serialized=\"1\"";
}
$condition = str_replace(']]>', ']]]]><![CDATA[>', $condition);

					$is_serialized = " is_serialized=\"1\"";
}
$condition = str_replace(']]>', ']]]]><![CDATA[>', $condition);

Zeile 575Zeile 566
				$view_type = "group";
if($view['username'])
{

				$view_type = "group";
if($view['username'])
{

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


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

				}
}
else

				}
}
else

Zeile 591Zeile 583

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



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


			if($lang->$title_string)

			if(isset($lang->$title_string))

			{
$view['title'] = $lang->$title_string;
}

			{
$view['title'] = $lang->$title_string;
}

Zeile 634Zeile 626

$query = $db->simple_select("adminoptions", "defaultviews", "uid='{$mybb->user['uid']}'");
$default_views = my_unserialize($db->fetch_field($query, "defaultviews"));


$query = $db->simple_select("adminoptions", "defaultviews", "uid='{$mybb->user['uid']}'");
$default_views = my_unserialize($db->fetch_field($query, "defaultviews"));

	if(!$db->num_rows($query))
{
$create = true;
}

	$create = !$db->num_rows($query);




	$default_views[$type] = $vid;

	$default_views[$type] = $vid;

	$default_views = serialize($default_views);

	$default_views = my_serialize($default_views);

	$updated_admin = array("defaultviews" => $db->escape_string($default_views));

	$updated_admin = array("defaultviews" => $db->escape_string($default_views));





	if($create == true)

	if($create == true)

	{

	{

		$updated_admin['uid'] = $mybb->user['uid'];
$updated_admin['notes'] = '';
$updated_admin['permissions'] = '';
$db->insert_query("adminoptions", $updated_admin);

		$updated_admin['uid'] = $mybb->user['uid'];
$updated_admin['notes'] = '';
$updated_admin['permissions'] = '';
$db->insert_query("adminoptions", $updated_admin);

	}

	}

	else
{
$db->update_query("adminoptions", $updated_admin, "uid='{$mybb->user['uid']}'");
}
}


	else
{
$db->update_query("adminoptions", $updated_admin, "uid='{$mybb->user['uid']}'");
}
}


 
/**
* @param string $type
*
* @return bool|array
*/

function fetch_default_view($type)
{
global $mybb, $db;

function fetch_default_view($type)
{
global $mybb, $db;