From 5b52254b6a6ea6e94b0e1ab06ca9a178ece3b463 Mon Sep 17 00:00:00 2001 From: Earl Miles <merlin@logrus.com> Date: Thu, 29 Jan 2009 22:12:05 +0000 Subject: [PATCH] #360766 by sun: code cleanup to match standards. --- ctools.install | 1 + ctools.module | 1 + delegator/delegator.admin.inc | 53 ++++++++------- delegator/delegator.install | 3 +- delegator/delegator.module | 14 ++-- delegator/plugins/task_types/page.admin.inc | 2 +- delegator/plugins/task_types/page.inc | 2 + delegator/plugins/tasks/node_edit.inc | 7 +- delegator/plugins/tasks/node_view.inc | 7 +- delegator/plugins/tasks/page.admin.inc | 72 +++++++++++---------- delegator/plugins/tasks/page.inc | 21 +++--- delegator/plugins/tasks/user_view.inc | 7 +- includes/ajax.inc | 6 +- includes/collapsible.theme.inc | 11 ++-- includes/context-access-admin.inc | 31 +++++---- includes/context-admin.inc | 39 ++++++----- includes/context-task-handler.inc | 3 + includes/context.inc | 18 ++++-- includes/context.theme.inc | 2 + includes/css.inc | 17 ++--- includes/dependent.inc | 1 + includes/dropdown.theme.inc | 1 + includes/form.inc | 3 +- includes/menu.inc | 6 +- includes/modal.inc | 1 + includes/object-cache.inc | 2 +- includes/plugins.inc | 8 +-- includes/wizard.theme.inc | 1 + plugins/access/node_access.inc | 6 +- plugins/access/node_language.inc | 3 +- plugins/access/node_type.inc | 3 +- plugins/access/perm.inc | 1 + plugins/access/role.inc | 3 +- plugins/access/site_language.inc | 3 +- plugins/arguments/nid.inc | 1 + plugins/arguments/node_add.inc | 1 + plugins/arguments/node_edit.inc | 1 + plugins/arguments/term.inc | 1 + plugins/arguments/uid.inc | 1 + plugins/arguments/vid.inc | 1 + plugins/contexts/node.inc | 7 +- 41 files changed, 202 insertions(+), 170 deletions(-) diff --git a/ctools.install b/ctools.install index 7de01fe8..ca77e96b 100644 --- a/ctools.install +++ b/ctools.install @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * Contains install and update functions for ctools. diff --git a/ctools.module b/ctools.module index 39c2371f..fe62bfab 100644 --- a/ctools.module +++ b/ctools.module @@ -9,6 +9,7 @@ * nothing more than a few convenience functions and some hooks that * must be implemented in the module file. */ + /** * Include ctools .inc files as necessary. */ diff --git a/delegator/delegator.admin.inc b/delegator/delegator.admin.inc index d4406346..18486038 100644 --- a/delegator/delegator.admin.inc +++ b/delegator/delegator.admin.inc @@ -205,6 +205,7 @@ function delegator_admin_new_task_handler($handler, $task_name, $task, $subtask_ return "admin/build/delegator/$task_name"; } } + /** * Used as a callback to uasort to sort the task cache by weight. * @@ -304,10 +305,10 @@ function delegator_administer_task($task_name) { * Form to administer task handlers assigned to a task. */ function delegator_admin_list_form(&$form_state) { - $task = &$form_state['task']; - $subtask = &$form_state['subtask']; + $task = &$form_state['task']; + $subtask = &$form_state['subtask']; $task_handlers = &$form_state['task_handlers']; - $cache = &$form_state['cache']; + $cache = &$form_state['cache']; // Get a list of possible task handlers for this task. $task_handler_plugins = delegator_get_task_handler_plugins($task); @@ -415,7 +416,7 @@ function delegator_admin_list_form(&$form_state) { } $form['handlers'][$id]['dropdown'] = array( - '#value' => theme('ctools_dropdown', t('Operations'), delegator_admin_make_dropdown_links($actions), 'delegator-task-handler-operations') + '#value' => theme('ctools_dropdown', t('Operations'), delegator_admin_make_dropdown_links($actions), 'delegator-task-handler-operations'), ); $form['handlers'][$id]['action'] = array( @@ -535,7 +536,7 @@ function delegator_admin_make_dropdown_links($actions) { } if (is_array($text)) { - $links[] = array( + $links[] = array( 'title' => '<span class="text">' . $id . '</span>' . theme('links', delegator_admin_make_dropdown_links($text)), 'html' => TRUE, ); @@ -557,10 +558,10 @@ function delegator_admin_make_dropdown_links($actions) { function theme_delegator_admin_list_form($form) { $output = ''; if (!empty($form['#delegator-lock'])) { - $account = user_load($form['#delegator-lock']->uid); - $name = theme('username', $account); + $account = user_load($form['#delegator-lock']->uid); + $name = theme('username', $account); $lock_age = format_interval(time() - $form['#delegator-lock']->updated); - $break = url('admin/build/delegator/' . $form['#task-name'] . '/break-lock'); + $break = url('admin/build/delegator/' . $form['#task-name'] . '/break-lock'); $output .= '<div class="delegator-locked">'; $output .= t('This task is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to <a href="!break">break this lock</a>.', array('!user' => $name, '!age' => $lock_age, '!break' => $break)); @@ -636,7 +637,7 @@ function theme_delegator_admin_list_form($form) { array('data' => t('Task handler'), 'class' => 'delegator-handler'), array('data' => t('Type'), 'class' => 'delegator-type'), t('Weight'), - array('data' => t('Operations'), 'class' => 'delegator-operations') + array('data' => t('Operations'), 'class' => 'delegator-operations'), ); drupal_add_tabledrag('delegator-task-list-arrange', 'order', 'sibling', 'weight'); @@ -858,7 +859,6 @@ function delegator_admin_list_form_action($form, &$form_state) { return; } - /** * Delegated submit handler to delete an item. */ @@ -986,10 +986,8 @@ function delegator_admin_task_handler_form_info($task_name) { 'id' => 'delegator_task_handler', 'show back' => TRUE, 'show cancel' => TRUE, - 'return path' => "admin/build/delegator/$task_name", - - 'next callback' => 'delegator_admin_edit_task_handler_next', + 'next callback' => 'delegator_admin_edit_task_handler_next', 'finish callback' => 'delegator_admin_edit_task_handler_finish', 'return callback' => 'delegator_admin_edit_task_handler_finish', 'cancel callback' => 'delegator_admin_edit_task_handler_cancel', @@ -1002,9 +1000,9 @@ function delegator_admin_task_handler_form_info($task_name) { function delegator_administer_task_handler_edit($task_name, $handler_id, $name, $step) { list($task_id, $subtask_id) = delegator_get_task_id($task_name); - $task = delegator_get_task($task_id); + $task = delegator_get_task($task_id); $subtask = delegator_get_task_subtask($task, $subtask_id); - $plugin = delegator_get_task_handler($handler_id); + $plugin = delegator_get_task_handler($handler_id); $cache = delegator_admin_get_task_cache($task, $subtask_id); @@ -1031,7 +1029,7 @@ function delegator_administer_task_handler_edit($task_name, $handler_id, $name, } $form_info['order'] = $plugin['edit forms']; $form_info['forms'] = $plugin['forms']; - $form_info['path'] = "admin/build/delegator/$task_name/$handler_id/$name/%step"; + $form_info['path'] = "admin/build/delegator/$task_name/$handler_id/$name/%step"; if (empty($plugin['forms'][$step]['no return'])) { $form_info['show return'] = TRUE; } @@ -1077,9 +1075,9 @@ function delegator_administer_task_handler_add($task_name, $name, $step) { return drupal_not_found(); } - $task = delegator_get_task($task_id); + $task = delegator_get_task($task_id); $subtask = delegator_get_task_subtask($task, $subtask_id); - $plugin = delegator_get_task_handler($handler->handler); + $plugin = delegator_get_task_handler($handler->handler); // Prevent silliness of using some other handler type's tabs for this // particular handler, or of somehow having invalid tasks or task handlers. @@ -1153,7 +1151,6 @@ function delegator_admin_edit_task_handler_next(&$form_state) { } } - /** * Form wizard finish handler; called to update everything the wizard touched. * @@ -1231,11 +1228,12 @@ function delegator_administer_break_lock(&$form_state, $task_name) { $account = user_load($lock->uid); return confirm_form($form, - t('Are you sure you want to break this lock?'), - $cancel, - t('By breaking this lock, any unsaved changes made by !user will be lost!', array('!user' => theme('username', $account))), - t('Break lock'), - t('Cancel')); + t('Are you sure you want to break this lock?'), + $cancel, + t('By breaking this lock, any unsaved changes made by !user will be lost!', array('!user' => theme('username', $account))), + t('Break lock'), + t('Cancel') + ); } /** @@ -1303,10 +1301,10 @@ function delegator_admin_import_task_handler_validate($form, &$form_state) { // See if the task is already locked. $cache = delegator_admin_get_task_cache($form_state['task'], $handler->subtask); if ($cache->locked) { - $account = user_load($cache->locked->uid); - $name = theme('username', $account); + $account = user_load($cache->locked->uid); + $name = theme('username', $account); $lock_age = format_interval(time() - $cache->locked->updated); - $break = url('admin/build/delegator/' . $handler->task . '/break-lock', array('query' => array('destination' => $_GET['q'], 'cancel' => $_GET['q']))); + $break = url('admin/build/delegator/' . $handler->task . '/break-lock', array('query' => array('destination' => $_GET['q'], 'cancel' => $_GET['q']))); form_error($form['object'], t('Unable to import task handler because the task is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to <a href="!break">break this lock</a>.', array('!user' => $name, '!age' => $lock_age, '!break' => $break))); } @@ -1348,3 +1346,4 @@ function delegator_admin_import_task_handler_submit($form, &$form_state) { delegator_admin_set_task_cache($form_state['task'], $handler->subtask, $cache); $form_state['redirect'] = 'admin/build/delegator/' . $form_state['task_name']; } + diff --git a/delegator/delegator.install b/delegator/delegator.install index 04132dce..c6e1889c 100644 --- a/delegator/delegator.install +++ b/delegator/delegator.install @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * Installation routines for delegator module. @@ -84,7 +85,7 @@ function delegator_schema_1() { ), 'primary key' => array('name'), 'indexes' => array( - 'weights' => array('name', 'weight'), + 'weights' => array('name', 'weight'), ), ); diff --git a/delegator/delegator.module b/delegator/delegator.module index c98d5b9a..42e0f4a6 100644 --- a/delegator/delegator.module +++ b/delegator/delegator.module @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * @@ -485,14 +486,14 @@ function delegator_new_task_handler($task, $subtask_id, $plugin, $weight = 0, $c } // Create a new, empty handler object. - $handler = new stdClass; - $handler->title = ''; - $handler->task = $task['name']; + $handler = new stdClass; + $handler->title = ''; + $handler->task = $task['name']; $handler->subtask = $subtask_id; - $handler->name = $name; + $handler->name = $name; $handler->handler = $plugin['name']; - $handler->weight = $weight; - $handler->conf = array(); + $handler->weight = $weight; + $handler->conf = array(); // These are provided by the core export API provided by ctools and we // set defaults here so that we don't cause notices. Perhaps ctools should @@ -787,3 +788,4 @@ function delegator_task_handler_ctools_access_set($argument, $access) { delegator_admin_set_task_cache($task, $subtask_id, $cache); } } + diff --git a/delegator/plugins/task_types/page.admin.inc b/delegator/plugins/task_types/page.admin.inc index 3706c64e..cf3925ae 100644 --- a/delegator/plugins/task_types/page.admin.inc +++ b/delegator/plugins/task_types/page.admin.inc @@ -108,7 +108,7 @@ function delegator_page_type_sort_tasks($tasks, &$tables, $bucket, $task_id = NU $operations = array( array( 'title' => t('Task handlers'), - 'href' => "admin/build/delegator/$task_name" + 'href' => "admin/build/delegator/$task_name", ), ); } diff --git a/delegator/plugins/task_types/page.inc b/delegator/plugins/task_types/page.inc index cdf20576..614bff79 100644 --- a/delegator/plugins/task_types/page.inc +++ b/delegator/plugins/task_types/page.inc @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * Groups tasks that provide pages and provides a common administrative UI for them. @@ -54,3 +55,4 @@ function delegator_page_type_menu(&$items, $task) { 'weight' => -10, ) + $base; } + diff --git a/delegator/plugins/tasks/node_edit.inc b/delegator/plugins/tasks/node_edit.inc index f61077cb..c6fd11a7 100644 --- a/delegator/plugins/tasks/node_edit.inc +++ b/delegator/plugins/tasks/node_edit.inc @@ -10,18 +10,14 @@ function delegator_node_edit_delegator_tasks() { 'node_edit' => array( // This is a 'page' task and will fall under the page admin UI 'task type' => 'page', - 'title' => t('Node edit'), 'description' => t('The node edit task allows you to control what handler will handle the job of editing a node at the path <em>node/%node/edit</em>. It also handles the node add page at node/add/%type. If no handler is set or matches the criteria, the default Drupal node renderer will be used. Please note that some modules sufficiently customize their node add and edit procedure that this may not successfully override adding or editing of all types.'), - 'admin title' => 'Node edit', // translated by menu system 'admin description' => 'Overrides for the built in node edit handler at <em>node/%node/edit</em>.', 'admin path' => 'node/%node/edit', - // Menu hooks so that we can alter the node/%node menu entry to point to us. 'hook menu' => 'delegator_node_edit_menu', 'hook menu alter' => 'delegator_node_edit_menu_alter', - // This is task uses 'context' handlers and must implement these to give the // handler data it needs. 'handler type' => 'context', // handler type -- misnamed @@ -103,7 +99,7 @@ function delegator_node_add($type) { 'uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, - 'language' => '' + 'language' => '', ); drupal_set_title(t('Create @name', array('@name' => $types[$type]->name))); @@ -134,3 +130,4 @@ function delegator_node_edit_get_arguments($task, $subtask_id) { function delegator_node_edit_get_contexts($task, $subtask_id) { return ctools_context_get_placeholders_from_argument(delegator_node_edit_get_arguments($task, $subtask_id)); } + diff --git a/delegator/plugins/tasks/node_view.inc b/delegator/plugins/tasks/node_view.inc index bd7d0f77..febe5ce9 100644 --- a/delegator/plugins/tasks/node_view.inc +++ b/delegator/plugins/tasks/node_view.inc @@ -19,18 +19,14 @@ function delegator_node_view_delegator_tasks() { 'node_view' => array( // This is a 'page' task and will fall under the page admin UI 'task type' => 'page', - 'title' => t('Node view'), 'description' => t('The node view task allows you to control what handler will handle the job of rendering a node view at the path <em>node/%node</em>. If no handler is set or matches the criteria, the default Drupal node renderer will be used.'), - 'admin title' => 'Node view', // translated by menu system 'admin description' => 'Overrides for the built in node view handler at <em>node/%node</em>.', 'admin path' => 'node/%node', - // Menu hooks so that we can alter the node/%node menu entry to point to us. 'hook menu' => 'delegator_node_view_menu', 'hook menu alter' => 'delegator_node_view_menu_alter', - // This is task uses 'context' handlers and must implement these to give the // handler data it needs. 'handler type' => 'context', // handler type -- misnamed @@ -52,7 +48,7 @@ function delegator_node_view_menu_alter(&$items, $task) { $items['node/%node']['file path'] = $task['path']; $items['node/%node']['file'] = $task['file']; -// @todo override node revision handler as well? + // @todo override node revision handler as well? } /** @@ -105,3 +101,4 @@ function delegator_node_view_get_arguments($task, $subtask_id) { function delegator_node_view_get_contexts($task, $subtask_id) { return ctools_context_get_placeholders_from_argument(delegator_node_view_get_arguments($task, $subtask_id)); } + diff --git a/delegator/plugins/tasks/page.admin.inc b/delegator/plugins/tasks/page.admin.inc index 4fd48af1..fd67e066 100644 --- a/delegator/plugins/tasks/page.admin.inc +++ b/delegator/plugins/tasks/page.admin.inc @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * Administrative functions for the page subtasks. @@ -37,9 +38,9 @@ function delegator_page_menu(&$items, $task) { 'type' => MENU_LOCAL_TASK, ) + $base; - $form_info = delegator_page_edit_form_info(); + $form_info = delegator_page_edit_form_info(); $default_task = FALSE; - $weight = 0; + $weight = 0; foreach ($form_info['order'] as $step => $form_title) { // The first edit form is the default for tabs, so it gets a bit // of special treatment here. @@ -133,18 +134,18 @@ function delegator_page_menu(&$items, $task) { $subtask->access['settings'] = NULL; } - $path = array(); - $page_arguments = array($subtask_id); + $path = array(); + $page_arguments = array($subtask_id); $access_arguments = array($subtask->access); - $load_arguments = array($subtask_id, '%index'); + $load_arguments = array($subtask_id, '%index'); // Replace named placeholders with our own placeholder to load contexts. foreach (explode('/', $subtask->path) as $position => $bit) { if ($bit[0] == '%' && $bit != '%') { // If an argument, swap it out with our argument loader and make sure // the argument gets passed through to the page callback. - $path[] = '%dp_arg'; - $page_arguments[] = $position; + $path[] = '%dp_arg'; + $page_arguments[] = $position; $access_arguments[] = $position; } else { @@ -205,14 +206,17 @@ function delegator_page_menu_item($menu, $access_arguments, $page_arguments, $lo default: $item['type'] = MENU_CALLBACK; break; + case 'normal': $item['type'] = MENU_NORMAL_ITEM; // Insert item into the proper menu $item['menu_name'] = $menu['name']; break; + case 'tab': $item['type'] = MENU_LOCAL_TASK; break; + case 'default tab': $item['type'] = MENU_DEFAULT_LOCAL_TASK; break; @@ -292,8 +296,8 @@ function delegator_page_add_subtask($step = NULL) { // If step is unset, we're creating a new one. Wipe out our values and start // over. if (!isset($step) || !$page = delegator_page_get_page_cache('::new')) { - $step = 'basic'; - $page = delegator_page_new(); + $step = 'basic'; + $page = delegator_page_new(); $page->new = TRUE; delegator_page_set_page_cache($page); } @@ -370,7 +374,7 @@ function delegator_page_add_subtask_finish(&$form_state) { 'id' => '', 'identifier' => '', 'argument' => '', - 'settings' => array() + 'settings' => array(), ); } } @@ -386,10 +390,10 @@ function delegator_page_add_subtask_finish(&$form_state) { if (isset($form_state['create task handler'])) { require_once './' . drupal_get_path('module', 'delegator') . '/delegator.admin.inc'; - $task = $form_state['task']; + $task = $form_state['task']; $task_name = delegator_make_task_name($task['name'], $page->name); - $cache = delegator_admin_get_task_cache($task, $page->name, $form_state['task_handlers']); - $plugin = delegator_get_task_handler($form_state['create task handler']); + $cache = delegator_admin_get_task_cache($task, $page->name, $form_state['task_handlers']); + $plugin = delegator_get_task_handler($form_state['create task handler']); // Create a new handler. $handler = delegator_new_task_handler($task, $page->name, $plugin, 0, $cache); @@ -571,7 +575,7 @@ function delegator_page_form_menu(&$form, &$form_state) { 'none' => t('No menu entry'), 'normal' => t('Normal menu entry'), 'tab' => t('Menu tab'), - 'default tab' => t('Default menu tab') + 'default tab' => t('Default menu tab'), ), '#default_value' => $menu['type'], ); @@ -604,7 +608,7 @@ function delegator_page_form_menu(&$form, &$form_state) { '#type' => 'select', '#options' => menu_get_menus(), '#default_value' => $menu['name'], - '#description' => t('Insert item into an available menu.'), // + '#description' => t('Insert item into an available menu.'), '#process' => array('ctools_dependent_process'), '#dependency' => array('radio:menu[type]' => array('normal')), ); @@ -712,7 +716,6 @@ function delegator_page_form_access_submit(&$form, &$form_state) { $form_state['page']->access['logic'] = $form_state['values']['logic']; } - /** * Form to handle assigning argument handlers to named arguments. */ @@ -854,11 +857,9 @@ function delegator_page_subtask_argument_ajax($step = NULL, $cache_name = NULL, 'id' => 'delegator_page_argument', 'path' => "admin/build/delegator/argument/%step/$cache_name/$keyword", 'show cancel' => TRUE, - 'next callback' => 'delegator_page_argument_next', 'finish callback' => 'delegator_page_argument_finish', 'cancel callback' => 'delegator_page_argument_cancel', - 'order' => array( 'change' => t('Change context type'), 'settings' => t('Argument settings'), @@ -866,11 +867,11 @@ function delegator_page_subtask_argument_ajax($step = NULL, $cache_name = NULL, 'forms' => array( 'change' => array( 'title' => t('Change argument'), - 'form id' => 'delegator_page_argument_form_change' + 'form id' => 'delegator_page_argument_form_change', ), 'settings' => array( 'title' => t('Argument settings'), - 'form id' => 'delegator_page_argument_form_settings' + 'form id' => 'delegator_page_argument_form_settings', ), ), ); @@ -989,8 +990,8 @@ function delegator_page_argument_form_change(&$form, &$form_state) { * Submit handler to change an argument. */ function delegator_page_argument_form_change_submit(&$form, &$form_state) { - $page = &$form_state['page']; - $keyword = &$form_state['keyword']; + $page = &$form_state['page']; + $keyword = &$form_state['keyword']; $argument = $form_state['values']['argument']; // If the argument is not changing, we do not need to do anything. @@ -1204,11 +1205,12 @@ function delegator_page_break_lock_subtask(&$form_state, $name) { $account = user_load($lock->uid); return confirm_form($form, - t('Are you sure you want to break this lock?'), - $cancel, - t('By breaking this lock, any unsaved changes made by !user will be lost!', array('!user' => theme('username', $account))), - t('Break lock'), - t('Cancel')); + t('Are you sure you want to break this lock?'), + $cancel, + t('By breaking this lock, any unsaved changes made by !user will be lost!', array('!user' => theme('username', $account))), + t('Break lock'), + t('Cancel') + ); } /** @@ -1261,10 +1263,10 @@ function delegator_page_import_subtask_validate($form, &$form_state) { // See if the task is already locked. $cache = delegator_page_get_page_cache($name); if (!empty($cache->locked)) { - $account = user_load($cache->locked->uid); + $account = user_load($cache->locked->uid); $username = theme('username', $account); $lock_age = format_interval(time() - $cache->locked->updated); - $break = url('admin/build/pages/break-lock/' . $name, array('query' => array('destination' => $_GET['q'], 'cancel' => $_GET['q']))); + $break = url('admin/build/pages/break-lock/' . $name, array('query' => array('destination' => $_GET['q'], 'cancel' => $_GET['q']))); form_error($form['object'], t('Unable to import page because it is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to <a href="!break">break this lock</a>.', array('!user' => $username, '!age' => $lock_age, '!break' => $break))); } @@ -1462,11 +1464,12 @@ function delegator_page_delete_subtask($form_state, $name) { } return confirm_form($form, - $title, - $cancel, - $desc, - t('Delete'), - t('Cancel')); + $title, + $cancel, + $desc, + t('Delete'), + t('Cancel') + ); } /** @@ -1477,3 +1480,4 @@ function delegator_page_delete_subtask_submit(&$form, &$form_state) { drupal_set_message(t('The page has been deleted.')); $form_state['redirect'] = 'admin/build/pages'; } + diff --git a/delegator/plugins/tasks/page.inc b/delegator/plugins/tasks/page.inc index 290208fb..03613990 100644 --- a/delegator/plugins/tasks/page.inc +++ b/delegator/plugins/tasks/page.inc @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * Handle the 'page' task, which creates pages with arbitrary tasks and lets @@ -30,7 +31,6 @@ function delegator_page_delegator_tasks() { 'function' => 'delegator_page_menu', ), 'hook theme' => 'delegator_page_theme', - // page only items 'task type' => 'page', 'operations' => array( @@ -53,7 +53,6 @@ function delegator_page_delegator_tasks() { 'handler type' => 'context', 'get arguments' => 'delegator_page_get_arguments', 'get context placeholders' => 'delegator_page_get_contexts', - ), ); } @@ -85,9 +84,9 @@ function delegator_page_subtask($task, $subtask_id) { * Build a subtask array for a given page. */ function delegator_page_build_subtask($task, $page) { - $form_info = delegator_page_edit_form_info(); + $form_info = delegator_page_edit_form_info(); $edit_links = array(); - $name = $page->name; + $name = $page->name; foreach ($form_info['order'] as $form_id => $form_title) { $edit_links[] = array( @@ -122,14 +121,14 @@ function delegator_page_build_subtask($task, $page) { ); } } - $operations[] = array( + $operations[] = array( 'title' => '<span class="text">' . t('Edit handler') . '</span>' . theme('links', $actions), 'html' => TRUE, ); } } } - $operations[] = array( + $operations[] = array( 'title' => '<span class="text">' . t('Edit page') . '</span>' . theme('links', $edit_links), 'html' => TRUE, ); @@ -221,19 +220,19 @@ function delegator_page_edit_form_info() { ), 'forms' => array( 'basic' => array( - 'form id' => 'delegator_page_form_basic' + 'form id' => 'delegator_page_form_basic', ), 'access' => array( - 'form id' => 'delegator_page_form_access' + 'form id' => 'delegator_page_form_access', ), 'menu' => array( - 'form id' => 'delegator_page_form_menu' + 'form id' => 'delegator_page_form_menu', ), 'argument' => array( - 'form id' => 'delegator_page_form_argument' + 'form id' => 'delegator_page_form_argument', ), 'multiple' => array( - 'form id' => 'delegator_page_argument_form_multiple' + 'form id' => 'delegator_page_argument_form_multiple', ), ), ); diff --git a/delegator/plugins/tasks/user_view.inc b/delegator/plugins/tasks/user_view.inc index f9618944..9d128a2d 100644 --- a/delegator/plugins/tasks/user_view.inc +++ b/delegator/plugins/tasks/user_view.inc @@ -10,24 +10,18 @@ function delegator_user_view_delegator_tasks() { 'user_view' => array( // This is a 'page' task and will fall under the page admin UI 'task type' => 'page', - 'title' => t('User view'), 'description' => t('The user view task allows you to control which modules serve requests made to user/%. By default, the core user module will show the user account page. The first task that matches the user will be used to display the user. If no task handlers exist, or if none of the existing task handlers are configured to handle the currently requested user, then the request falls back to the default Drupal user view mechanism.'), - 'admin title' => 'User view', // translated by menu system 'admin description' => 'Overrides for the built in user handler, allowing customized user output.', 'admin path' => 'user/%user', - 'hook menu' => 'delegator_user_view_menu', 'hook menu alter' => 'delegator_user_view_menu_alter', - // This is task uses 'context' handlers and must implement these to give the // handler data it needs. 'handler type' => 'context', // handler type -- misnamed - 'get arguments' => 'delegator_user_view_get_arguments', 'get context placeholders' => 'delegator_user_view_get_contexts', - ), ); } @@ -95,3 +89,4 @@ function delegator_user_view_get_arguments($task, $subtask_id) { function delegator_user_view_get_contexts($task, $subtask_id) { return ctools_context_get_placeholders_from_argument(delegator_user_view_get_arguments($task, $subtask_id)); } + diff --git a/includes/ajax.inc b/includes/ajax.inc index d388ea38..b850630f 100644 --- a/includes/ajax.inc +++ b/includes/ajax.inc @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * Utilize the CTools AJAX responder. @@ -38,12 +39,12 @@ * Commands are usually created with a couple of helper functions, so they * look like this: * - * @code{ + * @code * $commands = array(); * $commands[] = ctools_ajax_command_replace('#ctools-object-1', 'some html here'); * $commands[] = ctools_ajax_command_changed('#ctools-object-1'); * ctools_ajax_render($commands); // this function exits. - * } + * @endcode */ /** @@ -186,3 +187,4 @@ function ctools_ajax_render_error($error = '') { $commands[] = ctools_ajax_command_error($error); ctools_ajax_render($commands); } + diff --git a/includes/collapsible.theme.inc b/includes/collapsible.theme.inc index a1f73176..76d81724 100644 --- a/includes/collapsible.theme.inc +++ b/includes/collapsible.theme.inc @@ -39,13 +39,10 @@ function theme_ctools_collapsible($handle, $content, $collapsed = FALSE) { $class = $collapsed ? ' ctools-collapsed' : ''; $output = '<div class="ctools-collapsible-container' . $class . '">'; - $output .= '<div class="ctools-collapsible-handle">'; - $output .= $handle; - $output .= '</div>'; - $output .= '<div class="ctools-collapsible-content">'; - $output .= $content; - $output .= '</div>'; + $output .= '<div class="ctools-collapsible-handle">' . $handle . '</div>'; + $output .= '<div class="ctools-collapsible-content">' . $content . '</div>'; $output .= '</div>'; return $output; -} \ No newline at end of file +} + diff --git a/includes/context-access-admin.inc b/includes/context-access-admin.inc index b58d480c..7dc4632a 100644 --- a/includes/context-access-admin.inc +++ b/includes/context-access-admin.inc @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * Contains administrative screens for the access control plugins. @@ -29,7 +30,7 @@ * control is used to let the user pick the and/or logic. * * Access control is stored in an array: - * @code{ + * @code * array( * 'plugins' => array( * 0 => array( @@ -40,7 +41,7 @@ * ), * 'operator' => 'AND', // or 'OR', * ), - * } + * @endcode * * To add this widget to your UI, you need to do a little bit of setup. * @@ -79,7 +80,7 @@ * } * * To utilize this form: - * @code{ + * @code * ctools_include('context-access-admin'); * ctools_include('form'), * $form_state = array( @@ -94,7 +95,7 @@ * if (!empty($form_state['executed'])) { * // save $form_state['access'] however you like. * } - * } + * @endcode * * Additionally, you may add 'no buttons' => TRUE if you wish to embed this * form into your own, and instead call @@ -155,7 +156,7 @@ function ctools_access_admin_form(&$form_state) { '#type' => 'submit', '#attributes' => array('class' => 'ctools-use-modal'), '#id' => "ctools-access-add", - '#value' => t('Add') + '#value' => t('Add'), ); $form['logic'] = array( @@ -192,9 +193,9 @@ function ctools_access_admin_render_table($access, $fragment, $contexts) { } foreach ($access['plugins'] as $id => $test) { - $row = array(); + $row = array(); $plugin = ctools_get_access_plugin($test['name']); - $title = isset($plugin['title']) ? $plugin['title'] : t('Broken/missing access plugin %plugin', array('%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'); @@ -290,7 +291,8 @@ function ctools_access_ajax_add($fragment = NULL, $name = NULL) { $test = array( 'name' => $name, - 'settings' => array() // TODO defaults + // TODO defaults + 'settings' => array(), ); if (isset($plugin['required context'])) { @@ -337,8 +339,8 @@ function ctools_access_ajax_add($fragment = NULL, $name = NULL) { $function($argument, $access); } - $table = ctools_access_admin_render_table($access, $fragment, $contexts); - $output = array(); + $table = ctools_access_admin_render_table($access, $fragment, $contexts); + $output = array(); $output[] = ctools_ajax_command_replace('table#ctools-access-table', $table); $output[] = ctools_modal_command_dismiss(); } @@ -401,8 +403,8 @@ function ctools_access_ajax_edit($fragment = NULL, $id = NULL) { $function($argument, $access); } - $table = ctools_access_admin_render_table($access, $fragment, $contexts); - $output = array(); + $table = ctools_access_admin_render_table($access, $fragment, $contexts); + $output = array(); $output[] = ctools_ajax_command_replace('table#ctools-access-table', $table); $output[] = ctools_modal_command_dismiss(); } @@ -495,9 +497,10 @@ function ctools_access_ajax_delete($fragment = NULL, $id = NULL) { $function($argument, $access); } - $table = ctools_access_admin_render_table($access, $fragment, $contexts); - $output = array(); + $table = ctools_access_admin_render_table($access, $fragment, $contexts); + $output = array(); $output[] = ctools_ajax_command_replace('table#ctools-access-table', $table); ctools_ajax_render($output); } + diff --git a/includes/context-admin.inc b/includes/context-admin.inc index 533c0c0f..928986da 100644 --- a/includes/context-admin.inc +++ b/includes/context-admin.inc @@ -25,7 +25,7 @@ function ctools_context_info($type = NULL) { 'argument' => array( 'title' => t('Arguments'), 'singular title' => t('argument'), - 'description' => '', /* t("Arguments are parsed from the URL and translated into contexts that may be added to the display via the 'content' tab. These arguments are parsed in the order received, and you may use % in your URL to hold the place of an object; the rest of the arguments will come after the URL. For example, if the URL is node/%/panel and your user visits node/1/panel/foo, the first argument will be 1, and the second argument will be foo."), */ + 'description' => '', // t("Arguments are parsed from the URL and translated into contexts that may be added to the display via the 'content' tab. These arguments are parsed in the order received, and you may use % in your URL to hold the place of an object; the rest of the arguments will come after the URL. For example, if the URL is node/%/panel and your user visits node/1/panel/foo, the first argument will be 1, and the second argument will be foo."), 'add button' => t('Add argument'), 'context function' => 'ctools_get_argument', 'form id' => 'ctools_edit_argument_form', @@ -35,7 +35,7 @@ function ctools_context_info($type = NULL) { 'relationship' => array( 'title' => t('Relationships'), 'singular title' => t('relationship'), - 'description' => '', /* t('Relationships are contexts that are created from already existing contexts; the add relationship button will only appear once there is another context available. Relationships can load objects based upon how they are related to each other; for example, the author of a node, or a taxonomy term attached to a node, or the vocabulary of a taxonomy term.'), */ + 'description' => '', // t('Relationships are contexts that are created from already existing contexts; the add relationship button will only appear once there is another context available. Relationships can load objects based upon how they are related to each other; for example, the author of a node, or a taxonomy term attached to a node, or the vocabulary of a taxonomy term.'), 'add button' => t('Add relationship'), 'context function' => 'ctools_get_relationship', 'form id' => 'ctools_edit_relationship_form', @@ -45,7 +45,7 @@ function ctools_context_info($type = NULL) { 'context' => array( 'title' => t('Contexts'), 'singular title' => t('context'), - 'description' => '', /* t('Contexts are embedded directly into the panel; you generally must select an object in the panel. For example, you could select node 5, or the term "animals" or the user "administrator"'), */ + 'description' => '', // t('Contexts are embedded directly into the panel; you generally must select an object in the panel. For example, you could select node 5, or the term "animals" or the user "administrator"'), 'add button' => t('Add context'), 'context function' => 'ctools_get_context', 'form id' => 'ctools_edit_context_form', @@ -55,7 +55,7 @@ function ctools_context_info($type = NULL) { 'requiredcontext' => array( 'title' => t('Required contexts'), 'singular title' => t('required context'), - 'description' => '', /* t('Required contexts are passed in from some external source, such as a containing panel. If a mini panel has required contexts, it can only appear when that context is available, and therefore will not show up as a standard Drupal block.'), */ + 'description' => '', // t('Required contexts are passed in from some external source, such as a containing panel. If a mini panel has required contexts, it can only appear when that context is available, and therefore will not show up as a standard Drupal block.'), 'add button' => t('Add required context'), 'context function' => 'ctools_get_context', 'form id' => 'ctools_edit_requiredcontext_form', @@ -183,7 +183,6 @@ function ctools_context_add_relationship_form($module, &$form, &$form_state, &$f $available_relationships = ctools_context_get_relevant_relationships(ctools_context_load_contexts($object, TRUE, $base_contexts)); ctools_context_add_item_table('relationship', $form_location, $available_relationships, $object->relationships); - } /** @@ -281,11 +280,11 @@ function ctools_context_add_item_to_form($module, $type, $name, &$form, $positio } $form['remove'] = array( - '#value' => ctools_ajax_image_button(ctools_image_path('icon-delete.png'), "ctools/context/ajax/delete/$module/$type/$name/$position", t('Remove this item.')) + '#value' => ctools_ajax_image_button(ctools_image_path('icon-delete.png'), "ctools/context/ajax/delete/$module/$type/$name/$position", t('Remove this item.')), ); $form['settings'] = array( - '#value' => ctools_modal_image_button(ctools_image_path('icon-configure.png'), "ctools/context/ajax/configure/$module/$type/$name/$position", t('Configure settings for this item.')) + '#value' => ctools_modal_image_button(ctools_image_path('icon-configure.png'), "ctools/context/ajax/configure/$module/$type/$name/$position", t('Configure settings for this item.')), ); } @@ -508,8 +507,8 @@ function ctools_context_ajax_item_edit($module = NULL, $type = NULL, $object_nam * Form (for ajax use) to add a context */ function ctools_edit_context_form(&$form_state) { - $object = $form_state['object']; - $context = $form_state['info']; + $object = $form_state['object']; + $context = $form_state['info']; $position = $form_state['position']; $contexts = $form_state['contexts']; @@ -537,7 +536,7 @@ function ctools_edit_context_form(&$form_state) { $form['context']['identifier'] = array( '#type' => 'textfield', '#title' => t('Identifier'), - '#description' => t('Enter a name to identify this !type on administrative screens.', array('!type' =>t('context'))), + '#description' => t('Enter a name to identify this !type on administrative screens.', array('!type' => t('context'))), '#default_value' => $ctext['identifier'], ); @@ -595,8 +594,8 @@ function ctools_edit_context_form_submit($form, &$form_state) { * Form (for ajax use) to add a context */ function ctools_edit_requiredcontext_form(&$form_state) { - $object = $form_state['object']; - $context = $form_state['info']; + $object = $form_state['object']; + $context = $form_state['info']; $position = $form_state['position']; $contexts = $form_state['contexts']; @@ -625,7 +624,7 @@ function ctools_edit_requiredcontext_form(&$form_state) { $form['requiredcontext']['identifier'] = array( '#type' => 'textfield', '#title' => t('Identifier'), - '#description' => t('Enter a name to identify this !type on administrative screens.', array('!type' =>t('required context'))), + '#description' => t('Enter a name to identify this !type on administrative screens.', array('!type' => t('required context'))), '#default_value' => $ctext['identifier'], ); @@ -656,10 +655,10 @@ function ctools_edit_requiredcontext_form_submit($form, &$form_state) { * Form (for ajax use) to add a relationship */ function ctools_edit_relationship_form(&$form_state) { - $object = $form_state['object']; + $object = $form_state['object']; $relationship = $form_state['info']; - $position = $form_state['position']; - $contexts = $form_state['contexts']; + $position = $form_state['position']; + $contexts = $form_state['contexts']; $rel = $object->relationships[$position]; @@ -687,7 +686,7 @@ function ctools_edit_relationship_form(&$form_state) { $form['relationship']['identifier'] = array( '#type' => 'textfield', '#title' => t('Identifier'), - '#description' => t('Enter a name to identify this !type on administrative screens.', array('!type' =>t('relationship'))), + '#description' => t('Enter a name to identify this !type on administrative screens.', array('!type' => t('relationship'))), '#default_value' => $rel['identifier'], ); @@ -745,7 +744,7 @@ function ctools_edit_relationship_form_submit($form, &$form_state) { */ function ctools_edit_argument_form(&$form_state) { // Basic values required to orient ourselves - $object = $form_state['object']; + $object = $form_state['object']; $argument = $form_state['info']; $position = $form_state['position']; $contexts = $form_state['contexts']; @@ -797,7 +796,7 @@ function ctools_edit_argument_form(&$form_state) { $form['argument']['identifier'] = array( '#type' => 'textfield', '#title' => t('Identifier'), - '#description' => t('Enter a name to identify this !type on administrative screens.', array('!type' =>t('argument'))), + '#description' => t('Enter a name to identify this !type on administrative screens.', array('!type' => t('argument'))), '#default_value' => $arg['identifier'], ); @@ -887,7 +886,7 @@ function ctools_context_ajax_item_delete($module = NULL, $type = NULL, $object_n unset($ref[$position]); ctools_object_cache_set("context_object:$module", $object_name, $object); - $output = array(); + $output = array(); $output[] = ctools_ajax_command_replace('#' . $type . '-row-' . $position, ''); $output[] = ctools_ajax_command_restripe("#$type-table"); ctools_ajax_render($output); diff --git a/includes/context-task-handler.inc b/includes/context-task-handler.inc index 28d88f39..d5c97fcb 100644 --- a/includes/context-task-handler.inc +++ b/includes/context-task-handler.inc @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * Support for creating 'context' type task handlers. @@ -72,6 +73,7 @@ function ctools_context_handler_render($task, $subtask_id, $contexts, $page = TR * The handler in question. * @param $contexts * The context objects provided by the task. + * * @return * TRUE if these contexts match the selection criteria. NULL or FALSE * otherwise. @@ -291,3 +293,4 @@ function ctools_context_handler_edit_context_submit(&$form, &$form_state) { $form_state['handler']->conf['relationships'] = $form_state['context_object']->relationships; ctools_object_cache_clear('context_object:delegator', $form_state['handler']->name); } + diff --git a/includes/context.inc b/includes/context.inc index ea279982..da4a2150 100644 --- a/includes/context.inc +++ b/includes/context.inc @@ -100,6 +100,7 @@ class ctools_context_required { var $title = NULL; /** + * * @param $title * The first parameter should be the 'title' of the context for use * in UYI selectors when multiple contexts qualify. @@ -572,6 +573,7 @@ function ctools_get_relationships() { } /** + * * @param $relationship * The configuration of a relationship. It must contain the following data: * - name: The name of the relationship plugin being used. @@ -701,6 +703,7 @@ function ctools_get_contexts() { } /** + * * @param $context * The configuration of a context. It must contain the following data: * - name: The name of the context plugin being used. @@ -918,8 +921,8 @@ function ctools_access_get_loggedin_context() { global $user; $context = ctools_context_create('user', $user); $context->identifier = t('Logged in user'); - $context->keyword = 'viewer'; - $context->id = 0; + $context->keyword = 'viewer'; + $context->id = 0; return $context; } @@ -935,8 +938,8 @@ function ctools_access_summary($plugin, $contexts, $test) { $description = ''; if ($function = ctools_plugin_get_function($plugin, 'summary')) { $required_context = isset($plugin['required context']) ? $plugin['required context'] : array(); - $context = isset($test['context']) ? $test['context'] : array(); - $description = $function($test['settings'], ctools_context_select($contexts, $required_context, $context)); + $context = isset($test['context']) ? $test['context'] : array(); + $description = $function($test['settings'], ctools_context_select($contexts, $required_context, $context)); } return $description; } @@ -972,9 +975,9 @@ function ctools_access($settings, $contexts = array()) { $pass = FALSE; $plugin = ctools_get_access_plugin($test['name']); if ($plugin && $function = ctools_plugin_get_function($plugin, 'callback')) { - $required_context = isset($plugin['required context']) ? $plugin['required context'] : array(); - $context = isset($test['context']) ? $test['context'] : array(); - $pass = $function($test['settings'], ctools_context_select($contexts, $required_context, $context)); + $required_context = isset($plugin['required context']) ? $plugin['required context'] : array(); + $context = isset($test['context']) ? $test['context'] : array(); + $pass = $function($test['settings'], ctools_context_select($contexts, $required_context, $context)); } if ($pass && $settings['logic'] == 'or') { @@ -987,3 +990,4 @@ function ctools_access($settings, $contexts = array()) { return TRUE; } + diff --git a/includes/context.theme.inc b/includes/context.theme.inc index e929dcc6..88e94814 100644 --- a/includes/context.theme.inc +++ b/includes/context.theme.inc @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * Contains theme registry and theme implementations for the context tool. @@ -270,3 +271,4 @@ function theme_ctools_context_list_no_table($object) { return $output; } + diff --git a/includes/css.inc b/includes/css.inc index 39cceac0..25830176 100644 --- a/includes/css.inc +++ b/includes/css.inc @@ -1,7 +1,5 @@ <?php /* $Id$ */ -// Original author: Dmitri Gaskin -// Most of the rest of the work: Sam Boyer /* * @file @@ -108,6 +106,7 @@ function ctools_css_filter($css, $compressed = TRUE) { * @param array $css_data * An array of css data, as produced by @see ctools_css_disassemble() * disassembler and the @see ctools_css_filter_css_data() filter. + * * @return string $css * css optimized for human viewing. */ @@ -137,6 +136,7 @@ function ctools_css_assemble($css_data) { * @param array $css_data * An array of css data, as produced by @see ctools_css_disassemble() * disassembler and the @see ctools_css_filter_css_data() filter. + * * @return string $css * css optimized for use. */ @@ -172,6 +172,7 @@ function ctools_css_compress($css_data) { * * @param string $css * A string containing the css to be disassembled. + * * @return array $disassembled_css * An array of disassembled, slightly cleaned-up/formatted css statements. */ @@ -221,17 +222,16 @@ function _ctools_css_disassemble_selector($selector_str) { } else { // Selector is no good, so we scrap it. - unset ($selectors[$key]); + unset($selectors[$key]); } } - // Check for malformed selectors; if found, we skip this declaration. + // Check for malformed selectors; if found, we skip this declaration. if (empty($selectors)) { return FALSE; } return implode(', ', $selectors); } - function _ctools_css_disassemble_declaration($declaration) { $formatted_statement = array(); $propval_pairs = explode(";", $declaration); @@ -244,11 +244,11 @@ function _ctools_css_disassemble_declaration($declaration) { continue; } // Clean up the current property-value pair. - $propval_pair = preg_replace("/[\n|\t|\\|\s]+/", ' ', strtolower(trim($propval_pair))); + $propval_pair = preg_replace("/[\n|\t|\\|\s]+/", ' ', strtolower(trim($propval_pair))); // Explode the remaining fragements some more, but clean them up first. list($property, $value) = explode(':', $propval_pair); // If the property survived, toss it onto the stack. - if(!empty($property)) { + if (!empty($property)) { $formatted_statement[trim($property)] = trim($value); } } @@ -274,7 +274,7 @@ function _ctools_css_disassemble_declaration($declaration) { * An array of disassembled, filtered CSS. */ function ctools_css_filter_css_data($css, $allowed_properties = array(), $allowed_values = array(), $allowed_values_regex = '', $disallowed_values_regex = '') { -// function ctools_css_filter_css_data($css, &$filtered = NULL, $allowed_properties = array(), $allowed_values = array(), $allowed_values_regex = '', $disallowed_values_regex = '') { +//function ctools_css_filter_css_data($css, &$filtered = NULL, $allowed_properties = array(), $allowed_values = array(), $allowed_values_regex = '', $disallowed_values_regex = '') { // Retrieve the default list of allowed properties if none is provided. $allowed_properties = !empty($allowed_properties) ? $allowed_properties : ctools_css_filter_default_allowed_properties(); // Retrieve the default list of allowed values if none is provided. @@ -438,3 +438,4 @@ function ctools_css_filter_default_allowed_values() { 'yellow', ); } + diff --git a/includes/dependent.inc b/includes/dependent.inc index 9031d334..31baac9b 100644 --- a/includes/dependent.inc +++ b/includes/dependent.inc @@ -62,3 +62,4 @@ function ctools_dependent_process($element, $edit, &$form_state, &$form) { return $element; } + diff --git a/includes/dropdown.theme.inc b/includes/dropdown.theme.inc index e445ace5..c68cf919 100644 --- a/includes/dropdown.theme.inc +++ b/includes/dropdown.theme.inc @@ -74,3 +74,4 @@ function theme_ctools_dropdown($title, $links, $class = '') { $output .= '</div>'; // dropdown return $output; } + diff --git a/includes/form.inc b/includes/form.inc index cc324691..b5e1b2b0 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -234,7 +234,7 @@ function ctools_process_form($form_id, &$form, &$form_state) { // possibly ending execution. We make sure we do not react to the batch // that is already being processed (if a batch operation performs a // drupal_execute). - if ($batch =& batch_get() && !isset($batch['current_set'])) { + if ($batch = &batch_get() && !isset($batch['current_set'])) { // The batch uses its own copies of $form and $form_state for // late execution of submit handers and post-batch redirection. $batch['form'] = $form; @@ -290,3 +290,4 @@ function ctools_validate_form($form_id, $form, &$form_state) { _form_validate($form, $form_state, $form_id); $validated_forms[$form_id] = TRUE; } + diff --git a/includes/menu.inc b/includes/menu.inc index ebcd9b9b..cd3caac5 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -10,9 +10,9 @@ * file helps smooth some edges out. */ function ctools_get_menu_trail($path = NULL) { - $trail = array(); + $trail = array(); $trail[] = array('title' => t('Home'), 'href' => '<front>', 'localized_options' => array(), 'type' => 0); - $item = menu_get_item($path); + $item = menu_get_item($path); // Check whether the current item is a local task (displayed as a tab). if ($item['tab_parent']) { @@ -71,6 +71,7 @@ function ctools_get_menu_trail($path = NULL) { * * @param $menu_name * The named menu links to return + * * @return * An array of menu links, in the order they should be rendered. The array * is a list of associative arrays -- these have two keys, link and below. @@ -166,3 +167,4 @@ function ctools_menu_tree_page_data($item, $menu_name = 'navigation') { } return $tree[$cid]; } + diff --git a/includes/modal.inc b/includes/modal.inc index 9fcaf201..dccb0a9b 100644 --- a/includes/modal.inc +++ b/includes/modal.inc @@ -183,3 +183,4 @@ function ctools_modal_render($title, $output) { $commands[] = ctools_modal_command_display($title, $output); ctools_ajax_render($commands); } + diff --git a/includes/object-cache.inc b/includes/object-cache.inc index 5ca0e716..dbbeb973 100644 --- a/includes/object-cache.inc +++ b/includes/object-cache.inc @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * The non-volatile object cache is used to store an object while it is @@ -119,4 +120,3 @@ function ctools_object_cache_clean($age = NULL) { } db_query("DELETE FROM {ctools_object_cache} WHERE updated < %d", time() - $age); } - diff --git a/includes/plugins.inc b/includes/plugins.inc index 2ca1ba83..19526930 100644 --- a/includes/plugins.inc +++ b/includes/plugins.inc @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * @@ -67,7 +68,6 @@ function ctools_plugin_api_include($owner, $api, $minimum_version, $current_vers require_once "./$info[path]/$info[file]"; } } - } return $cache[$owner][$api]; @@ -107,7 +107,7 @@ function ctools_get_plugins($module, $type, $id = NULL) { // if cache load successful, set $all_hooks and $all_files to true. if (!empty($cache->data)) { - $plugins[$type] = $cache->data; + $plugins[$type] = $cache->data; $all_hooks[$type] = TRUE; $all_files[$type] = TRUE; } @@ -225,7 +225,6 @@ function ctools_plugin_get_directories($info) { $directories[$name] = drupal_get_path('theme', $name) . '/' . $theme->info['plugins'][$info['module']][$info['type']]; } } - } return $directories; } @@ -294,7 +293,7 @@ function ctools_plugin_process($info, $module, $identifier, $path, $file = NULL, 'module' => $module, 'name' => $name, 'path' => $path, - 'file' => $file + 'file' => $file, ); // Fill in plugin specific defaults, if they exist. @@ -397,3 +396,4 @@ function ctools_plugin_load_function($module, $type, $id, $function_name) { $plugin = ctools_get_plugins($module, $type, $id); return ctools_plugin_get_function($plugin, $function_name); } + diff --git a/includes/wizard.theme.inc b/includes/wizard.theme.inc index 643b05ef..8a3f6c66 100644 --- a/includes/wizard.theme.inc +++ b/includes/wizard.theme.inc @@ -1,5 +1,6 @@ <?php // $Id$ + /** * @file * Themable for the wizard tool. diff --git a/plugins/access/node_access.inc b/plugins/access/node_access.inc index 6b0c0502..acf9e720 100644 --- a/plugins/access/node_access.inc +++ b/plugins/access/node_access.inc @@ -78,11 +78,15 @@ function ctools_node_access_ctools_acesss_summary($conf, $context) { switch ($conf['type']) { case 'view': return t('@user can view @node.', $replacement); + case 'update': return t('@user can edit @node.', $replacement); + case 'delete': return t('@user can delete @node.', $replacement); + case 'create': return t('@user can create nodes of the same type as @node.', $replacement); } -} \ No newline at end of file +} + diff --git a/plugins/access/node_language.inc b/plugins/access/node_language.inc index 7363538d..e90ff1ae 100644 --- a/plugins/access/node_language.inc +++ b/plugins/access/node_language.inc @@ -112,4 +112,5 @@ function ctools_node_language_ctools_acesss_summary($conf, $context) { } return format_plural(count($names), '@identifier can be in languages "@languages"', '@identifier can be in language "@languages"', array('@languages' => implode(', ', $names), '@identifier' => $context->identifier)); -} \ No newline at end of file +} + diff --git a/plugins/access/node_type.inc b/plugins/access/node_type.inc index 8b6ff961..c8877650 100644 --- a/plugins/access/node_type.inc +++ b/plugins/access/node_type.inc @@ -85,4 +85,5 @@ function ctools_node_type_ctools_acesss_summary($conf, $context) { } return format_plural(count($names), '@identifier can be type "@types"', '@identifier can be types "@types"', array('@types' => implode(', ', $names), '@identifier' => $context->identifier)); -} \ No newline at end of file +} + diff --git a/plugins/access/perm.inc b/plugins/access/perm.inc index d8861ff5..1a271725 100644 --- a/plugins/access/perm.inc +++ b/plugins/access/perm.inc @@ -69,3 +69,4 @@ function ctools_perm_ctools_acesss_summary($conf, $context) { return t('@identifier must have "@perm"', array('@identifier' => $context->identifier, '@perm' => $conf['perm'])); } + diff --git a/plugins/access/role.inc b/plugins/access/role.inc index a459fdf9..1ac06671 100644 --- a/plugins/access/role.inc +++ b/plugins/access/role.inc @@ -78,4 +78,5 @@ function ctools_role_ctools_acesss_summary($conf, $context) { } return format_plural(count($names), '@identifier must have role "@roles"', '@identifier can be one of "@roles"', array('@roles' => implode(', ', $names), '@identifier' => $context->identifier)); -} \ No newline at end of file +} + diff --git a/plugins/access/site_language.inc b/plugins/access/site_language.inc index 662f9d64..8b91288b 100644 --- a/plugins/access/site_language.inc +++ b/plugins/access/site_language.inc @@ -85,4 +85,5 @@ function ctools_site_language_ctools_acesss_summary($conf, $context) { } return format_plural(count($names), 'Site language can be languages "@languages"', 'Site language can be language "@languages"', array('@languages' => implode(', ', $names))); -} \ No newline at end of file +} + diff --git a/plugins/arguments/nid.inc b/plugins/arguments/nid.inc index 95e6bc66..de19cea6 100644 --- a/plugins/arguments/nid.inc +++ b/plugins/arguments/nid.inc @@ -45,3 +45,4 @@ function ctools_argument_nid_context($arg = NULL, $conf = NULL, $empty = FALSE) return ctools_context_create('node', $node); } + diff --git a/plugins/arguments/node_add.inc b/plugins/arguments/node_add.inc index c2384fe9..3547fca4 100644 --- a/plugins/arguments/node_add.inc +++ b/plugins/arguments/node_add.inc @@ -36,3 +36,4 @@ function ctools_node_add_context($arg = NULL, $conf = NULL, $empty = FALSE) { return ctools_context_create('node_add_form', $arg); } + diff --git a/plugins/arguments/node_edit.inc b/plugins/arguments/node_edit.inc index ece6c26c..7838665e 100644 --- a/plugins/arguments/node_edit.inc +++ b/plugins/arguments/node_edit.inc @@ -47,3 +47,4 @@ function ctools_node_edit_context($arg = NULL, $conf = NULL, $empty = FALSE) { // This will perform a node_access check, so we don't have to. return ctools_context_create('node_edit_form', $node); } + diff --git a/plugins/arguments/term.inc b/plugins/arguments/term.inc index e5d81544..e481c00c 100644 --- a/plugins/arguments/term.inc +++ b/plugins/arguments/term.inc @@ -85,3 +85,4 @@ function ctools_term_settings_form(&$form, &$form_state, $conf) { '#suffix' => '</div>', ); } + diff --git a/plugins/arguments/uid.inc b/plugins/arguments/uid.inc index 35f15b58..cc2290e8 100644 --- a/plugins/arguments/uid.inc +++ b/plugins/arguments/uid.inc @@ -46,3 +46,4 @@ function ctools_argument_uid_context($arg = NULL, $conf = NULL, $empty = FALSE) return ctools_context_create('user', $account); } + diff --git a/plugins/arguments/vid.inc b/plugins/arguments/vid.inc index a0ad990b..59929705 100644 --- a/plugins/arguments/vid.inc +++ b/plugins/arguments/vid.inc @@ -41,3 +41,4 @@ function ctools_vid_context($arg = NULL, $conf = NULL, $empty = FALSE) { return ctools_context_create('vocabulary', $vocabulary); } + diff --git a/plugins/contexts/node.inc b/plugins/contexts/node.inc index 758d8b84..5238676d 100644 --- a/plugins/contexts/node.inc +++ b/plugins/contexts/node.inc @@ -50,7 +50,7 @@ function ctools_context_create_node($empty, $data = NULL, $conf = FALSE) { $nid = is_array($data) && isset($data['nid']) ? $data['nid'] : (is_object($data) ? $data->nid : 0); if (module_exists('translation')) { - if ($translation = module_invoke('translation', 'node_nid', $nid, $GLOBALS['language']->language)) { + if ($translation = module_invoke('translation', 'node_nid', $nid, $GLOBALS['language']->language)) { $nid = $translation; $reload = TRUE; } @@ -138,9 +138,9 @@ function ctools_context_node_settings_form_validate($form, &$form_values, &$form return; } - $nid = $form_values['node']; + $nid = $form_values['node']; $preg_matches = array(); - $match = preg_match('/\[nid: (\d+)\]/', $nid, $preg_matches); + $match = preg_match('/\[nid: (\d+)\]/', $nid, $preg_matches); if (!$match) { $match = preg_match('/^nid: (\d+)/', $nid, $preg_matches); } @@ -173,3 +173,4 @@ function ctools_context_node_settings_form_submit($form, &$form_values, &$form_s // Don't let this be stored. unset($form_values['set_identifier']); } + -- GitLab