Commit 9c5812c8 authored by theo lem's avatar theo lem
Browse files

Preparing for release v1.1

parent d05f2fe4
# Changelog
All notable changes to this project will be documented in this file.
_Note : the file `CHANGELOG.txt` is the Drupal 7 changelog. The present file lists changes made to Framaforms._
_Note : the file `CHANGELOG.txt` is the Drupal 7 changelog. The present file lists changes made to Yakforms._
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased
## [1.1] 2021/05/20
IMPORTANT NOTE : Framaforms has become Yakforms. The modules were renamed, and manual action is needed on your instance
to upgrade to the latest version. Instructions here : https://framagit.org/framasoft/framaforms/-/wikis/From-Framaforms-to-Yakforms.
to upgrade to the latest version. Instructions here : https://framagit.org/yakforms/yakforms/-/wikis/From-Framaforms-to-Yakforms.
### Added
* Option to automatically export form submissions as CSV files before deletion (#113, introducted by !85, fixed by !104).
* Introduced Drupal Token mechanism, usable on full-HTML pages (#118, !100, !107).
* jQuery warning on form modification (!109).e
* jQuery warning on form modification (!109).
* Option to set custom 'from' mail address and subject for notification emails.
* Warning message on forms where results are public (#67, !120).
* Possibility to limit the number of forms / user (#116, !126).
* Script to resend mails : `scripts/resend-mail.php` (!146).
* The custom modules (Yakforms, Yakforms Public Results and Yakforms Share Results) are now distributed on Drupal.org, allowing
easier individual modules update using Drush or the Drupal admin UI.
* The custom modules ([Yakforms](drupal.org/project/yakforms), [Yakforms Public Results](https://www.drupal.org/project/yakforms_public_results) and [Yakforms Share Results](https://www.drupal.org/project/yakforms_share_results)) are now distributed on Drupal.org, allowing easier individual modules update using Drush or the Drupal admin UI.
* Subthemes based on TailwindCSS palette, selectable by end user on forms (!163)
* Possibility to translate the node creation form.
### Changed
* The `form1` content type is now part of the Framaforms module (declared via `includes/framaforms.node.inc`) (!89).
* Added collapsible `fieldset` elements to admin menu (!93).
* The general header can now be customized through the administration menu(!96).
* Better admin menu (!93, !96).
* The HTML templates for default pages are now translatable (!99).
* Updated Drupal to 7.74 (!113)
* Better stylesheet for printing forms (!124)
* Removed Bootstrap includes from the module, the lib is now in the `framaforms` theme. (!138)
* Wide theme modifications for new graphical identity (!162)
* Drupal core and contrib module updates (!113, !150, !152).
### Fixed
* Expiration date is now modified when a form is cloned (#61)
......
......@@ -4,8 +4,8 @@ core = 7.x
dependencies[] = ctools
package = Chaos tool suite
; Information added by Drupal.org packaging script on 2020-10-23
version = "7.x-1.17"
; Information added by Drupal.org packaging script on 2021-01-30
version = "7.x-1.19"
core = "7.x"
project = "ctools"
datestamp = "1603490551"
datestamp = "1611988843"
......@@ -19,8 +19,8 @@ files[] = tests/object_cache.test
files[] = tests/object_cache_unit.test
files[] = tests/page_tokens.test
; Information added by Drupal.org packaging script on 2020-10-23
version = "7.x-1.17"
; Information added by Drupal.org packaging script on 2021-01-30
version = "7.x-1.19"
core = "7.x"
project = "ctools"
datestamp = "1603490551"
datestamp = "1611988843"
......@@ -4,8 +4,8 @@ core = 7.x
package = Chaos tool suite
dependencies[] = ctools
; Information added by Drupal.org packaging script on 2020-10-23
version = "7.x-1.17"
; Information added by Drupal.org packaging script on 2021-01-30
version = "7.x-1.19"
core = "7.x"
project = "ctools"
datestamp = "1603490551"
datestamp = "1611988843"
......@@ -4,8 +4,8 @@ package = Chaos tool suite
dependencies[] = ctools
core = 7.x
; Information added by Drupal.org packaging script on 2020-10-23
version = "7.x-1.17"
; Information added by Drupal.org packaging script on 2021-01-30
version = "7.x-1.19"
core = "7.x"
project = "ctools"
datestamp = "1603490551"
datestamp = "1611988843"
......@@ -4,8 +4,8 @@ core = 7.x
package = Chaos tool suite
dependencies[] = ctools
; Information added by Drupal.org packaging script on 2020-10-23
version = "7.x-1.17"
; Information added by Drupal.org packaging script on 2021-01-30
version = "7.x-1.19"
core = "7.x"
project = "ctools"
datestamp = "1603490551"
datestamp = "1611988843"
......@@ -7,8 +7,8 @@ dependencies[] = page_manager
dependencies[] = advanced_help
core = 7.x
; Information added by Drupal.org packaging script on 2020-10-23
version = "7.x-1.17"
; Information added by Drupal.org packaging script on 2021-01-30
version = "7.x-1.19"
core = "7.x"
project = "ctools"
datestamp = "1603490551"
datestamp = "1611988843"
......@@ -1416,16 +1416,12 @@ function ctools_context_get_context_from_relationships($relationships, &$context
if (is_array($rdata['context'])) {
$rcontexts = array();
foreach ($rdata['context'] as $cid) {
if (empty($contexts[$cid])) {
continue 2;
if (!empty($contexts[$cid])) {
$rcontexts[] = $contexts[$cid];
}
$rcontexts[] = $contexts[$cid];
}
}
else {
if (empty($contexts[$rdata['context']])) {
continue;
}
elseif (!empty($contexts[$rdata['context']])) {
$rcontexts = $contexts[$rdata['context']];
}
......
......@@ -456,18 +456,20 @@ function ctools_export_ui_switcher_page($plugin_name, $op) {
// Load the $plugin information.
$plugin = ctools_get_export_ui($plugin_name);
$handler = ctools_export_ui_get_handler($plugin);
if ($handler) {
$method = $op . '_page';
if (method_exists($handler, $method)) {
// Replace the first two arguments:
$args[0] = $js;
$args[1] = $_POST;
return call_user_func_array(array($handler, $method), $args);
}
if (!$plugin) {
return t('Configuration error. No plugin found: %plugin_name.', array('%plugin_name' => $plugin_name));
}
else {
$handler = ctools_export_ui_get_handler($plugin);
if (!$handler) {
return t('Configuration error. No handler found.');
}
$method = $op . '_page';
if (method_exists($handler, $method)) {
// Replace the first two arguments:
$args[0] = $js;
$args[1] = $_POST;
return call_user_func_array(array($handler, $method), $args);
}
}
......@@ -637,11 +637,19 @@ function ctools_get_default_object($table, $name) {
}
/**
* Get export object defaults.
*
* Call the hook to get all default objects of the given type from the
* export. If configured properly, this could include loading up an API
* to get default objects.
*
* @param string $table
* The name of the table to be loaded. Data is expected to be in the
* schema to make all this work.
* @param array $export
* The export definition from the table's hook_schema() definition.
*/
function _ctools_export_get_defaults($table, $export) {
function _ctools_export_get_defaults($table, array $export) {
$cache = &drupal_static(__FUNCTION__, array());
// If defaults may be cached, first see if we can load from cache.
......@@ -684,7 +692,8 @@ function _ctools_export_get_defaults($table, $export) {
$cache[$table][$name] = $object;
}
else {
// If version checking is enabled, ensure that the object can be used.
// If version checking is enabled, ensure that the object can be
// used.
if (isset($object->api_version) &&
version_compare($object->api_version, $export['api']['minimum_version']) >= 0 &&
version_compare($object->api_version, $export['api']['current_version']) <= 0) {
......@@ -866,6 +875,7 @@ function ctools_var_export($var, $prefix = '') {
}
else {
$output = "array(\n";
ksort($var);
foreach ($var as $key => $value) {
$output .= $prefix . " " . ctools_var_export($key) . " => " . ctools_var_export($value, $prefix . ' ') . ",\n";
}
......
......@@ -238,8 +238,6 @@ function ctools_field_label($field_name) {
function ctools_field_invoke_field($field_name, $op, $entity_type, $entity, &$a = NULL, &$b = NULL, $options = array()) {
if (is_array($field_name)) {
$instance = $field_name;
$field = empty($field_name['field']) ? field_info_field($instance['field_name']) : $field_name['field'];
$field_name = $instance['field_name'];
}
else {
list(, , $bundle) = entity_extract_ids($entity_type, $entity);
......@@ -250,6 +248,11 @@ function ctools_field_invoke_field($field_name, $op, $entity_type, $entity, &$a
return;
}
// Keep the variables consistent regardless if we retrieve the field instance
// ourself, or if one is provided to us via the $field_name variable.
$field = field_info_field($instance['field_name']);
$field_name = $instance['field_name'];
// Merge default options.
$default_options = array(
'default' => FALSE,
......
......@@ -97,7 +97,7 @@ function page_manager_page_wizard($name, $step = NULL) {
}
// Check for possibly more complex access callback on plugin.
if ($function = ctools_plugin_get_function($plugin, 'access callback') && !$function($plugin)) {
if (($function = ctools_plugin_get_function($plugin, 'access callback')) && !$function($plugin)) {
return MENU_ACCESS_DENIED;
}
......
......@@ -26,7 +26,7 @@
// Grab all the links that match this url and add the fetching class.
// This allows the caching system to grab each url once and only once
// instead of grabbing the url once per <a>.
var $objects = $('a[href="' + old_url + '"]')
var $objects = $('a[href="' + old_url + '"]');
$objects.addClass('ctools-fetching');
try {
url = old_url.replace(/\/nojs(\/|$)/g, '/ajax$1');
......
......@@ -98,5 +98,5 @@ Drupal.behaviors.CToolsAutoSubmit = {
});
});
}
}
};
})(jQuery);
......@@ -194,7 +194,7 @@
Drupal.CTools.CollapsibleCallbacksAfterToggle[i]($container, handle, content, toggle);
}
}
}
};
var clickMe = function () {
if (Drupal.CTools.CollapsibleCallbacks) {
......@@ -222,7 +222,7 @@
}
return false;
}
};
// Let both the toggle and the handle be clickable.
toggle.click(clickMe);
......@@ -237,5 +237,5 @@
attach: function(context) {
$('.ctools-collapsible-container', context).once('ctools-collapsible', Drupal.CTools.bindCollapsible);
}
}
};
})(jQuery);
......@@ -14,7 +14,7 @@
* - Checkboxes don't have their own id, so you need to add one in a div
* around the checkboxes via #prefix and #suffix. You actually need to add TWO
* divs because it's the parent that gets hidden. Also be sure to retain the
* 'expand_checkboxes' in the #process array, because the CTools process will
* 'form_process_checkboxes' in the #process array, because the CTools process will
* override it.
*/
......@@ -34,7 +34,7 @@
}
}
return false;
}
};
Drupal.CTools.dependent.autoAttach = function() {
......@@ -118,7 +118,7 @@
}
}
return val;
}
};
var setChangeTrigger = function(trigger_id, bind_id) {
// Triggered when change() is clicked.
......@@ -205,7 +205,7 @@
}
}
}
}
};
$(trigger_id).bind('change.ctools-dependent', function() {
// Trigger the internal change function
......@@ -214,11 +214,11 @@
});
// Trigger initial reaction
changeTrigger(trigger_id, bind_id);
}
};
setChangeTrigger(trigger_id, bind_id);
}
}
}
};
Drupal.behaviors.CToolsDependent = {
attach: function (context) {
......@@ -240,5 +240,5 @@
})
.trigger('change.ctools-dependent');
}
}
};
})(jQuery);
......@@ -69,7 +69,7 @@
$secondaryActions.animate({height: "show", opacity: "show"}, 100);
$dropbutton.addClass('open');
}
}
};
// Hide the secondary actions initially.
$secondaryActions.hide();
......@@ -90,5 +90,5 @@
);
});
}
}
};
})(jQuery);
......@@ -61,7 +61,7 @@
$("div.ctools-dropdown-container", $dropdown)
.animate({height: "show", opacity: "show"}, 100);
}
}
};
$("a.ctools-dropdown-link", $dropdown).click(function() {
toggle();
return false;
......@@ -83,5 +83,5 @@
);
});
}
}
};
})(jQuery);
......@@ -38,5 +38,5 @@
return false;
});
}
}
};
})(jQuery);
......@@ -86,7 +86,7 @@
'width': (width - Drupal.CTools.Modal.currentSettings.modalSize.contentRight) + 'px',
'height': (height - Drupal.CTools.Modal.currentSettings.modalSize.contentBottom) + 'px'
});
}
};
if (!Drupal.CTools.Modal.modal) {
Drupal.CTools.Modal.modal = $(Drupal.theme(settings.modalTheme));
......@@ -120,9 +120,9 @@
* Provide the HTML to create the modal dialog.
*/
Drupal.theme.prototype.CToolsModalDialog = function () {
var html = ''
html += '<div id="ctools-modal">'
html += ' <div class="ctools-modal-content">' // panels-modal-content
var html = '';
html += '<div id="ctools-modal">';
html += ' <div class="ctools-modal-content">'; // panels-modal-content
html += ' <div class="modal-header">';
html += ' <a class="close" href="#">';
html += Drupal.CTools.Modal.currentSettings.closeText + Drupal.CTools.Modal.currentSettings.closeImage;
......@@ -135,7 +135,7 @@
html += '</div>';
return html;
}
};
/**
* Provide the HTML to create the throbber.
......@@ -159,7 +159,7 @@
if (match) {
return match[1];
}
}
};
/**
* Click function for modals that can be cached.
......@@ -186,7 +186,7 @@
setTimeout(function() { Drupal.CTools.AJAX.ajaxSubmit($form, url); }, 1);
return false;
}
};
/**
* Bind links that will open modals to the appropriate function.
......@@ -250,7 +250,7 @@
element_settings.url = $this.attr('action');
element_settings.event = 'submit';
element_settings.progress = { 'type': 'throbber' }
element_settings.progress = { 'type': 'throbber' };
var base = $this.attr('id');
Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
......@@ -291,9 +291,15 @@
* AJAX responder command to place HTML within the modal.
*/
Drupal.CTools.Modal.modal_display = function(ajax, response, status) {
var settings = response.settings || ajax.settings || Drupal.settings;
// If the modal does not exist yet, create it.
if ($('#modalContent').length == 0) {
Drupal.CTools.Modal.show(Drupal.CTools.Modal.getSettings(ajax.element));
}
// If the modal exists run detachBehaviors before removing existing content.
else {
Drupal.detachBehaviors($('#modalContent'), settings, 'unload');
}
$('#modal-title').html(response.title);
// Simulate an actual page load by scrolling to the top after adding the
// content. This is helpful for allowing users to see error messages at the
......@@ -302,7 +308,6 @@
$(document).trigger('CToolsAttachBehaviors', $('#modalContent'));
// Attach behaviors within a modal dialog.
var settings = response.settings || ajax.settings || Drupal.settings;
Drupal.attachBehaviors($('#modalContent'), settings);
if ($('#modal-content').hasClass('ctools-modal-loading')) {
......@@ -315,7 +320,7 @@
// button by the show() function called above.)
$('#modal-content :focusable:first').focus();
}
}
};
/**
* AJAX responder command to dismiss the modal.
......@@ -323,7 +328,7 @@
Drupal.CTools.Modal.modal_dismiss = function(command) {
Drupal.CTools.Modal.dismiss();
$('link.ctools-temporary-css').remove();
}
};
/**
* Display loading
......@@ -334,7 +339,7 @@
output: Drupal.theme(Drupal.CTools.Modal.currentSettings.throbberTheme),
title: Drupal.CTools.Modal.currentSettings.loadingText
});
}
};
/**
* Find a URL for an AJAX button.
......@@ -590,6 +595,7 @@
$('body').unbind( 'keydown', modalTabTrapHandler );
$('.close', $modalHeader).unbind('click', modalContentClose);
$(document).unbind('keydown', modalEventEscapeCloseHandler);
$(document).trigger('CToolsCloseModalBehaviors', $('#modalContent'));
$(document).trigger('CToolsDetachBehaviors', $('#modalContent'));
// Closing animation.
......@@ -675,7 +681,7 @@
var $modalContent = $('#modalContent');
var $modalHeader = $modalContent.find('.modal-header');
$('.close', $modalHeader).unbind('click', modalContentClose);
$('body').unbind('keypress', modalEventEscapeCloseHandler);
$(document).unbind('keydown', modalEventEscapeCloseHandler);
$(document).trigger('CToolsDetachBehaviors', $modalContent);
// jQuery magic loop through the instances and run the animations or removal.
......
Supports Markdown
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