Commit 94dd5d9b authored by m.stenta's avatar m.stenta
Browse files

Move logs View into new log_plan module.

parent 1a559270
......@@ -328,17 +328,6 @@ function log_log_update($log) {
log_name_generate($log);
}
/***************************************************************
* Views hooks
* *************************************************************/
/**
* Implements hook_views_api().
*/
function log_views_api() {
return array("version" => "3.0");
}
/***************************************************************
* Access functions
* *************************************************************/
......
name = "Log Plan"
description = "A planning module that utilizes log entities."
core = 7.x
package = "Log"
dependencies[] = log
\ No newline at end of file
<?php
/**
* @file
* Log Plan
* A planning module that utilizes log entities.
*/
/****************************************************************
* Drupal hooks
* **************************************************************/
/**
* Implements hook_permission().
*/
function log_plan_permission() {
$perms = array(
'view log plan' => array(
'title' => t('View log plan'),
'description' => t('Allow access to the log plan View at /plan'),
),
);
return $perms;
}
/**
* Implements hook_admin_paths().
*/
function log_plan_admin_paths() {
// Display log paths with the admin theme, if specified.
if (variable_get('log_admin_theme', TRUE)) {
$paths = array(
'plan*' => TRUE,
);
return $paths;
}
}
/***************************************************************
* Views hooks
* *************************************************************/
/**
* Implements hook_views_api().
*/
function log_plan_views_api() {
return array('version' => 3);
}
\ No newline at end of file
<?php
/**
* @file
* Default log Views
* Default log plan Views
*/
/**
* Implements hook_views_default_views().
*/
function log_views_default_views() {
function log_plan_views_default_views() {
$export = array();
$view = new view();
$view->name = 'logs';
$view->description = '';
$view->tag = 'default';
$view->name = 'log_plan';
$view->description = 'A View of log entities for planning purposes.';
$view->tag = 'log';
$view->base_table = 'log';
$view->human_name = 'Logs';
$view->human_name = 'Log Plan';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Logs';
$handler->display->display_options['title'] = 'Plan';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['access']['perm'] = 'view any log entities';
$handler->display->display_options['access']['perm'] = 'view log plan';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
......@@ -43,36 +43,36 @@ function log_views_default_views() {
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
'id' => array(
'sortable' => 1,
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'name' => array(
'sortable' => 1,
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'type' => array(
'sortable' => 1,
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'created' => array(
'sortable' => 1,
'default_sort_order' => 'desc',
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
'changed' => array(
'sortable' => 1,
'default_sort_order' => 'desc',
'sortable' => 0,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
......@@ -83,12 +83,6 @@ function log_views_default_views() {
'empty_column' => 0,
),
);
/* Header: Global: Unfiltered text */
$handler->display->display_options['header']['area_text_custom']['id'] = 'area_text_custom';
$handler->display->display_options['header']['area_text_custom']['table'] = 'views';
$handler->display->display_options['header']['area_text_custom']['field'] = 'area_text_custom';
$handler->display->display_options['header']['area_text_custom']['empty'] = TRUE;
$handler->display->display_options['header']['area_text_custom']['content'] = '<a href="/log/add">+ Create a log entry</a>';
/* Field: Log: Log ID */
$handler->display->display_options['fields']['id']['id'] = 'id';
$handler->display->display_options['fields']['id']['table'] = 'log';
......@@ -105,28 +99,10 @@ function log_views_default_views() {
$handler->display->display_options['fields']['type']['id'] = 'type';
$handler->display->display_options['fields']['type']['table'] = 'log';
$handler->display->display_options['fields']['type']['field'] = 'type';
/* Field: Log: Created */
$handler->display->display_options['fields']['created']['id'] = 'created';
$handler->display->display_options['fields']['created']['table'] = 'log';
$handler->display->display_options['fields']['created']['field'] = 'created';
$handler->display->display_options['fields']['created']['date_format'] = 'short';
/* Field: Log: Changed */
$handler->display->display_options['fields']['changed']['id'] = 'changed';
$handler->display->display_options['fields']['changed']['table'] = 'log';
$handler->display->display_options['fields']['changed']['field'] = 'changed';
$handler->display->display_options['fields']['changed']['date_format'] = 'short';
/* Field: Global: Custom text */
$handler->display->display_options['fields']['nothing']['id'] = 'nothing';
$handler->display->display_options['fields']['nothing']['table'] = 'views';
$handler->display->display_options['fields']['nothing']['field'] = 'nothing';
$handler->display->display_options['fields']['nothing']['label'] = 'Operations';
$handler->display->display_options['fields']['nothing']['alter']['text'] = '<a href="/log/[id]/edit?destination=logs/all">Edit</a> | <a href="/log/[id]/delete?destination=logs/all">Delete</a>';
/* Sort criterion: Log: Changed */
$handler->display->display_options['sorts']['changed']['id'] = 'changed';
$handler->display->display_options['sorts']['changed']['table'] = 'log';
$handler->display->display_options['sorts']['changed']['field'] = 'changed';
$handler->display->display_options['sorts']['changed']['order'] = 'DESC';
$handler->display->display_options['sorts']['changed']['expose']['label'] = 'Modified date';
/* Sort criterion: Log: Log ID */
$handler->display->display_options['sorts']['id']['id'] = 'id';
$handler->display->display_options['sorts']['id']['table'] = 'log';
$handler->display->display_options['sorts']['id']['field'] = 'id';
/* Filter criterion: Log: Name */
$handler->display->display_options['filters']['name']['id'] = 'name';
$handler->display->display_options['filters']['name']['table'] = 'log';
......@@ -135,14 +111,9 @@ function log_views_default_views() {
$handler->display->display_options['filters']['name']['group'] = 1;
$handler->display->display_options['filters']['name']['exposed'] = TRUE;
$handler->display->display_options['filters']['name']['expose']['operator_id'] = 'name_op';
$handler->display->display_options['filters']['name']['expose']['label'] = 'Name';
$handler->display->display_options['filters']['name']['expose']['use_operator'] = TRUE;
$handler->display->display_options['filters']['name']['expose']['label'] = 'Search';
$handler->display->display_options['filters']['name']['expose']['operator'] = 'name_op';
$handler->display->display_options['filters']['name']['expose']['identifier'] = 'name';
$handler->display->display_options['filters']['name']['expose']['remember_roles'] = array(
2 => '2',
1 => 0,
);
/* Filter criterion: Log: Log type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'log';
......@@ -153,55 +124,21 @@ function log_views_default_views() {
$handler->display->display_options['filters']['type']['expose']['label'] = 'Type';
$handler->display->display_options['filters']['type']['expose']['operator'] = 'type_op';
$handler->display->display_options['filters']['type']['expose']['identifier'] = 'type';
$handler->display->display_options['filters']['type']['expose']['multiple'] = TRUE;
$handler->display->display_options['filters']['type']['expose']['remember_roles'] = array(
2 => '2',
1 => 0,
);
/* Filter criterion: Log: Created */
$handler->display->display_options['filters']['created']['id'] = 'created';
$handler->display->display_options['filters']['created']['table'] = 'log';
$handler->display->display_options['filters']['created']['field'] = 'created';
$handler->display->display_options['filters']['created']['group'] = 1;
$handler->display->display_options['filters']['created']['exposed'] = TRUE;
$handler->display->display_options['filters']['created']['expose']['operator_id'] = 'created_op';
$handler->display->display_options['filters']['created']['expose']['label'] = 'Created date';
$handler->display->display_options['filters']['created']['expose']['use_operator'] = TRUE;
$handler->display->display_options['filters']['created']['expose']['operator'] = 'created_op';
$handler->display->display_options['filters']['created']['expose']['identifier'] = 'created';
$handler->display->display_options['filters']['created']['expose']['remember_roles'] = array(
2 => '2',
1 => 0,
);
/* Filter criterion: Log: Changed */
$handler->display->display_options['filters']['changed']['id'] = 'changed';
$handler->display->display_options['filters']['changed']['table'] = 'log';
$handler->display->display_options['filters']['changed']['field'] = 'changed';
$handler->display->display_options['filters']['changed']['group'] = 1;
$handler->display->display_options['filters']['changed']['exposed'] = TRUE;
$handler->display->display_options['filters']['changed']['expose']['operator_id'] = 'changed_op';
$handler->display->display_options['filters']['changed']['expose']['label'] = 'Changed date';
$handler->display->display_options['filters']['changed']['expose']['use_operator'] = TRUE;
$handler->display->display_options['filters']['changed']['expose']['operator'] = 'changed_op';
$handler->display->display_options['filters']['changed']['expose']['identifier'] = 'changed';
$handler->display->display_options['filters']['changed']['expose']['remember_roles'] = array(
2 => '2',
1 => 0,
);
/* Display: All logs */
$handler = $view->new_display('page', 'All logs', 'page');
$handler->display->display_options['path'] = 'logs/all';
$handler->display->display_options['menu']['type'] = 'default tab';
$handler->display->display_options['menu']['title'] = 'All Logs';
/* Display: Plan */
$handler = $view->new_display('page', 'Plan', 'page');
$handler->display->display_options['path'] = 'plan';
$handler->display->display_options['menu']['type'] = 'normal';
$handler->display->display_options['menu']['title'] = 'Plan';
$handler->display->display_options['menu']['weight'] = '0';
$handler->display->display_options['menu']['name'] = 'management';
$handler->display->display_options['menu']['context'] = 0;
$handler->display->display_options['menu']['context_only_inline'] = 0;
$handler->display->display_options['tab_options']['type'] = 'normal';
$handler->display->display_options['tab_options']['title'] = 'Logs';
$handler->display->display_options['tab_options']['weight'] = '0';
$export['logs'] = $view;
$export['log_plan'] = $view;
return $export;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment