Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues/79 #102

Open
wants to merge 3 commits into
base: 7.x-4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drupal-org.make
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ projects[watcher][version] = "1.0"
projects[webform][version] = "3.27"
projects[wysiwyg][version] = "2.4"
projects[wysiwyg_filter][version] = "1.6-rc9"
projects[save_draft][version] = "1.4"

; Themes
projects[bootstrap][version] = "3.15"
Expand Down
8 changes: 8 additions & 0 deletions modules/custom/ideal_idea/ideal_idea.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

/**
* Implements hook_install().
*/
function ideal_idea_install() {
db_query("UPDATE {system} SET weight = 1 WHERE name = 'ideal_idea'");
}
17 changes: 16 additions & 1 deletion modules/custom/ideal_idea/ideal_idea.module
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ function ideal_idea_form_alter(&$form, &$form_state, $form_id) {
'#weight' => 4,
'#attributes' => array('class' => array('go-back'), 'onClick' => 'history.go(-1);'),
);

if (isset($form['actions']['draft'])) {
$id = array_search('save_draft_submit', $form['actions']['draft']['#submit']);
if (is_numeric($id)) {
$form['actions']['draft']['#submit'][$id] = 'ideal_idea_node_form_draft_submit';
}
}

/*
*************************************************
* This whole block is commented out since there is a problem with the drag n drop module(s).
Expand Down Expand Up @@ -183,4 +191,11 @@ function ideal_render_popup_markup($header = '', $body, $buttons = ''){
</div>';
return $output;
}
?>

function ideal_idea_node_form_draft_submit($form, &$form_state) {
node_form_submit($form, $form_state);
if (!empty($form_state['nid'])) {
$nid = $form_state['nid'];
$form_state['redirect'] = ['node/' . $nid . '/edit'];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ function fe_permissions_user_default_permissions() {
'module' => 'nodequeue',
);

// Exported permission: 'save draft'.
$permissions['save draft'] = array(
'name' => 'save draft',
'roles' => array(
'administrator' => 'administrator',
'anonymous user' => 'anonymous user',
'authenticated user' => 'authenticated user',
),
'module' => 'save_draft',
);

// Exported permission: 'view analytics dashboard'.
$permissions['view analytics dashboard'] = array(
'name' => 'view analytics dashboard',
Expand Down
2 changes: 2 additions & 0 deletions modules/features/fe_permissions/fe_permissions.info
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies[] = dashboard
dependencies[] = features
dependencies[] = node
dependencies[] = nodequeue
dependencies[] = save_draft
dependencies[] = statistics
dependencies[] = system
dependencies[] = user
Expand All @@ -27,6 +28,7 @@ features[user_permission][] = administer nodes
features[user_permission][] = administer users
features[user_permission][] = bypass node access
features[user_permission][] = manipulate all queues
features[user_permission][] = save draft
features[user_permission][] = view analytics dashboard
features[user_permission][] = view the administration theme
features_exclude[dependencies][admin_menu] = admin_menu
1 change: 1 addition & 0 deletions modules/features/fe_user/fe_user.info
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies[] = user
dependencies[] = userpoints
dependencies[] = userpoints_rules
dependencies[] = views
dependencies[] = views_bootstrap
dependencies[] = voting_rules
dependencies[] = watcher
features[context][] = user_page
Expand Down
91 changes: 91 additions & 0 deletions modules/features/fe_user/fe_user.views_default.inc
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,97 @@ function fe_user_views_default_views() {
$handler->display->display_options['row_plugin'] = 'node';
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['block_description'] = 'View: User Page: User ideas';

/* Display: User Draft Ideas */
$handler = $view->new_display('page', 'User Draft Ideas', 'draft');
$handler->display->display_options['defaults']['access'] = FALSE;
$handler->display->display_options['access']['type'] = 'role';
$handler->display->display_options['access']['role'] = array(
2 => '2',
);
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'views_bootstrap_table_plugin_style';
$handler->display->display_options['style_options']['default_row_class'] = FALSE;
$handler->display->display_options['style_options']['columns'] = array(
'title' => 'title',
);
$handler->display->display_options['style_options']['default'] = '-1';
$handler->display->display_options['style_options']['info'] = array(
'title' => array(
'sortable' => 1,
'default_sort_order' => 'asc',
'align' => '',
'separator' => '',
'empty_column' => 0,
),
);
$handler->display->display_options['style_options']['bootstrap_styles'] = array(
'striped' => 0,
'bordered' => 0,
'hover' => 0,
'condensed' => 0,
);
$handler->display->display_options['style_options']['responsive'] = 0;
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = FALSE;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = FALSE;
/* Field: Content: Body */
$handler->display->display_options['fields']['body']['id'] = 'body';
$handler->display->display_options['fields']['body']['table'] = 'field_data_body';
$handler->display->display_options['fields']['body']['field'] = 'body';
$handler->display->display_options['fields']['body']['type'] = 'text_summary_or_trimmed';
$handler->display->display_options['fields']['body']['settings'] = array(
'trim_length' => '600',
);
/* Field: Content: Is Part Of A Challenge */
$handler->display->display_options['fields']['field_challenge_ref']['id'] = 'field_challenge_ref';
$handler->display->display_options['fields']['field_challenge_ref']['table'] = 'field_data_field_challenge_ref';
$handler->display->display_options['fields']['field_challenge_ref']['field'] = 'field_challenge_ref';
$handler->display->display_options['fields']['field_challenge_ref']['settings'] = array(
'bypass_access' => 0,
'link' => 0,
);
/* Field: Content: Updated date */
$handler->display->display_options['fields']['changed']['id'] = 'changed';
$handler->display->display_options['fields']['changed']['table'] = 'node';
$handler->display->display_options['fields']['changed']['field'] = 'changed';
$handler->display->display_options['fields']['changed']['label'] = 'Last Updated';
$handler->display->display_options['fields']['changed']['date_format'] = 'long';
$handler->display->display_options['fields']['changed']['second_date_format'] = 'long';
/* Field: Content: Edit link */
$handler->display->display_options['fields']['edit_node']['id'] = 'edit_node';
$handler->display->display_options['fields']['edit_node']['table'] = 'views_entity_node';
$handler->display->display_options['fields']['edit_node']['field'] = 'edit_node';
$handler->display->display_options['defaults']['filter_groups'] = FALSE;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = '0';
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;
/* Filter criterion: Content: Type */
$handler->display->display_options['filters']['type']['id'] = 'type';
$handler->display->display_options['filters']['type']['table'] = 'node';
$handler->display->display_options['filters']['type']['field'] = 'type';
$handler->display->display_options['filters']['type']['value'] = array(
'idea' => 'idea',
);
$handler->display->display_options['path'] = 'user/%/draft';
$handler->display->display_options['menu']['type'] = 'tab';
$handler->display->display_options['menu']['title'] = 'My Draft Ideas';
$handler->display->display_options['menu']['weight'] = '0';
$handler->display->display_options['menu']['context'] = 0;
$handler->display->display_options['menu']['context_only_inline'] = 0;
$export['user_ideas'] = $view;

return $export;
Expand Down