Skip to content

Commit

Permalink
Updating pathauto, token, and ctools.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Palazzolo committed Mar 20, 2012
1 parent f80de37 commit 9636bbd
Show file tree
Hide file tree
Showing 148 changed files with 4,598 additions and 1,880 deletions.
18 changes: 16 additions & 2 deletions sites/all/modules/contrib/ctools/API.txt
@@ -1,8 +1,22 @@
Current API Version: 2.0.1 Current API Version: 2.0.5


Please note that the API version is an internal number and does not match release numbers. It is entirely possible that releases will not increase the API version number, and increasing this number too often would burden contrib module maintainers who need to keep up with API changes. Please note that the API version is an internal number and does not match release numbers. It is entirely possible that releases will not increase the API version number, and increasing this number too often would burden contrib module maintainers who need to keep up with API changes.


This file contains a log of changes to the API. This file contains a log of changes to the API.
API Version 2.0.5
Introduce ctools_fields_get_fields_by_type().
Add language.inc
Introduce hook_ctools_content_subtype_alter($subtype, $plugin);

API Version 2.0.4
Introduce ctools_form_include_file()

API Version 2.0.3
Introduce ctools_field_invoke_field() and ctools_field_invoke_field_default().

API Version 2.0.2
Introduce ctools_export_crud_load_multiple() and 'load multiple callback' to
export schema.


API Version 2.0.1 API Version 2.0.1
Introduce ctools_export_crud_enable(), ctools_export_crud_disable() and Introduce ctools_export_crud_enable(), ctools_export_crud_disable() and
Expand All @@ -11,7 +25,7 @@ API Version 2.0.1
how the exportable objects are instantiated. how the exportable objects are instantiated.
Introduce 'hook_ctools_math_expression_functions_alter'. Introduce 'hook_ctools_math_expression_functions_alter'.


API Version 2.0 API Version 2.0
Remove the deprecated callback-based behavior of the 'defaults' property on Remove the deprecated callback-based behavior of the 'defaults' property on
plugin types; array addition is now the only option. If you need more plugin types; array addition is now the only option. If you need more
complex logic, do it with the 'process' callback. complex logic, do it with the 'process' callback.
Expand Down
601 changes: 333 additions & 268 deletions sites/all/modules/contrib/ctools/LICENSE.txt

Large diffs are not rendered by default.

24 changes: 9 additions & 15 deletions sites/all/modules/contrib/ctools/bulk_export/bulk_export.css
@@ -1,24 +1,18 @@

.export-container {
div.export-container {
width: 48%; width: 48%;
float: left; float: left;
padding: .5em; padding: 5px 1% 0;
} }

.export-container table {
div.export-container table {
width: 100%; width: 100%;
} }

.export-container table input,
div.export-container table input, .export-container table th,
div.export-container table th, .export-container table td {
div.export-container table td { padding: 0 0 .2em .5em;
padding: 0 0 2px .5em;
margin: 0; margin: 0;
border-right: none; vertical-align: middle;
border-left: none;
vertical-align: center;
} }

.export-container .select-all {
div.export-container .select-all {
width: 1.5em; width: 1.5em;
} }
6 changes: 3 additions & 3 deletions sites/all/modules/contrib/ctools/bulk_export/bulk_export.info
Expand Up @@ -4,9 +4,9 @@ core = 7.x
dependencies[] = ctools dependencies[] = ctools
package = Chaos tool suite package = Chaos tool suite


; Information added by drupal.org packaging script on 2011-07-28 ; Information added by drupal.org packaging script on 2012-03-17
version = "7.x-1.0-rc1" version = "7.x-1.0-rc2"
core = "7.x" core = "7.x"
project = "ctools" project = "ctools"
datestamp = "1311894415" datestamp = "1332017742"


29 changes: 29 additions & 0 deletions sites/all/modules/contrib/ctools/bulk_export/bulk_export.js
@@ -0,0 +1,29 @@

/**
* @file
* CTools Bulk Export javascript functions.
*/

(function ($) {

Drupal.behaviors.CToolsBulkExport = {
attach: function (context) {

$('#bulk-export-export-form .vertical-tabs-pane', context).drupalSetSummary(function (context) {

// Check if any individual checkbox is checked.
if ($('.bulk-selection input:checked', context).length > 0) {
return Drupal.t('Exportables selected');
}

return '';
});

// Special bind click on the select-all checkbox.
$('.select-all').bind('click', function(context) {
$(this, '.vertical-tabs-pane').drupalSetSummary(context);
});
}
};

})(jQuery);
115 changes: 90 additions & 25 deletions sites/all/modules/contrib/ctools/bulk_export/bulk_export.module
Expand Up @@ -37,8 +37,13 @@ function bulk_export_menu() {


/** /**
* FAPI gateway to the bulk exporter. * FAPI gateway to the bulk exporter.
*
* @param $cli
* Whether this function is called from command line.
* @param $options
* A collection of options, only passed in by drush_ctools_export().
*/ */
function bulk_export_export() { function bulk_export_export($cli = FALSE, $options = array()) {
ctools_include('export'); ctools_include('export');
$schemas = ctools_export_get_schemas(TRUE); $schemas = ctools_export_get_schemas(TRUE);
$exportables = $export_tables = array(); $exportables = $export_tables = array();
Expand All @@ -59,14 +64,38 @@ function bulk_export_export() {
'no_redirect' => TRUE, 'no_redirect' => TRUE,
'exportables' => $exportables, 'exportables' => $exportables,
'export_tables' => $export_tables, 'export_tables' => $export_tables,
'name' => '',
'code' => '',
); );
$output = drupal_build_form('bulk_export_export_form', $form_state);
if (!empty($form_state['submitted'])) { // If called from drush_ctools_export, get the module name and
// select all exportables and call the submit function directly.
if ($cli) {
$module_name = $options['name'];
$form_state['values']['name'] = $module_name;
$form_state['values']['tables'] = array();
foreach ($exportables as $table => $names) {
if (!empty($names)) {
$form_state['values']['tables'][] = $table;
$form_state['values'][$table] = array();
foreach ($names as $name => $title) {
$form_state['values'][$table][$name] = $name;
}
}
}
$output = bulk_export_export_form_submit($form, $form_state);
}
else {
$output = drupal_build_form('bulk_export_export_form', $form_state);
$module_name = $form_state['module'];
}

if (!empty($form_state['submitted']) || $cli) {
drupal_set_title(t('Bulk export results')); drupal_set_title(t('Bulk export results'));
$output = ''; $output = '';
$module_code = ''; $module_code = '';
$api_code = array(); $api_code = array();
$dependencies = array(); $dependencies = $file_data = array();
foreach ($form_state['code'] as $module => $api_info) { foreach ($form_state['code'] as $module => $api_info) {
if ($module == 'general') { if ($module == 'general') {
$module_code .= $api_info; $module_code .= $api_info;
Expand All @@ -82,15 +111,20 @@ function bulk_export_export() {
$api_code[$api_hook] .= " }\n"; $api_code[$api_hook] .= " }\n";
$dependencies[$module] = TRUE; $dependencies[$module] = TRUE;


$file = $form_state['module'] . '.' . $api . '.inc'; $file = $module_name . '.' . $api . '.inc';
$code = "<?php\n\n"; $code = "<?php\n\n";
$code .= "/**\n"; $code .= "/**\n";
$code .= " * @file\n"; $code .= " * @file\n";
$code .= " * Bulk export of $api objects generated by Bulk export module.\n"; $code .= " * Bulk export of $api objects generated by Bulk export module.\n";
$code .= " */\n\n"; $code .= " */\n\n";
$code .= $info['code']; $code .= $info['code'];
$export_form = drupal_get_form('ctools_export_form', $code, t('Place this in @file', array('@file' => $file))); if ($cli) {
$output .= drupal_render($export_form); $file_data[$file] = $code;
}
else {
$export_form = drupal_get_form('ctools_export_form', $code, t('Place this in @file', array('@file' => $file)));
$output .= drupal_render($export_form);
}
} }
} }
} }
Expand All @@ -99,9 +133,9 @@ function bulk_export_export() {
if ($api_code) { if ($api_code) {
foreach ($api_code as $api_hook => $text) { foreach ($api_code as $api_hook => $text) {
$api = "\n/**\n"; $api = "\n/**\n";
$api .= " * Implement hook_$api_hook().\n"; $api .= " * Implements hook_$api_hook().\n";
$api .= " */\n"; $api .= " */\n";
$api .= "function $form_state[module]_$api_hook(\$module, \$api) {\n"; $api .= "function {$module_name}_$api_hook(\$module, \$api) {\n";
$api .= $text; $api .= $text;
$api .= "}\n"; $api .= "}\n";
$module_code = $api . $module_code; $module_code = $api . $module_code;
Expand All @@ -115,8 +149,13 @@ function bulk_export_export() {
$module .= " * Bulk export of objects generated by Bulk export module.\n"; $module .= " * Bulk export of objects generated by Bulk export module.\n";
$module .= " */\n"; $module .= " */\n";
$module .= $module_code; $module .= $module_code;
$export_form = drupal_get_form('ctools_export_form', $module, t('Place this in @file', array('@file' => $form_state['module'] . '.module'))); if ($cli) {
$output = drupal_render($export_form) . $output; $file_data[$module_name . '.module'] = $module;
}
else {
$export_form = drupal_get_form('ctools_export_form', $module, t('Place this in @file', array('@file' => $form_state['module'] . '.module')));
$output = drupal_render($export_form) . $output;
}
} }


$info = strtr("name = @module export module\n", array('@module' => $form_state['module'])); $info = strtr("name = @module export module\n", array('@module' => $form_state['module']));
Expand All @@ -126,12 +165,21 @@ function bulk_export_export() {
} }
$info .= "package = Chaos tool suite\n"; $info .= "package = Chaos tool suite\n";
$info .= "core = 7.x\n"; $info .= "core = 7.x\n";
$export_form = drupal_get_form('ctools_export_form', $info, t('Place this in @file', array('@file' => $form_state['module'] . '.info'))); if ($cli) {
$output = drupal_render($export_form) . $output; $file_data[$module_name . '.info'] = $info;

}
else {
$export_form = drupal_get_form('ctools_export_form', $info, t('Place this in @file', array('@file' => $form_state['module'] . '.info')));
$output = drupal_render($export_form) . $output;
}
} }


return $output; if ($cli) {
return $file_data;
}
else {
return $output;
}
} }
else { else {
return t('There are no objects to be exported at this time.'); return t('There are no objects to be exported at this time.');
Expand All @@ -143,28 +191,38 @@ function bulk_export_export() {
* *
*/ */
function bulk_export_export_form($form, &$form_state) { function bulk_export_export_form($form, &$form_state) {
$form['tables'] = array(
'#prefix' => '<div class="clearfix">',
'#suffix' => '</div>',
'#tree' => TRUE,
);


$files = system_rebuild_module_data(); $files = system_rebuild_module_data();


$options = array(); $form['additional_settings'] = array(
'#type' => 'vertical_tabs',
);

$options = $tables = array();
foreach ($form_state['exportables'] as $table => $list) { foreach ($form_state['exportables'] as $table => $list) {
if (empty($list)) { if (empty($list)) {
continue; continue;
} }


foreach ($list as $id => $title) { foreach ($list as $id => $title) {
$options[$table][$id] = array($title); $options[$table][$id] = array($title);
$options[$table][$id]['#attributes'] = array('class' => array('bulk-selection'));
} }


$module = $form_state['export_tables'][$table]; $module = $form_state['export_tables'][$table];
$header = array("{$files[$module]->info['name']}: $table"); $header = array($table);
$module_name = $files[$module]->info['name'];
$tables[] = $table;

if (!isset($form[$module_name])) {
$form[$files[$module]->info['name']] = array(
'#type' => 'fieldset',
'#group' => 'additional_settings',
'#title' => $module_name,
);
}


$form['tables'][$table] = array( $form[$module_name]['tables'][$table] = array(
'#prefix' => '<div class="export-container">', '#prefix' => '<div class="export-container">',
'#suffix' => '</div>', '#suffix' => '</div>',
'#type' => 'tableselect', '#type' => 'tableselect',
Expand All @@ -173,6 +231,11 @@ function bulk_export_export_form($form, &$form_state) {
); );
} }


$form['tables'] = array(
'#type' => 'value',
'#value' => $tables,
);

$form['name'] = array( $form['name'] = array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Module name'), '#title' => t('Module name'),
Expand All @@ -186,6 +249,7 @@ function bulk_export_export_form($form, &$form_state) {


$form['#action'] = url('admin/structure/bulk-export/results'); $form['#action'] = url('admin/structure/bulk-export/results');
$form['#attached']['css'][] = drupal_get_path('module', 'bulk_export') . '/bulk_export.css'; $form['#attached']['css'][] = drupal_get_path('module', 'bulk_export') . '/bulk_export.css';
$form['#attached']['js'][] = drupal_get_path('module', 'bulk_export') . '/bulk_export.js';
return $form; return $form;
} }


Expand All @@ -195,9 +259,10 @@ function bulk_export_export_form($form, &$form_state) {
function bulk_export_export_form_submit($form, &$form_state) { function bulk_export_export_form_submit($form, &$form_state) {
$code = array(); $code = array();
$name = empty($form_state['values']['name']) ? 'foo' : $form_state['values']['name']; $name = empty($form_state['values']['name']) ? 'foo' : $form_state['values']['name'];
$tables = $form_state['values']['tables'];


foreach ($form_state['values']['tables'] as $table => $names) { foreach ($tables as $table) {
$names = array_keys(array_filter($names)); $names = array_keys(array_filter($form_state['values'][$table]));
if ($names) { if ($names) {
natcasesort($names); natcasesort($names);
ctools_export_to_hook_code($code, $table, $names, $name); ctools_export_to_hook_code($code, $table, $names, $name);
Expand Down
8 changes: 8 additions & 0 deletions sites/all/modules/contrib/ctools/css/collapsible-div.css
Expand Up @@ -9,6 +9,14 @@
background-image: url(../images/collapsible-expanded.png); background-image: url(../images/collapsible-expanded.png);
} }


.ctools-collapsible-container .ctools-collapsible-handle {
display: none;
}

html.js .ctools-collapsible-container .ctools-collapsible-handle {
display: block;
}

.ctools-collapsible-container .ctools-collapsible-handle { .ctools-collapsible-container .ctools-collapsible-handle {
cursor: pointer; cursor: pointer;
} }
Expand Down

0 comments on commit 9636bbd

Please sign in to comment.