Zeile 6 | Zeile 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 34 | Zeile 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"); }
|
|
|
if($mybb->input['do'] == "add") { if($mybb->request_method == "post")
| if($mybb->input['do'] == "add") { if($mybb->request_method == "post")
|
Zeile 99 | Zeile 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 121 | Zeile 123 |
---|
"perpage" => 20, ); }
|
"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."&action=views&do=add", "post");
$page->output_nav_tabs($sub_tabs, 'create_view');
| $form = new Form($base_url."&action=views&do=add", "post");
$page->output_nav_tabs($sub_tabs, 'create_view');
|
Zeile 136 | Zeile 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 198 | Zeile 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";
| $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 224 | Zeile 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 237 | Zeile 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 250 | Zeile 253 |
---|
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']) { $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) { $errors[] = $lang->error_no_view_fields; }
if(intval($mybb->input['perpage']) <= 0)
|
if(count($mybb->input['fields']) <= 0) { $errors[] = $lang->error_no_view_fields; }
if(intval($mybb->input['perpage']) <= 0)
|
{
| {
|
$errors[] = $lang->error_invalid_view_perpage;
|
$errors[] = $lang->error_invalid_view_perpage;
|
}
| }
|
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['sortorder'] != "asc" && $mybb->input['sortorder'] != "desc") { $errors[] = $lang->error_invalid_view_sortorder;
|
Zeile 289 | Zeile 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 305 | Zeile 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."&action=views&do=edit&vid={$admin_view['vid']}", "post");
$sub_tabs = array();
| $form = new Form($base_url."&action=views&do=edit&vid={$admin_view['vid']}", "post");
$sub_tabs = array();
|
Zeile 340 | Zeile 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->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)), $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 370 | Zeile 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") {
| if($type == "user") {
|
Zeile 380 | Zeile 386 |
---|
}
$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 391 | Zeile 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 .= "<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 411 | Zeile 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";
| }
$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->end();
// Build the search conditions if(function_exists($conditions_callback))
|
$form_container = new FormContainer($lang->fields_to_show); $form_container->output_row($lang->fields_to_show_desc, $description, $field_select); $form_container->end();
// Build the search conditions if(function_exists($conditions_callback))
|
{
| {
|
$conditions_callback($mybb->input, $form); }
| $conditions_callback($mybb->input, $form); }
|
Zeile 444 | Zeile 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"); }
|
$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"); }
|
|
|
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."&action=views&do=delete&vid={$admin_view['vid']}", $lang->confirm_view_deletion);
| $page->output_confirm_action($base_url."&action=views&do=delete&vid={$admin_view['vid']}", $lang->confirm_view_deletion);
|
} }
| } }
|
Zeile 495 | Zeile 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 512 | Zeile 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 529 | Zeile 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 581 | Zeile 595 |
---|
{ $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}&action=views&do=edit&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}&action=views&do=edit&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}&action=views&do=edit&vid={$view['vid']}"); if($view['vid'] != $default_view) { $popup->add_item($lang->set_as_default, "{$base_url}&action=views&do=set_default&vid={$view['vid']}");
|
$popup = new PopupMenu("view_{$view['vid']}", $lang->options); $popup->add_item($lang->edit_view, "{$base_url}&action=views&do=edit&vid={$view['vid']}"); if($view['vid'] != $default_view) { $popup->add_item($lang->set_as_default, "{$base_url}&action=views&do=set_default&vid={$view['vid']}");
|
} if($views > 1)
| }
if($views > 1 && $view['vid'] != 1)
|
{ $popup->add_item($lang->delete_view, "{$base_url}&action=views&do=delete&vid={$view['vid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_view_deletion}')"); }
| { $popup->add_item($lang->delete_view, "{$base_url}&action=views&do=delete&vid={$view['vid']}&my_post_key={$mybb->post_code}", "return AdminCP.deleteConfirmation(this, '{$lang->confirm_view_deletion}')"); }
|
Zeile 607 | Zeile 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 618 | Zeile 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();
|
} }
| } }
|