Commit 0391686e authored by Sol Villar's avatar Sol Villar Committed by topicus

NuCivic/internal#622: Removed Revert to button.

NuCivic/internal#632: Added temporal dependency with data story.

NuCivic/internal#632: Added temporal dependency with data story.

NuCivic/internal#622: Updated data_story info on makefile.

NuCivic/internal#622: Updated data_story project revision.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Fixed bug: URL aliases were overriden.

NuCivic/internal#622: Added admin page for configuration.

NuCivic/internal#622: Exported default configuration for dkan_sitewide_panelizer.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Changed status message on node creation.

NuCivic/internal#622: Clear cache after changes on panel display.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Fixed code styling.

NuCivic/internal#622: Fixed code styling.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Updated data_story revision.

NuCivic/internal#622: Updated data_story revision.
parent b49601e5
......@@ -46,6 +46,7 @@ function dkan_additional_setup() {
cache_clear_all();
features_revert(array('dkan_sitewide_search_db' => array('search_api_server')));
features_revert(array('dkan_sitewide_roles_perms' => array('user_permission', 'og_features_permission')));
features_revert(array('dkan_sitewide' => array('variable')));
unset($_SESSION['messages']['warning']);
cache_clear_all();
......
......@@ -33,11 +33,15 @@ projects[colorizer][patch][2444249] = https://www.drupal.org/files/issues/colori
projects[diff][version] = 3.2
projects[draggableviews][version] = 2.1
projects[draggableviews][subdir] = contrib
projects[fieldable_panels_panes][subdir] = contrib
projects[entityreference_filter][version] = 1.5
projects[fieldable_panels_panes][version] = 1.6
projects[honeypot][version] = 1.17
projects[fontyourface][version] = 2.8
projects[imagecache_actions][download][type] = git
projects[imagecache_actions][download][url] = "http://git.drupal.org/project/imagecache_actions.git"
projects[imagecache_actions][download][branch] = 7.x-1.x
......@@ -57,35 +61,6 @@ projects[og_moderation][patch][2231737] = https://drupal.org/files/issues/any-us
projects[defaultconfig][version] = 1.0-alpha9
projects[panelizer][version] = 3.1
projects[panelizer][subdir] = contrib
projects[defaultconfig][version] = 1.0-alpha9
projects[defaultconfig][subdir] = contrib
projects[views_autocomplete_filters][version] = 1.1
projects[views_autocomplete_filters][subdir] = contrib
projects[views_autocomplete_filters][patch][2277453] = http://drupal.org/files/issues/ViewsAutocompleteFilters-no_results_on_some_environments-2277453-1.patch
projects[views_autocomplete_filters][patch][2374709] = http://www.drupal.org/files/issues/views_autocomplete_filters-cache-2374709-2.patch
projects[views_autocomplete_filters][patch][2317351] = http://www.drupal.org/files/issues/views_autocomplete_filters-content-pane-2317351-4.patch
libraries[jquery.imagesloaded][download][type] = file
libraries[jquery.imagesloaded][download][url] = https://github.com/desandro/imagesloaded/archive/v2.1.2.tar.gz
libraries[jquery.imagesloaded][download][subtree] = imagesloaded-2.1.2
libraries[jquery.imgareaselect][download][type] = file
libraries[jquery.imgareaselect][download][url] = http://odyniec.net/projects/imgareaselect/jquery.imgareaselect-0.9.10.zip
libraries[jquery.imgareaselect][download][subtree] = jquery.imgareaselect-0.9.10
projects[panopoly_widgets][version] = 1.21
projects[panopoly_widgets][subdir] = contrib
includes[panopoly_widgets_make] = http://cgit.drupalcode.org/panopoly_widgets/plain/panopoly_widgets.make
projects[panopoly_images][version] = 1.21
projects[panopoly_images][subdir] = contrib
includes[panopoly_images_make] = http://cgit.drupalcode.org/panopoly_images/plain/panopoly_images.make
projects[panels][version] = 3.4
projects[panels][subdir] = contrib
projects[views_autocomplete_filters][version] = 1.1
projects[views_autocomplete_filters][patch][2277453] = http://drupal.org/files/issues/ViewsAutocompleteFilters-no_results_on_some_environments-2277453-1.patch
......@@ -134,7 +109,6 @@ projects[bootstrap][download][version] = 3.x
projects[bootstrap][download][type] = git
projects[bootstrap][download][revision] = "0390173732439fd60e898c7086219ab8c99c2f3d"
projects[nuboot][subdir] = contrib
projects[nuboot][download][type] = git
projects[nuboot][download][url] = https://github.com/NuCivic/nuboot.git
projects[nuboot][download][revision] = "fbd7ea2c2f1fa45a5f5a10b4215950940335879e"
......@@ -143,7 +117,7 @@ projects[nuboot][download][branch] = 7.x-1.x
projects[nuboot_radix][download][type] = git
projects[nuboot_radix][download][url] = https://github.com/NuCivic/nuboot_radix.git
projects[nuboot_radix][download][branch] = 7.x-1.x
projects[nuboot_radix][download][revision] = "7469d6a8d7fc71793f97e2e050744e92825e9d22"
projects[nuboot_radix][download][revision] = "08d5af72e590a56a2e6ec543f82957171acae245"
projects[nuboot_radix][type] = theme
projects[radix][type] = theme
......
......@@ -37,4 +37,5 @@ features[variable][] = menu_parent_page
features[variable][] = node_options_page
features[variable][] = node_preview_page
features[variable][] = node_submitted_page
features[variable][] = pathauto_node_page_pattern
features[variable][] = pathauto_node_pattern
......@@ -126,6 +126,13 @@ function dkan_sitewide_strongarm() {
$strongarm->value = 0;
$export['node_submitted_page'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'pathauto_node_page_pattern';
$strongarm->value = '[node:title]';
$export['pathauto_node_page_pattern'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
......
name = DKAN Sitewide Data Dashboard
description = DKAN module for Data Dashboard content type
core = 7.x
package = DKAN
version = 7.x-1.0
......@@ -14,6 +15,7 @@ features[ctools][] = views:views_default:3.0
features[features_api][] = api:2
features[node][] = data_dashboard
features[panelizer_defaults][] = node:data_dashboard:default:default
features[variable][] = dkan_sitewide_panelizer_data_dashboard
features[variable][] = menu_options_data_dashboard
features[variable][] = menu_parent_data_dashboard
features[variable][] = node_options_data_dashboard
......@@ -25,4 +27,4 @@ features[variable][] = panelizer_node:data_dashboard_allowed_layouts_default
features[variable][] = panelizer_node:data_dashboard_allowed_types_default
features[variable][] = panelizer_node:data_dashboard_default
features[views_view][] = data_dashboards
mtime = 1433978961
mtime = 1434478067
......@@ -10,6 +10,13 @@
function dkan_sitewide_data_dashboard_strongarm() {
$export = array();
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'dkan_sitewide_panelizer_data_dashboard';
$strongarm->value = TRUE;
$export['dkan_sitewide_panelizer_data_dashboard'] = $strongarm;
$strongarm = new stdClass();
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
......
<?php
/**
* @file
* Hooks and functions implementations for administration pages.
*/
/**
* Hook: hook_menu().
*/
function dkan_sitewide_panelizer_menu() {
$items = array();
$items['admin/config/content/dkan_panelizer'] = array(
'title' => 'Panelizer DKAN',
'description' => t('Configure DKAN module to embed panelizer layout form on content creation.'),
'page callback' => 'drupal_get_form',
'page arguments' => array('dkan_sitewide_panelizer_admin'),
'access arguments' => array('administer dkan_sitewide_panelizer settings'),
'type' => MENU_NORMAL_ITEM,
);
return $items;
}
/**
* Generation of administration form.
*/
function dkan_sitewide_panelizer_admin() {
$panelized_content_types = array();
$non_panelized_content_types = array();
$enabled_content_types = array();
// Get Panelizer handler used to check if a content type is panelized.
$handler = panelizer_entity_plugin_get_handler('node');
if (!$handler) {
return;
}
// Get all available content types.
$content_types = node_type_get_types();
foreach ($content_types as $content_type_name => $content_type_data) {
$is_panelized = $handler->is_panelized($content_type_name . '.default');
$has_default = $handler->has_default_panel($content_type_name . '.default');
if ($is_panelized && $has_default) {
$panelized_content_types[$content_type_name] = $content_type_data->name;
if (variable_get('dkan_sitewide_panelizer_' . $content_type_name)) {
$enabled_content_types[] = $content_type_name;
}
}
else {
$non_panelized_content_types[$content_type_name] = $content_type_data->name;
}
}
// Build form.
$form = array();
$form['panelized_content_types'] = array(
'#title' => t('Panelized Content Types'),
'#type' => 'checkboxes',
'#default_value' => $enabled_content_types,
'#options' => $panelized_content_types,
);
$form['non_panelized_content_types'] = array(
'#title' => t('Non panelized Content Types'),
'#type' => 'checkboxes',
'#description' => t("This content types don't have their 'default' view panelized or&nbsp;" .
"they don't have a default panel for that view.&nbsp;" .
"You can panelize them <a href='/admin/config/content/panelizer'>here</a>."),
'#disabled' => TRUE,
'#options' => $non_panelized_content_types,
);
$form['#submit'][] = 'dkan_sitewide_panelizer_admin_submit';
return system_settings_form($form);
}
/**
* Custom submit handler.
*/
function dkan_sitewide_panelizer_admin_submit($form, &$form_state) {
$config_values = array_merge($form_state['values']['panelized_content_types'],
$form_state['values']['non_panelized_content_types']);
foreach ($config_values as $content_type_name => $value) {
if ($value) {
variable_set('dkan_sitewide_panelizer_' . $content_type_name, TRUE);
}
else {
variable_set('dkan_sitewide_panelizer_' . $content_type_name, FALSE);
}
}
}
/**
*
*/
function _get_panelized_content_types() {
}
name = DKAN Sitewide Panelizer
description = DKAN module for simplifying the creation of panelized content
core = 7.x
package = DKAN
version = 7.x-1.0
......
<?php
/**
* @file
* Drupal needs this blank file.
* Module core functions.
*/
include_once 'dkan_sitewide_panelizer.admin.inc';
/**
* Hook: hook_FORM_ID_form_alter().
*/
function dkan_sitewide_panelizer_form_panels_ipe_edit_control_form_alter(&$form, &$form_state) {
// This is needed in order to alter the form AFTER panelizer.
$form['#after_build'][] = 'dkan_sitewide_panelizer_after_build';
}
/**
* Custom callback to be executed after the form is built.
*/
function dkan_sitewide_panelizer_after_build($form, &$form_state) {
// Remove 'Revert to' button.
$form['buttons']['revert_default']['#access'] = FALSE;
$form['buttons']['revert_default']['#type'] = 'hidden';
return $form;
}
/**
* Hook: hook_form_alter().
*/
function dkan_sitewide_panelizer_form_alter(&$form, &$form_state, $form_id) {
if (array_key_exists('node', $form_state)) {
......@@ -15,8 +40,16 @@ function dkan_sitewide_panelizer_form_alter(&$form, &$form_state, $form_id) {
return;
}
// Append layouts form only on node creation and when the content type is panelized.
if ((!isset($node->nid) || isset($node->is_new)) && $handler->is_panelized($node->type . '.default')) {
// Check if this functionality was enabled for the content type.
$is_enabled = variable_get('dkan_sitewide_panelizer_' . $node->type);
// Check if the default view of the content type is panelized.
$is_panelized = $handler->is_panelized($node->type . '.default');
// Check if there is a default panel for the default view.
$has_default = $handler->has_default_panel($node->type . '.default');
// Check if its a creation form.
$is_creation = (!isset($node->nid) || isset($node->is_new)) ? TRUE : FALSE;
if ($is_creation && $is_enabled && $is_panelized && $has_default) {
ctools_include('common', 'panels');
ctools_include('cleanstring');
......@@ -29,12 +62,10 @@ function dkan_sitewide_panelizer_form_alter(&$form, &$form_state, $form_id) {
// Add layout form.
$form['layout'] = array(
'#prefix' =>
'<div class="panels-choose-layout panels-layouts-checkboxes clearfix">' .
'<label>Select layout</label>' .
'<div class="form-checkboxes clearfix">',
'#suffix' =>
'</div></div>',
'#prefix' => '<div class="panels-choose-layout panels-layouts-checkboxes clearfix">' .
'<label>Select layout</label>' .
'<div class="form-checkboxes clearfix">',
'#suffix' => '</div></div>',
'#weight' => $form['additional_settings']['#weight'] - 1,
);
......@@ -65,6 +96,9 @@ function dkan_sitewide_panelizer_form_alter(&$form, &$form_state, $form_id) {
}
}
/**
* Custom submit handler.
*/
function dkan_sitewide_panelizer_node_submit($form, &$form_state) {
if (isset($form_state['node']) && is_object($form_state['node'])) {
......@@ -74,23 +108,35 @@ function dkan_sitewide_panelizer_node_submit($form, &$form_state) {
// Load entity.
$entity = entity_load_single('node', $nid);
$current_display = $entity->panelizer['default']->display;
// Clear status messages.
drupal_get_messages('status');
// Add explanatory status message.
drupal_set_message(t("Your %content_type '%title' has been created. Start adding content by clicking on the + sign on each panel.",
array('%content_type' => node_type_get_name($entity->type), '%title' => $entity->title)));
if (isset($entity->panelizer)) {
// Update display with the new layout.
$entity->panelizer['default']->display = _change_layout($form_state['values']['layout'], $current_display);
$entity->panelizer['default']->display_is_modified = TRUE;
// There is a default display.
$current_display = $entity->panelizer['default']->display;
// Update the default display with the new layout.
$entity->panelizer['default']->display = _change_layout($form_state['values']['layout'], $current_display);
$entity->panelizer['default']->display_is_modified = TRUE;
// Save entity.
entity_save('node', $entity);
// Save entity.
entity_save('node', $entity);
// Check: Setting $form_state['reditect'] did not work.
drupal_goto('node/' . $nid, array('query' => array('edit' => 'true')));
// Check: Setting $form_state['reditect'] did not work.
drupal_goto('node/' . $nid, array('query' => array('edit' => 'true')));
}
}
}
function dkan_sitewide_panelizer_preprocess_page(&$vars)
{
// Get URL parameters
/**
* Hook: hook_preprocess_page().
*/
function dkan_sitewide_panelizer_preprocess_page(&$vars) {
// Get URL parameters.
$query_params = drupal_get_query_parameters();
if (isset($query_params['edit']) && $query_params['edit'] == 'true') {
......@@ -110,6 +156,9 @@ function dkan_sitewide_panelizer_preprocess_page(&$vars)
}
}
/**
* Change current layout to new layout.
*/
function _change_layout($new_layout_name, $old_display) {
// Create new display.
......@@ -129,7 +178,7 @@ function _change_layout($new_layout_name, $old_display) {
// Get current panes.
$current_panes = $old_display->content;
foreach($current_panes as $pid => $pane) {
foreach ($current_panes as $pid => $pane) {
$pane->panel = $default_region;
......@@ -139,4 +188,4 @@ function _change_layout($new_layout_name, $old_display) {
}
return $new_display;
}
\ No newline at end of file
}
jQuery(document).ready(function() {
// Is there a better way to do this?
jQuery('#panels-ipe-customize-page').trigger('click');
});
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