Zeile 11 | Zeile 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 64 | Zeile 64 |
---|
{ $mybb->input['fields'] = explode(",", $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; }
|
Zeile 254 | Zeile 254 |
---|
$mybb->input['fields'] = explode(",", $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; }
|
Zeile 363 | Zeile 363 |
---|
$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->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,
| { $sort_directions = array( "asc" => $lang->ascending,
|
Zeile 377 | Zeile 377 |
---|
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();
|
Zeile 399 | Zeile 399 |
---|
if(is_array($fields)) { foreach($fields as $key => $field)
|
if(is_array($fields)) { foreach($fields as $key => $field)
|
{
| {
|
if($active[$key]) { continue;
| if($active[$key]) { continue;
|
Zeile 472 | Zeile 472 |
---|
$db->delete_query("adminviews", "vid='{$admin_view['vid']}'"); flash_message($lang->success_view_deleted, 'success'); admin_redirect($base_url."&action=views");
|
$db->delete_query("adminviews", "vid='{$admin_view['vid']}'"); flash_message($lang->success_view_deleted, 'success'); admin_redirect($base_url."&action=views");
|
}
| }
|
else { $page->output_confirm_action($base_url."&action=views&do=delete&vid={$admin_view['vid']}", $lang->confirm_view_deletion);
| else { $page->output_confirm_action($base_url."&action=views&do=delete&vid={$admin_view['vid']}", $lang->confirm_view_deletion);
|
Zeile 544 | Zeile 544 |
---|
{ $page->output_header($lang->view_manager);
|
{ $page->output_header($lang->view_manager);
|
$page->output_nav_tabs($sub_tabs, 'views');
| $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));
| $table = new Table; $table->construct_header($lang->view); $table->construct_header($lang->controls, array("class" => "align_center", "width" => 150));
|
Zeile 575 | Zeile 575 |
---|
$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 { $view_type = "user";
|
} } else { $view_type = "user";
|
}
| }
|
$default_add = ''; if($default_view == $view['vid']) {
| $default_add = ''; if($default_view == $view['vid']) {
|
Zeile 655 | Zeile 656 |
---|
} }
|
} }
|
| /** * @param string $type * * @return bool|array */
|
function fetch_default_view($type) { global $mybb, $db;
| function fetch_default_view($type) { global $mybb, $db;
|