Skip to content
Snippets Groups Projects
Commit 9f033992 authored by Chris Gross's avatar Chris Gross
Browse files

7.x-1.5 Release Candidate 1

parent d345387c
No related branches found
No related tags found
No related merge requests found
Showing
with 291 additions and 190 deletions
WCM Base 7.x-1.5-rc1, 2018-02-09
--------------------------------
- WCM Base: Updated contrib modules Better Exposed Filters, ctools, Media, Mime Mail.
- WCM Omega: Updated styles for menu blocks, tile panes, accordion lists, typography groups.
- WCM Workbench Settings: Updated Drafty contrib module to 1.0-rc1.
- OCIO Landing Page: Added svg to allowed uploads on banner field.
WCM Base 7.x-1.4, 2018-01-30
----------------------------
- OCIO Calendar:
......
......@@ -7,9 +7,9 @@ dependencies[] = views
files[] = better_exposed_filters_exposed_form_plugin.inc
files[] = tests/better_exposed_filters.test
; Information added by Drupal.org packaging script on 2017-02-01
version = "7.x-3.4"
; Information added by Drupal.org packaging script on 2017-10-25
version = "7.x-3.5"
core = "7.x"
project = "better_exposed_filters"
datestamp = "1485926287"
datestamp = "1508952850"
......@@ -873,7 +873,7 @@ dateFormat: "dd-mm-yy"
$secondary = array(
'#type' => 'fieldset',
'#title' => $settings['general']['secondary_label'],
'#title' => filter_xss_admin($settings['general']['secondary_label']),
'#collapsible' => TRUE,
'#collapsed' => $secondary_collapse,
'#theme' => 'secondary_exposed_elements',
......@@ -1072,7 +1072,7 @@ dateFormat: "dd-mm-yy"
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#title' => $settings['sort']['advanced']['collapsible_label'],
'#title' => filter_xss_admin($settings['sort']['advanced']['collapsible_label']),
);
foreach ($sort_elems as $elem) {
$form['bef_sort_options'][$elem] = $form[$elem];
......
......@@ -41,9 +41,9 @@ features_exclude[field][node-bef_test-field_price] = node-bef_test-field_price
features_exclude[field][node-bef_test-field_date] = node-bef_test-field_date
hidden = 1
; Information added by Drupal.org packaging script on 2017-02-01
version = "7.x-3.4"
; Information added by Drupal.org packaging script on 2017-10-25
version = "7.x-3.5"
core = "7.x"
project = "better_exposed_filters"
datestamp = "1485926287"
datestamp = "1508952850"
Current API VERSION: 2.0. See API.txt for more information.
ctools 7.x-1.x-dev
==================
#1008120: "New custom content" shows empty form if custom content panes module is not enabled.
#999302 by troky: Fix jump menu. Apparently this wasn't actually committed the last time it was committed.
#1065976 by tekante and David_Rothstein: Reset plugin static cache during module enable to prevent stale data from harming export ui.
#1016510 by EclipseGC: Make the taxonomy system page functional.
ctools 7.x-1.x-alpha2 (05-Jan-2011)
===================================
#911396 by alex_b: Prevent notices in export UI.
#919768 by mikey_p: Allow url options to be sent to ctools_ajax_command_url().
#358953 by cedarm: Allow term context to return lowercase, spaces to dashes versions of terms.
#931434 by EclipseGc: Argument plugin for node revision ID.
#910656: CTools AJAX sample wizard demo "domesticated" checkbox value not stored.
#922442 by EugenMayer, neclimdul and voxpelli: Make sure ctools_include can handle '' or NULL directory.
#919956 by traviss359: Correct example in wizard advanced help.
#942968: Fix taxonomy term access rule with tag term vocabs.
#840344: node add argument had crufty code causing notices.
#944462 by longhairedgit: Invalid character in regex causes rare notice.
#938778 by dereine: Fix profile content type for D7 updates.
Add detach event to modal close so that wysiwyg can detach the editor.
Variant titles showing up as blank if more than one variant on a page.
#940016: token support was not yet updated for D7.
#940446: Skip validation on back and cancel buttons in all wizards.
#954492: Redirect not always working in wizard.inc
#955348: Lack of redirect on "Update" button in Page Manager causing data loss sometimes.
#941778: Update and save button should not appear in the "Add variant" path.
#955070 by EclipseGc: Update ctools internal page tokens to work properly on content all content.
#956890 by EclipseGc: Update views_content to not use views dependency since that is gone.
#954728 by EclipseGc: Update node template page function name to not collide with new hook_node_view().
#946534 by EclipseGc: Add support for field content on all entitities.
#952586 by EclipseGc: Fix node_author content type.
#959206: If a context is not set when rendering content, attempt to guess the context (fixes Views panes where "From context" was added but pane was never edited.)
#961654 by benshell: drupal_alter() only supports 4 arguments.
#911362 by alex_b: Facilitate plugin cache resets for tests.
#945360 by naxoc: node_tag_new() not updated to D7.
#953804 by EclipseGc: Fix node comment rendering.
#953542 by EclipseGc: Fix node rendering.
#953776 by EclipseGc: Fix node link rendering.
#954772 by EclipseGc: Fix node build mode selection in node content type.
#954762 by EclipseGc: Fix comment forbidden theme call.
#954894 by EclipseGc: Fix breadcrumb content type.
#955180 by EclipseGc: Fix page primary navigation type.
#957190 by EclipseGc: Fix page secondary navigation type.
#957194 by EclipseGc: Remove mission content type, since D7 no longer has a site mission.
#957348 by EclipseGc: Fix search form URL path.
#952586 by andypost: Use format_username for displaying unlinked usernames.
#963800 by benshell: Fix query to fetch custom block title.
#983496 by Amitaibu: Fix term argument to use proper load function.
#989484 by Amitaibu: Fix notice in views plugin.
#982496: Fix token context.
#995026: Fix export UI during enable/disable which would throw notices and not properly set/unset menu items.
#998870 by Amitaibu: Fix notice when content has no icon by using function already designed for that.
#983576 by Amitaibu: Node view fallback task showed white screen.
#1004644 by pillarsdotnet: Update a missed theme() call to D7.
#1006162 by aspilicious: .info file cleanup.
#998312 by dereine: Support the expanded/hidden options that Views did for dependent.js
#955030: Remove no longer supported footer message content type.
Fix broken query in term context config.
#992022 by pcambra: Fix node autocomplete.
#946302 by BerdArt and arywyr: Fix PHP 5.3 reference error.
#980528 by das-peter: Notice fix with entity settings.
#999302 by troky: ctools_jump_menu() needed updating to new form parameters.
#964174: stylizer plugin theme delegation was in the wrong place, causing errors.
#991658 by burlap: Fully load the "user" context for the logged in user because not all fields are in $user.
#1014866 by das-peter: Smarter title panes, notice fix on access plugin descriptions.
#1015662 by troky: plugin .info files were not using correct filepaths.
#941780 by EclipseGc: Restore the "No blocks" functionality.
#951048 by EclipseGc: Tighter entity integration so that new entities are automatic contexts and relationships.
#941800 by me and aspilicious: Use Drupal 7 #machine_name automation on page manager pages and all export_ui defaults.
Disabled exportables and pages not properly greyed out.
#969208 by me and benshell: Get user_view and user profile working.
#941796: Recategorize blocks
ctools 7.x-1.x-alpha1
=====================
Changelog reset for 7.x
Basic conversion done during sprint.
......@@ -5,10 +5,9 @@ dependencies[] = ctools
package = Chaos tool suite
version = CTOOLS_MODULE_VERSION
; Information added by Drupal.org packaging script on 2016-11-22
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2018-02-04
version = "7.x-1.13"
core = "7.x"
project = "ctools"
datestamp = "1479787162"
datestamp = "1517704095"
......@@ -137,7 +137,7 @@ function bulk_export_export($cli = FALSE, $options = array()) {
// Add hook_ctools_plugin_api at the top of the module code, if there is any.
if ($api_code) {
foreach ($api_code as $api_hook => $text) {
$api = "\n/**\n";
$api = "\n/**\n";
$api .= " * Implements hook_$api_hook().\n";
$api .= " */\n";
$api .= "function {$module_name}_$api_hook(\$module, \$api) {\n";
......@@ -148,7 +148,7 @@ function bulk_export_export($cli = FALSE, $options = array()) {
}
if ($module_code) {
$module = "<?php\n\n";
$module = "<?php\n\n";
$module .= "/**\n";
$module .= " * @file\n";
$module .= " * Bulk export of objects generated by Bulk export module.\n";
......@@ -193,7 +193,6 @@ function bulk_export_export($cli = FALSE, $options = array()) {
/**
* FAPI definition for the bulk exporter form.
*
*/
function bulk_export_export_form($form, &$form_state) {
......
.ctools-button-processed {
border-style: solid;
border-width: 1px;
......
.ctools-collapsible-container .ctools-toggle {
float: left;
width: 21px;
......
......@@ -5,8 +5,8 @@
}
.ctools-owns-lock {
background: #FFFFDD none repeat scroll 0 0;
border: 1px solid #F0C020;
background: #ffffdd none repeat scroll 0 0;
border: 1px solid #f0c020;
padding: 1em;
}
......
.ctools-dropbutton-processed {
padding-right: 18px;
position: relative;
......
......@@ -49,14 +49,14 @@ html.js div.ctools-dropdown div.ctools-dropdown-container {
html.js div.ctools-dropdown div.ctools-dropdown-container ul li li a {
padding-left: 25px;
width: 150px;
color: #027AC6;
color: #027ac6;
}
html.js div.ctools-dropdown div.ctools-dropdown-container ul li a {
text-decoration: none;
padding-left: 5px;
width: 170px;
color: #027AC6;
color: #027ac6;
}
html.js div.ctools-dropdown div.ctools-dropdown-container ul li span {
......@@ -69,5 +69,5 @@ html.js div.ctools-dropdown div.ctools-dropdown-container ul li span.text {
}
html.js .ctools-dropdown-hover {
background-color: #ECECEC;
background-color: #ececec;
}
......@@ -79,7 +79,7 @@ div.ctools-modal-content .no-float .form-item * {
float: none;
}
div.ctools-modal-content .modal-form .no-float label {
div.ctools-modal-content .modal-form .no-float label {
width: auto;
}
......
/* Farbtastic placement */
.color-form {
max-width: 50em;
......@@ -32,7 +31,8 @@
clear: left; /* LTR */
width: 14em;
}
.color-form .form-text, .color-form .form-select {
.color-form .form-text,
.color-form .form-select {
float: left; /* LTR */
}
.color-form .form-text {
......@@ -84,7 +84,7 @@
cursor: default;
}
.ctools-style-icons .form-item {
.ctools-style-icons .form-item {
width: 100px;
float: left;
margin: 0 3px !important;
......
.wizard-trail {
font-size: 120%;
}
......
......@@ -17,9 +17,9 @@
* Inform CTools about plugin types.
*
* @return array
* An array of plugin types, keyed by the type name.
* See the advanced help topic 'plugins-creating' for details of the array
* properties.
* An array of plugin types, keyed by the type name.
* See the advanced help topic 'plugins-creating' for details of the array
* properties.
*/
function hook_ctools_plugin_type() {
$plugins['my_type'] = array(
......@@ -65,6 +65,7 @@ function hook_ctools_plugin_type() {
* directory location is being requested.
* @param string $plugin_type
* The name of the plugin type for which a base directory is being requested.
*
* @return string
* The path where CTools' plugin system should search for plugin files,
* relative to your module's root. Omit leading and trailing slashes.
......@@ -94,7 +95,7 @@ function hook_ctools_plugin_directory($owner, $plugin_type) {
// Yes, this is exactly like Form 2 - just a different reasoning for it.
return "plugins/$plugin_type";
}
// Finally, if nothing matches, it's safe to return nothing at all (or NULL).
// Finally, if nothing matches, it's safe to return nothing at all (== NULL).
}
/**
......@@ -155,7 +156,7 @@ function hook_ctools_api_hook_alter(&$list) {
* allow to use it in the math expression api.
*
* @param $functions
* An array which has the functions as value.
* An array which has the functions as value.
*/
function hook_ctools_math_expression_functions_alter(&$functions) {
// Allow to convert from degrees to radiant.
......@@ -200,7 +201,10 @@ function hook_ctools_render_alter(&$info, &$page, &$context) {
*/
function hook_ctools_content_subtype_alter($subtype, $plugin) {
// Force a particular subtype of a particular plugin to render last.
if ($plugin['module'] == 'some_plugin_module' && $plugin['name'] == 'some_plugin_name' && $subtype['subtype_id'] == 'my_subtype_id') {
if ($plugin['module'] === 'some_plugin_module'
&& $plugin['name'] === 'some_plugin_name'
&& $subtype['subtype_id'] === 'my_subtype_id'
) {
$subtype['render last'] = TRUE;
}
}
......@@ -228,6 +232,28 @@ function hook_ctools_entity_context_alter(&$plugin, &$entity, $plugin_id) {
}
}
/**
* Alter the conversion of context items by ctools context plugin convert()s.
*
* @param ctools_context $context
* The current context plugin object. If this implemented a 'convert'
* function, the value passed in has been processed by that function.
* @param string $converter
* A string associated with the plugin type, identifying the operation.
* @param string $value
* The value being converted; this is the only return from the function.
* @param $converter_options
* Array of key-value pairs to pass to a converter function from higher
* levels.
*
* @see ctools_context_convert_context()
*/
function hook_ctools_context_converter_alter($context, $converter, &$value, $converter_options) {
if ($converter === 'mystring') {
$value = 'fixed';
}
}
/**
* Alter the definition of entity context plugins.
*
......@@ -266,6 +292,22 @@ function hook_ctools_cleanstring_CLEAN_ID_alter(&$settings) {
$settings['lower case'] = TRUE;
}
/**
* Let other modules modify the context handler before it is rendered.
*
* @param object $handler
* A handler for a current task and subtask.
* @param array $contexts
* An associative array of contexts.
* @param array $args
* An array for current args.
*
* @see ctools_context_handler_pre_render()
*/
function ctools_context_handler_pre_render($handler, $contexts, $args) {
$handler->conf['css_id'] = 'my-id';
}
/**
* @} End of "addtogroup hooks".
*/
......@@ -12,13 +12,22 @@ files[] = tests/context.test
files[] = tests/css.test
files[] = tests/css_cache.test
files[] = tests/ctools.plugins.test
files[] = tests/ctools.test
files[] = tests/math_expression.test
files[] = tests/math_expression_stack.test
files[] = tests/object_cache.test
files[] = tests/object_cache_unit.test
files[] = tests/page_tokens.test
files[] = tests/uuid_with_uuid.test
files[] = tests/uuid_without_uuid.test
; Information added by Drupal.org packaging script on 2016-11-22
version = "7.x-1.12"
; Dependencies that are only used for the tests.
; @see tests/uuid_with_uuid.test
test_dependencies[] = uuid
; Information added by Drupal.org packaging script on 2018-02-04
version = "7.x-1.13"
core = "7.x"
project = "ctools"
datestamp = "1479787162"
datestamp = "1517704095"
......@@ -40,7 +40,19 @@ function ctools_requirements($phase) {
* Implements hook_schema().
*/
function ctools_schema() {
return ctools_schema_3();
return ctools_schema_4();
}
/**
* Version 4 of the CTools schema.
*/
function ctools_schema_4() {
$schema = ctools_schema_3();
// Update the 'name' field to be 255 bytes long:
$schema['ctools_object_cache']['fields']['name']['length'] = 255;
return $schema;
}
/**
......@@ -49,7 +61,7 @@ function ctools_schema() {
function ctools_schema_3() {
$schema = ctools_schema_2();
// update the 'obj' field to be 128 bytes long:
// Update the 'obj' field to be 128 bytes long:
$schema['ctools_object_cache']['fields']['obj']['length'] = 128;
return $schema;
......@@ -61,7 +73,7 @@ function ctools_schema_3() {
function ctools_schema_2() {
$schema = ctools_schema_1();
// update the 'name' field to be 128 bytes long:
// Update the 'name' field to be 128 bytes long:
$schema['ctools_object_cache']['fields']['name']['length'] = 128;
// Update the 'data' field to be type 'blob'.
......@@ -95,10 +107,10 @@ function ctools_schema_2() {
'serialize' => TRUE,
),
'filter' => array(
'type' => 'int',
'size' => 'tiny',
'description' => 'Whether or not this CSS needs to be filtered.',
),
'type' => 'int',
'size' => 'tiny',
'description' => 'Whether or not this CSS needs to be filtered.',
),
),
'primary key' => array('cid'),
);
......@@ -197,7 +209,7 @@ function ctools_update_6003() {
if ($result) {
db_delete('system')->condition('name', 'panels_views')->execute();
module_enable(array('views_content'), TRUE);
}
}
}
/**
......@@ -216,7 +228,7 @@ function ctools_update_6005() {
}
/**
* ctools_custom_content table was originally here, but is now moved to
* The ctools_custom_content table was originally here, but is now moved to
* its own module.
*/
function ctools_update_6007() {
......@@ -230,18 +242,18 @@ function ctools_update_6007() {
}
/**
* ctools_object_cache needs to be defined as a blob.
* The ctools_object_cache needs to be defined as a blob.
*/
function ctools_update_6008() {
db_delete('ctools_object_cache')
->execute();
db_change_field('ctools_object_cache', 'data', 'data', array(
'type' => 'blob',
'size' => 'big',
'description' => 'Serialized data being stored.',
'serialize' => TRUE,
)
'type' => 'blob',
'size' => 'big',
'description' => 'Serialized data being stored.',
'serialize' => TRUE,
)
);
}
......@@ -263,3 +275,14 @@ function ctools_update_7001() {
'description' => 'The type of the object this cache is attached to; this essentially represents the owner so that several sub-systems can use this cache.',
));
}
/**
* Increase the length of the ctools_object_cache.name column to 255.
*/
function ctools_update_7002() {
db_change_field('ctools_object_cache', 'name', 'name', array(
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
));
}
......@@ -23,7 +23,7 @@ define('CTOOLS_API_VERSION', '2.0.9');
* ; Requires CTools v7.x-1.4 or newer.
* dependencies[] = ctools (>=1.4)
*/
define('CTOOLS_MODULE_VERSION', '7.x-1.11');
define('CTOOLS_MODULE_VERSION', '7.x-1.13');
/**
* Test the CTools API version.
......@@ -75,6 +75,9 @@ define('CTOOLS_MODULE_VERSION', '7.x-1.11');
* The minimum version of CTools necessary for your software to run with it.
* @param $maximum
* The maximum version of CTools allowed for your software to run with it.
*
* @return bool
* TRUE if the running ctools is usable, FALSE otherwise.
*/
function ctools_api_version($minimum, $maximum = NULL) {
if (version_compare(CTOOLS_API_VERSION, $minimum, '<')) {
......@@ -89,8 +92,7 @@ function ctools_api_version($minimum, $maximum = NULL) {
}
// -----------------------------------------------------------------------
// General utility functions
// General utility functions.
/**
* Include .inc files as necessary.
*
......@@ -118,6 +120,7 @@ function ctools_api_version($minimum, $maximum = NULL) {
* @param $dir
* Optional subdirectory containing the include file.
*/
function ctools_include($file, $module = 'ctools', $dir = 'includes') {
static $used = array();
......@@ -147,8 +150,8 @@ function ctools_form_include(&$form_state, $file, $module = 'ctools', $dir = 'in
/**
* Add an arbitrary path to the $form_state so it can work with form cache.
*
* module_load_include uses an unfortunately annoying syntax to work, making it
* difficult to translate the more simple $path + $file syntax.
* The module_load_include() function uses an unfortunately annoying syntax to
* work, making it difficult to translate the more simple $path + $file syntax.
*/
function ctools_form_include_file(&$form_state, $filename) {
if (!isset($form_state['build_info']['args'])) {
......@@ -172,6 +175,9 @@ function ctools_form_include_file(&$form_state, $filename) {
* Optional module containing the include.
* @param $dir
* Optional subdirectory containing the include file.
*
* @return string
* A string containing the appropriate path from drupal root.
*/
function ctools_image_path($image, $module = 'ctools', $dir = 'images') {
return drupal_get_path('module', $module) . "/$dir/" . $image;
......@@ -211,6 +217,9 @@ function ctools_add_css($file, $module = 'ctools', $dir = 'css') {
* Optional module containing the include.
* @param $dir
* Optional subdirectory containing the include file.
*
* @return string
* A string containing the appropriate path from drupal root.
*/
function ctools_attach_css($file, $module = 'ctools', $dir = 'css') {
return drupal_get_path('module', $module) . "/$dir/$file.css";
......@@ -249,6 +258,9 @@ function ctools_add_js($file, $module = 'ctools', $dir = 'js') {
* Optional module containing the include.
* @param $dir
* Optional subdirectory containing the include file.
*
* @return string
* A string containing the appropriate path from drupal root.
*/
function ctools_attach_js($file, $module = 'ctools', $dir = 'js') {
return drupal_get_path('module', $module) . "/$dir/$file.js";
......@@ -267,16 +279,29 @@ function ctools_get_roles() {
return user_roles();
}
/*
* Break x,y,z and x+y+z into an array. Numeric only.
/**
* Parse integer sequences of the form "x,y,z" or "x+y+z" into separate values.
*
* A string with integers separated by comma (,) is reported as an 'and' set;
* separation by a plus sign (+) or a space ( ) is an 'or' set. The meaning
* of this is up to the caller. Negative or fractional numbers are not
* recognised.
*
* Additional space characters within or around the sequence are not allowed.
*
* @param $str
* The string to parse.
*
* @return $object
* An object containing
* - operator: Either 'and' or 'or'
* - value: An array of numeric values.
* @return object
* An object containing the properties:
*
* - operator: Either 'and' or 'or' when there are multiple matched values.
* Absent when invalid_input is TRUE or there is only one value.
* - value: An array of integers (never strings) from $str. An empty array is
* returned if the input is empty. A single integer input is returned
* as a single value, but no 'operator' is defined.
* - invalid_input: TRUE if input could not be parsed and the values array
* will contain just -1. This property is otherwise absent.
*/
function ctools_break_phrase($str) {
$object = new stdClass();
......@@ -286,7 +311,7 @@ function ctools_break_phrase($str) {
$object->operator = 'or';
$object->value = preg_split('/[+ ]/', $str);
}
else if (preg_match('/^([0-9]+,)*[0-9]+$/', $str)) {
elseif (preg_match('/^([0-9]+,)*[0-9]+$/', $str)) {
$object->operator = 'and';
$object->value = explode(',', $str);
}
......@@ -304,7 +329,7 @@ function ctools_break_phrase($str) {
// Doubly ensure that all values are numeric only.
foreach ($object->value as $id => $value) {
$object->value[$id] = intval($value);
$object->value[$id] = (int) $value;
}
return $object;
......@@ -314,23 +339,29 @@ function ctools_break_phrase($str) {
* Set a token/value pair to be replaced later in the request, specifically in
* ctools_page_token_processing().
*
* @param $token
* @param string $token
* The token to be replaced later, during page rendering. This should
* ideally be a string inside of an HTML comment, so that if there is
* no replacement, the token will not render on the page.
* @param $type
* ideally be a string inside of an HTML comment, so that if there is
* no replacement, the token will not render on the page.
* If $token is NULL, the token set is not changed, but is still
* returned.
* @param string $type
* The type of the token. Can be either 'variable', which will pull data
* directly from the page variables
* @param $argument
* If $type == 'variable' then argument should be the key to fetch from
* the $variables. If $type == 'callback' then it should either be the
* callback, or an array that will be sent to call_user_func_array().
*
* @return
* directly from the page variables, or 'callback', which causes a function
* to be called to calculate the value. No other values are supported.
* @param string|array $argument
* For $type of:
* - 'variable': argument should be the key to fetch from the $variables.
* - 'callback': then it should either be the callback function name as a
* string, or an array that will be sent to call_user_func_array(). Argument
* arrays must not use array keys (i.e. $a[0] is the first and $a[1] the
* second element, etc.)
*
* @return array
* A array of token/variable names to be replaced.
*/
function ctools_set_page_token($token = NULL, $type = NULL, $argument = NULL) {
static $tokens = array();
$tokens = &drupal_static('ctools_set_page_token', array());
if (isset($token)) {
$tokens[$token] = array($type, $argument);
......@@ -339,13 +370,32 @@ function ctools_set_page_token($token = NULL, $type = NULL, $argument = NULL) {
}
/**
* Easily set a token from the page variables.
* Reset the defined page tokens within this request.
*
* Introduced for simpletest purposes. Normally not needed.
*/
function ctools_reset_page_tokens() {
drupal_static_reset('ctools_set_page_token');
}
/**
* Set a replacement token from the containing element's children during #post_render.
*
* This function can be used like this:
* $token = ctools_set_variable_token('tabs');
* $token = ctools_set_variable_token('tabs');
*
* $token will then be a simple replacement for the 'tabs' about of the
* variables available in the page template.
* The token "<!-- ctools-page-tabs -->" would then be replaced by the value of
* this element's (sibling) render array key 'tabs' during post-render (or be
* deleted if there was no such key by that point).
*
* @param string $token
* The token string for the page callback, e.g. 'title'.
*
* @return string
* The constructed token.
*
* @see ctools_set_callback_token()
* @see ctools_page_token_processing()
*/
function ctools_set_variable_token($token) {
$string = '<!-- ctools-page-' . $token . ' -->';
......@@ -354,10 +404,45 @@ function ctools_set_variable_token($token) {
}
/**
* Easily set a token from the page variables.
* Set a replacement token from the value of a function during #post_render.
*
* This function can be used like this:
* $token = ctools_set_variable_token('id', 'mymodule_myfunction');
* $token = ctools_set_callback_token('id', 'mymodule_myfunction');
*
* Or this (from its use in ctools_page_title_content_type_render):
* $token = ctools_set_callback_token('title', array(
* 'ctools_page_title_content_type_token', $conf['markup'], $conf['id'], $conf['class']
* )
* );
*
* The token (e.g: "<!-- ctools-page-id-1b7f84d1c8851290cc342631ac663053 -->")
* would then be replaced during post-render by the return value of:
*
* ctools_page_title_content_type_token($value_markup, $value_id, $value_class);
*
* @param string $token
* The token string for the page callback, e.g. 'title'.
*
* @param string|array $callback
* For callback functions that require no args, the name of the function as a
* string; otherwise an array of two or more elements: the function name
* followed by one or more function arguments.
*
* NB: the value of $callback must be a procedural (non-class) function that
* passes the php function_exists() check.
*
* The callback function itself will be called with args dependent
* on $callback. If:
* - $callback is a string, the function is called with a reference to the
* render array;
* - $callback is an array, the function is called with $callback merged
* with an array containing a reference to the render array.
*
* @return string
* The constructed token.
*
* @see ctools_set_variable_token()
* @see ctools_page_token_processing()
*/
function ctools_set_callback_token($token, $callback) {
// If the callback uses arguments they are considered in the token.
......@@ -384,9 +469,9 @@ function ctools_set_no_blocks($blocks = FALSE) {
/**
* Wrapper function to create UUIDs via ctools, falls back on UUID module
* if it is enabled. This code is a copy of uuid.inc from the uuid module.
*
* @see http://php.net/uniqid#65879
*/
function ctools_uuid_generate() {
if (!module_exists('uuid')) {
ctools_include('uuid');
......@@ -413,6 +498,7 @@ function ctools_uuid_generate() {
/**
* Check that a string appears to be in the format of a UUID.
*
* @see http://drupal.org/project/uuid
*
* @param $uuid
......@@ -468,6 +554,8 @@ function ctools_class_add($classes, $hook = 'html') {
*/
function ctools_class_remove($classes, $hook = 'html') {
if (!is_array($classes)) {
// @todo Consider using explode(' ', $classes);
// @todo Consider checking that $classes is a string before adding.
$classes = array($classes);
}
......@@ -480,12 +568,35 @@ function ctools_class_remove($classes, $hook = 'html') {
}
}
// -----------------------------------------------------------------------
// Drupal core hooks
/**
* Reset the storage used for ctools_class_add and ctools_class_remove.
*
* @see ctools_class_add()
* @see ctools_class_remove()
*/
function ctools_class_reset() {
drupal_static_reset('ctools_process_classes');
}
/**
* Return the classes for the body (added by ctools_class_add).
*
* @return array
* A copy of the array of classes to add to the body tag. If none have been
* added, this will be an empty array.
*
* @see ctools_class_add()
*/
function ctools_get_classes() {
return drupal_static('ctools_process_classes', array());
}
// -----------------------------------------------------------------------
// Drupal core hooks.
/**
* Implement hook_init to keep our global CSS at the ready.
*/
function ctools_init() {
ctools_add_css('ctools');
// If we are sure that CTools' AJAX is in use, change the error handling.
......@@ -504,7 +615,7 @@ function ctools_init() {
* Shutdown handler used during ajax operations to help catch fatal errors.
*/
function ctools_shutdown_handler() {
if (function_exists('error_get_last') AND ($error = error_get_last())) {
if (function_exists('error_get_last') && ($error = error_get_last())) {
switch ($error['type']) {
case E_ERROR:
case E_CORE_ERROR:
......@@ -583,7 +694,6 @@ function ctools_flush_caches() {
/**
* Implements hook_element_info_alter().
*
*/
function ctools_element_info_alter(&$type) {
ctools_include('dependent');
......@@ -619,10 +729,10 @@ function ctools_registry_files_alter(&$files, $indexed_modules) {
// -----------------------------------------------------------------------
// FAPI hooks that must be in the .module file.
/**
* Alter the comment form to get a little more control over it.
*/
function ctools_form_comment_form_alter(&$form, &$form_state) {
if (!empty($form_state['ctools comment alter'])) {
// Force the form to post back to wherever we are.
......@@ -640,11 +750,11 @@ function ctools_node_comment_form_submit(&$form, &$form_state) {
// -----------------------------------------------------------------------
// CTools hook implementations.
/**
* Implementation of hook_ctools_plugin_directory() to let the system know
* where all our own plugins are.
*/
function ctools_ctools_plugin_directory($owner, $plugin_type) {
if ($owner == 'ctools') {
return 'plugins/' . $plugin_type;
......@@ -665,11 +775,11 @@ function ctools_ctools_plugin_type() {
// -----------------------------------------------------------------------
// Drupal theme preprocess hooks that must be in the .module file.
/**
* A theme preprocess function to automatically allow panels-based node
* templates based upon input when the panel was configured.
*/
function ctools_preprocess_node(&$vars) {
// The 'ctools_template_identifier' attribute of the node is added when the pane is
// rendered.
......@@ -679,14 +789,13 @@ function ctools_preprocess_node(&$vars) {
}
}
/**
* Implements hook_page_alter().
*
* Last ditch attempt to remove sidebar regions if the "no blocks"
* functionality has been activated.
*
* @see ctools_block_list_alter().
* @see ctools_block_list_alter()
*/
function ctools_page_alter(&$page) {
$check = drupal_static('ctools_set_no_blocks', TRUE);
......@@ -716,6 +825,7 @@ function ctools_page_token_processing($children, $elements) {
case 'variable':
$tokens[$token] = isset($elements[$argument]) ? $elements[$argument] : '';
break;
case 'callback':
if (is_string($argument) && function_exists($argument)) {
$tokens[$token] = $argument($elements);
......@@ -744,7 +854,7 @@ function ctools_process(&$variables, $hook) {
return;
}
$classes = drupal_static('ctools_process_classes', array());
$classes = ctools_get_classes();
// Process the classses to add.
if (!empty($classes[$hook]['add'])) {
......@@ -758,12 +868,6 @@ 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'] = array_unique(array_merge($variables['classes_array'], $variables['attributes_array']['class']));
$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']);
......@@ -771,7 +875,6 @@ function ctools_process(&$variables, $hook) {
// -----------------------------------------------------------------------
// Menu callbacks that must be in the .module file.
/**
* Determine if the current user has access via a plugin.
*
......@@ -795,6 +898,7 @@ function ctools_process(&$variables, $hook) {
* @return
* TRUE if access is granted, false if otherwise.
*/
function ctools_access_menu($access) {
// Short circuit everything if there are no access tests.
if (empty($access['plugins'])) {
......@@ -823,7 +927,7 @@ function ctools_access_menu($access) {
* An indexed array of zero or more permission strings to be checked by
* user_access().
*
* @return
* @return bool
* Iff all checks pass will this function return TRUE. If an invalid argument
* is passed (e.g., not a string), this function errs on the safe said and
* returns FALSE.
......@@ -885,7 +989,6 @@ function ctools_export_ui_load($item_name, $plugin_name) {
// -----------------------------------------------------------------------
// Caching callbacks on behalf of export-ui.
/**
* Menu access callback for various tasks of export-ui.
*/
......@@ -929,7 +1032,7 @@ function ctools_export_ui_ctools_access_get($argument) {
}
/**
* Callback for access control ajax form on behalf of export ui
* Callback for access control ajax form on behalf of export ui.
*
* Returns the cached access config and contexts used.
* Note that this is assuming that access will be in $item->access -- if it
......@@ -962,8 +1065,9 @@ function ctools_menu_local_tasks_alter(&$data, $router_item, $root_path) {
}
/**
* Implement hook_block_list_alter() to potentially remove blocks.
* Implements hook_block_list_alter().
*
* Used to potentially remove blocks.
* This exists in order to replicate Drupal 6's "no blocks" functionality.
*/
function ctools_block_list_alter(&$blocks) {
......@@ -1026,6 +1130,7 @@ function ctools_ctools_entity_context_alter(&$plugin, &$entity, $plugin_id) {
case 'entity_id:taxonomy_term':
$plugin['no ui'] = TRUE;
break;
case 'entity:user':
$plugin = ctools_get_context('user');
unset($plugin['no ui']);
......@@ -1059,18 +1164,21 @@ function ctools_field_create_field($field) {
function ctools_field_create_instance($instance) {
ctools_flush_field_caches();
}
/**
* Implements hook_field_delete_field().
*/
function ctools_field_delete_field($field) {
ctools_flush_field_caches();
}
/**
* Implements hook_field_delete_instance().
*/
function ctools_field_delete_instance($instance) {
ctools_flush_field_caches();
}
/**
* Implements hook_field_update_field().
*/
......
......@@ -5,9 +5,9 @@ package = Chaos tool suite
version = CTOOLS_MODULE_VERSION
dependencies[] = ctools
; Information added by Drupal.org packaging script on 2016-11-22
version = "7.x-1.12"
; Information added by Drupal.org packaging script on 2018-02-04
version = "7.x-1.13"
core = "7.x"
project = "ctools"
datestamp = "1479787162"
datestamp = "1517704095"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment