Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentTorregrosa committed Aug 26, 2016
2 parents 4bbeb79 + e8a898d commit b6af696
Show file tree
Hide file tree
Showing 79 changed files with 4,132 additions and 3,607 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ package = Chaos tool suite
version = CTOOLS_MODULE_VERSION


; Information added by Drupal.org packaging script on 2015-08-19
version = "7.x-1.9"
; Information added by Drupal.org packaging script on 2016-08-17
version = "7.x-1.10"
core = "7.x"
project = "ctools"
datestamp = "1440020680"
datestamp = "1471454104"

7 changes: 3 additions & 4 deletions www7/sites/all/modules/contrib/ctools/ctools.info
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ name = Chaos tools
description = A library of helpful tools by Merlin of Chaos.
core = 7.x
package = Chaos tool suite
version = CTOOLS_MODULE_VERSION
files[] = includes/context.inc
files[] = includes/css-cache.inc
files[] = includes/math-expr.inc
files[] = includes/stylizer.inc
files[] = tests/css_cache.test

; Information added by Drupal.org packaging script on 2015-08-19
version = "7.x-1.9"
; Information added by Drupal.org packaging script on 2016-08-17
version = "7.x-1.10"
core = "7.x"
project = "ctools"
datestamp = "1440020680"
datestamp = "1471454104"

8 changes: 7 additions & 1 deletion www7/sites/all/modules/contrib/ctools/ctools.module
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ define('CTOOLS_API_VERSION', '2.0.8');
* ; Requires CTools v7.x-1.4 or newer.
* dependencies[] = ctools (>=1.4)
*/
define('CTOOLS_MODULE_VERSION', '7.x-1.9');
define('CTOOLS_MODULE_VERSION', '7.x-1.10');

/**
* Test the CTools API version.
Expand Down Expand Up @@ -758,6 +758,12 @@ function ctools_process(&$variables, $hook) {
$variables['classes_array'] = array_diff($variables['classes_array'], $remove_classes);
}

// Update the classes within the attributes array to match the classes array
if (isset($variables['attributes_array']['class'])) {
$variables['attributes_array']['class'] = $variables['classes_array'];
$variables['attributes'] = $variables['attributes_array'] ? drupal_attributes($variables['attributes_array']) : '';
}

// Since this runs after template_process(), we need to re-implode the
// classes array.
$variables['classes'] = implode(' ', $variables['classes_array']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ package = Chaos tool suite
version = CTOOLS_MODULE_VERSION
dependencies[] = ctools

; Information added by Drupal.org packaging script on 2015-08-19
version = "7.x-1.9"
; Information added by Drupal.org packaging script on 2016-08-17
version = "7.x-1.10"
core = "7.x"
project = "ctools"
datestamp = "1440020680"
datestamp = "1471454104"

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ version = CTOOLS_MODULE_VERSION
dependencies[] = ctools
core = 7.x

; Information added by Drupal.org packaging script on 2015-08-19
version = "7.x-1.9"
; Information added by Drupal.org packaging script on 2016-08-17
version = "7.x-1.10"
core = "7.x"
project = "ctools"
datestamp = "1440020680"
datestamp = "1471454104"

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ package = Chaos tool suite
version = CTOOLS_MODULE_VERSION
dependencies[] = ctools

; Information added by Drupal.org packaging script on 2015-08-19
version = "7.x-1.9"
; Information added by Drupal.org packaging script on 2016-08-17
version = "7.x-1.10"
core = "7.x"
project = "ctools"
datestamp = "1440020680"
datestamp = "1471454104"

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ function edit_form(&$form, &$form_state) {
'#title' => t('Title'),
);

$form['title_heading'] = array(
'#title' => t('Title heading'),
'#type' => 'select',
'#default_value' => isset($form_state['item']->settings['title_heading']) ? $form_state['item']->settings['title_heading'] : 'h2',
'#options' => array(
'h1' => t('h1'),
'h2' => t('h2'),
'h3' => t('h3'),
'h4' => t('h4'),
'h5' => t('h5'),
'h6' => t('h6'),
'div' => t('div'),
'span' => t('span'),
),
);

$form['body'] = array(
'#type' => 'text_format',
'#title' => t('Body'),
Expand All @@ -43,6 +59,7 @@ function edit_form_submit(&$form, &$form_state) {

// Since items in our settings are not in the schema, we have to do these manually:
$form_state['item']->settings['title'] = $form_state['values']['title'];
$form_state['item']->settings['title_heading'] = $form_state['values']['title_heading'];
$form_state['item']->settings['body'] = $form_state['values']['body']['value'];
$form_state['item']->settings['format'] = $form_state['values']['body']['format'];
$form_state['item']->settings['substitute'] = $form_state['values']['substitute'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ dependencies[] = page_manager
dependencies[] = advanced_help
core = 7.x

; Information added by Drupal.org packaging script on 2015-08-19
version = "7.x-1.9"
; Information added by Drupal.org packaging script on 2016-08-17
version = "7.x-1.10"
core = "7.x"
project = "ctools"
datestamp = "1440020680"
datestamp = "1471454104"

10 changes: 3 additions & 7 deletions www7/sites/all/modules/contrib/ctools/includes/context.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ctools_context {
var $restrictions = array();
var $empty = FALSE;

function ctools_context($type = 'none', $data = NULL) {
function __construct($type = 'none', $data = NULL) {
$this->type = $type;
$this->data = $data;
$this->title = t('Unknown context');
Expand Down Expand Up @@ -119,7 +119,7 @@ class ctools_context_required {
* @param ...
* One or more keywords to use for matching which contexts are allowed.
*/
function ctools_context_required($title) {
function __construct($title) {
$args = func_get_args();
$this->title = array_shift($args);

Expand Down Expand Up @@ -204,10 +204,6 @@ class ctools_context_required {
*/
class ctools_context_optional extends ctools_context_required {
var $required = FALSE;
function ctools_context_optional() {
$args = func_get_args();
call_user_func_array(array($this, 'ctools_context_required'), $args);
}

/**
* Add the 'empty' context which is possible for optional
Expand Down Expand Up @@ -1163,7 +1159,7 @@ function ctools_context_match_required_contexts($required, $contexts) {
}

foreach ($required as $r) {
$context = clone(array_shift($contexts));
$context = clone array_shift($contexts);
$context->identifier = $r['identifier'];
$context->page_title = isset($r['title']) ? $r['title'] : '';
$context->keyword = $r['keyword'];
Expand Down
2 changes: 1 addition & 1 deletion www7/sites/all/modules/contrib/ctools/includes/export.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ function ctools_export_default_to_hook_code($schema, $table, $names, $name) {
$output .= " \${$export['identifier']}s = array();\n\n";
foreach ($objects as $object) {
$output .= ctools_export_crud_export($table, $object, ' ');
$output .= " \${$export['identifier']}s['" . check_plain($object->$export['key']) . "'] = \${$export['identifier']};\n\n";
$output .= " \${$export['identifier']}s['" . check_plain($object->{$export['key']}) . "'] = \${$export['identifier']};\n\n";
}
$output .= " return \${$export['identifier']}s;\n";
$output .= "}\n";
Expand Down
3 changes: 1 addition & 2 deletions www7/sites/all/modules/contrib/ctools/includes/fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,14 @@ function ctools_fields_get_field_formatter_settings_form($field, $formatter_type
*/
function ctools_fields_get_field_formatter_info($fields) {
$info = array();
$field_info = module_invoke_all('field_formatter_info');
$field_info = field_info_formatter_types();
foreach ($fields as $field) {
foreach ($field_info as $format_name => $formatter_info) {
if (in_array($field['type'], $formatter_info['field types'])) {
$info += array($format_name => $formatter_info);
}
}
}
drupal_alter('field_formatter_info', $info);
return $info;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ctools_math_expr {
'sqrt','abs','ln','log',
'time', 'ceil', 'floor', 'min', 'max', 'round');

function ctools_math_expr() {
function __construct() {
// make the variables a little more accurate
$this->v['pi'] = pi();
$this->v['e'] = exp(1);
Expand Down
2 changes: 1 addition & 1 deletion www7/sites/all/modules/contrib/ctools/includes/plugins.inc
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ function ctools_plugin_load_includes($info, $filename = NULL) {
}
else {

require_once DRUPAL_ROOT . '/' . $file->uri;
include_once DRUPAL_ROOT . '/' . $file->uri;
// .inc files have a special format for the hook identifier.
// For example, 'foo.inc' in the module 'mogul' using the plugin
// whose hook is named 'borg_type' should have a function named (deep breath)
Expand Down
51 changes: 32 additions & 19 deletions www7/sites/all/modules/contrib/ctools/js/dependent.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@
else {
switch ($(trigger).attr('type')) {
case 'checkbox':
var val = $(trigger).attr('checked') ? true : false;
// **This check determines if using a jQuery version 1.7 or newer which requires the use of the prop function instead of the attr function when not called on an attribute
if ($().prop) {
var val = $(trigger).prop('checked') ? true : false;
}
else {
var val = $(trigger).attr('checked') ? true : false;
}

if (val) {
$(trigger).siblings('label').removeClass('hidden-options').addClass('expanded-options');
Expand Down Expand Up @@ -148,34 +154,41 @@
len++;
}

var object = $('#' + id + '-wrapper');
if (!object.size()) {
// Some elements can't use the parent() method or they can
// damage things. They are guaranteed to have wrappers but
// only if dependent.inc provided them. This check prevents
// problems when multiple AJAX calls cause settings to build
// up.
var $original = $('#' + id);
if ($original.is('fieldset') || $original.is('textarea')) {
continue;
}

object = $('#' + id).parent();
var $original = $('#' + id);
if ($original.is('fieldset') || $original.is('textarea')) {
continue;
}

var object = $original.parent();

if (Drupal.settings.CTools.dependent[id].type == 'disable') {
if (Drupal.settings.CTools.dependent[id].num <= len) {
// Show if the element if criteria is matched
object.attr('disabled', false);
object.addClass('dependent-options');
object.children().attr('disabled', false);
// **This check determines if using a jQuery version 1.7 or newer which requires the use of the prop function instead of the attr function when not called on an attribute
if (typeof $().prop == 'function') {
object.prop('disabled', false);
object.addClass('dependent-options');
object.children().prop('disabled', false);
}
else {
object.attr('disabled', false);
object.addClass('dependent-options');
object.children().attr('disabled', false);
}
}
else {
// Otherwise hide. Use css rather than hide() because hide()
// does not work if the item is already hidden, for example,
// in a collapsed fieldset.
object.attr('disabled', true);
object.children().attr('disabled', true);
// **This check determines if using a jQuery version 1.7 or newer which requires the use of the prop function instead of the attr function when not called on an attribute
if (typeof $().prop == 'function') {
object.prop('disabled', true);
object.children().prop('disabled', true);
}
else {
object.attr('disabled', true);
object.children().attr('disabled', true);
}
}
}
else {
Expand Down
33 changes: 18 additions & 15 deletions www7/sites/all/modules/contrib/ctools/js/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@
*/
Drupal.theme.prototype.CToolsModalDialog = function () {
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;
html += ' </a>';
html += ' <span id="modal-title" class="modal-title">&nbsp;</span>';
html += ' </div>';
html += ' <div id="modal-content" class="modal-content">';
html += ' </div>';
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;
html += ' </a>';
html += ' <span id="modal-title" class="modal-title">&nbsp;</span>';
html += ' </div>';
html += ' <div id="modal-content" class="modal-content">';
html += ' </div>';
html += ' </div>';
html += '</div>';

return html;
}
Expand All @@ -142,11 +142,11 @@
*/
Drupal.theme.prototype.CToolsModalThrobber = function () {
var html = '';
html += ' <div id="modal-throbber">';
html += ' <div class="modal-throbber-wrapper">';
html += Drupal.CTools.Modal.currentSettings.throbber;
html += ' </div>';
html += '<div id="modal-throbber">';
html += ' <div class="modal-throbber-wrapper">';
html += Drupal.CTools.Modal.currentSettings.throbber;
html += ' </div>';
html += '</div>';

return html;
};
Expand Down Expand Up @@ -265,7 +265,10 @@
}
// An empty event means we were triggered via .click() and
// in jquery 1.4 this won't trigger a submit.
if (event.bubbles == undefined) {
// We also have to check jQuery version to prevent
// IE8 + jQuery 1.4.4 to break on other events
// bound to the submit button.
if (jQuery.fn.jquery === '1.4' && typeof event.bubbles === "undefined") {
$(this.form).trigger('submit');
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion www7/sites/all/modules/contrib/ctools/js/stylizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Drupal.CTools.Stylizer.addFarbtastic = function(context) {
// This behavior attaches by ID, so is only valid once on a page.
if ($('ctools_stylizer_color_scheme_form .color-form.Stylizer-processed').size()) {
if ($('#ctools_stylizer_color_scheme_form .color-form.Stylizer-processed').size()) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1542,6 +1542,7 @@ function page_manager_handler_import_submit(&$form, &$form_state) {
* Rearrange the order of variants.
*/
function page_manager_handler_rearrange($form, &$form_state) {
ctools_include('context-task-handler');
$page = $form_state['page'];

$form['handlers'] = array('#tree' => TRUE);
Expand All @@ -1552,9 +1553,20 @@ function page_manager_handler_rearrange($form, &$form_state) {
}
$handler = $page->handlers[$id];
$plugin = page_manager_get_task_handler($handler->handler);

$object = ctools_context_handler_get_task_object($page->task, $page->subtask, $handler);
$display = new stdClass();
$display->context = ctools_context_load_contexts($object, TRUE);
$content = page_manager_get_handler_title($plugin, $handler, $page->task, $page->subtask_id);
$access = ctools_access_group_summary(!empty($handler->conf['access']) ? $handler->conf['access'] : array(), $display->context);
if ($access) {
$access = t('This panel will be selected if @conditions.', array('@conditions' => $access));
}
else {
$access = t('This panel will always be selected.');
}
$content .= '<div>' . $access . '</div>';
$form['handlers'][$id]['title'] = array(
'#markup' => page_manager_get_handler_title($plugin, $handler, $page->task, $page->subtask_id),
'#markup' => $content,
);

$form['handlers'][$id]['weight'] = array(
Expand Down
Loading

0 comments on commit b6af696

Please # to comment.