Index: ctools.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/ctools.info,v
retrieving revision 1.4
diff -u -p -r1.4 ctools.info
--- ctools.info 27 Sep 2009 03:41:00 -0000 1.4
+++ ctools.info 5 Oct 2009 22:46:20 -0000
@@ -2,4 +2,27 @@
name = Chaos tools
description = A library of helpful tools by Merlin of Chaos.
core = 7.x
-package = Chaos tool suite
\ No newline at end of file
+package = Chaos tool suite
+files[] = ctools.module
+files[] = includes/ajax.inc
+files[] = includes/collapsible.theme.inc
+files[] = includes/content.inc
+files[] = includes/content.menu.inc
+files[] = includes/content.theme.inc
+files[] = includes/context-access-admin.inc
+files[] = includes/context-admin.inc
+files[] = includes/context-task-handler.inc
+files[] = includes/context.inc
+files[] = includes/context.menu.inc
+files[] = includes/context.theme.inc
+files[] = includes/css.inc
+files[] = includes/dependent.inc
+files[] = includes/dropdown.theme.inc
+files[] = includes/export.inc
+files[] = includes/form.inc
+files[] = includes/menu.inc
+files[] = includes/modal.inc
+files[] = includes/object-cache.inc
+files[] = includes/plugins.inc
+files[] = includes/wizard.inc
+files[] = includes/wizard.theme.inc
Index: ctools.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/ctools.install,v
retrieving revision 1.12
diff -u -p -r1.12 ctools.install
--- ctools.install 16 Aug 2009 21:59:42 -0000 1.12
+++ ctools.install 5 Oct 2009 23:01:02 -0000
@@ -13,22 +13,15 @@
function ctools_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
- $path = file_create_path('ctools/css');
- if (!file_check_directory($path)) {
- $path = file_directory_path() . '/ctools';
- file_check_directory($path, FILE_CREATE_DIRECTORY);
- $path .= '/css';
- file_check_directory($path, FILE_CREATE_DIRECTORY);
- }
-
$requirements['ctools_css_cache'] = array(
'title' => t('CTools CSS Cache'),
'severity' => REQUIREMENT_OK,
'value' => t('Exists'),
);
- if (!file_check_directory($path)) {
- $requirements['ctools_css_cache']['description'] = t('The CTools CSS cache directory, %path could not be created due to a misconfigured files directory. Please ensure that the files directory is correctly configured and that the webserver has permission to create directories.', array('%path' => $path));
+ $path = 'public://ctools/css';
+ if (!file_prepare_directory($path, FILE_CREATE_DIRECTORY)) {
+ $requirements['ctools_css_cache']['description'] = t('The CTools CSS cache directory, %path could not be created due to a misconfigured files directory. Please ensure that the files directory is correctly configured and that the webserver has permission to create directories.', array('%path' => file_uri_target($path)));
$requirements['ctools_css_cache']['severity'] = REQUIREMENT_ERROR;
$requirements['ctools_css_cache']['value'] = t('Unable to create');
}
@@ -38,21 +31,7 @@ function ctools_requirements($phase) {
}
/**
- * Implementation of hook_install()
- */
-function ctools_install() {
- drupal_install_schema('ctools');
-}
-
-/**
- * Implementation of hook_uninstall()
- */
-function ctools_uninstall() {
- drupal_uninstall_schema('ctools');
-}
-
-/**
- * Implementation of hook_schemea
+ * Implement hook_schema().
*/
function ctools_schema() {
// Currently, schema 1 is the only schema we have. As we make updates,
@@ -110,7 +89,7 @@ function ctools_schema_2() {
*/
function ctools_schema_1() {
$schema['ctools_object_cache'] = array(
- 'description' => t('A special cache used to store objects that are being edited; it serves to save state in an ordinarily stateless environment.'),
+ 'description' => 'A special cache used to store objects that are being edited; it serves to save state in an ordinarily stateless environment.',
'fields' => array(
'sid' => array(
'type' => 'varchar',
@@ -151,54 +130,12 @@ function ctools_schema_1() {
}
/**
- * Enlarge the ctools_object_cache.name column to prevent truncation and weird
- * errors.
- */
-function ctools_update_6001() {
- $ret = array();
-
- // Perform updates like this to reduce code duplication.
- $schema = ctools_schema_2();
-
- db_change_field($ret, 'ctools_object_cache', 'name', 'name', $schema['ctools_object_cache']['fields']['name']);
-
- return $ret;
-}
-
-/**
- * Add the new css cache table.
+ * Update to Drupal 7.
+ * Could be solved later. Set the version number for new installs.
*/
-function ctools_update_6002() {
+function ctools_update_7000() {
$ret = array();
- // Schema 2 is locked and should not be changed.
- $schema = ctools_schema_2();
-
- db_create_table($ret, 'ctools_css_cache', $schema['ctools_css_cache']);
return $ret;
}
-/**
- * Take over for the panels_views module if it was on.
- */
-function ctools_update_6003() {
- $ret = array();
-
- $result = db_result(db_query("SELECT status FROM {system} WHERE name = 'panels_views'"));
- if ($result) {
- $ret[] = update_sql("DELETE from {system} WHERE name = 'panels_views'");
- drupal_install_modules(array('views_content'));
- }
-
- return $ret;
-}
-
-/**
- * Add primary key to the ctools_object_cache table.
- */
-function ctools_update_6004() {
- $ret = array();
- db_add_primary_key($ret, 'ctools_object_cache', array('sid', 'obj', 'name'));
- db_drop_index($ret, 'ctools_object_cache', 'sid_obj_name');
- return $ret;
-}
Index: ctools.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/ctools.module,v
retrieving revision 1.28
diff -u -p -r1.28 ctools.module
--- ctools.module 27 Sep 2009 03:41:00 -0000 1.28
+++ ctools.module 5 Oct 2009 23:14:06 -0000
@@ -79,7 +79,7 @@ function ctools_api_version($minimum, $m
* Include ctools .inc files as necessary.
*/
function ctools_include($file) {
- static $used = array();
+ $used = &drupal_static(__FUNCTION__, array());
if (!isset($used[$file])) {
require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'ctools') . "/includes/$file.inc";
}
@@ -95,14 +95,14 @@ function ctools_image_path($image) {
}
/**
- * Include views .css files.
+ * Include ctools .css files.
*/
function ctools_add_css($file) {
drupal_add_css(drupal_get_path('module', 'ctools') . "/css/$file.css");
}
/**
- * Include views .js files.
+ * Include ctools .js files.
*/
function ctools_add_js($file) {
drupal_add_js(drupal_get_path('module', 'ctools') . "/js/$file.js");
@@ -137,7 +137,7 @@ function _ctools_passthrough(&$items, $t
}
/**
- * Implementation of hook_theme_registry_alter()
+ * Implement hook_theme_registry_alter().
*/
function ctools_theme_registry_alter(&$registry) {
if ($registry['menu_local_tasks']['function'] == 'theme_menu_local_tasks') {
@@ -193,7 +193,7 @@ function ctools_garland_preprocess_page(
}
/**
- * Implementation of hook_theme().
+ * Implement hook_theme().
*/
function ctools_theme() {
$items = array();
@@ -202,7 +202,7 @@ function ctools_theme() {
}
/**
- * Implementation of hook_menu().
+ * Implement hook_menu().
*/
function ctools_menu() {
$items = array();
@@ -211,8 +211,8 @@ function ctools_menu() {
}
/**
- * Implementation of hook_ctools_plugin_dierctory() to let the system know
- * we implement task and task_handler plugins.
+ * Implement hook_ctools_plugin_dierctory().
+ * Let the system know we implement task and task_handler plugins.
*/
function ctools_ctools_plugin_directory($module, $plugin) {
if ($module == 'ctools') {
@@ -224,15 +224,10 @@ function ctools_ctools_plugin_directory(
* Get a list of roles in the system.
*/
function ctools_get_roles() {
- static $roles = NULL;
+ $roles = &drupal_static(__FUNCTION__);
if (!isset($roles)) {
- $roles = array();
- $result = db_query("SELECT r.rid, r.name FROM {role} r ORDER BY r.name");
- while ($obj = db_fetch_object($result)) {
- $roles[$obj->rid] = $obj->name;
- }
+ $roles = db_query("SELECT r.rid, r.name FROM {role} r ORDER BY r.name")->fetchAllKeyed();
}
-
return $roles;
}
@@ -277,7 +272,8 @@ function ctools_access_menu($access) {
}
/**
- * Implementation of hook_cron. Clean up old caches.
+ * Implement hook_cron().
+ * Clean up old caches.
*/
function ctools_cron() {
// TODO: Should this use the passthrough?
@@ -416,7 +412,7 @@ function ctools_preprocess_page(&$variab
* 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(__FUNCTION__, array());
if (isset($token)) {
$tokens[$token] = array($type, $argument);
Index: bulk_export/bulk_export.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/bulk_export/bulk_export.info,v
retrieving revision 1.2
diff -u -p -r1.2 bulk_export.info
--- bulk_export/bulk_export.info 12 Jul 2009 18:11:58 -0000 1.2
+++ bulk_export/bulk_export.info 5 Oct 2009 22:46:20 -0000
@@ -1,6 +1,7 @@
; $Id: bulk_export.info,v 1.2 2009/07/12 18:11:58 merlinofchaos Exp $
name = Bulk Export
description = Performs bulk exporting of data objects known about by Chaos tools.
-core = 6.x
+core = 7.x
dependencies[] = ctools
-package = Chaos tool suite
\ No newline at end of file
+package = Chaos tool suite
+files[] = bulk_export.module
Index: bulk_export/bulk_export.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/bulk_export/bulk_export.module,v
retrieving revision 1.3
diff -u -p -r1.3 bulk_export.module
--- bulk_export/bulk_export.module 22 Jul 2009 21:12:07 -0000 1.3
+++ bulk_export/bulk_export.module 5 Oct 2009 23:04:03 -0000
@@ -7,24 +7,30 @@
*/
/**
- * Implementation of hook_perm().
+ * Implement hook_perm().
*/
-function bulk_export_perm() {
- return array('use bulk exporter');
+function bulk_export_permission() {
+ return array(
+ 'use bulk exporter' => array(
+ 'title' => t('Access Bulk Exporter'),
+ 'description' => t('Export various system objects into code.'),
+ ),
+ );
}
/**
- * Implementation of hook_theme().
+ * Implement hook_theme().
*/
function bulk_export_theme() {
- return array('bulk_export_export_form' => array(
+ return array(
+ 'bulk_export_export_form' => array(
'arguments' => array('form' => NULL),
),
);
}
/**
- * Implementation of hook_menu().
+ * Implement hook_menu().
*/
function bulk_export_menu() {
$items['admin/build/bulkexport'] = array(
@@ -56,14 +62,13 @@ function bulk_export_export() {
}
}
if ($exportables) {
- ctools_include('form');
$form_state = array(
're_render' => FALSE,
'no_redirect' => TRUE,
'exportables' => $exportables,
'export_tables' => $export_tables,
);
- $output = ctools_build_form('bulk_export_export_form', $form_state);
+ $output = drupal_build_form('bulk_export_export_form', $form_state);
if (!$output) {
drupal_set_title(t('Bulk export results'));
$output = '';
@@ -138,8 +143,7 @@ function bulk_export_export() {
* FAPI definition for the bulk exporter form.
*
*/
-function bulk_export_export_form(&$form_state) {
- $form = array();
+function bulk_export_export_form($form, &$form_state) {
$form['tables'] = array(
'#prefix' => '
',
'#suffix' => '
',
Index: includes/ajax.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/ajax.inc,v
retrieving revision 1.15
diff -u -p -r1.15 ajax.inc
--- includes/ajax.inc 27 Sep 2009 03:41:01 -0000 1.15
+++ includes/ajax.inc 5 Oct 2009 22:46:20 -0000
@@ -44,7 +44,7 @@ function ctools_ajax_image_button($image
* to use-ajax.
*/
function ctools_ajax_text_button($text, $dest, $alt, $class = '', $type = 'use-ajax') {
- return l($text, $dest, array('html' => TRUE, 'attributes' => array('class' => "$type $class", 'title' => $alt)));
+ return l($text, $dest, array('html' => TRUE, 'attributes' => array('class' => array($type, $class), 'title' => $alt)));
}
/**
@@ -125,13 +125,13 @@ function ctools_ajax_associate_url_to_el
//Create a unique ID to associate $form_element and hidden elements since we dont have an ID
$form_element['#id'] = uniqid('ctools-ajax-url-');
- $form_element['#attributes']['class'] = $type;
+ $form_element['#attributes']['class'] = array($type);
}
//Add hidden form element to hold base URL
$form[$form_element['#id'] . '-url'] = array(
'#type' => 'hidden',
'#value' => $dest,
- '#attributes' => array('class' => $form_element['#id'] . '-url'),
+ '#attributes' => array('class' => array($form_element['#id'] . '-url')),
);
}
Index: includes/content.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/content.inc,v
retrieving revision 1.12
diff -u -p -r1.12 content.inc
--- includes/content.inc 19 Aug 2009 23:21:55 -0000 1.12
+++ includes/content.inc 5 Oct 2009 23:06:45 -0000
@@ -298,7 +298,7 @@ function ctools_content_render($type, $s
$url = $content->title_link;
}
// set defaults so we don't bring up notices
- $url += array('href' => '', 'attributes' => NULL, 'query' => NULL, 'fragment' => NULL, 'absolute' => NULL, 'html' => TRUE);
+ $url += array('href' => '', 'attributes' => array(), 'query' => array(), 'fragment' => '', 'absolute' => NULL, 'html' => TRUE);
$content->title = l($content->title, $url['href'], $url);
}
}
@@ -419,7 +419,7 @@ function ctools_content_admin_info($type
if (empty($output) || !is_object($output)) {
$output = new stdClass();
$output->title = t('No info');
- $output->content =t ('No info available.');
+ $output->content = t('No info available.');
}
return $output;
}
Index: includes/content.menu.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/content.menu.inc,v
retrieving revision 1.3
diff -u -p -r1.3 content.menu.inc
--- includes/content.menu.inc 27 Sep 2009 03:41:01 -0000 1.3
+++ includes/content.menu.inc 5 Oct 2009 22:46:20 -0000
@@ -31,20 +31,20 @@ function ctools_content_autocomplete_nod
$match = preg_match('/^nid: (\d+)/', $string, $preg_matches);
}
if ($match) {
- $arg = $preg_matches[1];
- $where = "n.nid = %d";
+ $arg = array(':nid' => $preg_matches[1]);
+ $where = "n.nid = :nid";
}
else {
- $arg = $string;
- $where = "LOWER(n.title) LIKE LOWER('%%%s%%')";
+ $arg = array(':title' => '%' . $string . '%');
+ $where = "LOWER(n.title) LIKE LOWER(:title)";
}
- $result = db_query_range("SELECT n.nid, n.title, u.name FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE $where", $arg, 0, 10);
+ $result = db_query_range("SELECT n.nid, n.title, u.name FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE $where", 0, 10, $arg);
$matches = array();
- while ($node = db_fetch_object($result)) {
+ foreach ($result as $node) {
$name = empty($node->name) ? variable_get('anonymous', t('Anonymous')) : check_plain($node->name);
$matches[$node->title . " [nid: $node->nid]"] = '' . check_plain($node->title) . ' (' . t('by @user', array('@user' => $name)) . ')';
}
- drupal_json($matches);
+ drupal_json_output($matches);
}
}
Index: includes/context-access-admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/context-access-admin.inc,v
retrieving revision 1.8
diff -u -p -r1.8 context-access-admin.inc
--- includes/context-access-admin.inc 27 Sep 2009 03:41:01 -0000 1.8
+++ includes/context-access-admin.inc 5 Oct 2009 22:46:20 -0000
@@ -113,7 +113,7 @@
/**
* Administrative form for access control.
*/
-function ctools_access_admin_form(&$form_state) {
+function ctools_access_admin_form($form, &$form_state) {
ctools_include('context');
$argument = isset($form_state['callback argument']) ? $form_state['callback argument'] : '';
$fragment = $form_state['module'];
@@ -132,7 +132,7 @@ function ctools_access_admin_form(&$form
);
// This sets up the URL for the add access modal.
$form['add-button']['add-url'] = array(
- '#attributes' => array('class' => "ctools-access-add-url"),
+ '#attributes' => array('class' => array("ctools-access-add-url")),
'#type' => 'hidden',
'#value' => url("ctools/context/ajax/access/add/$fragment", array('absolute' => TRUE)),
);
@@ -147,14 +147,14 @@ function ctools_access_admin_form(&$form
$form['add-button']['type'] = array(
// This ensures that the form item is added to the URL.
- '#attributes' => array('class' => "ctools-access-add-url"),
+ '#attributes' => array('class' => array("ctools-access-add-url")),
'#type' => 'select',
'#options' => $options,
);
$form['add-button']['add'] = array(
'#type' => 'submit',
- '#attributes' => array('class' => 'ctools-use-modal'),
+ '#attributes' => array('class' => array('ctools-use-modal')),
'#id' => "ctools-access-add",
'#value' => t('Add'),
);
@@ -197,23 +197,23 @@ function ctools_access_admin_render_tabl
$plugin = ctools_get_access_plugin($test['name']);
$title = isset($plugin['title']) ? $plugin['title'] : t('Broken/missing access plugin %plugin', array('%plugin' => $test['name']));
- $row[] = array('data' => $title, 'class' => 'ctools-access-title');
+ $row[] = array('data' => $title, 'class' => array('ctools-access-title'));
$description = ctools_access_summary($plugin, $contexts, $test);
- $row[] = array('data' => $description, 'class' => 'ctools-access-description');
+ $row[] = array('data' => $description, 'class' => array('ctools-access-description'));
$operations = ctools_modal_image_button(ctools_image_path('icon-configure.png'), "ctools/context/ajax/access/configure/$fragment/$id", t('Configure settings for this item.'));
$operations .= ctools_ajax_image_button(ctools_image_path('icon-delete.png'), "ctools/context/ajax/access/delete/$fragment/$id", t('Remove this item.'));
- $row[] = array('data' => $operations, 'class' => 'ctools-access-operations', 'align' => 'right');
+ $row[] = array('data' => $operations, 'class' => array('ctools-access-operations'), 'align' => 'right');
$rows[] = $row;
}
$header = array(
- array('data' => t('Title'), 'class' => 'ctools-access-title'),
- array('data' => t('Description'), 'class' => 'ctools-access-description'),
- array('data' => '', 'class' => 'ctools-access-operations', 'align' => 'right'),
+ array('data' => t('Title'), 'class' => array('ctools-access-title')),
+ array('data' => t('Description'), 'class' => array('ctools-access-description')),
+ array('data' => '', 'class' => array('ctools-access-operations'), 'align' => 'right'),
);
if (empty($rows)) {
Index: includes/context-admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/context-admin.inc,v
retrieving revision 1.10
diff -u -p -r1.10 context-admin.inc
--- includes/context-admin.inc 27 Sep 2009 03:41:01 -0000 1.10
+++ includes/context-admin.inc 5 Oct 2009 23:16:33 -0000
@@ -17,7 +17,7 @@
* and can let modules utilize.
*/
function ctools_context_info($type = NULL) {
- static $info = NULL;
+ $info = &drupal_static(__FUNCTION__);
// static doesn't work with functions like t().
if (empty($info)) {
@@ -288,21 +288,21 @@ function ctools_context_add_item_table_b
// The URL for this ajax button
$form['buttons'][$type]['add-url'] = array(
- '#attributes' => array('class' => "ctools-$type-add-url"),
+ '#attributes' => array('class' => array("ctools-$type-add-url")),
'#type' => 'hidden',
'#value' => url("ctools/context/ajax/add/$module/$type/$name", array('absolute' => TRUE)),
);
// This also will be in the URL.
$form['buttons'][$type]['item'] = array(
- '#attributes' => array('class' => "ctools-$type-add-url"),
+ '#attributes' => array('class' => array("ctools-$type-add-url")),
'#type' => 'select',
'#options' => $available_contexts,
);
$form['buttons'][$type]['add'] = array(
'#type' => 'submit',
- '#attributes' => array('class' => 'ctools-use-modal'),
+ '#attributes' => array('class' => array('ctools-use-modal')),
'#id' => "ctools-$type-add",
'#value' => $type_info['add button'],
);
@@ -327,7 +327,7 @@ function ctools_context_add_item_to_form
$form['position'] = array(
'#type' => 'weight',
'#default_value' => $position,
- '#attributes' => array('class' => 'drag-position'),
+ '#attributes' => array('class' => array('drag-position')),
);
}
Index: includes/context.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/context.theme.inc,v
retrieving revision 1.7
diff -u -p -r1.7 context.theme.inc
--- includes/context.theme.inc 3 Aug 2009 21:41:41 -0000 1.7
+++ includes/context.theme.inc 5 Oct 2009 22:46:20 -0000
@@ -93,8 +93,8 @@ function theme_ctools_context_item_form(
if (!empty($form['buttons'])) {
// Display the add context item.
$row = array();
- $row[] = array('data' => drupal_render($form['buttons'][$type]['item']), 'class' => 'title');
- $row[] = array('data' => drupal_render($form['buttons'][$type]['add']), 'class' => 'add', 'width' => "60%");
+ $row[] = array('data' => drupal_render($form['buttons'][$type]['item']), 'class' => array('title'));
+ $row[] = array('data' => drupal_render($form['buttons'][$type]['add']), 'class' => array('add'), 'width' => "60%");
$output .= '';
$output .= drupal_render($form['buttons'][$type]);
$output .= theme('table', array(), array($row), array('id' => $type . '-add-table'));
Index: includes/export.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/export.inc,v
retrieving revision 1.20
diff -u -p -r1.20 export.inc
--- includes/export.inc 1 Oct 2009 21:43:53 -0000 1.20
+++ includes/export.inc 5 Oct 2009 23:18:54 -0000
@@ -220,11 +220,11 @@ function ctools_export_load_object($tabl
}
/**
- * Reset all static caches in ctools_export_load_object() or static caches for
+ * Reset all static caches in ctools_export_load_object() or static caches for
* a given table in ctools_export_load_object().
- *
+ *
* @param $table
- * String that is the name of a table. If not defined, all static caches in
+ * String that is the name of a table. If not defined, all static caches in
* ctools_export_load_object() will be reset.
*/
function ctools_export_load_object_reset($table = NULL) {
@@ -285,7 +285,7 @@ function ctools_get_default_object($tabl
* to get default objects.
*/
function _ctools_export_get_defaults($table, $export) {
- static $cache = array();
+ $cache = &drupal_static(__FUNCTION__, array());
if (!isset($cache[$table])) {
$cache[$table] = array();
@@ -491,7 +491,8 @@ function ctools_export_get_schema($table
* Gets the schemas for all tables with ctools object metdata.
*/
function ctools_export_get_schemas($for_export = FALSE) {
- static $export_tables;
+ $export_tables = &drupal_static(__FUNCTION__);
+
if (is_null($export_tables)) {
$export_tables = array();
$schemas = drupal_get_schema();
Index: includes/plugins.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/plugins.inc,v
retrieving revision 1.19
diff -u -p -r1.19 plugins.inc
--- includes/plugins.inc 27 Sep 2009 03:41:01 -0000 1.19
+++ includes/plugins.inc 5 Oct 2009 23:10:06 -0000
@@ -56,7 +56,7 @@
* need. This should be in the documentation for that particular API.
*/
function ctools_plugin_api_info($owner, $api, $minimum_version, $current_version) {
- static $cache = array();
+ $cache = &drupal_static(__FUNCTION__, array());
if (!isset($cache[$owner][$api])) {
$cache[$owner][$api] = array();
foreach (module_implements('ctools_plugin_api') as $module) {
@@ -104,7 +104,7 @@ function ctools_plugin_api_info($owner,
* The API information, in case you need it.
*/
function ctools_plugin_api_include($owner, $api, $minimum_version, $current_version) {
- static $already_done = array();
+ $already_done = &drupal_static(__FUNCTION__, array());
$info = ctools_plugin_api_info($owner, $api, $minimum_version, $current_version);
if (!isset($already_done[$owner][$api])) {
@@ -141,10 +141,10 @@ function ctools_plugin_api_include($owne
* of the array are specific to the plugin.
*/
function ctools_get_plugins($module, $type, $id = NULL) {
- static $plugins = array();
- static $all_hooks = array();
- static $all_files = array();
- static $info = array();
+ $plugins = &drupal_static('ctools_get_plugins_plugins', array());
+ $all_hooks = &drupal_static('ctools_get_plugins_all_hooks', array());
+ $all_files = &drupal_static('ctools_get_plugins_all_files', array());
+ $info = &drupal_static('ctools_get_plugins_info', array());
if (!isset($info[$module][$type])) {
$info[$module][$type] = ctools_plugin_get_info($module, $type);
Index: includes/wizard.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/wizard.inc,v
retrieving revision 1.13
diff -u -p -r1.13 wizard.inc
--- includes/wizard.inc 27 Sep 2009 03:41:01 -0000 1.13
+++ includes/wizard.inc 5 Oct 2009 22:46:20 -0000
@@ -218,7 +218,7 @@ function ctools_wizard_wrapper(&$form, &
$button_attributes = array();
if (!empty($form_state['ajax']) && empty($form_state['modal'])) {
- $button_attributes = array('class' => 'ctools-use-ajax');
+ $button_attributes = array('class' => array('ctools-use-ajax'));
}
if (!empty($form_info['show back']) && isset($form_state['previous'])) {
Index: page_manager/page_manager.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/page_manager/page_manager.admin.inc,v
retrieving revision 1.28
diff -u -p -r1.28 page_manager.admin.inc
--- page_manager/page_manager.admin.inc 27 Sep 2009 03:41:02 -0000 1.28
+++ page_manager/page_manager.admin.inc 5 Oct 2009 22:46:20 -0000
@@ -71,14 +71,14 @@ function page_manager_list_page($js = NU
$form = ctools_build_form('page_manager_list_pages_form', $form_state);
$header = array(
- array('data' => t('Type'), 'class' => 'page-manager-page-type'),
- array('data' => t('Name'), 'class' => 'page-manager-page-name'),
- array('data' => t('Title'), 'class' => 'page-manager-page-title'),
- array('data' => t('Path'), 'class' => 'page-manager-page-path'),
- array('data' => t('Storage'), 'class' => 'page-manager-page-storage'),
+ array('data' => t('Type'), 'class' => array('page-manager-page-type')),
+ array('data' => t('Name'), 'class' => array('page-manager-page-name')),
+ array('data' => t('Title'), 'class' => array('page-manager-page-title')),
+ array('data' => t('Path'), 'class' => array('page-manager-page-path')),
+ array('data' => t('Storage'), 'class' => array('page-manager-page-storage')),
);
- $header[] = array('data' => t('Operations'), 'class' => 'page-manager-page-operations');
+ $header[] = array('data' => t('Operations'), 'class' => array('page-manager-page-operations'));
$table = theme('table', $header, $pages['rows'], array('id' => 'page-manager-list-pages'));
$operations = '
' . theme('links', $pages['operations']) . '
';
@@ -120,13 +120,13 @@ function page_manager_get_pages($tasks,
$task_name = $task['name'];
}
- $class = 'page-task-' . $id;
+ $class = array('page-task-' . $id);
if (isset($task['row class'])) {
- $class .= ' ' . $task['row class'];
+ $class[] = $task['row class'];
}
if (!empty($task['disabled'])) {
- $class .= ' page-manager-disabled';
+ $class[] = 'page-manager-disabled';
}
$path = array();
@@ -148,15 +148,15 @@ function page_manager_get_pages($tasks,
$type = isset($task['admin type']) ? $task['admin type'] : t('System');
$pages['types'][$type] = $type;
- $row['data']['type'] = array('data' => $type, 'class' => 'page-manager-page-type');
+ $row['data']['type'] = array('data' => $type, 'class' => array('page-manager-page-type'));
- $row['data']['name'] = array('data' => $task_name, 'class' => 'page-manager-page-name');
- $row['data']['title'] = array('data' => $task['admin title'], 'class' => 'page-manager-page-title');
- $row['data']['path'] = array('data' => $visible_path, 'class' => 'page-manager-page-path');
+ $row['data']['name'] = array('data' => $task_name, 'class' => array('page-manager-page-name'));
+ $row['data']['title'] = array('data' => $task['admin title'], 'class' => array('page-manager-page-title'));
+ $row['data']['path'] = array('data' => $visible_path, 'class' => array('page-manager-page-path'));
$storage = isset($task['storage']) ? $task['storage'] : t('In code');
$pages['storages'][$storage] = $storage;
- $row['data']['storage'] = array('data' => $storage, 'class' => 'page-manager-page-storage');
+ $row['data']['storage'] = array('data' => $storage, 'class' => array('page-manager-page-storage'));
/*
@@ -192,7 +192,7 @@ function page_manager_get_pages($tasks,
}
}
- $row['data']['operations'] = array('data' => theme('links', $operations), 'class' => 'page-manager-page-operations');
+ $row['data']['operations'] = array('data' => theme('links', $operations), 'class' => array('page-manager-page-operations'));
$pages['disabled'][$task_name] = !empty($task['disabled']);
$pages['rows'][$task_name] = $row;
@@ -273,14 +273,14 @@ function page_manager_list_pages_form(&$
'#type' => 'submit',
'#id' => 'edit-pages-apply',
'#value' => t('Apply'),
- '#attributes' => array('class' => 'ctools-use-ajax'),
+ '#attributes' => array('class' => array('ctools-use-ajax')),
);
$form['reset'] = array(
'#type' => 'submit',
'#id' => 'edit-pages-reset',
'#value' => t('Reset'),
- '#attributes' => array('class' => 'ctools-use-ajax'),
+ '#attributes' => array('class' => array('ctools-use-ajax')),
);
ctools_add_js('ajax-responder');
@@ -373,7 +373,7 @@ function page_manager_edit_page($page) {
$operations = page_manager_get_operations($page);
$args = array('summary');
- $rendered_operations = page_manager_render_operations($page, $operations, $args, array('class' => 'operations-main'), 'nav');
+ $rendered_operations = page_manager_render_operations($page, $operations, $args, array('class' => array('operations-main')), 'nav');
$content = page_manager_get_operation_content(FALSE, $page, $args, $operations);
$output = theme('page_manager_edit_page', $page, $form, $rendered_operations, $content);
@@ -410,7 +410,7 @@ function page_manager_edit_page_operatio
// operations, such as renaming or adding a handler. Thus we get a new set
// of operations.
$operations = page_manager_get_operations($page);
- $rendered_operations = page_manager_render_operations($page, $operations, $args, array('class' => 'operations-main'), 'nav');
+ $rendered_operations = page_manager_render_operations($page, $operations, $args, array('class' => array('operations-main')), 'nav');
// Since this form should never be submitted to this page, process it late so
// that we can be sure it notices changes.
@@ -465,7 +465,7 @@ function page_manager_get_operations($pa
'actions' => array(
'type' => 'group',
'title' => '',
- 'class' => 'operations-actions',
+ 'class' => array('operations-actions'),
'location' => 'primary',
'children' => array(),
),
@@ -611,7 +611,7 @@ function page_manager_get_handler_operat
ctools_include('export');
$group = array(
'type' => 'group',
- 'class' => 'operations-handlers',
+ 'class' => array('operations-handlers'),
'title' => t('Variants'),
);
@@ -628,7 +628,7 @@ function page_manager_get_handler_operat
$operations[$id] = array(
'type' => 'group',
- 'class' => 'operations-handlers-' . $id,
+ 'class' => array('operations-handlers-' . $id),
'title' => page_manager_get_handler_title($plugin, $handler, $page->task, $page->subtask_id),
'collapsible' => $collapsible,
'children' => array(),
@@ -636,7 +636,7 @@ function page_manager_get_handler_operat
$operations[$id]['children']['actions'] = array(
'type' => 'group',
- 'class' => 'operations-handlers-actions-' . $id,
+ 'class' => array('operations-handlers-actions-' . $id),
'title' => t('Variant operations'),
'children' => array(),
'location' => $id,
@@ -1042,29 +1042,29 @@ function page_manager_render_operations(
// We only render an li for things in the same nav tree.
if (empty($operation['location']) || $operation['location'] == $location) {
- $class = $attributes['class'];
+ $class = array($attributes['class']);
if ($id == $first) {
- $class .= ' operation-first';
+ $class[] = 'operation-first';
}
else if ($id == $last) {
- $class .= ' operation-last';
+ $class[] = 'operation-last';
}
if (empty($operation['silent']) && !empty($page->changes[$current_path])) {
- $class .= $operation['type'] == 'group' ? ' changed-group' : ' changed';
+ $class[] = $operation['type'] == 'group' ? 'changed-group' : 'changed';
}
else {
- $class .= ' not-changed';
+ $class[] = 'not-changed';
}
if ($active == $id) {
- $class .= $operation['type'] == 'group' ? ' active-group' : ' active';
+ $class[] = $operation['type'] == 'group' ? 'active-group' : 'active';
}
else {
- $class .= ' not-active';
+ $class[] = 'not-active';
}
- $output[$location] .= '
';
+ $output[$location] .= '';
}
switch ($operation['type']) {
@@ -1084,12 +1084,12 @@ function page_manager_render_operations(
}
}
- $class = 'page-manager-operation';
+ $class = array('page-manager-operation');
if (!isset($operation['ajax']) || !empty($operation['ajax'])) {
- $class .= ' ctools-use-ajax';
+ $class[] = 'ctools-use-ajax';
}
if (!empty($operation['class'])) {
- $class .= ' ' . $operation['class'];
+ $class[] = $operation['class'];
}
$description = isset($operation['description']) ? $operation['description'] : '';
Index: page_manager/plugins/tasks/page.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/page_manager/plugins/tasks/page.admin.inc,v
retrieving revision 1.19
diff -u -p -r1.19 page.admin.inc
--- page_manager/plugins/tasks/page.admin.inc 27 Sep 2009 03:41:02 -0000 1.19
+++ page_manager/plugins/tasks/page.admin.inc 5 Oct 2009 22:46:20 -0000
@@ -858,14 +858,14 @@ function page_manager_page_form_argument
// The URL for this ajax button
$form['table']['argument'][$keyword]['change-url'] = array(
- '#attributes' => array('class' => "page-manager-context-$keyword-change-url"),
+ '#attributes' => array('class' => array("page-manager-context-$keyword-change-url")),
'#type' => 'hidden',
'#value' => url("admin/build/pages/argument/change/$task_name/$keyword", array('absolute' => TRUE)),
);
$form['table']['argument'][$keyword]['change'] = array(
'#type' => 'submit',
'#value' => t('Change'),
- '#attributes' => array('class' => 'ctools-use-modal'),
+ '#attributes' => array('class' => array('ctools-use-modal')),
'#id' => "page-manager-context-$keyword-change",
);
@@ -875,14 +875,14 @@ function page_manager_page_form_argument
if (!empty($plugin)) {
// The URL for this ajax button
$form['table']['argument'][$keyword]['settings-url'] = array(
- '#attributes' => array('class' => "page-manager-context-$keyword-settings-url"),
+ '#attributes' => array('class' => array("page-manager-context-$keyword-settings-url")),
'#type' => 'hidden',
'#value' => url("admin/build/pages/argument/settings/$task_name/$keyword", array('absolute' => TRUE)),
);
$form['table']['argument'][$keyword]['settings'] = array(
'#type' => 'submit',
'#value' => t('Settings'),
- '#attributes' => array('class' => 'ctools-use-modal'),
+ '#attributes' => array('class' => array('ctools-use-modal')),
'#id' => "page-manager-context-$keyword-settings",
);
}
@@ -894,10 +894,10 @@ function page_manager_page_form_argument
*/
function theme_page_manager_page_form_argument_table($form) {
$header = array(
- array('data' => t('Argument'), 'class' => 'page-manager-argument'),
- array('data' => t('Position in path'), 'class' => 'page-manager-position'),
- array('data' => t('Context assigned'), 'class' => 'page-manager-context'),
- array('data' => t('Operations'), 'class' => 'page-manager-operations'),
+ array('data' => t('Argument'), 'class' => array('page-manager-argument')),
+ array('data' => t('Position in path'), 'class' => array('page-manager-position')),
+ array('data' => t('Context assigned'), 'class' => array('page-manager-context')),
+ array('data' => t('Operations'), 'class' => array('page-manager-operations')),
);
$rows = array();
Index: page_manager/plugins/tasks/page.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/page_manager/plugins/tasks/page.inc,v
retrieving revision 1.17
diff -u -p -r1.17 page.inc
--- page_manager/plugins/tasks/page.inc 19 Aug 2009 01:12:24 -0000 1.17
+++ page_manager/plugins/tasks/page.inc 5 Oct 2009 22:46:20 -0000
@@ -572,9 +572,9 @@ function page_manager_page_admin_summary
$rows = array();
$rows[] = array(
- array('class' => t('page-summary-label'), 'data' => t('Storage')),
- array('class' => t('page-summary-data'), 'data' => $subtask['storage']),
- array('class' => t('page-summary-operation'), 'data' => ''),
+ array('class' => array('page-summary-label'), 'data' => t('Storage')),
+ array('class' => array('page-summary-data'), 'data' => $subtask['storage']),
+ array('class' => array('page-summary-operation'), 'data' => ''),
);
if (!empty($page->disabled)) {
@@ -587,9 +587,9 @@ function page_manager_page_admin_summary
}
$rows[] = array(
- array('class' => t('page-summary-label'), 'data' => t('Status')),
- array('class' => t('page-summary-data'), 'data' => $text),
- array('class' => t('page-summary-operation'), 'data' => $link),
+ array('class' => array('page-summary-label'), 'data' => t('Status')),
+ array('class' => array('page-summary-data'), 'data' => $text),
+ array('class' => array('page-summary-operation'), 'data' => $link),
);
@@ -614,8 +614,8 @@ function page_manager_page_admin_summary
if ($message) {
$rows[] = array(
- array('class' => t('page-summary-data'), 'data' => $message, 'colspan' => 2),
- array('class' => t('page-summary-operation'), 'data' => $link),
+ array('class' => array('page-summary-data'), 'data' => $message, 'colspan' => 2),
+ array('class' => array('page-summary-operation'), 'data' => $link),
);
}
@@ -627,9 +627,9 @@ function page_manager_page_admin_summary
}
$rows[] = array(
- array('class' => t('page-summary-label'), 'data' => t('Path')),
- array('class' => t('page-summary-data'), 'data' => $path),
- array('class' => t('page-summary-operation'), 'data' => $link),
+ array('class' => array('page-summary-label'), 'data' => t('Path')),
+ array('class' => array('page-summary-data'), 'data' => $path),
+ array('class' => array('page-summary-operation'), 'data' => $link),
);
if (empty($access['plugins'])) {
@@ -648,9 +648,9 @@ function page_manager_page_admin_summary
$link = l(t('Edit'), page_manager_edit_url($task_name, array('settings', 'access')));
$rows[] = array(
- array('class' => t('page-summary-label'), 'data' => t('Access')),
- array('class' => t('page-summary-data'), 'data' => $access),
- array('class' => t('page-summary-operation'), 'data' => $link),
+ array('class' => array('page-summary-label'), 'data' => t('Access')),
+ array('class' => array('page-summary-data'), 'data' => $access),
+ array('class' => array('page-summary-operation'), 'data' => $link),
);
$menu_options = array(
@@ -683,9 +683,9 @@ function page_manager_page_admin_summary
$link = l(t('Edit'), page_manager_edit_url($task_name, array('settings', 'menu')));
$rows[] = array(
- array('class' => t('page-summary-label'), 'data' => t('Menu')),
- array('class' => t('page-summary-data'), 'data' => $menu),
- array('class' => t('page-summary-operation'), 'data' => $link),
+ array('class' => array('page-summary-label'), 'data' => t('Menu')),
+ array('class' => array('page-summary-data'), 'data' => $menu),
+ array('class' => array('page-summary-operation'), 'data' => $link),
);
$output .= theme('table', array(), $rows, array('id' => 'page-manager-page-summary'));
Index: page_manager/plugins/tasks/term_view.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/page_manager/plugins/tasks/term_view.inc,v
retrieving revision 1.5
diff -u -p -r1.5 term_view.inc
--- page_manager/plugins/tasks/term_view.inc 4 Aug 2009 21:43:06 -0000 1.5
+++ page_manager/plugins/tasks/term_view.inc 5 Oct 2009 22:46:20 -0000
@@ -255,23 +255,23 @@ function page_manager_term_view_admin_su
$task_name = page_manager_make_task_name($task['name'], $subtask['name']);
$rows[] = array(
- array('class' => t('page-summary-label'), 'data' => t('Path')),
- array('class' => t('page-summary-data'), 'data' => 'taxonomy/term/%term'),
- array('class' => t('page-summary-operation'), 'data' => ''),
+ array('class' => array('page-summary-label'), 'data' => t('Path')),
+ array('class' => array('page-summary-data'), 'data' => 'taxonomy/term/%term'),
+ array('class' => array('page-summary-operation'), 'data' => ''),
);
$rows[] = array(
- array('class' => t('page-summary-label'), 'data' => t('Access')),
- array('class' => t('page-summary-data'), 'data' => t('This page is publicly accessible.')),
- array('class' => t('page-summary-operation'), 'data' => ''),
+ array('class' => array('page-summary-label'), 'data' => t('Access')),
+ array('class' => array('page-summary-data'), 'data' => t('This page is publicly accessible.')),
+ array('class' => array('page-summary-operation'), 'data' => ''),
);
$menu = t('No menu entry');
$rows[] = array(
- array('class' => t('page-summary-label'), 'data' => t('Menu')),
- array('class' => t('page-summary-data'), 'data' => $menu),
- array('class' => t('page-summary-operation'), 'data' => ''),
+ array('class' => array('page-summary-label'), 'data' => t('Menu')),
+ array('class' => array('page-summary-data'), 'data' => $menu),
+ array('class' => array('page-summary-operation'), 'data' => ''),
);
if (variable_get('page_manager_term_view_type', 'multiple') == 'multiple') {
@@ -282,9 +282,9 @@ function page_manager_term_view_admin_su
}
$rows[] = array(
- array('class' => t('page-summary-label'), 'data' => t('%term')),
- array('class' => t('page-summary-data'), 'data' => $message),
- array('class' => t('page-summary-operation'), 'data' => ''),
+ array('class' => array('page-summary-label'), 'data' => t('%term')),
+ array('class' => array('page-summary-data'), 'data' => $message),
+ array('class' => array('page-summary-operation'), 'data' => ''),
);
if (variable_get('page_manager_taxonomy_breadcrumb', TRUE)) {
@@ -295,9 +295,9 @@ function page_manager_term_view_admin_su
}
$rows[] = array(
- array('class' => t('page-summary-label'), 'data' => t('Breadcrumb')),
- array('class' => t('page-summary-data'), 'data' => $message),
- array('class' => t('page-summary-operation'), 'data' => ''),
+ array('class' => array('page-summary-label'), 'data' => t('Breadcrumb')),
+ array('class' => array('page-summary-data'), 'data' => $message),
+ array('class' => array('page-summary-operation'), 'data' => ''),
);
$output = theme('table', array(), $rows, array('id' => 'page-manager-page-summary'));
Index: page_manager/theme/page_manager.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/page_manager/theme/page_manager.theme.inc,v
retrieving revision 1.5
diff -u -p -r1.5 page_manager.theme.inc
--- page_manager/theme/page_manager.theme.inc 27 Sep 2009 03:41:02 -0000 1.5
+++ page_manager/theme/page_manager.theme.inc 5 Oct 2009 22:46:20 -0000
@@ -84,13 +84,13 @@ function theme_page_manager_handler_rear
$row[] = array(
'data' => drupal_render($element['title']),
- 'class' => 'page-manager-handler',
+ 'class' => array('page-manager-handler'),
);
- $element['weight']['#attributes']['class'] = 'weight';
+ $element['weight']['#attributes']['class'][] = 'weight';
$row[] = drupal_render($element['weight']);
- $rows[] = array('data' => $row, 'class' => 'draggable', 'id' => 'page-manager-row-' . $id);
+ $rows[] = array('data' => $row, 'class' => array('draggable'), 'id' => 'page-manager-row-' . $id);
}
}
@@ -99,7 +99,7 @@ function theme_page_manager_handler_rear
}
$header = array(
- array('data' => t('Variant'), 'class' => 'page-manager-handler'),
+ array('data' => t('Variant'), 'class' => array('page-manager-handler')),
t('Weight'),
);
Index: plugins/content_types/user_context/profile_fields.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/plugins/content_types/user_context/profile_fields.inc,v
retrieving revision 1.5
diff -u -p -r1.5 profile_fields.inc
--- plugins/content_types/user_context/profile_fields.inc 27 Sep 2009 03:41:03 -0000 1.5
+++ plugins/content_types/user_context/profile_fields.inc 5 Oct 2009 22:46:20 -0000
@@ -41,6 +41,7 @@ function ctools_profile_fields_content_t
if (is_array($account->content[$category])) {
foreach ($account->content[$category] as $field) {
if (is_array($field['#attributes'])) {
+ // @todo 'class' is *always* an array now. 04/10/2009 sun
$vars[$field['#attributes']['class']]['title'] = $field['#title'];
$vars[$field['#attributes']['class']]['value'] = $field['#value'];
}