diff --git a/sites/all/modules/contrib/content/diff/CHANGELOG.txt b/sites/all/modules/contrib/content/diff/CHANGELOG.txt deleted file mode 100644 index 38696432..00000000 --- a/sites/all/modules/contrib/content/diff/CHANGELOG.txt +++ /dev/null @@ -1,166 +0,0 @@ - -CHANGELOG for Diff 7.x-2.0+13-dev to 7.x-3.x -============================================ - -1) System variable names have been changed ------------------------------------------- - -Considerable changes have occurred. - -2) hook_diff() was removed --------------------------- - -This has been replaced by hook_entity_diff() as of Diff 7.x-3.x. - -3) Field diffs are handled independently by Diff and the field module ---------------------------------------------------------------------- - -Field modules SHOULD NOT implement hook_entity_diff(). - -This is complicated and costly in terms of performance. - -Two new field callbacks are defined to handle these. - - a) MODULE_field_diff_view_prepare() - - Optional: If you need to load data, use MODULE_field_diff_view_prepare(). - - b) MODULE_field_diff_view() - - Recommended: You should implement this to generate the compared data. - -If there is no corresponding hook for a field, the field comparison will try -to guess the value using $item['safe_value'] or $item['value'] properties. - -If you need to make this configurable, there are two additional hooks: - - c) MODULE_field_diff_default_options($field_type) - - You should define any additioal settings here. This shares a global namespace - of the diff module, so you can overwrite core Diff settings here too. - - In saying that, take care not to accidentially do this. - - d) MODULE_field_diff_options_form($field_type, $settings) - - This is where you insert Form API elements to configure your option settings. - -4) Field diffs are now configurable ------------------------------------ - -Each field type defined by core have configurable settings to control the -rendering of the comparison. - - a) Global configuration - - An administration page has been added to handle field type default settings. - - This is the preferred way to configure field settings are these are global to - all fields of this type. - - b) View mode display options - - The display "Diff comparison" is used to control the fields that are displayed - when comparing different revisions. - - The following is a walk-through on how you would configure the Basic page - (page) content types field configuration. - - - Enable "Diff comparison" custom view mode - - Navigate to admin/structure/types/manage/page/display and look at the - Custom Display Settings for this view mode. Check and save. - - - Configure the display - - After Saving this page, a new tab appears "Diff comparison", click this or - navigate directly to admin/structure/types/manage/page/display/diff_standard - - - You can hide or show the fields that you want to display when doing - comparisons. - - If the field has no inbuilt diff support, then the renderred field items - will be compared. - -5) Standard comparison preview / Inline diff view setting ---------------------------------------------------------- - -You can set the view modes used to compare the rendered node. This can be found -in the Diff settings in the Content Type settings page. - -6) Optional CSS and new Boxes styles ------------------------------------- - -This takes the styles from WikiPedia to really spice up the diff page. - -7) Optional JScript extras --------------------------- - -This spices up the revision checkboxes on the revisions page. - -8) Simple past revision token support -------------------------------------- - -Use-case, email notifications when content has changes. If these support tokens, -then you can embed Diffs into these emails. - -9) Extensive string review --------------------------- -See http://drupal.org/node/1785742 - - -10) Inline block settings changes ---------------------------------- -The inline block settings are now in the block configuration page. - -11) And much more... --------------------- - -The complete change log follows: - -Diff 7.x-2.x - o #888680 by Deciphered, Alan D.: Allow modules to interact via drupal_alter() - o #1280892 by Alan D., crea: Diff should track the variables that it defines - o #1304658 by Alan D., kari.kaariainen: Remove links and comments from the comparison preview - o #1122206 by binford2k, Alan D.: Notices thrown by DiffEngine::process_chunk() - o #1175064 by zilverdistel, Alan D.: Provide variables for leading and trailing context - o #1673864 by Alan D.: Allow users to bypass the admin theme when viewing comparisons - o #1673876 by Alan D.: Use Drupal autoloading for classes - o #1673856 by Alan D.: Use hook_form_BASE_FORM_ID_alter() rather than hook_form_alter() - o #1673856 by Alan D.: Normalise line endings - o #114308 by Alan D.: add jQuery for hiding radios that shouldn't show diffs - o #1688840 by Alan D.: Enable new JScript behaviour by default - o #372957 by erykmynn, JuliaKM, lsrzj, andrew_rs, alexpott, et al: HTML Strip for Diff, WYSIWYG Friendly - (This was refactored in the 7.x-3.x branch from the commited 7.x-2.x code) - o #521212 by Alan D., blakehall: Make diff comparison page themable - o #1671484 by Alan D.: Show number of lines changed on revisions page - o #114699 by smokris, Alan D.: Diff module should support Token - o #372957 by c31ck: display either Hide or Show based on what clicking it will do at any time (HTML Strip for Diff) - This was altered for the 7.x-3.x branch. - o #1807510 & #1825202: Simplify Diff administration - o #1812162 by mitchell, Alan D.: 'Highlight changes' block appears on edit form - - Node to Entity changes - ---------------------- - These are roughly tracked in the meta issue #1365750 Generalize API and Integrate with core field types - - o (no issue) by Alan D.: Use entity specific system variables. - o (no issue) by Alan D.: View mode code, new hooks, new API. Massive patch! - - Resolves: - o #248778: Taxonomy diff - o #1550698: Diff of "select from list" fields shows change in key, not change in value - o #1458814: File (and image) field support - o #1418760: Optional setting to honour the display settings - o #1347316: Selectable view mode for inline diffs and "Current revision" display view mode - o #1458906: Improve performances (of existing 7.x-2.x field rendering) - o #1424162: Diff in Taxonomy term description - o #1211282: Image diff support - -The following patches will be posted in the corresponding project queues once -the 7.x-3.x branch is released: - o #1595702 by Alan D., mbilbille: Support of field collection module - o #1350604 by Alan D., johaziel: Datetime diff - o (no issue) by Alan D.: Email field Diff support - o (no issue) by Alan D.: Countries Diff support - o (no issue) by Alan D.: Name field Diff support - o (no issue) by Alan D.: Link field Diff support diff --git a/sites/all/modules/contrib/content/diff/DiffEngine.php b/sites/all/modules/contrib/content/diff/DiffEngine.php index 12366107..04234b76 100644 --- a/sites/all/modules/contrib/content/diff/DiffEngine.php +++ b/sites/all/modules/contrib/content/diff/DiffEngine.php @@ -41,7 +41,7 @@ class _DiffOp { class _DiffOp_Copy extends _DiffOp { var $type = 'copy'; - function _DiffOp_Copy($orig, $closing = FALSE) { + function __construct($orig, $closing = FALSE) { if (!is_array($closing)) { $closing = $orig; } @@ -62,7 +62,7 @@ class _DiffOp_Copy extends _DiffOp { class _DiffOp_Delete extends _DiffOp { var $type = 'delete'; - function _DiffOp_Delete($lines) { + function __construct($lines) { $this->orig = $lines; $this->closing = FALSE; } @@ -80,7 +80,7 @@ class _DiffOp_Delete extends _DiffOp { class _DiffOp_Add extends _DiffOp { var $type = 'add'; - function _DiffOp_Add($lines) { + function __construct($lines) { $this->closing = $lines; $this->orig = FALSE; } @@ -98,7 +98,7 @@ class _DiffOp_Add extends _DiffOp { class _DiffOp_Change extends _DiffOp { var $type = 'change'; - function _DiffOp_Change($orig, $closing) { + function __construct($orig, $closing) { $this->orig = $orig; $this->closing = $closing; } @@ -215,11 +215,17 @@ class _DiffEngine { // Find deletes & adds. $delete = array(); while ($xi < $n_from && $this->xchanged[$xi]) { - $delete[] = $from_lines[$xi++]; + $_fl = $from_lines[$xi++]; + if (strlen($_fl)) { + $delete[] = $_fl; + } } $add = array(); while ($yi < $n_to && $this->ychanged[$yi]) { - $add[] = $to_lines[$yi++]; + $_tl = $to_lines[$yi++]; + if (strlen($_tl)) { + $add[] = $_tl; + } } if ($delete && $add) { $edits[] = new _DiffOp_Change($delete, $add); @@ -576,7 +582,7 @@ class Diff { * (Typically these are lines from a file.) * @param $to_lines array An array of strings. */ - function Diff($from_lines, $to_lines) { + function __construct($from_lines, $to_lines) { $eng = new _DiffEngine; $this->edits = $eng->diff($from_lines, $to_lines); //$this->_check($from_lines, $to_lines); @@ -735,12 +741,11 @@ class MappedDiff extends Diff { * @param $mapped_to_lines array This array should * have the same number of elements as $to_lines. */ - function MappedDiff($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) { - + function __construct($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) { assert(sizeof($from_lines) == sizeof($mapped_from_lines)); assert(sizeof($to_lines) == sizeof($mapped_to_lines)); - $this->Diff($mapped_from_lines, $mapped_to_lines); + parent::__construct($mapped_from_lines, $mapped_to_lines); $xi = $yi = 0; for ($i = 0; $i < sizeof($this->edits); $i++) { @@ -950,7 +955,7 @@ define('NBSP', ' '); // iso-8859-x non-breaking space. * @subpackage DifferenceEngine */ class _HWLDF_WordAccumulator { - function _HWLDF_WordAccumulator() { + function __construct() { $this->_lines = array(); $this->_line = ''; $this->_group = ''; @@ -1016,11 +1021,11 @@ class WordLevelDiff extends MappedDiff { return 10000; } - function WordLevelDiff($orig_lines, $closing_lines) { + function __construct($orig_lines, $closing_lines) { list($orig_words, $orig_stripped) = $this->_split($orig_lines); list($closing_words, $closing_stripped) = $this->_split($closing_lines); - $this->MappedDiff($orig_words, $closing_words, $orig_stripped, $closing_stripped); + parent::__construct($orig_words, $closing_words, $orig_stripped, $closing_stripped); } function _split($lines) { @@ -1095,7 +1100,7 @@ class DrupalDiffFormatter extends DiffFormatter { 'offset' => array('x' => 0, 'y' => 0), ); - function DrupalDiffFormatter() { + function __construct() { $this->leading_context_lines = variable_get('diff_context_lines_leading', 2); $this->trailing_context_lines = variable_get('diff_context_lines_trailing', 2); } diff --git a/sites/all/modules/contrib/content/diff/css/diff.boxes.css b/sites/all/modules/contrib/content/diff/css/diff.boxes.css index ee1b3116..4af7a48f 100644 --- a/sites/all/modules/contrib/content/diff/css/diff.boxes.css +++ b/sites/all/modules/contrib/content/diff/css/diff.boxes.css @@ -1,5 +1,6 @@ - -html.js .diff-js-hidden { display: none; } +html.js .diff-js-hidden { + display: none; +} /* Reset as many core themes as possible */ table.diff { @@ -8,7 +9,7 @@ table.diff { border: 0 none; width: 98%; border-spacing: 5px; - table-layout: fixed ; + table-layout: fixed; border-collapse: separate; } table.diff tr td:last-child { @@ -24,10 +25,13 @@ table.diff th { border-spacing: 4px; padding: 4px 8px; } -table.diff tr, table.diff tr.even { +table.diff tr, +table.diff tr.even { background: none; } -table.diff tr th, table.diff tr th a, table.diff tr th a:hover { +table.diff tr th, +table.diff tr th a, +table.diff tr th a:hover { color: inherit; font-weight: bold; } @@ -37,28 +41,34 @@ table.diff tr.odd { border-style: none; background: transparent; } -table.diff th a { display: inline; } +table.diff th a { + display: inline; +} /* Main theming */ -table.diff, td.diff-number { - background-color: white +table.diff, +td.diff-number { + background-color: white; } table.diff td.diff-lineno { - font-weight: bold + font-weight: bold; } -table.diff td.diff-addedline, table.diff td.diff-deletedline, table.diff td.diff-context { +table.diff td.diff-addedline, +table.diff td.diff-deletedline, +table.diff td.diff-context { font-size: 88%; vertical-align: top; white-space: -moz-pre-wrap; - white-space: pre-wrap + white-space: pre-wrap; } -table.diff td.diff-addedline, table.diff td.diff-deletedline { +table.diff td.diff-addedline, +table.diff td.diff-deletedline { border-style: solid; border-width: 1px 1px 1px 4px; - border-radius: 0.33em + border-radius: 0.33em; } table.diff td.diff-context { @@ -76,45 +86,46 @@ table.diff td.diff-addedline { } table.diff td.diff-deletedline { - border-color: #ffe49c + border-color: #ffe49c; } .diffchange { font-weight: bold; - text-decoration: none + text-decoration: none; } -table.diff td.diff-addedline .diffchange, table.diff td.diff-deletedline .diffchange { +table.diff td.diff-addedline .diffchange, +table.diff td.diff-deletedline .diffchange { border-radius: 0.33em; - padding: 0.25em 0 + padding: 0.25em 0; } table.diff td.diff-addedline .diffchange { - background: #d8ecff + background: #d8ecff; } table.diff td.diff-deletedline .diffchange { - background: #feeec8 + background: #feeec8; } table.diff table.diff td { - padding: 0.33em 0.66em + padding: 0.33em 0.66em; } table.diff td.diff-marker { width: 2%; text-align: right; font-weight: bold; - font-size: 1.25em + font-size: 1.25em; } table.diff col.diff-content { - width: 48% + width: 48%; } table.diff table.diff td div { word-wrap: break-word; - overflow: auto + overflow: auto; } td.diff-prevlink { text-align: left; @@ -122,3 +133,7 @@ td.diff-prevlink { td.diff-nextlink { text-align: right; } + +table.diff-revisions tr.revision-published td { + background-color: #aaffaa; +} diff --git a/sites/all/modules/contrib/content/diff/css/diff.default.css b/sites/all/modules/contrib/content/diff/css/diff.default.css index a7ab7ffd..78337b93 100644 --- a/sites/all/modules/contrib/content/diff/css/diff.default.css +++ b/sites/all/modules/contrib/content/diff/css/diff.default.css @@ -1,30 +1,47 @@ - -html.js .diff-js-hidden { display: none; } +html.js .diff-js-hidden { + display: none; +} /** * Inline diff metadata */ .diff-inline-metadata { - padding:4px; - border:1px solid #ddd; - background:#fff; - margin:0px 0px 10px; + padding: 4px; + border: 1px solid #ddd; + background: #fff; + margin: 0 0 10px; } -.diff-inline-legend { font-size:11px; } +.diff-inline-legend { + font-size: 11px; +} .diff-inline-legend span, -.diff-inline-legend label { margin-right:5px; } +.diff-inline-legend label { + margin-right: 5px; +} /** * Inline diff markup */ -span.diff-deleted { color:#ccc; } -span.diff-deleted img { border: solid 2px #ccc; } -span.diff-changed { background:#ffb; } -span.diff-changed img { border:solid 2px #ffb; } -span.diff-added { background:#cfc; } -span.diff-added img { border: solid 2px #cfc; } +span.diff-deleted { + color: #ccc; +} +span.diff-deleted img { + border: solid 2px #ccc; +} +span.diff-changed { + background: #ffb; +} +span.diff-changed img { + border: solid 2px #ffb; +} +span.diff-added { + background: #cfc; +} +span.diff-added img { + border: solid 2px #cfc; +} /** * Traditional split diff theming @@ -35,7 +52,8 @@ table.diff { table-layout: fixed; width: 100%; } -table.diff tr.even, table.diff tr.odd { +table.diff tr.even, +table.diff tr.odd { background-color: inherit; border: none; } @@ -45,7 +63,8 @@ td.diff-prevlink { td.diff-nextlink { text-align: right; } -td.diff-section-title, div.diff-section-title { +td.diff-section-title, +div.diff-section-title { background-color: #f0f0ff; font-size: 0.83em; font-weight: bold; @@ -84,3 +103,7 @@ table.diff td div { table.diff td { padding: 0.1ex 0.4em; } + +table.diff-revisions tr.revision-published td { + background-color: #aaffaa; +} diff --git a/sites/all/modules/contrib/content/diff/diff.admin.inc b/sites/all/modules/contrib/content/diff/diff.admin.inc index a9df19ed..8c5202f2 100644 --- a/sites/all/modules/contrib/content/diff/diff.admin.inc +++ b/sites/all/modules/contrib/content/diff/diff.admin.inc @@ -20,17 +20,6 @@ function diff_admin_settings($form, $form_state) { '#empty_option' => t('- None -'), '#description' => t('Alter the CSS used when displaying diff results.'), ); - $form['diff_default_state_node'] = array( - '#type' => 'select', - '#title' => t('Diff default state'), - '#default_value' => variable_get('diff_default_state_node', 'raw'), - '#options' => array( - 'raw' => t('HTML view'), - 'raw_plain' => t('Plain view'), - ), - '#empty_option' => t('- None -'), - '#description' => t('Default display to show when viewing a diff, html tags in diffed result or as plain text.'), - ); $form['diff_radio_behavior'] = array( '#type' => 'select', '#title' => t('Diff radio behavior'), @@ -68,17 +57,50 @@ function diff_admin_settings($form, $form_state) { function diff_admin_global_entity_settings($form, $form_state, $entity_type) { $entity_info = entity_get_info($entity_type); drupal_set_title(t('Diff settings for %entity_label entities', array('%entity_label' => $entity_info['label'])), PASS_THROUGH); + + if ($options = module_invoke_all('entity_diff_options', $entity_type)) { + $form['diff_additional_options_' . $entity_type] = array( + '#type' => 'checkboxes', + '#title' => t('Property options'), + '#default_value' => variable_get('diff_additional_options_' . $entity_type, array()), + '#options' => $options, + ); + } + else { + $form['diff_additional_options_' . $entity_type] = array( + '#type' => 'value', + '#value' => array(), + ); + } + $form['diff_show_header_' . $entity_type] = array( '#type' => 'checkbox', - '#title' => t('Show entity label header'), + '#title' => t('Show entity label row header'), '#default_value' => variable_get('diff_show_header_' . $entity_type, 1), ); + if (user_access('administer permissions')) { + $admin_link = l(t('View the administration theme'), 'admin/people/permissions', array('fragment' => 'edit-view-the-administration-theme')); + } + else { + $admin_link = t('View the administration theme'); + } $form['diff_admin_path_' . $entity_type] = array( '#type' => 'checkbox', - '#title' => t('Treat diff pages as administrative'), - '#description' => t('Diff pages are treated as administrative pages by default, although it is up to each module to enforce this and to implement this optional setting.'), + '#title' => t('Use administration theme'), + '#description' => t('This option will enable users with the !link permission to use the admin theme when doing comparisons.', array('!link' => $admin_link)), '#default_value' => variable_get('diff_admin_path_' . $entity_type, 1), ); + $form['diff_default_state_' . $entity_type] = array( + '#type' => 'select', + '#title' => t('Diff default state'), + '#default_value' => variable_get('diff_default_state_' . $entity_type, 'raw'), + '#options' => array( + 'raw' => t('HTML view'), + 'raw_plain' => t('Plain view'), + ), + '#empty_option' => t('- None -'), + '#description' => t('Default display to show when viewing a diff, html tags in diffed result or as plain text.'), + ); return system_settings_form($form); } diff --git a/sites/all/modules/contrib/content/diff/diff.api.php b/sites/all/modules/contrib/content/diff/diff.api.php index 507293a1..e2b6f848 100644 --- a/sites/all/modules/contrib/content/diff/diff.api.php +++ b/sites/all/modules/contrib/content/diff/diff.api.php @@ -11,27 +11,75 @@ */ /** - * Allow modules to provide a comparison about entities. + * Allow modules to provide a comparison about entity properties. * * @param object $old_entity * The older entity revision. + * * @param object $new_entity * The newer entity revision. + * * @param array $context * An associative array containing: * - entity_type: The entity type; e.g., 'node' or 'user'. - * - view_mode: The view mode to use. Defaults to FALSE. + * - old_entity: The older entity. + * - new_entity: The newer entity. + * - view_mode: The view mode to use. Defaults to FALSE. If no view mode is + * given, the recommended fallback view mode is 'default'. + * - states: An array of view states. These could be one of: + * - raw: The raw value of the diff, the classic 7.x-2.x view. + * - rendered: The rendered HTML as determined by the view mode. Only + * return markup for this state if the value is normally shown + * by this view mode. The user will most likely be able to see + * the raw or raw_plain state, so this is optional. + * + * The rendering state is a work in progress. + * + * Conditionally, you can get these states, but setting these will override + * the user selectable markdown method. + * + * - raw_plain: As raw, but text should be markdowned. + * - rendered_plain: As rendered, but text should be markdowned. * * @return array * An associative array of values keyed by the entity property. * - * @todo - * Investiagate options and document these. + * This is effectively an unnested Form API-like structure. + * + * States are returned as follows: + * + * $results['line'] = array( + * '#name' => t('Line'), + * '#states' => array( + * 'raw' => array( + * '#old' => '

This was the old line number [tag].

', + * '#new' => '

This is the new line [tag].

', + * ), + * 'rendered' => array( + * '#old' => '

This was the old line number 57.

', + * '#new' => '

This is the new line 57.

', + * ), + * ), + * ); + * + * For backwards compatibility, no changes are required to support states, + * but it is recommended to provide a better UI for end users. + * + * For example, the following example is equivalent to returning the raw + * state from the example above. + * + * $results['line'] = array( + * '#name' => t('Line'), + * '#old' => '

This was the old line number [tag].

', + * '#new' => '

This is the new line [tag].

', + * ); */ function hook_entity_diff($old_entity, $new_entity, $context) { + $results = array(); + if ($context['entity_type'] == 'node') { $type = node_type_get_type($new_entity); - $result['title'] = array( + $results['title'] = array( '#name' => $type->title_label, '#old' => array($old_entity->title), '#new' => array($new_entity->title), @@ -41,6 +89,8 @@ function hook_entity_diff($old_entity, $new_entity, $context) { ), ); } + + return $results; } /** @@ -57,7 +107,7 @@ function hook_entity_diff($old_entity, $new_entity, $context) { * * @see hook_entity_diff() */ -function hook_entity_diff_alter($entity_diffs, $context) { +function hook_entity_diff_alter(&$entity_diffs, $context) { } /** diff --git a/sites/all/modules/contrib/content/diff/diff.css b/sites/all/modules/contrib/content/diff/diff.css index a09147c1..8c634a91 100644 --- a/sites/all/modules/contrib/content/diff/diff.css +++ b/sites/all/modules/contrib/content/diff/diff.css @@ -1,30 +1,46 @@ - -html.js .diff-js-hidden { display:none; } +html.js .diff-js-hidden { + display:none; +} /** * Inline diff metadata */ .diff-inline-metadata { - padding:4px; - border:1px solid #ddd; - background:#fff; - margin:0px 0px 10px; - } - -.diff-inline-legend { font-size:11px; } + padding: 4px; + border: 1px solid #ddd; + background: #fff; + margin: 0 0 10px; +} +.diff-inline-legend { + font-size: 11px; +} .diff-inline-legend span, -.diff-inline-legend label { margin-right:5px; } +.diff-inline-legend label { + margin-right: 5px; +} /** * Inline diff markup */ -span.diff-deleted { color:#ccc; } -span.diff-deleted img { border: solid 2px #ccc; } -span.diff-changed { background:#ffb; } -span.diff-changed img { border:solid 2px #ffb; } -span.diff-added { background:#cfc; } -span.diff-added img { border: solid 2px #cfc; } +span.diff-deleted { + color: #ccc; +} +span.diff-deleted img { + border: solid 2px #ccc; +} +span.diff-changed { + background: #ffb; +} +span.diff-changed img { + border: solid 2px #ffb; +} +span.diff-added { + background: #cfc; +} +span.diff-added img { + border: solid 2px #cfc; +} /** * Traditional split diff theming @@ -35,7 +51,8 @@ table.diff { table-layout: fixed; width: 100%; } -table.diff tr.even, table.diff tr.odd { +table.diff tr.even, +table.diff tr.odd { background-color: inherit; border: none; } @@ -45,7 +62,8 @@ td.diff-prevlink { td.diff-nextlink { text-align: right; } -td.diff-section-title, div.diff-section-title { +td.diff-section-title, +div.diff-section-title { background-color: #f0f0ff; font-size: 0.83em; font-weight: bold; diff --git a/sites/all/modules/contrib/content/diff/diff.diff.inc b/sites/all/modules/contrib/content/diff/diff.diff.inc index 63c01b44..8e7f682a 100644 --- a/sites/all/modules/contrib/content/diff/diff.diff.inc +++ b/sites/all/modules/contrib/content/diff/diff.diff.inc @@ -12,17 +12,6 @@ * * This manually invokes hook_diff() to avoid a function name clash with the * PHP 5 (>= 5.3.0) date_diff() function or the Dates modules implementation. - * - * @param object $old_entity - * The older node revision. - * @param object $new_entity - * The newer node revision. - * @param array $context - * An associative array containing: - * - entity_type: The entity type; e.g., 'node' or 'user'. - * - old_entity: The older entity. - * - new_entity: The newer entity. - * - view_mode: The view mode to use. Defaults to FALSE. */ function diff_entity_diff($old_entity, $new_entity, $context) { $return = array(); @@ -52,11 +41,13 @@ function diff_entity_diff($old_entity, $new_entity, $context) { * - old_entity: The older entity. * - new_entity: The newer entity. * - view_mode: The view mode to use. Defaults to FALSE. + * @param string $default_langcode + * (optional) Language code to force comparison in. * * @return array * An associative array of values keyed by the field name and delta value. */ -function diff_entity_fields_diff($old_entity, $new_entity, $context) { +function diff_entity_fields_diff($old_entity, $new_entity, $context, $default_langcode = NULL) { $result = array(); $entity_type = $context['entity_type']; @@ -65,7 +56,7 @@ function diff_entity_fields_diff($old_entity, $new_entity, $context) { $field_context = $context; $actual_mode = FALSE; - list(,, $bundle_name) = entity_extract_ids($entity_type, $new_entity); + list(, , $bundle_name) = entity_extract_ids($entity_type, $new_entity); $instances = field_info_instances($entity_type, $bundle_name); // Some fields piggy back the display settings, so we need to fake these by @@ -98,7 +89,7 @@ function diff_entity_fields_diff($old_entity, $new_entity, $context) { // We provide a loose check on the field access. if (field_access('view', $field, $entity_type) || field_access('edit', $field, $entity_type)) { - $langcode = field_language($entity_type, $new_entity, $field_name); + $langcode = $default_langcode ? $default_langcode : field_language($entity_type, $new_entity, $field_name); $field_context['language'] = $langcode; $field_context['field'] = $field; @@ -136,10 +127,18 @@ function diff_entity_fields_diff($old_entity, $new_entity, $context) { $func = 'diff_field_diff_view'; } + // Copy the static ID cache to ensure this is the same for each comparison. + $original_html_ids = drupal_static('drupal_html_id'); + $html_ids = &drupal_static('drupal_html_id'); + // These callbacks should be independent of revision. $old_context = $field_context; $old_context['entity'] = $old_entity; $old_values = $func($old_items, $old_context); + + // Restores the ID cache to the original. + $html_ids = $original_html_ids; + $new_context = $field_context; $new_context['entity'] = $new_entity; $new_values = $func($new_items, $new_context); @@ -200,22 +199,29 @@ function diff_entity_fields_diff($old_entity, $new_entity, $context) { * An array of strings representing the value, keyed by delta index. */ function diff_field_diff_view($items, $context) { - $diff_items = array(); - $entity = clone $context['entity']; - $langcode = field_language($context['entity_type'], $entity, $context['field']['field_name']); - $view_mode = empty($context['view_mode']) ? 'diff_standard' : $context['view_mode']; - $element = field_view_field($context['entity_type'], $entity, $context['field']['field_name'], $view_mode, $langcode); + // Prevent unnecessary rendering of the field. This also prevents issues + // where field_view_field() will use a language fallback for display that + // may not match the requested diff comparison language. + if (!$items) { + return array(); + } - foreach (element_children($element) as $delta) { - $diff_items[$delta] = drupal_render($element[$delta]); - } + $diff_items = array(); + $entity = clone $context['entity']; + $langcode = field_language($context['entity_type'], $entity, $context['field']['field_name']); + $view_mode = empty($context['view_mode']) ? 'diff_standard' : $context['view_mode']; + $element = field_view_field($context['entity_type'], $entity, $context['field']['field_name'], $view_mode, $langcode); + + foreach (element_children($element) as $delta) { + $diff_items[$delta] = drupal_render($element[$delta]); + } return $diff_items; } /** * Helper function to get the settings for a given field or formatter. * - * @param array $context + * @param array $field_context * This will get the settings for a field. * - field (required): The field that the items belong to. * - entity: The entity that we are looking up. @@ -274,31 +280,6 @@ function diff_global_settings_form(&$subform, $form_state, $type, $settings) { ), ); - /* -This would be cool, but to do anything else than inline with the text appears -to be very hard, requiring a refactoring of both the modules API but also the -DiffFormatter and Diff classes. Diff 8.x-4.x maybe. - - $subform['show_delta'] = array( - '#type' => 'checkbox', - '#title' => t('Show delta values'), - '#default_value' => $settings['show_delta'], - ); - $subform['delta_format'] = array( - '#type' => 'radios', - '#title' => t('Delta insertion method'), - '#default_value' => $settings['delta_format'], - '#options' => array( - 'inline' => t('Prefix to item'), - 'row' => t('Individual row'), - ), - '#states' => array( - 'invisible' => array( - "input[id$='show-delta']" => array('checked' => FALSE), - ), - ), - ); - */ } /** @@ -323,11 +304,8 @@ function _diff_field_default_settings($module, $field_type, $settings = array()) 'markdown' => function_exists($func) ? '' : 'drupal_html_to_text', 'line_counter' => '', 'show_header' => 1, - // Can we? This seems too hard to track in the DiffFormatter as all we - // have is a string or an array of strings. - //'show_delta' => 0, - //'delta_format' => 'row', ); + return $settings; } diff --git a/sites/all/modules/contrib/content/diff/diff.info b/sites/all/modules/contrib/content/diff/diff.info index 5ae077e8..77b73168 100644 --- a/sites/all/modules/contrib/content/diff/diff.info +++ b/sites/all/modules/contrib/content/diff/diff.info @@ -1,12 +1,13 @@ name = Diff description = Show differences between content revisions. core = 7.x +configure = admin/config/content/diff files[] = DiffEngine.php -; Information added by drupal.org packaging script on 2012-11-13 -version = "7.x-3.2" +; Information added by Drupal.org packaging script on 2016-12-20 +version = "7.x-3.3" core = "7.x" project = "diff" -datestamp = "1352784357" +datestamp = "1482211686" diff --git a/sites/all/modules/contrib/content/diff/diff.install b/sites/all/modules/contrib/content/diff/diff.install index 16f1d27c..9d8b585d 100644 --- a/sites/all/modules/contrib/content/diff/diff.install +++ b/sites/all/modules/contrib/content/diff/diff.install @@ -5,6 +5,14 @@ * Provides uninstallation functions. */ +/** + * Implements hook_install(). + */ +function diff_install() { + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('diff view changes')); + user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('diff view changes')); +} + /** * Implements hook_uninstall(). */ @@ -16,6 +24,7 @@ function diff_uninstall() { 'diff_view_mode_', 'diff_admin_path_', 'diff_default_state_', + 'diff_additional_options_', ); foreach ($prefixes as $prefix) { db_delete('variable') @@ -55,27 +64,19 @@ function diff_update_7300() { } } -/** - * Removed diff_update_7301(). - */ - -/** - * Removed diff_update_7302(). - */ - /** * Renames some internal settings names. */ function diff_update_7303() { - // Get current values + // Get current values. $radio = variable_get('diff_script_revisioning', 'simple'); $leading = variable_get('diff_leading_context_lines', 2); $trailing = variable_get('diff_trailing_context_lines', 2); - // Create new variable names + // Create new variable names. variable_set('diff_radio_behavior', $radio); variable_set('diff_context_lines_leading', $leading); variable_set('diff_context_lines_trailing', $trailing); - // Delete old variables + // Delete old variables. variable_del('diff_script_revisioning'); variable_del('diff_leading_context_lines'); variable_del('diff_trailing_context_lines'); @@ -88,8 +89,8 @@ function diff_update_7304() { // This is now always applied to text fields. variable_del('diff_normalise_text'); - // Merge the content type settings for the inline diff block into a single variable. - // diff_update_7300() - show_diff_inline_TYPE to diff_show_diff_inline_node_TYPE + // Merge the content type settings for the inline diff block into a single + // variable. $node_types = array_keys(node_type_get_types()); $enabled_types = array(); foreach ($node_types as $node_type) { @@ -122,3 +123,19 @@ function diff_update_7305() { ->condition('name', db_like('diff_view_mode_inline_') . '%', 'LIKE') ->execute(); } + +/** + * Sets the optional additional node properties to render so that the title + * still shows by default when doing node comparisons. + */ +function diff_update_7306() { + variable_set('diff_additional_options_node', array('title' => 'title')); +} + +/** + * Grants access to the Diff "View Changes" button permission to all users. + */ +function diff_update_7307() { + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('diff view changes')); + user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('diff view changes')); +} diff --git a/sites/all/modules/contrib/content/diff/diff.module b/sites/all/modules/contrib/content/diff/diff.module index f58e1d72..d3050e3b 100644 --- a/sites/all/modules/contrib/content/diff/diff.module +++ b/sites/all/modules/contrib/content/diff/diff.module @@ -39,11 +39,14 @@ function diff_help($path, $arg) { case 'admin/help#diff': $output = '

' . t('The Diff module replaces the normal Revisions node tab. Diff enhances the listing of revisions with an option to view the differences between any two content revisions. Access to this feature is controlled with the View revisions permission. The feature can be disabled for an entire content type on the content type configuration page. Diff also provides an optional View changes button while editing a node.') . '

'; return $output; + case 'node/%/revisions/%/view': // The translated strings should match node_help('node/%/revisions'). return '

' . t('Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.') . '

'; + case 'node/%/revisions/view/%/%': return '

' . t('Comparing two revisions:') . '

'; + } } @@ -104,8 +107,7 @@ function diff_menu() { 'page callback' => 'diff_latest', 'page arguments' => array(1), 'type' => MENU_LOCAL_TASK, - 'access callback' => 'diff_node_revision_access', - 'access arguments' => array(1), + 'access arguments' => array('access content'), 'tab_parent' => 'node/%/revisions/view', 'file' => 'diff.pages.inc', ); @@ -152,10 +154,20 @@ function diff_menu() { ); $items['admin/config/content/diff/entities/node'] = array( - 'title' => 'Node', + 'title' => 'Nodes', + 'description' => 'Node comparison settings.', 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10, ); + $items['admin/config/content/diff/entities/user'] = array( + 'title' => 'Users', + 'description' => 'User diff settings.', + 'file' => 'diff.admin.inc', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('diff_admin_global_entity_settings', 'user'), + 'access arguments' => array('administer site configuration'), + 'type' => MENU_LOCAL_TASK, + ); return $items; } @@ -197,6 +209,18 @@ function diff_node_revision_access($node, $op = 'view') { return $may_revision_this_type && _node_revision_access($node, $op); } +/** + * Implements hook_permission(). + */ +function diff_permission() { + return array( + 'diff view changes' => array( + 'title' => t('Access %view button', array('%view' => t('View changes'))), + 'description' => t('Controls access to the %view button when editing content.', array('%view' => t('View changes'))), + ), + ); +} + /** * Implements hook_hook_info(). */ @@ -238,6 +262,28 @@ function diff_entity_info_alter(&$entity_info) { } } +/** + * Returns a list of all the existing revision numbers. + * + * Clone of node_revision_list() with revision status included. This would be + * an additional join in Drupal 8.x to the {node_field_revision} table. + * + * @param object $node + * The node object. + * + * @return array + * An associative array keyed by node revision number. + */ +function diff_node_revision_list($node) { + $revisions = array(); + $result = db_query('SELECT r.vid, r.title, r.log, r.uid, n.vid AS current_vid, r.status AS status, r.timestamp, u.name FROM {node_revision} r LEFT JOIN {node} n ON n.vid = r.vid INNER JOIN {users} u ON u.uid = r.uid WHERE r.nid = :nid ORDER BY r.vid DESC', array(':nid' => $node->nid)); + foreach ($result as $revision) { + $revisions[$revision->vid] = $revision; + } + + return $revisions; +} + /** * Implements hook_block_info(). */ @@ -287,7 +333,7 @@ function diff_block_view($delta) { $enabled_types = variable_get('diff_show_diff_inline_node_bundles', array()); if (!empty($enabled_types[$node->type])) { $block = array(); - $revisions = node_revision_list($node); + $revisions = diff_node_revision_list($node); if (count($revisions) > 1) { $block['subject'] = t('Highlight changes'); $block['content'] = drupal_get_form('diff_inline_form', $node, $revisions); @@ -302,7 +348,7 @@ function diff_block_view($delta) { */ function diff_node_view_alter(&$build) { $node = $build['#node']; - if (user_access('view revisions') && in_array($node->type, variable_get('diff_show_diff_inline_node_bundles', array()))) { + if (user_access('view revisions') && in_array($node->type, variable_get('diff_show_diff_inline_node_bundles', array()), TRUE)) { // Ugly but cheap way to check that we are viewing a node's revision page. if (arg(2) === 'revisions' && arg(3) === $node->vid) { module_load_include('inc', 'diff', 'diff.pages'); @@ -320,7 +366,9 @@ function diff_node_view_alter(&$build) { function diff_form_node_form_alter(&$form, $form_state) { // Add a 'View changes' button on the node edit form. $node = $form['#node']; - if (variable_get('diff_show_preview_changes_node_' . $node->type, TRUE) && !empty($node->nid)) { + if (variable_get('diff_show_preview_changes_node_' . $node->type, TRUE) + && user_access('diff view changes') + && !empty($node->nid)) { $form['actions']['preview_changes'] = array( '#type' => 'submit', '#value' => t('View changes'), @@ -347,6 +395,9 @@ function diff_form_node_type_form_alter(&$form, $form_state) { '#title' => t('Show View changes button on node edit form'), '#weight' => 10, '#default_value' => variable_get('diff_show_preview_changes_node_' . $type->type, TRUE), + '#description' => t('You can refine access using the "!perm" permission.', array( + '!perm' => t('Access %view button', array('%view' => t('View changes'))), + )), ); $form['diff']['diff_enable_revisions_page_node'] = array( '#type' => 'checkbox', @@ -430,7 +481,7 @@ function diff_node_form_build_preview_changes($form, &$form_state) { $changes = theme('table__diff__preview', array( 'header' => $header, 'rows' => $rows, - 'attributes' => array('class' => 'diff'), + 'attributes' => array('class' => array('diff')), 'colgroups' => _diff_default_cols(), 'sticky' => FALSE, )); @@ -440,6 +491,24 @@ function diff_node_form_build_preview_changes($form, &$form_state) { $form_state['rebuild'] = TRUE; } +/** + * Implementation of hook_features_pipe_COMPONENT_alter(). + */ +function diff_features_pipe_node_alter(&$pipe, $data, $export) { + if (!empty($data)) { + $variables = array( + 'diff_show_preview_changes_node', + 'diff_enable_revisions_page_node', + 'diff_view_mode_preview_node', + ); + foreach ($data as $node_type) { + foreach ($variables as $variable_name) { + $pipe['variable'][] = $variable_name . '_' . $node_type; + } + } + } +} + /** * Implements hook_theme(). */ @@ -483,7 +552,7 @@ function diff_theme() { * The source string to compare from. * @param string $b * The target string to compare to. - * @param boolean $show_header + * @param bool $show_header * Display diff context headers. For example, "Line x". * @param array $line_stats * This structure tracks line numbers across multiple calls to DiffFormatter. @@ -621,3 +690,85 @@ function diff_build_attachments($jscript = FALSE) { } return $attachments; } + +/** + * Implements hook_entity_diff() on behalf of the Node module. + */ +function node_entity_diff($old_node, $new_node, $context) { + $result = array(); + if ($context['entity_type'] == 'node') { + module_load_include('inc', 'diff', 'includes/node'); + $options = variable_get('diff_additional_options_node', array('title' => 'title')); + foreach (node_entity_diff_options('node') as $key => $option_label) { + if (!empty($options[$key])) { + $func = '_node_entity_diff_additional_options_' . $key; + $result[$key] = $func($old_node, $new_node, $context); + } + } + } + return $result; +} + +/** + * Implements hook_entity_diff_options() on behalf of the Node module. + */ +function node_entity_diff_options($entity_type) { + if ($entity_type == 'node') { + $options = array( + 'title' => t('Title field'), + // Author field is either the owner or revision creator, neither capture + // a change in the author field. + 'author' => t('Author'), + 'revision_author' => t('Revision author'), + 'type' => t('Node type'), + 'publishing_flags' => t('Publishing options'), + // More fields that currently can not be tracked. + 'created' => t('Created date'), + 'changed' => t('Updated date'), + 'revision_timestamp' => t('Revision timestamp'), + ); + if (module_exists('comment')) { + $options['comment'] = t('Comment setting'); + } + return $options; + } +} + +/** + * Implements hook_entity_diff() on behalf of the User module. + */ +function user_entity_diff($old_user, $new_user, $context) { + $result = array(); + if ($context['entity_type'] == 'user') { + module_load_include('inc', 'diff', 'includes/user'); + $options = variable_get('diff_additional_options_user', array( + 'name' => 'name', + 'mail' => 'mail', + 'status' => 'status', + )); + foreach (user_entity_diff_options('user') as $key => $option_label) { + if (!empty($options[$key])) { + $func = '_user_entity_diff_additional_options_' . $key; + $result[$key] = $func($old_user, $new_user, $context); + } + } + } + return $result; +} + +/** + * Implements hook_entity_diff_options() on behalf of the User module. + */ +function user_entity_diff_options($entity_type) { + if ($entity_type == 'user') { + $options = array( + 'name' => t('Username'), + 'mail' => t('E-mail address'), + 'roles' => t('Roles'), + 'status' => t('Status'), + 'timezone' => t('Time zone'), + 'password' => t('Password Hash'), + ); + return $options; + } +} diff --git a/sites/all/modules/contrib/content/diff/diff.pages.inc b/sites/all/modules/contrib/content/diff/diff.pages.inc index 1cd14419..285eb1ed 100644 --- a/sites/all/modules/contrib/content/diff/diff.pages.inc +++ b/sites/all/modules/contrib/content/diff/diff.pages.inc @@ -10,6 +10,9 @@ */ function diff_latest($node) { $revisions = node_revision_list($node); + if (count($revisions) < 2 || !diff_node_revision_access($node, 'view')) { + drupal_goto('node/' . $node->nid); + } $new = array_shift($revisions); $old = array_shift($revisions); drupal_goto("node/{$node->nid}/revisions/view/{$old->vid}/{$new->vid}"); @@ -35,19 +38,20 @@ function diff_node_revisions($form, $form_state, $node) { '#value' => $node->nid, ); - $revision_list = node_revision_list($node); + $revision_list = diff_node_revision_list($node); + $revision_count = count($revision_list); - if (count($revision_list) > REVISION_LIST_SIZE) { + if ($revision_count > REVISION_LIST_SIZE) { // If the list of revisions is longer than the number shown on one page // split the array. $page = isset($_GET['page']) ? $_GET['page'] : '0'; - $revision_chunks = array_chunk(node_revision_list($node), REVISION_LIST_SIZE); + $revision_chunks = array_chunk($revision_list, REVISION_LIST_SIZE); $revisions = $revision_chunks[$page]; // Set up global pager variables as would 'pager_query' do. // These variables are then used in the theme('pager') call later. global $pager_page_array, $pager_total, $pager_total_items; - $pager_total_items[0] = count($revision_list); - $pager_total[0] = ceil(count($revision_list) / REVISION_LIST_SIZE); + $pager_total_items[0] = $revision_count; + $pager_total[0] = ceil($revision_count / REVISION_LIST_SIZE); $pager_page_array[0] = max(0, min($page, ((int) $pager_total[0]) - 1)); } else { @@ -73,6 +77,7 @@ function diff_node_revisions($form, $form_state, $node) { '#markup' => t('!date by !username', array( '!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid"), '!username' => theme('username', array('account' => $revision)))) . $revision_log, + '#revision' => $revision, ); } else { @@ -82,6 +87,7 @@ function diff_node_revisions($form, $form_state, $node) { '!date' => $diff_date, '!username' => theme('username', array('account' => $revision))) ) . $revision_log, + '#revision' => $revision, ); if ($revert_permission) { $operations[] = array( @@ -117,23 +123,13 @@ function diff_node_revisions($form, $form_state, $node) { $form['submit'] = array('#type' => 'submit', '#value' => t('Compare')); - if (count($revision_list) > REVISION_LIST_SIZE) { + if ($revision_count > REVISION_LIST_SIZE) { $form['#suffix'] = theme('pager'); } $form['#attached'] = diff_build_attachments(TRUE); return $form; } -/** - * Submit code for input form to select two revisions. - */ -function diff_node_revisions_submit($form, &$form_state) { - // The ids are ordered so the old revision is always on the left. - $old_vid = min($form_state['values']['old'], $form_state['values']['new']); - $new_vid = max($form_state['values']['old'], $form_state['values']['new']); - $form_state['redirect'] = 'node/' . $form_state['values']['nid'] . '/revisions/view/' . $old_vid . '/' . $new_vid; -} - /** * Validation for input form to select two revisions. */ @@ -145,14 +141,27 @@ function diff_node_revisions_validate($form, &$form_state) { } } +/** + * Submit code for input form to select two revisions. + */ +function diff_node_revisions_submit($form, &$form_state) { + // The ids are ordered so the old revision is always on the left. + $old_vid = min($form_state['values']['old'], $form_state['values']['new']); + $new_vid = max($form_state['values']['old'], $form_state['values']['new']); + if (isset($_GET['destination'])) { + unset($_GET['destination']); + } + $form_state['redirect'] = 'node/' . $form_state['values']['nid'] . '/revisions/view/' . $old_vid . '/' . $new_vid; +} + /** * Create a comparison for the node between versions 'old_vid' and 'new_vid'. * * @param object $node - * Node on which to perform comparison - * @param integer $old_vid + * Node on which to perform comparison. + * @param int $old_vid * Version ID of the old revision. - * @param integer $new_vid + * @param int $new_vid * Version ID of the new revision. */ function diff_diffs_show($node, $old_vid, $new_vid, $state = NULL) { @@ -161,7 +170,7 @@ function diff_diffs_show($node, $old_vid, $new_vid, $state = NULL) { $default_state = variable_get('diff_default_state_node', 'raw'); if (empty($state)) { - $state = $default_state; + $state = $default_state; } $state = str_replace('-', '_', $state); if (!array_key_exists($state, diff_available_states())) { @@ -279,7 +288,7 @@ function diff_diffs_show($node, $old_vid, $new_vid, $state = NULL) { } $build['diff_preview']['header']['#markup'] = $header; // Don't include node links or comments when viewing the diff. - $build['diff_preview']['content'] = node_view($new_node, $view_mode); + $build['diff_preview']['content'] = function_exists('entity_view') ? entity_view('node', array($new_node), $view_mode) : node_view($new_node, $view_mode); if (isset($build['diff_preview']['content']['links'])) { unset($build['diff_preview']['content']['links']); } @@ -291,33 +300,33 @@ function diff_diffs_show($node, $old_vid, $new_vid, $state = NULL) { } /** - * Creates an array of rows which represent the difference between nodes. + * Creates an array of rows which represent the difference between two entities. * - * @param object $old_node - * Node for comparison which will be displayed on the left side. - * @param object $new_node - * Node for comparison which will be displayed on the right side. - * @param boolean $state - * The state to render for the diff. + * @param object $left_entity + * Entity for comparison which will be displayed on the left side. + * @param object $right_entity + * Entity for comparison which will be displayed on the right side. + * @param array $context + * The context used to render the diff. */ -function _diff_body_rows($old_node, $new_node, $state = 'raw') { +function diff_entity_body_rows($entity_type, $left_entity, $right_entity, $context = array()) { // This is an unique index only, so no need for drupal_static(). static $table_row_counter = 0; if ($theme = variable_get('diff_theme', 'default')) { drupal_add_css(drupal_get_path('module', 'diff') . "/css/diff.{$theme}.css"); } - module_load_include('inc', 'diff', 'includes/node'); $rows = array(); $any_visible_change = FALSE; - $context = array( - 'entity_type' => 'node', - 'states' => array($state), + $context += array( + 'entity_type' => $entity_type, + 'states' => array('raw'), 'view_mode' => 'diff_standard', ); + $state = current($context['states']); - $node_diffs = diff_compare_entities($old_node, $new_node, $context); + $entity_diffs = diff_compare_entities($left_entity, $right_entity, $context); // Track line numbers between multiple diffs. $line_stats = array( @@ -326,19 +335,19 @@ function _diff_body_rows($old_node, $new_node, $state = 'raw') { ); // Render diffs for each. - foreach ($node_diffs as $node_diff) { - $show_header = !empty($node_diff['#name']); + foreach ($entity_diffs as $entity_diff) { + $show_header = !empty($entity_diff['#name']); // These are field level settings. - if ($show_header && isset($node_diff['#settings']['show_header'])) { - $show_header = $show_header && $node_diff['#settings']['show_header']; + if ($show_header && isset($entity_diff['#settings']['show_header'])) { + $show_header = $show_header && $entity_diff['#settings']['show_header']; } // Line counting and line header options. - if (empty($node_diff['#settings']['line_counter'])) { + if (empty($entity_diff['#settings']['line_counter'])) { $line_counter = FALSE; } else { - $line_counter = $node_diff['#settings']['line_counter']; + $line_counter = $entity_diff['#settings']['line_counter']; } // Every call to 'line' resets the counters. if ($line_counter) { @@ -354,8 +363,8 @@ function _diff_body_rows($old_node, $new_node, $state = 'raw') { $line_stats_ref = NULL; } - list($old, $new) = diff_extract_state($node_diff, $state); - if ($node_diff_rows = diff_get_rows($old, $new, $line_counter && $line_counter != 'hidden', $line_stats_ref)) { + list($left, $right) = diff_extract_state($entity_diff, $state); + if ($entity_diff_rows = diff_get_rows($left, $right, $line_counter && $line_counter != 'hidden', $line_stats_ref)) { if ($line_counter && $line_counter != 'line') { $line_stats['offset']['x'] += $line_stats_ref['counter']['x']; $line_stats['offset']['y'] += $line_stats_ref['counter']['y']; @@ -363,7 +372,7 @@ function _diff_body_rows($old_node, $new_node, $state = 'raw') { if ($show_header) { $rows['diff-header-' . $table_row_counter++] = array( array( - 'data' => t('Changes to %name', array('%name' => $node_diff['#name'])), + 'data' => t('Changes to %name', array('%name' => $entity_diff['#name'])), 'class' => 'diff-section-title', 'colspan' => 4, ), @@ -371,7 +380,7 @@ function _diff_body_rows($old_node, $new_node, $state = 'raw') { } // To avoid passing counter to the Diff engine, index rows manually here // to allow modules to interact with the table. i.e. no array_merge(). - foreach ($node_diff_rows as $row) { + foreach ($entity_diff_rows as $row) { $rows['diff-row-' . $table_row_counter++] = $row; } $any_visible_change = TRUE; @@ -385,19 +394,28 @@ function _diff_body_rows($old_node, $new_node, $state = 'raw') { 'colspan' => 4, ), ); - // @todo: revise this. - // Needed to keep safari happy. - $rows['diff-empty-' . $table_row_counter++] = array( - array('data' => ''), - array('data' => ''), - array('data' => ''), - array('data' => ''), - ); } - return $rows; } +/** + * Creates an array of rows which represent the difference between nodes. + * + * @param object $old_node + * Node for comparison which will be displayed on the left side. + * @param object $new_node + * Node for comparison which will be displayed on the right side. + * @param bool $state + * The state to render for the diff. + */ +function _diff_body_rows($old_node, $new_node, $state = 'raw') { + $context = array( + 'states' => array($state), + 'view_mode' => 'diff_standard', + ); + return diff_entity_body_rows('node', $old_node, $new_node, $context); +} + /** * Generic callback to compare two entities. */ @@ -460,6 +478,9 @@ function diff_compare_entities($left_entity, $right_entity, $context) { if (!isset($diff['#sorted'])) { uasort($diff, 'element_sort'); } + else { + unset($diff['#sorted']); + } // Process the array and get line counts per field. array_walk($diff, 'diff_process_state_lines'); @@ -467,6 +488,9 @@ function diff_compare_entities($left_entity, $right_entity, $context) { return $diff; } +/** + * Helper function to get line counts per field. + */ function diff_process_state_lines(&$diff, $key) { foreach ($diff['#states'] as $state => $data) { if (isset($data['#old'])) { @@ -509,20 +533,29 @@ function diff_markdown_state(&$diff, $state) { } if (!isset($plain_old) && isset($old)) { - if (is_array($old)) { - $diff['#states'][$state . '_plain']['#old'] = $markdown ? array_map($markdown, $old) : $old; - } - else { - $diff['#states'][$state . '_plain']['#old'] = $markdown ? $markdown($old) : $old; - } + $diff['#states'][$state . '_plain']['#old'] = _diff_apply_markdown($markdown, $old); } if (!isset($plain_new) && isset($new)) { - if (is_array($new)) { - $diff['#states'][$state . '_plain']['#new'] = $markdown ? array_map($markdown, $new) : $new; - } - else { - $diff['#states'][$state . '_plain']['#new'] = $markdown ? $markdown($new) : $new; + $diff['#states'][$state . '_plain']['#new'] = _diff_apply_markdown($markdown, $new); + } +} + +/** + * Helper function to clear newlines from the content. + */ +function _diff_apply_markdown($markdown, $items) { + if (!$markdown) { + return $items; + } + if (is_array($items)) { + $items = array_map($markdown, $items); + foreach ($items as &$item) { + $item = trim($item, "\n"); } + return $items; + } + else { + return trim($markdown($items), "\n"); } } @@ -534,7 +567,7 @@ function diff_markdown_state(&$diff, $state) { * @param int $vid * Version ID to look for. * - * @return boolean|integer + * @return bool|int * Returns FALSE if $vid is the last entry. */ function _diff_get_next_vid($node_revisions, $vid) { @@ -553,10 +586,10 @@ function _diff_get_next_vid($node_revisions, $vid) { * * @param array $node_revisions * Array of node revision IDs in descending order. - * @param integer $vid + * @param int $vid * Version ID to look for. * - * @return boolean|integer + * @return bool|int * Returns FALSE if $vid is the first entry. */ function _diff_get_previous_vid($node_revisions, $vid) { @@ -615,13 +648,13 @@ function _diff_default_header($old_header = '', $new_header = '') { * normally rendered content of the specified revision. */ function diff_inline_show($node, $vid = 0, $metadata = TRUE) { - $new_node = $vid ? node_load($node->nid, $vid, TRUE) : clone $node; + $new_node = $vid ? node_load($node->nid, $vid) : clone $node; node_build_content($new_node); $new = drupal_render($new_node->content); $old = $vid ? _diff_get_previous_vid(node_revision_list($node), $vid) : 0; if ($old) { - $old_node = node_load($node->nid, $old, TRUE); + $old_node = node_load($node->nid, $old); node_build_content($old_node); $old = drupal_render($old_node->content); $output = $metadata ? theme('diff_inline_metadata', array('node' => $new_node)) : ''; diff --git a/sites/all/modules/contrib/content/diff/diff.theme.inc b/sites/all/modules/contrib/content/diff/diff.theme.inc index 96d20b3a..aee2581c 100644 --- a/sites/all/modules/contrib/content/diff/diff.theme.inc +++ b/sites/all/modules/contrib/content/diff/diff.theme.inc @@ -48,14 +48,21 @@ function theme_diff_node_revisions($vars) { 'data' => drupal_render($form['diff']['new'][$key]), 'class' => array('revision-current'), ); + $revision = $form['info'][$key]['#revision']; + if ($revision && !empty($revision->status)) { + $message = t('This is the published revision.'); + } + else { + $message = t('This is the current revision.'); + } $row[] = array( - 'data' => t('current revision'), + 'data' => '' . $message . '', 'class' => array('revision-current'), 'colspan' => '2', ); $rows[] = array( 'data' => $row, - 'class' => array('error diff-revision'), + 'class' => array('revision-published diff-revision'), ); } } @@ -64,17 +71,13 @@ function theme_diff_node_revisions($vars) { 'header' => $header, 'rows' => $rows, 'sticky' => FALSE, - 'attributes' => array('class' => 'diff-revisions'), + 'attributes' => array('class' => array('diff-revisions')), )); $output .= drupal_render_children($form); return $output; } -/** - * Theme functions - */ - /** * Theme function for a header line in the diff. */ @@ -139,11 +142,15 @@ function theme_diff_inline_chunk($vars) { switch ($vars['type']) { case 'add': return "{$vars['text']}"; + case 'change': return "{$vars['text']}"; + case 'delete': return "{$vars['text']}"; + default: return $vars['text']; + } } diff --git a/sites/all/modules/contrib/content/diff/diff.tokens.inc b/sites/all/modules/contrib/content/diff/diff.tokens.inc index 96dbd80a..605d2e43 100644 --- a/sites/all/modules/contrib/content/diff/diff.tokens.inc +++ b/sites/all/modules/contrib/content/diff/diff.tokens.inc @@ -38,13 +38,13 @@ function diff_tokens($type, $tokens, array $data = array(), array $options = arr // Basic diff standard comparison information. case 'diff': case 'diff-markdown': - $revisons = node_revision_list($node); - if (count($revisons) == 1) { + $revisions = node_revision_list($node); + if (count($revisions) == 1) { $replacements[$original] = t('(No previous revision available.)'); } else { module_load_include('inc', 'diff', 'diff.pages'); - $old_vid = _diff_get_previous_vid($revisons, $node->vid); + $old_vid = _diff_get_previous_vid($revisions, $node->vid); $state = $name == 'diff' ? 'raw' : 'raw_plain'; $build = diff_diffs_show($node, $old_vid, $node->vid, $state); unset($build['diff_table']['#rows']['states']); @@ -52,7 +52,10 @@ function diff_tokens($type, $tokens, array $data = array(), array $options = arr unset($build['diff_preview']); $output = drupal_render_children($build); - $replacements[$original] = $sanitize ? check_plain($output) : $output; + if ($sanitize) { + $output = filter_xss($output, array('a', 'em', 'strong', 'cite', 'blockquote', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd', 'table', 'tr', 'th', 'td')); + } + $replacements[$original] = $output; } break; diff --git a/sites/all/modules/contrib/content/diff/includes/file.inc b/sites/all/modules/contrib/content/diff/includes/file.inc index 678ff466..575e8498 100644 --- a/sites/all/modules/contrib/content/diff/includes/file.inc +++ b/sites/all/modules/contrib/content/diff/includes/file.inc @@ -67,7 +67,8 @@ function file_field_diff_view($items, $context) { if ($settings['compare_display_field'] && !empty($field['settings']['display_field'])) { $output['display'] = $item['display'] ? t('Displayed') : t('Hidden'); } - $diff_items[$delta] = implode('; ', $output); + $separator = $settings['property_separator'] == 'nl' ? "\n" : $settings['property_separator']; + $diff_items[$delta] = implode($separator, $output); } } @@ -82,6 +83,7 @@ function file_field_diff_default_options($field_type) { 'show_id' => 0, 'compare_display_field' => 0, 'compare_description_field' => 0, + 'property_separator' => '; ', ); } @@ -107,5 +109,21 @@ function file_field_diff_options_form($field_type, $settings) { '#default_value' => $settings['compare_display_field'], '#description' => t('This is only used if the "Enable Display field" is checked in the field settings.'), ); + $options_form['property_separator'] = array( + '#type' => 'select', + '#title' => t('Property separator'), + '#default_value' => $settings['property_separator'], + '#description' => t('Provides the ability to show properties inline or across multiple lines.'), + '#options' => array( + ', ' => t('Comma (,)'), + '; ' => t('Semicolon (;)'), + ' ' => t('Space'), + 'nl' => t('New line'), + ), + ); + // Allow users to set their own separator using variable_set(). + if (!isset($options_form['#options'][$settings['property_separator']])) { + $options_form['#options'][$settings['property_separator']] = $settings['property_separator']; + } return $options_form; } diff --git a/sites/all/modules/contrib/content/diff/includes/image.inc b/sites/all/modules/contrib/content/diff/includes/image.inc index cb93616d..b41753e1 100644 --- a/sites/all/modules/contrib/content/diff/includes/image.inc +++ b/sites/all/modules/contrib/content/diff/includes/image.inc @@ -68,7 +68,8 @@ function image_field_diff_view($items, $context) { if ($settings['show_id']) { $output[] = t('File ID: !fid', $t_args); } - $diff_items[$delta] = implode('; ', $output); + $separator = $settings['property_separator'] == 'nl' ? "\n" : $settings['property_separator']; + $diff_items[$delta] = implode($separator, $output); } } @@ -83,6 +84,7 @@ function image_field_diff_default_options($field_type) { 'show_id' => 0, 'compare_alt_field' => 0, 'compare_title_field' => 0, + 'property_separator' => '; ', ); } @@ -108,5 +110,21 @@ function image_field_diff_options_form($field_type, $settings) { '#default_value' => $settings['compare_title_field'], '#description' => t('This is only used if the "Enable Title field" is checked in the instance settings.'), ); + $options_form['property_separator'] = array( + '#type' => 'select', + '#title' => t('Property separator'), + '#default_value' => $settings['property_separator'], + '#description' => t('Provides the ability to show properties inline or across multiple lines.'), + '#options' => array( + ', ' => t('Comma (,)'), + '; ' => t('Semicolon (;)'), + ' ' => t('Space'), + 'nl' => t('New line'), + ), + ); + // Allow users to set their own separator using variable_set(). + if (!isset($options_form['#options'][$settings['property_separator']])) { + $options_form['#options'][$settings['property_separator']] = $settings['property_separator']; + } return $options_form; } diff --git a/sites/all/modules/contrib/content/diff/includes/node.inc b/sites/all/modules/contrib/content/diff/includes/node.inc index 3f0bca33..9cab7a68 100644 --- a/sites/all/modules/contrib/content/diff/includes/node.inc +++ b/sites/all/modules/contrib/content/diff/includes/node.inc @@ -6,102 +6,199 @@ */ /** - * Implements hook_entity_diff(). - * - * This function compares core node properties. This is currently limited to: - * - title: The title of the node. - * - * @param object $old_node - * The older node revision. - * @param object $new_node - * The newer node revision. - * @param array $context - * An associative array containing: - * - entity_type: The entity type; e.g., 'node' or 'user'. - * - old_entity: The older entity. - * - new_entity: The newer entity. - * - view_mode: The view mode to use. Defaults to FALSE. If no view mode is - * given, the recommended fallback view mode is 'default'. - * - states: An array of view states. These could be one of: - * - raw: The raw value of the diff, the classic 7.x-2.x view. - * - rendered: The rendered HTML as determined by the view mode. Only - * return markup for this state if the value is normally shown - * by this view mode. The user will most likely be able to see - * the raw or raw_plain state, so this is optional. - * - * The rendering state is a work in progress. - * - * Conditionally, you can get these states, but setting these will override - * the user selectable markdown method. - * - * - raw_plain: As raw, but text should be markdowned. - * - rendered_plain: As rendered, but text should be markdowned. - * - * @return array - * An associative array of values keyed by the entity property. - * - * This is effectively an unnested Form API-like structure. - * - * States are returned as follows: - * - * $results['line'] = array( - * '#name' => t('Line'), - * '#states' => array( - * 'raw' => array( - * '#old' => '

This was the old line number [tag].

', - * '#new' => '

This is the new line [tag].

', - * ), - * 'rendered' => array( - * '#old' => '

This was the old line number 57.

', - * '#new' => '

This is the new line 57.

', - * ), - * ), - * ); - * - * For backwards compatability, no changes are required to support states, - * but it is recommended to provide a better UI for end users. - * - * For example, the following example is equivalent to returning the raw - * state from the example above. - * - * $results['line'] = array( - * '#name' => t('Line'), - * '#old' => '

This was the old line number [tag].

', - * '#new' => '

This is the new line [tag].

', - * ); + * Private callback function to render the title field. */ -function node_entity_diff($old_node, $new_node, $context) { - $result = array(); - if ($context['entity_type'] == 'node') { - $type = node_type_get_type($new_node); - $result['title'] = array( - '#name' => $type->title_label, - '#states' => array(), - '#weight' => -5, - '#settings' => array( - // Global setting - 'diff_show_header_' . $entity_type - 'show_header' => variable_get('diff_show_header_node', 1), - ), - ); - foreach ($context['states'] as $state) { - switch ($state) { - case 'rendered': - $result['title']['#states'][$state] = array( - '#old' => l($old_node->title, 'node/' . $old_node->title), - '#new' => l($new_node->title, 'node/' . $new_node->title), - ); - break; +function _node_entity_diff_additional_options_title($old_node, $new_node, $context) { + $type = node_type_get_type($new_node); + $row = array( + '#name' => $type->title_label, + '#states' => array(), + '#weight' => -5, + '#settings' => array( + 'show_header' => variable_get('diff_show_header_node', 1), + ), + ); + foreach ($context['states'] as $state) { + switch ($state) { + case 'rendered': + $row['#states'][$state] = array( + '#old' => l($old_node->title, 'node/' . $old_node->title), + '#new' => l($new_node->title, 'node/' . $new_node->title), + ); + break; - // We specify a default so that the title is allows compared. - case 'raw': - default: - $result['title']['#states'][$state] = array( - '#old' => array($old_node->title), - '#new' => array($new_node->title), - ); - break; - } + // We specify a default so that the title is allows compared. + case 'raw': + default: + $row['#states'][$state] = array( + '#old' => array($old_node->title), + '#new' => array($new_node->title), + ); + break; } } - return $result; + return $row; +} + +/** + * Private callback function to render the type field. + */ +function _node_entity_diff_additional_options_type($old_node, $new_node, $context) { + $row = array( + '#name' => t('Content type'), + '#states' => array(), + '#weight' => -4, + '#settings' => array(), + ); + $old_type = node_type_get_type($old_node); + $new_type = node_type_get_type($new_node); + + foreach ($context['states'] as $state) { + $row['#states'][$state] = array( + '#old' => array($old_type ? $old_type->name : t('Deleted type !type', array('!type' => $old_node->type))), + '#new' => array($new_type ? $new_type->name : t('Deleted type !type', array('!type' => $new_node->type))), + ); + } + return $row; +} + +/** + * Private callback function to render the author field. + */ +function _node_entity_diff_additional_options_author($old_node, $new_node, $context) { + $old_author = user_load($old_node->uid); + $new_author = user_load($new_node->uid); + return _node_entity_diff_additional_options_account(t('Author'), $old_author, $new_author, $context, -4); +} + +/** + * Private callback function to render the revision_author field. + */ +function _node_entity_diff_additional_options_revision_author($old_node, $new_node, $context) { + $old_author = user_load($old_node->revision_uid); + $new_author = user_load($new_node->revision_uid); + return _node_entity_diff_additional_options_account(t('Revision author'), $old_author, $new_author, $context, -3.9); +} + +/** + * Private callback function to render the author field. + */ +function _node_entity_diff_additional_options_account($label, $old_author, $new_author, $context, $weight = 0) { + $row = array( + '#name' => $label, + '#states' => array(), + '#weight' => $weight, + '#settings' => array(), + ); + foreach ($context['states'] as $state) { + $row['#states'][$state] = array( + '#old' => array($old_author ? format_username($old_author) : t('Deleted user')), + '#new' => array($new_author ? format_username($new_author) : t('Deleted user')), + ); + } + return $row; +} + +/** + * Private callback function to render the status, sticky and published field. + */ +function _node_entity_diff_additional_options_publishing_flags($old_node, $new_node, $context) { + $row = array( + '#name' => t('Publishing options'), + '#states' => array(), + '#weight' => -3, + '#settings' => array(), + ); + $old_options = array($old_node->status ? t('Published') : t('Unpublished')); + if ($old_node->promote) { + $old_options[] = t('Promoted to front page'); + } + if ($old_node->sticky) { + $old_options[] = t('Sticky at top of lists'); + } + + $new_options = array($new_node->status ? t('Published') : t('Unpublished')); + if ($new_node->promote) { + $new_options[] = t('Promoted to front page'); + } + if ($new_node->sticky) { + $new_options[] = t('Sticky at top of lists'); + } + + foreach ($context['states'] as $state) { + $row['#states'][$state] = array( + '#old' => $old_options, + '#new' => $new_options, + ); + } + return $row; +} + +/** + * Private callback function to render the created field. + */ +function _node_entity_diff_additional_options_created($old_node, $new_node, $context) { + return _node_entity_diff_additional_options_date_field(t('Created timestamp'), $old_node->created, $new_node->created, $context, -1); +} + +/** + * Private callback function to render the changed field. + */ +function _node_entity_diff_additional_options_changed($old_node, $new_node, $context) { + return _node_entity_diff_additional_options_date_field(t('Changed timestamp'), $old_node->changed, $new_node->changed, $context, -1); +} + +/** + * Private callback function to render the revision_timestamp field. + */ +function _node_entity_diff_additional_options_revision_timestamp($old_node, $new_node, $context) { + return _node_entity_diff_additional_options_date_field(t('Revision timestamp'), $old_node->revision_timestamp, $new_node->revision_timestamp, $context, -1); +} + +/** + * Helper function to render the date flags. + */ +function _node_entity_diff_additional_options_date_field($label, $old_date, $new_date, $context, $weight = 0) { + $row = array( + '#name' => $label, + '#states' => array(), + '#weight' => $weight, + '#settings' => array(), + ); + + foreach ($context['states'] as $state) { + $row['#states'][$state] = array( + '#old' => array(format_date($old_date)), + '#new' => array(format_date($new_date)), + ); + } + return $row; +} + +/** + * Private callback function to render the comment field. + */ +function _node_entity_diff_additional_options_comment($old_node, $new_node, $context) { + if (!module_exists('comment')) { + return array(); + } + $row = array( + '#name' => t('Comment setting'), + '#states' => array(), + '#weight' => -1, + '#settings' => array(), + ); + $options = array( + COMMENT_NODE_OPEN => t('Open'), + COMMENT_NODE_CLOSED => t('Closed'), + COMMENT_NODE_HIDDEN => t('Hidden'), + ); + + foreach ($context['states'] as $state) { + $row['#states'][$state] = array( + '#old' => array($options[$old_node->comment]), + '#new' => array($options[$new_node->comment]), + ); + } + return $row; } diff --git a/sites/all/modules/contrib/content/diff/includes/user.inc b/sites/all/modules/contrib/content/diff/includes/user.inc new file mode 100644 index 00000000..7ebd5664 --- /dev/null +++ b/sites/all/modules/contrib/content/diff/includes/user.inc @@ -0,0 +1,148 @@ + t('Username'), + '#states' => array(), + '#weight' => -5, + '#settings' => array( + 'show_header' => variable_get('diff_show_header_user', 1), + ), + ); + foreach ($context['states'] as $state) { + switch ($state) { + case 'rendered': + $row['#states'][$state] = array( + '#old' => theme('username', array('account' => $old_user)), + '#new' => theme('username', array('account' => $old_user)), + ); + break; + + // We specify a default so that the name is always compared. + case 'raw': + default: + $row['#states'][$state] = array( + '#old' => array($old_user->name), + '#new' => array($new_user->name), + ); + break; + } + } + return $row; +} + +/** + * Private callback function to render the mail field. + */ +function _user_entity_diff_additional_options_mail($old_user, $new_user, $context) { + $row = array( + '#name' => t('E-mail address'), + '#states' => array(), + '#weight' => -4, + '#settings' => array(), + ); + + foreach ($context['states'] as $state) { + $row['#states'][$state] = array( + '#old' => array($old_user->mail), + '#new' => array($new_user->mail), + ); + } + return $row; +} + +/** + * Private callback function to render the status field. + */ +function _user_entity_diff_additional_options_status($old_user, $new_user, $context) { + $row = array( + '#name' => t('Status'), + '#states' => array(), + '#weight' => -3, + '#settings' => array(), + ); + + foreach ($context['states'] as $state) { + $row['#states'][$state] = array( + '#old' => array($old_user->status ? t('Active') : t('Blocked')), + '#new' => array($new_user->status ? t('Active') : t('Blocked')), + ); + } + return $row; +} + +/** + * Private callback function to render the timezone field. + */ +function _user_entity_diff_additional_options_timezone($old_user, $new_user, $context) { + $row = array( + '#name' => t('Time zone'), + '#states' => array(), + '#weight' => -1, + '#settings' => array(), + ); + $system_time_zones = system_time_zones(TRUE); + $old_zone = isset($old_user->timezone) ? $old_user->timezone : ''; + $new_zone = isset($new_user->timezone) ? $new_user->timezone : ''; + + foreach ($context['states'] as $state) { + $row['#states'][$state] = array( + '#old' => array(isset($system_time_zones[$old_zone]) ? $system_time_zones[$old_zone] : t('- None selected -')), + '#new' => array(isset($system_time_zones[$new_zone]) ? $system_time_zones[$new_zone] : t('- None selected -')), + ); + } + return $row; +} + +/** + * Private callback function to render the password field. + */ +function _user_entity_diff_additional_options_password($old_user, $new_user, $context) { + $row = array( + '#name' => t('Password Hash'), + '#states' => array(), + '#weight' => -1, + '#settings' => array(), + ); + + foreach ($context['states'] as $state) { + $row['#states'][$state] = array( + '#old' => array($old_user->pass), + '#new' => array($new_user->pass), + ); + } + return $row; +} + +/** + * Private callback function to render the roles field. + */ +function _user_entity_diff_additional_options_roles($old_user, $new_user, $context) { + $row = array( + '#name' => t('Roles'), + '#states' => array(), + '#weight' => -1, + '#settings' => array(), + ); + + $roles = user_roles(TRUE); + unset($roles[DRUPAL_AUTHENTICATED_RID]); + foreach ($context['states'] as $state) { + $row['#states'][$state] = array( + '#old' => array(implode("\n", array_intersect_key($roles, $old_user->roles))), + '#new' => array(implode("\n", array_intersect_key($roles, $new_user->roles))), + ); + } + return $row; +} diff --git a/sites/all/modules/contrib/content/diff/js/diff.js b/sites/all/modules/contrib/content/diff/js/diff.js index 2c873e9f..5b63d7b1 100644 --- a/sites/all/modules/contrib/content/diff/js/diff.js +++ b/sites/all/modules/contrib/content/diff/js/diff.js @@ -1,58 +1,65 @@ (function ($) { -Drupal.behaviors.diffRevisions = { - attach: function (context, settings) { - var $rows = $('table.diff-revisions tbody tr'); - function updateDiffRadios() { - var newTd = false; - var oldTd = false; - if (!$rows.length) { - return true; - } - $rows.removeClass('selected').each(function() { - var $row = $(this); - $row.removeClass('selected'); - var $inputs = $row.find('input[type="radio"]'); - var $oldRadio = $inputs.filter('[name="old"]').eq(0); - var $newRadio = $inputs.filter('[name="new"]').eq(0); - if (!$oldRadio.length || !$newRadio.length) { + "use strict"; + + Drupal.behaviors.diffRevisions = { + attach: function (context, settings) { + var $rows = $('table.diff-revisions tbody tr'); + function updateDiffRadios() { + var newTd = false; + var oldTd = false; + if (!$rows.length) { return true; } - if ($oldRadio.attr('checked')) { - oldTd = true; - $row.addClass('selected'); - $oldRadio.css('visibility', 'visible'); - $newRadio.css('visibility', 'hidden'); - } else if ($newRadio.attr('checked')) { - newTd = true; - $row.addClass('selected'); - $oldRadio.css('visibility', 'hidden'); - $newRadio.css('visibility', 'visible'); - } else { - if (Drupal.settings.diffRevisionRadios == 'linear') { - if (newTd && oldTd) { - $oldRadio.css('visibility', 'visible'); - $newRadio.css('visibility', 'hidden'); - } else if (newTd) { - $newRadio.css('visibility', 'visible'); - $oldRadio.css('visibility', 'visible'); - } else { - $newRadio.css('visibility', 'visible'); - $oldRadio.css('visibility', 'hidden'); - } - } else { - $newRadio.css('visibility', 'visible'); - $oldRadio.css('visibility', 'visible'); + $rows.removeClass('selected').each(function() { + var $row = $(this); + $row.removeClass('selected'); + var $inputs = $row.find('input[type="radio"]'); + var $oldRadio = $inputs.filter('[name="old"]').eq(0); + var $newRadio = $inputs.filter('[name="new"]').eq(0); + if (!$oldRadio.length || !$newRadio.length) { + return true; } - } - }); - return true; + if ($oldRadio.attr('checked')) { + oldTd = true; + $row.addClass('selected'); + $oldRadio.css('visibility', 'visible'); + $newRadio.css('visibility', 'hidden'); + } + else if ($newRadio.attr('checked')) { + newTd = true; + $row.addClass('selected'); + $oldRadio.css('visibility', 'hidden'); + $newRadio.css('visibility', 'visible'); + } + else { + if (Drupal.settings.diffRevisionRadios == 'linear') { + if (newTd && oldTd) { + $oldRadio.css('visibility', 'visible'); + $newRadio.css('visibility', 'hidden'); + } + else if (newTd) { + $newRadio.css('visibility', 'visible'); + $oldRadio.css('visibility', 'visible'); + } + else { + $newRadio.css('visibility', 'visible'); + $oldRadio.css('visibility', 'hidden'); + } + } + else { + $newRadio.css('visibility', 'visible'); + $oldRadio.css('visibility', 'visible'); + } + } + }); + return true; + } + if (Drupal.settings.diffRevisionRadios) { + $rows.find('input[name="new"], input[name="old"]').click(updateDiffRadios); + updateDiffRadios(); + } } - if (Drupal.settings.diffRevisionRadios) { - $rows.find('input[name="new"], input[name="old"]').click(updateDiffRadios); - updateDiffRadios(); - } - } -}; + }; })(jQuery); diff --git a/sites/all/modules/contrib/content/diff/readme.txt b/sites/all/modules/contrib/content/diff/readme.txt index f82db821..f5164666 100644 --- a/sites/all/modules/contrib/content/diff/readme.txt +++ b/sites/all/modules/contrib/content/diff/readme.txt @@ -58,13 +58,16 @@ e.g. http://www.example.com/admin/structure/types/manage/page i) "Show View changes button on node edit form" adds a new "Preview" like submit button to node editing pages. This shows a diff preview. + + This can be conditionally restricted per role using the user permission + "Access View changes button". ii) "Enable the Revisions page for this content type" adds the revisioning tab to content. This allows users to compare between various revisions that they have access to. iii) "Standard comparison preview" option allows you to control how the most - current revision is show on the revision comparision page. + current revision is shown on the revision comparison page. b) Publishing options diff --git a/sites/all/modules/contrib/dev/ctools/bulk_export/bulk_export.info b/sites/all/modules/contrib/dev/ctools/bulk_export/bulk_export.info index d9e4dfc8..22dc566a 100644 --- a/sites/all/modules/contrib/dev/ctools/bulk_export/bulk_export.info +++ b/sites/all/modules/contrib/dev/ctools/bulk_export/bulk_export.info @@ -6,9 +6,9 @@ package = Chaos tool suite version = CTOOLS_MODULE_VERSION -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-1.11" +; Information added by Drupal.org packaging script on 2016-11-22 +version = "7.x-1.12" core = "7.x" project = "ctools" -datestamp = "1476581654" +datestamp = "1479787162" diff --git a/sites/all/modules/contrib/dev/ctools/css/button.css b/sites/all/modules/contrib/dev/ctools/css/button.css index 15e484be..ead8f8ef 100644 --- a/sites/all/modules/contrib/dev/ctools/css/button.css +++ b/sites/all/modules/contrib/dev/ctools/css/button.css @@ -19,6 +19,7 @@ .ctools-button-processed .ctools-content ul { list-style-image: none; list-style-type: none; + margin-left: 0; } .ctools-button-processed li { diff --git a/sites/all/modules/contrib/dev/ctools/ctools.api.php b/sites/all/modules/contrib/dev/ctools/ctools.api.php index a7ab7839..f328a7ca 100644 --- a/sites/all/modules/contrib/dev/ctools/ctools.api.php +++ b/sites/all/modules/contrib/dev/ctools/ctools.api.php @@ -199,7 +199,10 @@ function hook_ctools_render_alter(&$info, &$page, &$context) { * or categories or to rename content on specific sites. */ function hook_ctools_content_subtype_alter($subtype, $plugin) { - $subtype['render last'] = TRUE; + // Force a particular subtype of a particular plugin to render last. + if ($plugin['module'] == 'some_plugin_module' && $plugin['name'] == 'some_plugin_name' && $subtype['subtype_id'] == 'my_subtype_id') { + $subtype['render last'] = TRUE; + } } /** diff --git a/sites/all/modules/contrib/dev/ctools/ctools.info b/sites/all/modules/contrib/dev/ctools/ctools.info index bdd3794c..3a2d031e 100644 --- a/sites/all/modules/contrib/dev/ctools/ctools.info +++ b/sites/all/modules/contrib/dev/ctools/ctools.info @@ -6,11 +6,19 @@ files[] = includes/context.inc files[] = includes/css-cache.inc files[] = includes/math-expr.inc files[] = includes/stylizer.inc -files[] = tests/css_cache.test -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-1.11" +; Tests. +files[] = tests/context.test +files[] = tests/css.test +files[] = tests/css_cache.test +files[] = tests/ctools.plugins.test +files[] = tests/math_expression.test +files[] = tests/math_expression_stack.test +files[] = tests/object_cache.test + +; Information added by Drupal.org packaging script on 2016-11-22 +version = "7.x-1.12" core = "7.x" project = "ctools" -datestamp = "1476581654" +datestamp = "1479787162" diff --git a/sites/all/modules/contrib/dev/ctools/ctools_access_ruleset/ctools_access_ruleset.info b/sites/all/modules/contrib/dev/ctools/ctools_access_ruleset/ctools_access_ruleset.info index 8d5a77c4..bfa17834 100644 --- a/sites/all/modules/contrib/dev/ctools/ctools_access_ruleset/ctools_access_ruleset.info +++ b/sites/all/modules/contrib/dev/ctools/ctools_access_ruleset/ctools_access_ruleset.info @@ -5,9 +5,9 @@ package = Chaos tool suite version = CTOOLS_MODULE_VERSION dependencies[] = ctools -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-1.11" +; Information added by Drupal.org packaging script on 2016-11-22 +version = "7.x-1.12" core = "7.x" project = "ctools" -datestamp = "1476581654" +datestamp = "1479787162" diff --git a/sites/all/modules/contrib/dev/ctools/ctools_ajax_sample/ctools_ajax_sample.info b/sites/all/modules/contrib/dev/ctools/ctools_ajax_sample/ctools_ajax_sample.info index dcb634d7..52126d51 100644 --- a/sites/all/modules/contrib/dev/ctools/ctools_ajax_sample/ctools_ajax_sample.info +++ b/sites/all/modules/contrib/dev/ctools/ctools_ajax_sample/ctools_ajax_sample.info @@ -5,9 +5,9 @@ version = CTOOLS_MODULE_VERSION dependencies[] = ctools core = 7.x -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-1.11" +; Information added by Drupal.org packaging script on 2016-11-22 +version = "7.x-1.12" core = "7.x" project = "ctools" -datestamp = "1476581654" +datestamp = "1479787162" diff --git a/sites/all/modules/contrib/dev/ctools/ctools_custom_content/ctools_custom_content.info b/sites/all/modules/contrib/dev/ctools/ctools_custom_content/ctools_custom_content.info index 715e4539..ee2d2d1e 100644 --- a/sites/all/modules/contrib/dev/ctools/ctools_custom_content/ctools_custom_content.info +++ b/sites/all/modules/contrib/dev/ctools/ctools_custom_content/ctools_custom_content.info @@ -5,9 +5,9 @@ package = Chaos tool suite version = CTOOLS_MODULE_VERSION dependencies[] = ctools -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-1.11" +; Information added by Drupal.org packaging script on 2016-11-22 +version = "7.x-1.12" core = "7.x" project = "ctools" -datestamp = "1476581654" +datestamp = "1479787162" diff --git a/sites/all/modules/contrib/dev/ctools/ctools_plugin_example/ctools_plugin_example.info b/sites/all/modules/contrib/dev/ctools/ctools_plugin_example/ctools_plugin_example.info index 97b3ebfe..337e699d 100644 --- a/sites/all/modules/contrib/dev/ctools/ctools_plugin_example/ctools_plugin_example.info +++ b/sites/all/modules/contrib/dev/ctools/ctools_plugin_example/ctools_plugin_example.info @@ -8,9 +8,9 @@ dependencies[] = page_manager dependencies[] = advanced_help core = 7.x -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-1.11" +; Information added by Drupal.org packaging script on 2016-11-22 +version = "7.x-1.12" core = "7.x" project = "ctools" -datestamp = "1476581654" +datestamp = "1479787162" diff --git a/sites/all/modules/contrib/dev/ctools/drush/ctools.drush.inc b/sites/all/modules/contrib/dev/ctools/drush/ctools.drush.inc index 1862dbe9..0342c734 100644 --- a/sites/all/modules/contrib/dev/ctools/drush/ctools.drush.inc +++ b/sites/all/modules/contrib/dev/ctools/drush/ctools.drush.inc @@ -64,7 +64,7 @@ function ctools_drush_command() { 'machine names' => 'Space separated list of exportables you want to view.', ), 'options' => array( - 'indent' => 'The string to use for indentation when dispalying the exportable export code. Defaults to \'\'.', + 'indent' => 'The string to use for indentation when displaying the exportable export code. Defaults to \'\'.', 'no-colour' => 'Remove any colour formatting from export string output. Ideal if you are sending the output of this command to a file.', 'module' => $module_text, 'all' => $all_text, diff --git a/sites/all/modules/contrib/dev/ctools/includes/content.inc b/sites/all/modules/contrib/dev/ctools/includes/content.inc index ae1c6073..6490d8d5 100644 --- a/sites/all/modules/contrib/dev/ctools/includes/content.inc +++ b/sites/all/modules/contrib/dev/ctools/includes/content.inc @@ -155,6 +155,11 @@ function ctools_content_get_subtypes($type) { // Walk through the subtypes and ensure minimal settings are // retained. foreach ($subtypes as $id => $subtype) { + // Ensure that the 'subtype_id' value exists. + if (!isset($subtype['subtype_id'])) { + $subtype['subtype_id'] = $id; + } + // Use exact name since this is a modify by reference. ctools_content_prepare_subtype($subtypes[$id], $plugin); } @@ -217,6 +222,7 @@ function ctools_content_prepare_subtype(&$subtype, $plugin) { } } + // Trigger hook_ctools_content_subtype_alter(). drupal_alter('ctools_content_subtype', $subtype, $plugin); } @@ -241,8 +247,8 @@ function ctools_content_prepare_subtype(&$subtype, $plugin) { * Any incoming content, if this display is a wrapper. * * @return - * The content as rendered by the plugin. This content should be an array - * with the following possible keys: + * The content as rendered by the plugin, or NULL. + * This content should be an object with the following possible properties: * - title: The safe to render title of the content. * - title_heading: The title heading. * - content: The safe to render HTML content. diff --git a/sites/all/modules/contrib/dev/ctools/includes/context-access-admin.inc b/sites/all/modules/contrib/dev/ctools/includes/context-access-admin.inc index 76643cf6..ea2a7c81 100644 --- a/sites/all/modules/contrib/dev/ctools/includes/context-access-admin.inc +++ b/sites/all/modules/contrib/dev/ctools/includes/context-access-admin.inc @@ -367,7 +367,6 @@ function ctools_access_ajax_edit($fragment = NULL, $id = NULL) { 'contexts' => $contexts, 'title' => t('Edit criteria'), 'ajax' => TRUE, - 'ajax' => TRUE, 'modal' => TRUE, 'modal return' => TRUE, ); diff --git a/sites/all/modules/contrib/dev/ctools/includes/context.inc b/sites/all/modules/contrib/dev/ctools/includes/context.inc index 8b6d6032..a532f657 100644 --- a/sites/all/modules/contrib/dev/ctools/includes/context.inc +++ b/sites/all/modules/contrib/dev/ctools/includes/context.inc @@ -676,14 +676,19 @@ function ctools_context_keyword_substitute($string, $keywords, $contexts, $conve } } - if (empty($context_keywords[$context]) || !empty($context_keywords[$context]->empty)) { - $keywords['%' . $keyword] = ''; - } - else if (!empty($converter)) { - $keywords['%' . $keyword] = ctools_context_convert_context($context_keywords[$context], $converter, $converter_options); + if (!isset($context_keywords[$context])) { + $keywords['%' . $keyword] = '%' . $keyword; } else { - $keywords['%' . $keyword] = $context_keywords[$keyword]->title; + if (empty($context_keywords[$context]) || !empty($context_keywords[$context]->empty)) { + $keywords['%' . $keyword] = ''; + } + else if (!empty($converter)) { + $keywords['%' . $keyword] = ctools_context_convert_context($context_keywords[$context], $converter, $converter_options); + } + else { + $keywords['%' . $keyword] = $context_keywords[$keyword]->title; + } } } } diff --git a/sites/all/modules/contrib/dev/ctools/includes/plugins.inc b/sites/all/modules/contrib/dev/ctools/includes/plugins.inc index 65f36629..d524f746 100644 --- a/sites/all/modules/contrib/dev/ctools/includes/plugins.inc +++ b/sites/all/modules/contrib/dev/ctools/includes/plugins.inc @@ -200,18 +200,18 @@ function ctools_plugin_api_get_hook($owner, $api) { /** * Fetch a group of plugins by name. * - * @param $module - * The name of the module that utilizes this plugin system. It will be - * used to call hook_ctools_plugin_$plugin() to get more data about the plugin. - * @param $type + * @param string $module + * The name of the module that utilizes this plugin system. It will be used to + * get more data about the plugin as defined on hook_ctools_plugin_type(). + * @param string $type * The type identifier of the plugin. - * @param $id + * @param string $id * If specified, return only information about plugin with this identifier. * The system will do its utmost to load only plugins with this id. * - * @return - * An array of information arrays about the plugins received. The contents - * of the array are specific to the plugin. + * @return array + * An array of information arrays about the plugins received. The contents of + * the array are specific to the plugin. */ function ctools_get_plugins($module, $type, $id = NULL) { // Store local caches of plugins and plugin info so we don't have to do full @@ -224,10 +224,14 @@ function ctools_get_plugins($module, $type, $id = NULL) { $info = ctools_plugin_get_plugin_type_info(); - // Bail out noisily if an invalid module/type combination is requested. if (!isset($info[$module][$type])) { - watchdog('ctools', 'Invalid plugin module/type combination requested: module @module and type @type', array('@module' => $module, '@type' => $type), WATCHDOG_ERROR); - return array(); + // If we don't find the plugin we attempt a cache rebuild before bailing out + $info = ctools_plugin_get_plugin_type_info(TRUE); + // Bail out noisily if an invalid module/type combination is requested. + if (!isset($info[$module][$type])) { + watchdog('ctools', 'Invalid plugin module/type combination requested: module @module and type @type', array('@module' => $module, '@type' => $type), WATCHDOG_ERROR); + return array(); + } } // Make sure our plugins array is populated. @@ -235,8 +239,8 @@ function ctools_get_plugins($module, $type, $id = NULL) { $plugins[$module][$type] = array(); } - // Attempt to shortcut this whole piece of code if we already have - // the requested plugin: + // Attempt to shortcut this whole piece of code if we already have the + // requested plugin: if ($id && array_key_exists($id, $plugins[$module][$type])) { return $plugins[$module][$type][$id]; } @@ -271,8 +275,8 @@ function ctools_get_plugins($module, $type, $id = NULL) { $plugins[$module][$type] = ctools_plugin_load_hooks($info[$module][$type]); } - // Then see if we should load all files. We only do this if we - // want a list of all plugins or there was a cache miss. + // Then see if we should load all files. We only do this if we want a list of + // all plugins or there was a cache miss. if (empty($setup[$module][$type]) && ($build_cache || !$id)) { $setup[$module][$type] = TRUE; $plugins[$module][$type] = array_merge($plugins[$module][$type], ctools_plugin_load_includes($info[$module][$type])); @@ -296,8 +300,8 @@ function ctools_get_plugins($module, $type, $id = NULL) { } - // If we were told earlier that this is cacheable and the cache was - // empty, give something back. + // If we were told earlier that this is cacheable and the cache was empty, + // give something back. if ($build_cache) { cache_set("plugins:$module:$type", $plugins[$module][$type], $info[$module][$type]['cache table']); } diff --git a/sites/all/modules/contrib/dev/ctools/includes/uuid.inc b/sites/all/modules/contrib/dev/ctools/includes/uuid.inc index 6e4c42c3..13897f1f 100644 --- a/sites/all/modules/contrib/dev/ctools/includes/uuid.inc +++ b/sites/all/modules/contrib/dev/ctools/includes/uuid.inc @@ -9,7 +9,9 @@ /** * Pattern for detecting a valid UUID. */ -define('UUID_PATTERN', '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}'); +if (!defined('UUID_PATTERN')) { + define('UUID_PATTERN', '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}'); +} /** * Generates a UUID using the Windows internal GUID generator. diff --git a/sites/all/modules/contrib/dev/ctools/page_manager/help/getting-started.html b/sites/all/modules/contrib/dev/ctools/page_manager/help/getting-started.html index 4e4f24ae..6a75a370 100644 --- a/sites/all/modules/contrib/dev/ctools/page_manager/help/getting-started.html +++ b/sites/all/modules/contrib/dev/ctools/page_manager/help/getting-started.html @@ -4,7 +4,7 @@ Note: this page is currently very preliminary. Please visit path = $form_state['values']['path']; $handlers = !empty($form_state['values']['handlers']) ? $form_state['page']->handlers : FALSE; + // Ensure the handler uuids are re-generated. + if ($handlers) { + foreach ($handlers as &$handler) { + if (isset($handler->conf['display']) && method_exists($handler->conf['display'], 'clone_display')) { + $handler->conf['display'] = $handler->conf['display']->clone_display(); + } + } + } + // Export the handler, which is a fantastic way to clean database IDs out of it. $export = page_manager_page_export($original, $handlers); ob_start(); diff --git a/sites/all/modules/contrib/dev/ctools/plugins/arguments/terms.inc b/sites/all/modules/contrib/dev/ctools/plugins/arguments/terms.inc index 4298ea91..d31f28de 100644 --- a/sites/all/modules/contrib/dev/ctools/plugins/arguments/terms.inc +++ b/sites/all/modules/contrib/dev/ctools/plugins/arguments/terms.inc @@ -65,6 +65,7 @@ function ctools_terms_breadcrumb($conf, $context) { return; } + $current = new stdClass(); $current->tid = $context->tids[0]; $breadcrumb = array(); while ($parents = taxonomy_get_parents($current->tid)) { diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/block/block.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/block/block.inc index 4d4c31c3..46b02e9e 100644 --- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/block/block.inc +++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/block/block.inc @@ -372,9 +372,9 @@ function profile_ctools_block_info($module, $delta, &$info) { } function book_ctools_block_info($module, $delta, &$info) { - // Hide the book navigation block which isn't as rich as what we can - // do with context. - $info = NULL; + $info['title'] = t('Book navigation menu'); + $info['icon'] = 'icon_core_block_menu.png'; + $info['category'] = t('Node'); } function blog_ctools_block_info($module, $delta, &$info) { diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_menu.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_menu.inc new file mode 100644 index 00000000..84497c85 --- /dev/null +++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_menu.inc @@ -0,0 +1,101 @@ + TRUE, + 'title' => t('Book navigation menu'), + 'icon' => '../block/icon_core_block_menu.png', + 'description' => t('The book menu belonging to the current book node.'), + 'required context' => new ctools_context_required(t('Node'), 'node'), + 'category' => t('Node'), + ); +} + +function ctools_node_book_menu_content_type_render($subtype, $conf, $panel_args, $context) { + $node = isset($context->data) ? clone($context->data) : NULL; + $block = new stdClass(); + $block->module = 'book_menu'; + + if ($conf['override_title']) { + $block->title = t($conf['override_title_text']); + } + else { + $block->title = t('Book navigation menu'); + } + if ($node) { + $block->delta = $node->nid; + // TODO: the value is not available somehow?!? + $book_block_mode = isset($conf['book_block_mode']) ? $conf['book_block_mode'] : 'book pages'; + + // Code below is taken from function book_block_view(). + $current_bid = empty($node->book['bid']) ? 0 : $node->book['bid']; + + if ($book_block_mode === 'all pages') { + $block->subject = t('Book navigation'); + $book_menus = array(); + $pseudo_tree = array(0 => array('below' => FALSE)); + foreach (book_get_books() as $book_id => $book) { + if ($book['bid'] === $current_bid) { + // If the current page is a node associated with a book, the menu + // needs to be retrieved. + $book_menus[$book_id] = menu_tree_output(menu_tree_all_data($node->book['menu_name'], $node->book)); + } + else { + // Since we know we will only display a link to the top node, there + // is no reason to run an additional menu tree query for each book. + $book['in_active_trail'] = FALSE; + // Check whether user can access the book link. + $book_node = node_load($book['nid']); + $book['access'] = node_access('view', $book_node); + $pseudo_tree[0]['link'] = $book; + $book_menus[$book_id] = menu_tree_output($pseudo_tree); + } + } + $book_menus['#theme'] = 'book_all_books_block'; + $block->content = $book_menus; + } + elseif ($current_bid) { + // Only display this block when the user is browsing a book. + $select = db_select('node', 'n') + ->fields('n', array('title')) + ->condition('n.nid', $node->book['bid']) + ->addTag('node_access'); + $title = $select->execute()->fetchField(); + // Only show the block if the user has view access for the top-level node. + if ($title) { + $tree = menu_tree_all_data($node->book['menu_name'], $node->book); + // There should only be one element at the top level. + $data = array_shift($tree); + // TODO: subject is not rendered + $block->subject = theme('book_title_link', array('link' => $data['link'])); + $block->content = ($data['below']) ? menu_tree_output($data['below']) : ''; + } + } + } + else { + $block->content = t('Book navigation pager goes here.'); + $block->delta = 'unknown'; + } + + return $block; +} + +function ctools_node_book_menu_content_type_admin_title($subtype, $conf, $context) { + return t('"@s" book navigation pager', array('@s' => $context->identifier)); +} + +function ctools_node_book_menu_content_type_edit_form($form, &$form_state) { + // Grab block form from the book module. + $block_form = book_block_configure($delta = ''); + // TODO: this does not work yet. + // See TODO in: ctools_node_book_menu_content_type_render + if (isset($form_state['input']['book_block_mode'])) { + $block_form['book_block_mode']['#default_value'] = $form_state['input']['book_block_mode']; + } + $form += $block_form; + return $form; +} diff --git a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_nav.inc b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_nav.inc index 403db8d1..f0529b43 100644 --- a/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_nav.inc +++ b/sites/all/modules/contrib/dev/ctools/plugins/content_types/node_context/node_book_nav.inc @@ -7,9 +7,9 @@ if (module_exists('book')) { */ $plugin = array( 'single' => TRUE, - 'title' => t('Book navigation'), - 'icon' => 'icon_node.png', - 'description' => t('The navigation menu the book the node belongs to.'), + 'title' => t('Book navigation pager'), + 'icon' => '../block/icon_core_booknavigation.png', + 'description' => t('The navigational pager and sub pages of the current book node.'), 'required context' => new ctools_context_required(t('Node'), 'node'), 'category' => t('Node'), ); @@ -20,13 +20,13 @@ function ctools_node_book_nav_content_type_render($subtype, $conf, $panel_args, $block = new stdClass(); $block->module = 'book_nav'; - $block->title = t('Book navigation'); + $block->title = t('Book navigation pager'); if ($node) { $block->content = isset($node->book) ? theme('book_navigation', array('book_link' => $node->book)) : ''; $block->delta = $node->nid; } else { - $block->content = t('Book navigation goes here.'); + $block->content = t('Book navigation pager goes here.'); $block->delta = 'unknown'; } @@ -34,7 +34,7 @@ function ctools_node_book_nav_content_type_render($subtype, $conf, $panel_args, } function ctools_node_book_nav_content_type_admin_title($subtype, $conf, $context) { - return t('"@s" book navigation', array('@s' => $context->identifier)); + return t('"@s" book navigation pager', array('@s' => $context->identifier)); } function ctools_node_book_nav_content_type_edit_form($form, &$form_state) { diff --git a/sites/all/modules/contrib/dev/ctools/stylizer/stylizer.info b/sites/all/modules/contrib/dev/ctools/stylizer/stylizer.info index 66957648..79dc8929 100644 --- a/sites/all/modules/contrib/dev/ctools/stylizer/stylizer.info +++ b/sites/all/modules/contrib/dev/ctools/stylizer/stylizer.info @@ -6,9 +6,9 @@ version = CTOOLS_MODULE_VERSION dependencies[] = ctools dependencies[] = color -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-1.11" +; Information added by Drupal.org packaging script on 2016-11-22 +version = "7.x-1.12" core = "7.x" project = "ctools" -datestamp = "1476581654" +datestamp = "1479787162" diff --git a/sites/all/modules/contrib/dev/ctools/term_depth/term_depth.info b/sites/all/modules/contrib/dev/ctools/term_depth/term_depth.info index 91701667..885a5d0d 100644 --- a/sites/all/modules/contrib/dev/ctools/term_depth/term_depth.info +++ b/sites/all/modules/contrib/dev/ctools/term_depth/term_depth.info @@ -5,9 +5,9 @@ dependencies[] = ctools package = Chaos tool suite version = CTOOLS_MODULE_VERSION -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-1.11" +; Information added by Drupal.org packaging script on 2016-11-22 +version = "7.x-1.12" core = "7.x" project = "ctools" -datestamp = "1476581654" +datestamp = "1479787162" diff --git a/sites/all/modules/contrib/dev/ctools/tests/context.test b/sites/all/modules/contrib/dev/ctools/tests/context.test index bdf14e3f..2dd4f4d4 100644 --- a/sites/all/modules/contrib/dev/ctools/tests/context.test +++ b/sites/all/modules/contrib/dev/ctools/tests/context.test @@ -5,7 +5,7 @@ class CtoolsContextKeywordsSubstitutionTestCase extends DrupalWebTestCase { return array( 'name' => 'Keywords substitution', 'description' => 'Verify that keywords are properly replaced with data.', - 'group' => 'Chaos Tools Suite', + 'group' => 'ctools', ); } @@ -51,6 +51,30 @@ class CtoolsContextKeywordsSubstitutionTestCase extends DrupalWebTestCase { "%{$node->title}", t('Keyword after escaped and unescaped percent sign has been replaced.'), ), + '%%foo:bar' => array( + "%foo:bar", + t('Non-existant context ignored.'), + ), + 'There was about 20%-30% difference in price.' => array( + 'There was about 20%-30% difference in price.', + t('Non-keyword percent sign left untouched.'), + ), + 'href="my%20file%2dname.pdf"' => array( + 'href="my%20file%2dname.pdf"', + t('HTTP URL escape left untouched.'), + ), + 'href="my%a0file%fdname.pdf"' => array( + 'href="my%a0file%fdname.pdf"', + t('HTTP URL escape (high-chars) left untouched.'), + ), + 'Click here!' => array( + 'Click here!', + t('HTTP URL escape percent sign left untouched in HTML.'), + ), + 'SELECT * FROM {table} WHERE field = "%s"' => array( + 'SELECT * FROM {table} WHERE field = "%s"', + t('SQL percent sign left untouched.'), + ), ); foreach ($checks as $string => $expectations) { list($expected_result, $message) = $expectations; diff --git a/sites/all/modules/contrib/dev/ctools/tests/css.test b/sites/all/modules/contrib/dev/ctools/tests/css.test index 4a5200ca..3ffd42a5 100644 --- a/sites/all/modules/contrib/dev/ctools/tests/css.test +++ b/sites/all/modules/contrib/dev/ctools/tests/css.test @@ -12,7 +12,7 @@ class CtoolsCssTestCase extends DrupalWebTestCase { return array( 'name' => 'CSS Tools tests', 'description' => '...', - 'group' => 'Chaos Tools Suite', + 'group' => 'ctools', ); } diff --git a/sites/all/modules/contrib/dev/ctools/tests/css_cache.test b/sites/all/modules/contrib/dev/ctools/tests/css_cache.test index e289b42c..0b3528da 100644 --- a/sites/all/modules/contrib/dev/ctools/tests/css_cache.test +++ b/sites/all/modules/contrib/dev/ctools/tests/css_cache.test @@ -16,7 +16,7 @@ class CtoolsObjectCache extends DrupalWebTestCase { return array( 'name' => 'Ctools CSS cache', 'description' => 'Tests the custom CSS cache handler.', - 'group' => 'Chaos Tools Suite', + 'group' => 'ctools', ); } diff --git a/sites/all/modules/contrib/dev/ctools/tests/ctools.plugins.test b/sites/all/modules/contrib/dev/ctools/tests/ctools.plugins.test index fe1829cf..7e866b16 100644 --- a/sites/all/modules/contrib/dev/ctools/tests/ctools.plugins.test +++ b/sites/all/modules/contrib/dev/ctools/tests/ctools.plugins.test @@ -12,7 +12,7 @@ class CtoolsPluginsGetInfoTestCase extends DrupalWebTestCase { return array( 'name' => 'Get plugin info', 'description' => 'Verify that plugin type definitions can properly set and overide values.', - 'group' => 'Chaos Tools Suite', + 'group' => 'ctools', ); } diff --git a/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export.test b/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export.test index 1accfd74..6a062de7 100644 --- a/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export.test +++ b/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export.test @@ -14,7 +14,7 @@ class CtoolsExportCrudTestCase extends DrupalWebTestCase { return array( 'name' => 'CTools export CRUD tests', 'description' => 'Test the CRUD functionality for the ctools export system.', - 'group' => 'Chaos Tools Suite', + 'group' => 'ctools', ); } diff --git a/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export_test.info b/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export_test.info index f2d96edc..1f2612ee 100644 --- a/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export_test.info +++ b/sites/all/modules/contrib/dev/ctools/tests/ctools_export_test/ctools_export_test.info @@ -8,9 +8,9 @@ hidden = TRUE files[] = ctools_export.test -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-1.11" +; Information added by Drupal.org packaging script on 2016-11-22 +version = "7.x-1.12" core = "7.x" project = "ctools" -datestamp = "1476581654" +datestamp = "1479787162" diff --git a/sites/all/modules/contrib/dev/ctools/tests/ctools_plugin_test.info b/sites/all/modules/contrib/dev/ctools/tests/ctools_plugin_test.info index bd906122..4a6d2766 100644 --- a/sites/all/modules/contrib/dev/ctools/tests/ctools_plugin_test.info +++ b/sites/all/modules/contrib/dev/ctools/tests/ctools_plugin_test.info @@ -12,9 +12,9 @@ files[] = math_expression.test files[] = math_expression_stack.test hidden = TRUE -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-1.11" +; Information added by Drupal.org packaging script on 2016-11-22 +version = "7.x-1.12" core = "7.x" project = "ctools" -datestamp = "1476581654" +datestamp = "1479787162" diff --git a/sites/all/modules/contrib/dev/ctools/tests/math_expression.test b/sites/all/modules/contrib/dev/ctools/tests/math_expression.test index 730e079a..8810e8c4 100644 --- a/sites/all/modules/contrib/dev/ctools/tests/math_expression.test +++ b/sites/all/modules/contrib/dev/ctools/tests/math_expression.test @@ -13,7 +13,7 @@ class CtoolsMathExpressionTestCase extends DrupalWebTestCase { return array( 'name' => 'CTools math expression tests', 'description' => 'Test the math expression library of ctools.', - 'group' => 'Chaos Tools Suite', + 'group' => 'ctools', ); } diff --git a/sites/all/modules/contrib/dev/ctools/tests/math_expression_stack.test b/sites/all/modules/contrib/dev/ctools/tests/math_expression_stack.test index 8143a55b..bdd46959 100644 --- a/sites/all/modules/contrib/dev/ctools/tests/math_expression_stack.test +++ b/sites/all/modules/contrib/dev/ctools/tests/math_expression_stack.test @@ -13,7 +13,7 @@ class CtoolsMathExpressionStackTestCase extends DrupalWebTestCase { return array( 'name' => 'CTools math expression stack tests', 'description' => 'Test the stack class of the math expression library.', - 'group' => 'Chaos Tools Suite', + 'group' => 'ctools', ); } diff --git a/sites/all/modules/contrib/dev/ctools/tests/object_cache.test b/sites/all/modules/contrib/dev/ctools/tests/object_cache.test index 8791d7e7..2e714d6b 100644 --- a/sites/all/modules/contrib/dev/ctools/tests/object_cache.test +++ b/sites/all/modules/contrib/dev/ctools/tests/object_cache.test @@ -12,7 +12,7 @@ class CtoolsObjectCache extends DrupalWebTestCase { return array( 'name' => 'Ctools object cache storage', 'description' => 'Verify that objects are written, readable and lockable.', - 'group' => 'Chaos Tools Suite', + 'group' => 'ctools', ); } diff --git a/sites/all/modules/contrib/dev/ctools/views_content/views_content.info b/sites/all/modules/contrib/dev/ctools/views_content/views_content.info index 84e2ae55..4f78dbdd 100644 --- a/sites/all/modules/contrib/dev/ctools/views_content/views_content.info +++ b/sites/all/modules/contrib/dev/ctools/views_content/views_content.info @@ -10,9 +10,9 @@ files[] = plugins/views/views_content_plugin_display_ctools_context.inc files[] = plugins/views/views_content_plugin_display_panel_pane.inc files[] = plugins/views/views_content_plugin_style_ctools_context.inc -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-1.11" +; Information added by Drupal.org packaging script on 2016-11-22 +version = "7.x-1.12" core = "7.x" project = "ctools" -datestamp = "1476581654" +datestamp = "1479787162" diff --git a/sites/all/modules/contrib/fields/date/date.field.inc b/sites/all/modules/contrib/fields/date/date.field.inc index fa311224..7aef97be 100644 --- a/sites/all/modules/contrib/fields/date/date.field.inc +++ b/sites/all/modules/contrib/fields/date/date.field.inc @@ -28,6 +28,7 @@ function date_field_formatter_info() { 'settings' => array( 'interval' => 2, 'interval_display' => 'time ago', + 'use_end_date' => false, ), ), 'date_plain' => array( @@ -207,7 +208,7 @@ function date_field_formatter_view($entity_type, $entity, $field, $instance, $la $variables['item'] = $item; $variables['dates'] = date_formatter_process($formatter, $entity_type, $entity, $field, $instance, $langcode, $item, $display); $variables['attributes'] = !empty($rdf_mapping) ? rdf_rdfa_attributes($rdf_mapping, $item['value']) : array(); - $variables['show_remaining_days'] = $display['settings']['show_remaining_days']; + $variables['show_remaining_days'] = isset($display['settings']['show_remaining_days']) ? $display['settings']['show_remaining_days'] : FALSE; $output = theme('date_display_combination', $variables); if (!empty($output)) { $element[$delta] = array('#markup' => $output); @@ -322,7 +323,7 @@ function date_field_widget_info() { } // The date text widget should use an increment of 1. - $info['date_text']['increment'] = 1; + $info['date_text']['settings']['increment'] = 1; return $info; } @@ -462,6 +463,14 @@ function date_field_instance_settings_form($field, $instance) { return _date_field_instance_settings_form($field, $instance); } +/** + * Form validation handler for _date_field_instance_settings_form(). + */ +function date_field_instance_settings_form_validate(&$form, &$form_state) { + module_load_include('inc', 'date', 'date_admin'); + return _date_field_instance_settings_form_validate($form, $form_state); +} + /** * Implements hook_field_widget_settings_form(). */ @@ -470,6 +479,14 @@ function date_field_widget_settings_form($field, $instance) { return _date_field_widget_settings_form($field, $instance); } +/** + * Form validation handler for _date_field_widget_settings_form(). + */ +function date_field_widget_settings_form_validate(&$form, &$form_state) { + module_load_include('inc', 'date', 'date_admin'); + return _date_field_widget_settings_form_validate($form, $form_state); +} + /** * Implements hook_field_settings_form(). */ @@ -478,6 +495,14 @@ function date_field_settings_form($field, $instance, $has_data) { return _date_field_settings_form($field, $instance, $has_data); } +/** + * Form validation handler for _date_field_settings_form(). + */ +function date_field_settings_validate(&$form, &$form_state) { + module_load_include('inc', 'date', 'date_admin'); + return _date_field_settings_validate($form, $form_state); +} + /** * Implements hook_content_migrate_field_alter(). * diff --git a/sites/all/modules/contrib/fields/date/date.info b/sites/all/modules/contrib/fields/date/date.info index c6fdde55..28263b42 100644 --- a/sites/all/modules/contrib/fields/date/date.info +++ b/sites/all/modules/contrib/fields/date/date.info @@ -13,10 +13,11 @@ files[] = tests/date_validation.test files[] = tests/date_timezone.test files[] = tests/date_views_pager.test files[] = tests/date_views_popup.test +files[] = tests/date_form.test -; Information added by Drupal.org packaging script on 2015-09-08 -version = "7.x-2.9" +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" core = "7.x" project = "date" -datestamp = "1441727353" +datestamp = "1491562090" diff --git a/sites/all/modules/contrib/fields/date/date.install b/sites/all/modules/contrib/fields/date/date.install index 9a9b6d35..765b90cf 100644 --- a/sites/all/modules/contrib/fields/date/date.install +++ b/sites/all/modules/contrib/fields/date/date.install @@ -204,3 +204,11 @@ function date_update_7004() { field_cache_clear(); drupal_set_message(t('Date text widgets have been updated to use an increment of 1.')); } + +/** + * Revisited: Date text widgets should always use an increment of 1. + */ +function date_update_7005() { + // @see https://www.drupal.org/node/1355256 + date_update_7004(); +} diff --git a/sites/all/modules/contrib/fields/date/date.migrate.inc b/sites/all/modules/contrib/fields/date/date.migrate.inc index ad2a5681..90c1ec51 100644 --- a/sites/all/modules/contrib/fields/date/date.migrate.inc +++ b/sites/all/modules/contrib/fields/date/date.migrate.inc @@ -1,10 +1,13 @@ ' . t('!start-date to !end-date', array( + $output = '' . t('!start-date to !end-date', array( '!start-date' => $start_date, '!end-date' => $end_date, - )) . ''; + )) . ''; // Add remaining message and return. return $output . $show_remaining_days; @@ -378,6 +378,8 @@ function theme_date_display_interval($variables) { 'end_date' => $dates['value2']['local']['object'], 'interval' => $options['interval'], 'interval_display' => $options['interval_display'], + 'use_end_date' => !empty($options['use_end_date']) ? + $options['use_end_date'] : FALSE, ); if ($return = theme('date_time_ago', $time_ago_vars)) { @@ -398,9 +400,9 @@ function theme_date_combo($variables) { // Group start/end items together in fieldset. $fieldset = array( - '#title' => field_filter_xss(t($element['#title'])) . ' ' . ($element['#delta'] > 0 ? intval($element['#delta'] + 1) : ''), + '#title' => field_filter_xss(t($element['#title'])) . ($element['#delta'] > 0 ? ' ' . intval($element['#delta'] + 1) : ''), '#value' => '', - '#description' => !empty($element['#fieldset_description']) ? $element['#fieldset_description'] : '', + '#description' => !empty($element['#description']) ? $element['#description'] : '', '#attributes' => array('class' => array('date-combo')), '#children' => $element['#children'], ); diff --git a/sites/all/modules/contrib/fields/date/date_admin.inc b/sites/all/modules/contrib/fields/date/date_admin.inc index 13da42ef..b800201e 100644 --- a/sites/all/modules/contrib/fields/date/date_admin.inc +++ b/sites/all/modules/contrib/fields/date/date_admin.inc @@ -14,15 +14,24 @@ function date_default_formatter_settings_form($field, $instance, $view_mode, $fo $formatter = $display['type']; $form = array(); + $date_formats = date_format_type_options(); $form['format_type'] = array( '#title' => t('Choose how users view dates and times:'), '#type' => 'select', - '#options' => date_format_type_options(), + '#options' => $date_formats + array('custom' => t('Custom')), '#default_value' => $settings['format_type'], '#description' => t('To add or edit options, visit Date and time settings.', array('@date-time-page' => url('admin/config/regional/date-time'))), '#weight' => 0, ); + $form['custom_date_format'] = array( + '#type' => 'textfield', + '#title' => t('Custom date format'), + '#description' => t('If "Custom", see the PHP manual for date formats. Otherwise, enter the number of different time units to display, which defaults to 2.', array('@url' => 'http://php.net/manual/function.date.php')), + '#default_value' => isset($settings['custom_date_format']) ? $settings['custom_date_format'] : '', + '#dependency' => array('edit-options-settings-format-type' => array('custom')), + ); + $form['fromto'] = array( '#title' => t('Display:'), '#type' => 'select', @@ -116,6 +125,14 @@ function date_interval_formatter_settings_form($field, $instance, $view_mode, $f '#default_value' => $settings['interval_display'], '#weight' => 0, ); + if (!empty($field['settings']['todate'])) { + $form['use_end_date'] = array( + '#title' => t('Use End date'), + '#description' => 'Use the End date, instead of the start date', + '#type' => 'checkbox', + '#default_value' => $settings['use_end_date'], + ); + } return $form; } @@ -186,7 +203,9 @@ function date_interval_formatter_settings_summary($field, $instance, $view_mode) $display = $instance['display'][$view_mode]; $settings = $display['settings']; $formatter = $display['type']; - $summary[] = t('Display time ago, showing @interval units.', array('@interval' => $settings['interval'])); + $field = ($settings['use_end_date'] == 1) ? 'End' : 'Start'; + $summary[] = t('Display time ago, showing @interval units. Using @field Date', + array('@interval' => $settings['interval'], '@field' => $field)); return $summary; } @@ -273,7 +292,7 @@ function _date_field_instance_settings_form($field, $instance) { /** * Form validation handler for _date_field_instance_settings_form(). */ -function date_field_instance_settings_form_validate(&$form, &$form_state) { +function _date_field_instance_settings_form_validate(&$form, &$form_state) { $settings = $form_state['values']['instance']['settings']; if ($settings['default_value'] == 'strtotime') { @@ -459,7 +478,7 @@ function _date_field_widget_settings_form($field, $instance) { /** * Form validation handler for _date_field_widget_settings_form(). */ -function date_field_widget_settings_form_validate(&$form, &$form_state) { +function _date_field_widget_settings_form_validate(&$form, &$form_state) { // The widget settings are in the wrong place in the form because of #tree on // the top level. $settings = $form_state['values']['instance']['widget']['settings']; @@ -561,7 +580,7 @@ function _date_field_settings_form($field, $instance, $has_data) { $form['cache_enabled'] = array( '#type' => 'checkbox', '#title' => t('Cache dates'), - '#description' => t('Date objects can be created and cached as date fields are loaded rather than when they are displayed to improve performance.'), + '#description' => t('Date objects can be created and cached as date fields are loaded, rather than when they are displayed, to improve performance.'), '#default_value' => !empty($settings['cache_enabled']), '#weight' => 10, ); @@ -594,7 +613,7 @@ function _date_field_settings_form($field, $instance, $has_data) { /** * Form validation handler for _date_field_settings_form(). */ -function date_field_settings_validate(&$form, &$form_state) { +function _date_field_settings_validate(&$form, &$form_state) { $field = &$form_state['values']['field']; if ($field['settings']['tz_handling'] == 'none') { diff --git a/sites/all/modules/contrib/fields/date/date_all_day/date_all_day.info b/sites/all/modules/contrib/fields/date/date_all_day/date_all_day.info index df773e41..fcdc673a 100644 --- a/sites/all/modules/contrib/fields/date/date_all_day/date_all_day.info +++ b/sites/all/modules/contrib/fields/date/date_all_day/date_all_day.info @@ -5,9 +5,9 @@ dependencies[] = date package = Date/Time core = 7.x -; Information added by Drupal.org packaging script on 2015-09-08 -version = "7.x-2.9" +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" core = "7.x" project = "date" -datestamp = "1441727353" +datestamp = "1491562090" diff --git a/sites/all/modules/contrib/fields/date/date_api/date_api.info b/sites/all/modules/contrib/fields/date/date_api/date_api.info index 40fbb056..c537ca04 100644 --- a/sites/all/modules/contrib/fields/date/date_api/date_api.info +++ b/sites/all/modules/contrib/fields/date/date_api/date_api.info @@ -9,9 +9,9 @@ stylesheets[all][] = date.css files[] = date_api.module files[] = date_api_sql.inc -; Information added by Drupal.org packaging script on 2015-09-08 -version = "7.x-2.9" +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" core = "7.x" project = "date" -datestamp = "1441727353" +datestamp = "1491562090" diff --git a/sites/all/modules/contrib/fields/date/date_api/date_api.module b/sites/all/modules/contrib/fields/date/date_api/date_api.module index 2a973ccf..160bc9fb 100644 --- a/sites/all/modules/contrib/fields/date/date_api/date_api.module +++ b/sites/all/modules/contrib/fields/date/date_api/date_api.module @@ -1833,9 +1833,10 @@ function date_format_interval($date, $granularity = 2, $display_ago = TRUE) { /** * A date object for the current time. * - * @param object $timezone - * (optional) Optionally force time to a specific timezone, defaults to user - * timezone, if set, otherwise site timezone. Defaults to NULL. + * @param object|string|null $timezone + * (optional) PHP DateTimeZone object, string or NULL allowed. Optionally + * force time to a specific timezone, defaults to user timezone, if set, + * otherwise site timezone. Defaults to NULL. * * @param bool $reset * (optional) Static cache reset. @@ -1844,11 +1845,16 @@ function date_format_interval($date, $granularity = 2, $display_ago = TRUE) { * The current time as a date object. */ function date_now($timezone = NULL, $reset = FALSE) { - if ($reset) { - drupal_static_reset(__FUNCTION__ . $timezone); + $static_var = __FUNCTION__ . $timezone; + if ($timezone instanceof DateTimeZone) { + $static_var = __FUNCTION__ . $timezone->getName(); } - $now = &drupal_static(__FUNCTION__ . $timezone); + if ($reset) { + drupal_static_reset($static_var); + } + + $now = &drupal_static($static_var); if (!isset($now)) { $now = new DateObject('now', $timezone); @@ -1920,7 +1926,12 @@ function date_days_in_month($year, $month) { // Pick a day in the middle of the month to avoid timezone shifts. $datetime = date_pad($year, 4) . '-' . date_pad($month) . '-15 00:00:00'; $date = new DateObject($datetime); - return $date->format('t'); + if ($date->errors) { + return FALSE; + } + else { + return $date->format('t'); + } } /** @@ -2075,6 +2086,9 @@ function date_iso_week_range($week, $year) { date_timezone_set($min_date, date_default_timezone_object()); // Find the first day of the first ISO week in the year. + // If it's already a Monday, date_modify won't add a Monday, + // it will remain the same day. So add a Sunday first, then a Monday. + date_modify($min_date, '+1 Sunday'); date_modify($min_date, '+1 Monday'); // Jump ahead to the desired week for the beginning of the week range. diff --git a/sites/all/modules/contrib/fields/date/date_api/date_api_elements.inc b/sites/all/modules/contrib/fields/date/date_api/date_api_elements.inc index fc91205c..638fcda5 100644 --- a/sites/all/modules/contrib/fields/date/date_api/date_api_elements.inc +++ b/sites/all/modules/contrib/fields/date/date_api/date_api_elements.inc @@ -111,7 +111,7 @@ function date_default_date($element) { $format = DATE_FORMAT_DATETIME; // The text and popup widgets might return less than a full datetime string. - if (strlen($element['#default_value']) < 19) { + if (is_string($element['#default_value']) && strlen($element['#default_value']) < 19) { switch (strlen($element['#default_value'])) { case 16: $format = 'Y-m-d H:i'; @@ -319,7 +319,7 @@ function date_text_element_process($element, &$form_state, $form) { $element['#tree'] = TRUE; $element['#theme_wrappers'] = array('date_text'); - $element['date']['#value'] = $element['#value']['date']; + $element['date']['#value'] = isset($element['#value']['date']) ? $element['#value']['date'] : ''; $element['date']['#type'] = 'textfield'; $element['date']['#weight'] = !empty($element['date']['#weight']) ? $element['date']['#weight'] : $element['#weight']; $element['date']['#attributes'] = array('class' => isset($element['#attributes']['class']) ? $element['#attributes']['class'] += array('date-date') : array('date-date')); diff --git a/sites/all/modules/contrib/fields/date/date_api/theme/theme.inc b/sites/all/modules/contrib/fields/date/date_api/theme/theme.inc index a6aef230..0a57ecd0 100644 --- a/sites/all/modules/contrib/fields/date/date_api/theme/theme.inc +++ b/sites/all/modules/contrib/fields/date/date_api/theme/theme.inc @@ -194,6 +194,7 @@ function theme_date_calendar_day($variables) { function theme_date_time_ago($variables) { $start_date = $variables['start_date']; $end_date = $variables['end_date']; + $use_end_date = isset($variables['use_end_date']) ? $variables['use_end_date'] : false; $interval = !empty($variables['interval']) ? $variables['interval'] : 2; $display = isset($variables['interval_display']) ? $variables['interval_display'] : 'time ago'; @@ -202,12 +203,20 @@ function theme_date_time_ago($variables) { return; } + // We use the end date only when the option is checked. + if ($use_end_date){ + $date = date_format($end_date, DATE_FORMAT_UNIX); + } + else { + $date = date_format($start_date, DATE_FORMAT_UNIX); + } + // Time to compare dates to. + $now = date_format(date_now(), DATE_FORMAT_UNIX); - $start = date_format($start_date, DATE_FORMAT_UNIX); // Will be positive for a datetime in the past (ago), and negative for a datetime in the future (hence). - $time_diff = $now - $start; + $time_diff = $now - $date; // Uses the same options used by Views format_interval. switch ($display) { diff --git a/sites/all/modules/contrib/fields/date/date_context/date_context.info b/sites/all/modules/contrib/fields/date/date_context/date_context.info index c521dd26..97cb8c9d 100644 --- a/sites/all/modules/contrib/fields/date/date_context/date_context.info +++ b/sites/all/modules/contrib/fields/date/date_context/date_context.info @@ -8,9 +8,9 @@ dependencies[] = context files[] = date_context.module files[] = plugins/date_context_date_condition.inc -; Information added by Drupal.org packaging script on 2015-09-08 -version = "7.x-2.9" +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" core = "7.x" project = "date" -datestamp = "1441727353" +datestamp = "1491562090" diff --git a/sites/all/modules/contrib/fields/date/date_elements.inc b/sites/all/modules/contrib/fields/date/date_elements.inc index 83697153..656d4998 100644 --- a/sites/all/modules/contrib/fields/date/date_elements.inc +++ b/sites/all/modules/contrib/fields/date/date_elements.inc @@ -74,7 +74,7 @@ function date_field_widget_form(&$form, &$form_state, $field, $instance, $langco // The repeating values will be re-generated when the repeat widget form is validated. // At this point we can't tell if this form element is going to be hidden by #access, and we're going to // lose all but the first value by doing this, so store the original values in case we need to replace them later. - if (!empty($field['settings']['repeat'])) { + if (!empty($field['settings']['repeat']) && module_exists('date_repeat_field')) { if ($delta == 0) { $form['#after_build'][] = 'date_repeat_after_build'; $form_state['storage']['repeat_fields'][$field_name] = array_merge($form['#parents'], array($field_name)); @@ -337,8 +337,11 @@ function date_combo_element_process($element, &$form_state, $form) { '#date_label_position' => $instance['widget']['settings']['label_position'], ); - $description = !empty($element['#description']) ? t($element['#description']) : ''; - unset($element['#description']); + // Date repeat is a multiple value field. So the description is removed from + // the single element earlier. Let's get it back. + if (isset($element['show_repeat_settings']) && !empty($element['value']['#instance']['description'])) { + $element['#description'] = $element['value']['#instance']['description']; + } // Give this element the right type, using a Date API // or a Date Popup element type. @@ -383,8 +386,7 @@ function date_combo_element_process($element, &$form_state, $form) { $element[$to_field]['#prefix'] = ''; // Users with JS enabled will never see initially blank values for the end // date (see Drupal.date.EndDateHandler()), so hide the message for them. - $description .= ' ' . t("Empty 'End date' values will use the 'Start date' values.") . ''; - $element['#fieldset_description'] = $description; + $element['#description'] .= ' ' . t("Empty 'End date' values will use the 'Start date' values.") . ''; if ($field['settings']['todate'] == 'optional') { $element[$to_field]['#states'] = array( 'visible' => array( @@ -395,9 +397,6 @@ function date_combo_element_process($element, &$form_state, $form) { ); } } - else { - $element[$from_field]['#description'] = $description; - } // Create label for error messages that make sense in multiple values // and when the title field is left blank. @@ -474,6 +473,12 @@ function date_combo_validate($element, &$form_state) { $form_values = drupal_array_get_nested_value($form_state['values'], $element['#field_parents']); $form_input = drupal_array_get_nested_value($form_state['input'], $element['#field_parents']); + // Programmatically calling drupal_submit_form() does not always add the date + // combo to $form_state['input']. + if (empty($form_input[$field_name]) && !empty($form_values[$field_name])) { + form_set_value($element, $element['#date_items'], $form_state); + return; + } // If the whole field is empty and that's OK, stop now. if (empty($form_input[$field_name]) && !$element['#required']) { return; @@ -546,11 +551,7 @@ function date_combo_validate($element, &$form_state) { return; } } - // Don't look for further errors if errors are already flagged - // because otherwise we'll show errors on the nested elements - // more than once. - elseif (!form_get_errors()) { - + else { $timezone = !empty($item[$tz_field]) ? $item[$tz_field] : $element['#date_timezone']; $timezone_db = date_get_timezone_db($field['settings']['tz_handling']); $element[$from_field]['#date_timezone'] = $timezone; @@ -625,7 +626,10 @@ function date_combo_validate($element, &$form_state) { } } } - if (!empty($errors)) { + // Don't show further errors if errors are already flagged + // because otherwise we'll show errors on the nested elements + // more than once. + if (!form_get_errors() && !empty($errors)) { if ($field['cardinality']) { form_error($element, t('There are errors in @field_name value #@delta:', array('@field_name' => $instance['label'], '@delta' => $delta + 1)) . theme('item_list', array('items' => $errors))); } diff --git a/sites/all/modules/contrib/fields/date/date_migrate/date_migrate.info b/sites/all/modules/contrib/fields/date/date_migrate/date_migrate.info index b3a6bba6..41e416a3 100644 --- a/sites/all/modules/contrib/fields/date/date_migrate/date_migrate.info +++ b/sites/all/modules/contrib/fields/date/date_migrate/date_migrate.info @@ -4,9 +4,9 @@ core = 7.x package = Date/Time hidden = TRUE -; Information added by Drupal.org packaging script on 2015-09-08 -version = "7.x-2.9" +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" core = "7.x" project = "date" -datestamp = "1441727353" +datestamp = "1491562090" diff --git a/sites/all/modules/contrib/fields/date/date_migrate/date_migrate_example/date_migrate_example.info b/sites/all/modules/contrib/fields/date/date_migrate/date_migrate_example/date_migrate_example.info index 6d79df40..ba07220d 100644 --- a/sites/all/modules/contrib/fields/date/date_migrate/date_migrate_example/date_migrate_example.info +++ b/sites/all/modules/contrib/fields/date/date_migrate/date_migrate_example/date_migrate_example.info @@ -20,9 +20,9 @@ package = "Features" project = "date_migrate_example" version = "7.x-2.0" -; Information added by Drupal.org packaging script on 2015-09-08 -version = "7.x-2.9" +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" core = "7.x" project = "date" -datestamp = "1441727353" +datestamp = "1491562090" diff --git a/sites/all/modules/contrib/fields/date/date_popup/date_popup.info b/sites/all/modules/contrib/fields/date/date_popup/date_popup.info index 500c7ffb..41945a63 100644 --- a/sites/all/modules/contrib/fields/date/date_popup/date_popup.info +++ b/sites/all/modules/contrib/fields/date/date_popup/date_popup.info @@ -7,9 +7,9 @@ configure = admin/config/date/date_popup stylesheets[all][] = themes/datepicker.1.7.css -; Information added by Drupal.org packaging script on 2015-09-08 -version = "7.x-2.9" +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" core = "7.x" project = "date" -datestamp = "1441727353" +datestamp = "1491562090" diff --git a/sites/all/modules/contrib/fields/date/date_popup/date_popup.js b/sites/all/modules/contrib/fields/date/date_popup/date_popup.js index bbf25e2d..f38dcb59 100644 --- a/sites/all/modules/contrib/fields/date/date_popup/date_popup.js +++ b/sites/all/modules/contrib/fields/date/date_popup/date_popup.js @@ -14,6 +14,14 @@ $(this).click(function(){ $(this).focus(); }); + if (datePopup.settings.syncEndDate) { + $('.start-date-wrapper').each(function(){ + var start_date_wrapper = this; + $(this).find('input:eq(0)').change(function(){ + $(start_date_wrapper).next('.end-date-wrapper').find('input:eq(0)').val($(this).val()); + }); + }); + } break; case 'timeEntry': diff --git a/sites/all/modules/contrib/fields/date/date_popup/date_popup.module b/sites/all/modules/contrib/fields/date/date_popup/date_popup.module index e91cc8a7..a03132e9 100644 --- a/sites/all/modules/contrib/fields/date/date_popup/date_popup.module +++ b/sites/all/modules/contrib/fields/date/date_popup/date_popup.module @@ -394,6 +394,10 @@ function date_popup_process_date_part(&$element) { 'fromTo' => isset($fromto), ); + if (!empty($element['#instance'])) { + $settings['syncEndDate'] = $element['#instance']['settings']['default_value2'] == 'sync'; + } + // Create a unique id for each set of custom settings. $id = date_popup_js_settings_id($element['#id'], 'datepicker', $settings); @@ -474,10 +478,11 @@ function date_popup_process_time_part(&$element) { $grans = array('hour', 'minute', 'second'); $time_granularity = array_intersect($granularity, $grans); $format = date_popup_format_to_popup_time(date_limit_format($element['#date_format'], $time_granularity), 'wvega'); + $default_value = isset($element['#default_value']) ? $element['#default_value'] : ''; // The first value in the dropdown list should be the same as the element // default_value, but it needs to be in JS format (i.e. milliseconds since // the epoch). - $start_time = new DateObject($element['#default_value'], $element['#date_timezone'], DATE_FORMAT_DATETIME); + $start_time = new DateObject($default_value, $element['#date_timezone'], DATE_FORMAT_DATETIME); date_increment_round($start_time, $element['#date_increment']); $start_time = $start_time->format(DATE_FORMAT_UNIX) * 1000; $settings = array( @@ -580,7 +585,7 @@ function date_popup_validate($element, &$form_state) { // If something was input but there is no date, the date is invalid. // If the field is empty and required, set error message and return. $error_field = implode('][', $element['#parents']); - if (empty($date) || !empty($date->errors)) { + if ((empty($element['#value']['date']) && empty($element['#value']['time'])) || !empty($date->errors)) { if (is_object($date) && !empty($date->errors)) { $message = t('The value input for field %field is invalid:', array('%field' => $label)); $message .= '
' . implode('
', $date->errors); @@ -613,7 +618,9 @@ function date_popup_validate($element, &$form_state) { */ function date_popup_input_date($element, $input, $auto_complete = FALSE) { if (empty($input) || !is_array($input) || !array_key_exists('date', $input) || empty($input['date'])) { - return NULL; + //check if there is no time associated in the input variable. This is the exception scenario where the user has entered only time and not date. + if(empty($input['time'])) + return NULL; } date_popup_add(); $granularity = date_format_order($element['#date_format']); @@ -622,9 +629,14 @@ function date_popup_input_date($element, $input, $auto_complete = FALSE) { $format = date_popup_date_format($element); $format .= $has_time ? ' ' . date_popup_time_format($element) : ''; - $datetime = trim($input['date']); + //check if date is empty, if yes, then leave it blank. + $datetime = !empty($input['date']) ? trim($input['date']) : ''; $datetime .= $has_time ? ' ' . trim($input['time']) : ''; $date = new DateObject($datetime, $element['#date_timezone'], $format); + //if the variable is time only then set TimeOnly to TRUE + if(empty($input['date']) && !empty($input['time']) ){ + $date->timeOnly = 'TRUE'; + } if (is_object($date)) { $date->limitGranularity($granularity); if ($date->validGranularity($granularity, $flexible)) { @@ -800,6 +812,14 @@ function theme_date_popup($vars) { return '
' . theme('form_element', $element) . '
'; } +/** + * Implements hook_date_field_instance_settings_form_alter(). + */ +function date_popup_date_field_instance_settings_form_alter(&$form, $context) { + // Add an extra option to sync the end date with the start date. + $form['default_value2']['#options']['sync'] = t('Sync with start date'); +} + /** * Implements hook_menu(). */ diff --git a/sites/all/modules/contrib/fields/date/date_repeat/date_repeat.info b/sites/all/modules/contrib/fields/date/date_repeat/date_repeat.info index b6afcd47..0a63175c 100644 --- a/sites/all/modules/contrib/fields/date/date_repeat/date_repeat.info +++ b/sites/all/modules/contrib/fields/date/date_repeat/date_repeat.info @@ -7,9 +7,9 @@ php = 5.2 files[] = tests/date_repeat.test files[] = tests/date_repeat_form.test -; Information added by Drupal.org packaging script on 2015-09-08 -version = "7.x-2.9" +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" core = "7.x" project = "date" -datestamp = "1441727353" +datestamp = "1491562090" diff --git a/sites/all/modules/contrib/fields/date/date_repeat/tests/date_repeat_form.test b/sites/all/modules/contrib/fields/date/date_repeat/tests/date_repeat_form.test index 0c5460ba..22d65296 100644 --- a/sites/all/modules/contrib/fields/date/date_repeat/tests/date_repeat_form.test +++ b/sites/all/modules/contrib/fields/date/date_repeat/tests/date_repeat_form.test @@ -25,7 +25,7 @@ class DateRepeatFormTestCase extends DrupalWebTestCase { // Create and log in our privileged user. $this->privileged_user = $this->drupalCreateUser(array( - 'administer content types', 'administer nodes', 'bypass node access', 'view date repeats' + 'administer content types', 'administer nodes', 'bypass node access', 'view date repeats', 'administer fields' )); $this->drupalLogin($this->privileged_user); diff --git a/sites/all/modules/contrib/fields/date/date_repeat_field/date_repeat_field.info b/sites/all/modules/contrib/fields/date/date_repeat_field/date_repeat_field.info index 31c99af5..c9aa9d67 100644 --- a/sites/all/modules/contrib/fields/date/date_repeat_field/date_repeat_field.info +++ b/sites/all/modules/contrib/fields/date/date_repeat_field/date_repeat_field.info @@ -7,9 +7,9 @@ stylesheets[all][] = date_repeat_field.css package = Date/Time core = 7.x -; Information added by Drupal.org packaging script on 2015-09-08 -version = "7.x-2.9" +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" core = "7.x" project = "date" -datestamp = "1441727353" +datestamp = "1491562090" diff --git a/sites/all/modules/contrib/fields/date/date_tools/date_tools.info b/sites/all/modules/contrib/fields/date/date_tools/date_tools.info index 3ec02859..04bfb03f 100644 --- a/sites/all/modules/contrib/fields/date/date_tools/date_tools.info +++ b/sites/all/modules/contrib/fields/date/date_tools/date_tools.info @@ -6,9 +6,9 @@ core = 7.x configure = admin/config/date/tools files[] = tests/date_tools.test -; Information added by Drupal.org packaging script on 2015-09-08 -version = "7.x-2.9" +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" core = "7.x" project = "date" -datestamp = "1441727353" +datestamp = "1491562090" diff --git a/sites/all/modules/contrib/fields/date/date_tools/tests/date_tools.test b/sites/all/modules/contrib/fields/date/date_tools/tests/date_tools.test index 47c05642..07af4a3d 100644 --- a/sites/all/modules/contrib/fields/date/date_tools/tests/date_tools.test +++ b/sites/all/modules/contrib/fields/date/date_tools/tests/date_tools.test @@ -28,7 +28,7 @@ class DateToolsTestCase extends DrupalWebTestCase { // Create and log in our privileged user. $this->privileged_user = $this->drupalCreateUser( - array('administer content types', 'administer nodes', 'bypass node access', 'administer date tools') + array('administer content types', 'administer nodes', 'bypass node access', 'administer date tools', 'administer fields') ); $this->drupalLogin($this->privileged_user); diff --git a/sites/all/modules/contrib/fields/date/date_views/date_views.info b/sites/all/modules/contrib/fields/date/date_views/date_views.info index 663efd35..68b32cc2 100644 --- a/sites/all/modules/contrib/fields/date/date_views/date_views.info +++ b/sites/all/modules/contrib/fields/date/date_views/date_views.info @@ -12,9 +12,9 @@ files[] = includes/date_views_filter_handler_simple.inc files[] = includes/date_views.views.inc files[] = includes/date_views_plugin_pager.inc -; Information added by Drupal.org packaging script on 2015-09-08 -version = "7.x-2.9" +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" core = "7.x" project = "date" -datestamp = "1441727353" +datestamp = "1491562090" diff --git a/sites/all/modules/contrib/fields/date/date_views/includes/date_views_filter_handler.inc b/sites/all/modules/contrib/fields/date/date_views/includes/date_views_filter_handler.inc index f761dfa0..ae6944ee 100644 --- a/sites/all/modules/contrib/fields/date/date_views/includes/date_views_filter_handler.inc +++ b/sites/all/modules/contrib/fields/date/date_views/includes/date_views_filter_handler.inc @@ -42,6 +42,32 @@ class date_views_filter_handler extends date_views_filter_handler_simple { $this->date_combine_conditions('op_contains'); } + function op_empty($field) { + $this->get_query_fields(); + if (empty($this->query_fields)) { + return; + } + + // Add each condition to the custom filter group. + foreach ((array) $this->query_fields as $query_field) { + $field = $query_field['field']; + $this->date_handler = $query_field['date_handler']; + + // Respect relationships when determining the table alias. + if ($field['table_name'] != $this->table || !empty($this->relationship)) { + $this->related_table_alias = $this->query->ensure_table($field['table_name'], $this->relationship); + } + else { + $this->related_table_alias = NULL; + } + + $table_alias = !empty($this->related_table_alias) ? $this->related_table_alias : $field['table_name']; + $field_name = $table_alias . '.' . $field['field_name']; + + parent::op_empty($field_name); + } + } + /** * Combines multiple date WHERE expressions into a single WHERE expression. * @@ -67,7 +93,7 @@ class date_views_filter_handler extends date_views_filter_handler_simple { $this->related_table_alias = $this->query->ensure_table($field['table_name'], $this->relationship); } else { - $this->related_table_alias = null; + $this->related_table_alias = NULL; } $table_alias = !empty($this->related_table_alias) ? $this->related_table_alias : $field['table_name']; $field_name = $table_alias . '.' . $field['field_name']; diff --git a/sites/all/modules/contrib/fields/date/date_views/includes/date_views_plugin_pager.inc b/sites/all/modules/contrib/fields/date/date_views/includes/date_views_plugin_pager.inc index 5caca4e5..1addd200 100644 --- a/sites/all/modules/contrib/fields/date/date_views/includes/date_views_plugin_pager.inc +++ b/sites/all/modules/contrib/fields/date/date_views/includes/date_views_plugin_pager.inc @@ -281,7 +281,7 @@ class date_views_plugin_pager extends views_plugin_pager { else { $this->view->date_info->prev_date = clone($argument->min_date); date_modify($this->view->date_info->prev_date, '-1 ' . $argument->date_handler->granularity); - $this->view->date_info->next_date = clone($argument->max_date); + $this->view->date_info->next_date = clone($argument->min_date); date_modify($this->view->date_info->next_date, '+1 ' . $argument->date_handler->granularity); } // Write the date_info properties that depend on the current value. diff --git a/sites/all/modules/contrib/fields/date/date_views/theme/theme.inc b/sites/all/modules/contrib/fields/date/date_views/theme/theme.inc index 9e7debc7..7ca03f3a 100644 --- a/sites/all/modules/contrib/fields/date/date_views/theme/theme.inc +++ b/sites/all/modules/contrib/fields/date/date_views/theme/theme.inc @@ -77,7 +77,7 @@ function template_preprocess_date_views_pager(&$vars) { switch ($granularity) { case 'week': $prev_week = date_week(date_format($prev_date, 'Y-m-d')); - $prev_arg = date_format($prev_date, 'Y-\W') . date_pad($prev_week); + $prev_arg = date_format($prev_date, 'o-\W') . date_pad($prev_week); break; default: $prev_arg = date_format($prev_date, $format[$granularity]); @@ -90,7 +90,7 @@ function template_preprocess_date_views_pager(&$vars) { switch ($granularity) { case 'week': $next_week = date_week(date_format($next_date, 'Y-m-d')); - $next_arg = date_format($next_date, 'Y-\W') . date_pad($next_week); + $next_arg = date_format($next_date, 'o-\W') . date_pad($next_week); break; default: $next_arg = date_format($next_date, $format[$granularity]); diff --git a/sites/all/modules/contrib/fields/date/tests/date_api.test b/sites/all/modules/contrib/fields/date/tests/date_api.test index 0924ebaa..03c9081b 100644 --- a/sites/all/modules/contrib/fields/date/tests/date_api.test +++ b/sites/all/modules/contrib/fields/date/tests/date_api.test @@ -393,7 +393,7 @@ class DateAPITestCase extends DrupalWebTestCase { $input = '23 abc 2012'; $timezone = NULL; $format = 'd M Y'; - $date = new dateObject($input, $timezone, $format); + $date = @new dateObject($input, $timezone, $format); $this->assertNotEqual(count($date->errors), 0, '23 abc 2012 should be an invalid date'); // Test Granularity. diff --git a/sites/all/modules/contrib/fields/date/tests/date_field.test b/sites/all/modules/contrib/fields/date/tests/date_field.test index 2dd3f051..b8aad594 100644 --- a/sites/all/modules/contrib/fields/date/tests/date_field.test +++ b/sites/all/modules/contrib/fields/date/tests/date_field.test @@ -16,7 +16,7 @@ abstract class DateFieldBasic extends DrupalWebTestCase { // Create and log in our privileged user. $this->privileged_user = $this->drupalCreateUser( - array('administer content types', 'administer nodes', 'bypass node access', 'administer date tools') + array('administer content types', 'administer nodes', 'bypass node access', 'administer date tools', 'administer fields') ); $this->drupalLogin($this->privileged_user); diff --git a/sites/all/modules/contrib/fields/date/tests/date_form.test b/sites/all/modules/contrib/fields/date/tests/date_form.test new file mode 100644 index 00000000..56b89e43 --- /dev/null +++ b/sites/all/modules/contrib/fields/date/tests/date_form.test @@ -0,0 +1,30 @@ + t('Date Form test'), + 'description' => t('Test Date form functions.') , + 'group' => t('Date'), + ); + } + + public function setUp() { + // Load the date_api module. + parent::setUp('date_test'); + } + + /** + * Tests rendering of a date element in a form. + */ + public function testDateForm() { + $this->drupalGet('date-test/form'); + } + +} diff --git a/sites/all/modules/contrib/fields/date/tests/date_migrate.test b/sites/all/modules/contrib/fields/date/tests/date_migrate.test index cdde115f..ec2ae7d8 100644 --- a/sites/all/modules/contrib/fields/date/tests/date_migrate.test +++ b/sites/all/modules/contrib/fields/date/tests/date_migrate.test @@ -18,6 +18,7 @@ class DateMigrateExampleUnitTest extends DrupalWebTestCase { 'name' => 'Date Migration', 'description' => 'Test migration into date fields', 'group' => 'Date', + 'dependencies' => array('migrate', 'features'), ); } diff --git a/sites/all/modules/contrib/fields/date/tests/date_test/date_test.info b/sites/all/modules/contrib/fields/date/tests/date_test/date_test.info new file mode 100644 index 00000000..2f265fa7 --- /dev/null +++ b/sites/all/modules/contrib/fields/date/tests/date_test/date_test.info @@ -0,0 +1,14 @@ +name = "Date module tests" +description = "Support module for date related testing." +package = Date/Time +version = VERSION +core = 7.x +hidden = TRUE +dependencies[] = date + +; Information added by Drupal.org packaging script on 2017-04-07 +version = "7.x-2.10" +core = "7.x" +project = "date" +datestamp = "1491562090" + diff --git a/sites/all/modules/contrib/fields/date/tests/date_test/date_test.module b/sites/all/modules/contrib/fields/date/tests/date_test/date_test.module new file mode 100644 index 00000000..18540891 --- /dev/null +++ b/sites/all/modules/contrib/fields/date/tests/date_test/date_test.module @@ -0,0 +1,40 @@ + 'Test form with date element', + 'description' => "Form with date element to make form related tests", + 'page callback' => 'drupal_get_form', + 'page arguments' => array('date_test_sample_form'), + 'access arguments' => array('access content'), + 'type' => MENU_CALLBACK, + ); + return $items; +} + +/** + * Form callback. Generates a test form with date elements. + */ +function date_test_sample_form($form, &$form_state) { + $form['date_test_select'] = array( + '#type' => 'date_select', + '#title' => t('Sample from'), + '#date_format' => 'H:i:s a', + '#default_value' => array( + 'hour' => 7, + 'minute' => 0, + 'second' => 0, + 'ampm' => 'am' + ), + ); + + return $form; +} diff --git a/sites/all/modules/contrib/fields/date/tests/date_timezone.test b/sites/all/modules/contrib/fields/date/tests/date_timezone.test index 54d882fd..9f2905a2 100644 --- a/sites/all/modules/contrib/fields/date/tests/date_timezone.test +++ b/sites/all/modules/contrib/fields/date/tests/date_timezone.test @@ -16,6 +16,16 @@ class DateTimezoneTestCase extends DateFieldBasic { ); } + public function setUp() { + parent::setUp(); + // Set the timezone explicitly. Otherwise the site's default timezone is + // used, which defaults to the server timezone when installing Drupal. This + // depends on the environment and is therefore uncertain. + // The Australia/Sydney timezone is chosen so all tests are run using an + // edge case scenario (UTC+10 and DST). + variable_set('date_default_timezone', 'Australia/Sydney'); + } + /** * @todo. */ @@ -23,7 +33,7 @@ class DateTimezoneTestCase extends DateFieldBasic { // Create a date fields with combinations of various timezone handling and // granularity. foreach (array('date', 'datestamp', 'datetime') as $field_type) { - foreach (array('site', 'none', 'date', 'user', 'utc') as $tz_handling) { + foreach (array('site', 'none', 'date', 'user', 'utc', 'Europe/Dublin') as $tz_handling) { foreach (array('year', 'month', 'day', 'hour', 'minute', 'second') as $max_granularity) { // Skip invalid combinations. if (in_array($max_granularity, array('year', 'month', 'day')) && $tz_handling != 'none') { @@ -182,17 +192,32 @@ class DateTimezoneTestCase extends DateFieldBasic { case 'hour': $edit[$field_name . '[und][0][value][date]'] = '10/07/2010 - 10'; $edit[$field_name . '[und][0][value2][date]'] = '10/07/2010 - 11'; - $should_be = 'Thu, 10/07/2010 - 10 to Thu, 10/07/2010 - 11'; + if ($tz_handling == 'utc') { + $should_be = 'Thu, 10/07/2010 - 21 to Thu, 10/07/2010 - 22'; + } + else { + $should_be = 'Thu, 10/07/2010 - 10 to Thu, 10/07/2010 - 11'; + } break; case 'minute': $edit[$field_name . '[und][0][value][date]'] = '10/07/2010 - 10:30'; $edit[$field_name . '[und][0][value2][date]'] = '10/07/2010 - 11:30'; - $should_be = 'Thu, 10/07/2010 - 10:30 to 11:30'; + if ($tz_handling == 'utc') { + $should_be = 'Thu, 10/07/2010 - 21:30 to 22:30'; + } + else { + $should_be = 'Thu, 10/07/2010 - 10:30 to 11:30'; + } break; case 'second': $edit[$field_name . '[und][0][value][date]'] = '10/07/2010 - 10:30:30'; $edit[$field_name . '[und][0][value2][date]'] = '10/07/2010 - 11:30:30'; - $should_be = 'Thu, 10/07/2010 - 10:30:30 to 11:30:30'; + if ($tz_handling == 'utc') { + $should_be = 'Thu, 10/07/2010 - 21:30:30 to 22:30:30'; + } + else { + $should_be = 'Thu, 10/07/2010 - 10:30:30 to 11:30:30'; + } break; } $this->drupalPost('node/add/story', $edit, t('Save')); diff --git a/sites/all/modules/contrib/panels/panels/KNOWN_ISSUES.txt b/sites/all/modules/contrib/panels/panels/KNOWN_ISSUES.txt index 66963675..27f0e7a9 100644 --- a/sites/all/modules/contrib/panels/panels/KNOWN_ISSUES.txt +++ b/sites/all/modules/contrib/panels/panels/KNOWN_ISSUES.txt @@ -88,4 +88,4 @@ Known Issue http://drupal.org/node/207859 secure pages doesn't know about. When trying to make non-secure ajax calls from a secure page, the browser denies the call. Solution: - The solution is to simply add panels/* to your Secure Pages configuration. \ No newline at end of file + The solution is to simply add panels/* to your Secure Pages configuration. diff --git a/sites/all/modules/contrib/panels/panels/README.txt b/sites/all/modules/contrib/panels/panels/README.txt index 3c86762e..c6d7eeea 100644 --- a/sites/all/modules/contrib/panels/panels/README.txt +++ b/sites/all/modules/contrib/panels/panels/README.txt @@ -1,3 +1,3 @@ Welcome to Panels 3 -Documentation is available at https://www.drupal.org/node/496278 \ No newline at end of file +Documentation is available at https://www.drupal.org/node/496278 diff --git a/sites/all/modules/contrib/panels/panels/css/panels-dashboard.css b/sites/all/modules/contrib/panels/panels/css/panels-dashboard.css index a7efeae1..ca2fe9c9 100644 --- a/sites/all/modules/contrib/panels/panels/css/panels-dashboard.css +++ b/sites/all/modules/contrib/panels/panels/css/panels-dashboard.css @@ -1,4 +1,3 @@ - .dashboard-entry .dashboard-link { font-size: 120%; font-weight: bold; diff --git a/sites/all/modules/contrib/panels/panels/css/panels.css b/sites/all/modules/contrib/panels/panels/css/panels.css index 13c473cc..170652df 100644 --- a/sites/all/modules/contrib/panels/panels/css/panels.css +++ b/sites/all/modules/contrib/panels/panels/css/panels.css @@ -1,4 +1,3 @@ - div.panel-pane div.admin-links { font-size: xx-small; margin-right: 1em; diff --git a/sites/all/modules/contrib/panels/panels/css/panels_admin.css b/sites/all/modules/contrib/panels/panels/css/panels_admin.css index 78094e2c..ce61b036 100644 --- a/sites/all/modules/contrib/panels/panels/css/panels_admin.css +++ b/sites/all/modules/contrib/panels/panels/css/panels_admin.css @@ -1,4 +1,3 @@ - .layout-link { float: left; padding: 1em; @@ -141,12 +140,12 @@ table .argument-operation input { } tr.changed td { - background-color: #FFFFDD !important; + background-color: #ffffdd !important; } tr.changed td span.star { font-weight: bold; - color: #E09010; + color: #e09010; } td select { diff --git a/sites/all/modules/contrib/panels/panels/css/panels_dnd.css b/sites/all/modules/contrib/panels/panels/css/panels_dnd.css index 7252ad67..dc42d581 100644 --- a/sites/all/modules/contrib/panels/panels/css/panels_dnd.css +++ b/sites/all/modules/contrib/panels/panels/css/panels_dnd.css @@ -1,4 +1,3 @@ - #panels-dnd-main { margin: 0.5em 0; } @@ -42,7 +41,7 @@ div.panels-set-title-hide .panels-set-title { } /* Add Icon */ -#panels-dnd-main div.panel-region .pane-add-link { +#panels-dnd-main div.panel-region .pane-add-link { } #panels-dnd-main div.panel-region .pane-add-link img { display: none; @@ -127,24 +126,24 @@ div.panels-set-title-hide .panel-pane-is-title { } .panel-portlet .changed div.grab-title { - background-color: #FFFFDD !important; - border-bottom: 1px solid #3D9CD7 !important; + background-color: #ffffdd !important; + border-bottom: 1px solid #3d9cd7 !important; color: black !important; } .panel-portlet .changed.hidden-pane div.grab-title { - background-color: #B4B488 !important; - border-bottom: 1px solid #3D9CD7 !important; + background-color: #b4b488 !important; + border-bottom: 1px solid #3d9cd7 !important; } .panel-portlet .changed div.grab-title span.star { font-weight: bold; - color: #E09010; + color: #e09010; } .panel-portlet .grabber:hover { color: #fff; - background-color: #2F78A5; + background-color: #2f78a5; } .panel-portlet.hidden-pane .grab-title:hover { @@ -175,7 +174,8 @@ div.panels-set-title-hide .panel-pane-is-title { margin: 0; } -.panel-portlet .buttons input, .panel-portlet .buttons button { +.panel-portlet .buttons input, +.panel-portlet .buttons button { margin: 0; padding: 0; display: inline; @@ -186,7 +186,7 @@ div.panels-set-title-hide .panel-pane-is-title { } .panel-portlet .pane-title { - font-size:110%; + font-size: 110%; cursor: pointer; } @@ -315,7 +315,7 @@ a.close img { padding-left: 1em; padding-bottom: 1em; margin-bottom: 1em; - background-color: #EEEEEE; + background-color: #eeeeee; } .panels-section-columns { @@ -354,7 +354,7 @@ a.close img { .panels-section-column-categories .inside { padding: 0; - } +} .panels-section-column-categories .content-type-button { padding-left: 10px; @@ -431,7 +431,7 @@ a.close img { float: none; } -.panels-modal-content .modal-form .no-float label { +.panels-modal-content .modal-form .no-float label { width: auto; } @@ -502,7 +502,6 @@ html.js div.panels-display-links div.ctools-dropdown-container ul li a { /* @group CTools Dropdown */ #panels-dnd-main .ctools-dropdown a.ctools-dropdown-text-link, html.js div.panels-display-links a.ctools-dropdown-text-link { - background: url('../images/arrow-down-light.png') 0 3px no-repeat!important; padding-left: 12px; } @@ -522,7 +521,6 @@ html.js div.panels-display-links div.ctools-dropdown-container { html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li, html.js div.panels-display-links div.ctools-dropdown-container ul li { - text-decoration: none; padding: 0; margin: 0; @@ -565,7 +563,7 @@ html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li html.js div.panels-display-links div.ctools-dropdown-container ul li .panels-sub-menu ul li a, html.js #panels-dnd-main div.ctools-dropdown div.ctools-dropdown-container ul li .panels-sub-menu span.panels-text, html.js div.panels-display-links div.ctools-dropdown-container ul li .panels-sub-menu span.panels-text { - width:auto; + width: auto; padding: 0 20px; } @@ -682,4 +680,3 @@ div.ctools-modal-content { top: -2em; margin-bottom: -2em; } - diff --git a/sites/all/modules/contrib/panels/panels/css/panels_page.css b/sites/all/modules/contrib/panels/panels/css/panels_page.css index 1d731b97..cce85900 100644 --- a/sites/all/modules/contrib/panels/panels/css/panels_page.css +++ b/sites/all/modules/contrib/panels/panels/css/panels_page.css @@ -1,4 +1,3 @@ - div.panels-page-type-container { clear: left; } diff --git a/sites/all/modules/contrib/panels/panels/i18n_panels/i18n_panels.i18n.inc b/sites/all/modules/contrib/panels/panels/i18n_panels/i18n_panels.i18n.inc index 71fdafb7..d1478e30 100644 --- a/sites/all/modules/contrib/panels/panels/i18n_panels/i18n_panels.i18n.inc +++ b/sites/all/modules/contrib/panels/panels/i18n_panels/i18n_panels.i18n.inc @@ -1,7 +1,7 @@ uuid)) { // Fetch exported uuid and validate it. $uuid = str_replace('new-', '', $pane->pid); - if (!panels_uuid_is_valid($uuid)) { + if (!ctools_uuid_is_valid($uuid)) { drupal_set_message(t('The pane %pane has no uuid, please resave or re-export it.', array('%pane' => $pane->pid)), 'warning'); continue; } @@ -366,7 +367,7 @@ function _18n_panels_is_exported_panels_display($display) { * * @todo I bet there are better ways to solve this mess. * - * @param boolean $reset + * @param bool $reset * Reset the static cache. * * @return array diff --git a/sites/all/modules/contrib/panels/panels/images/icon-css.png b/sites/all/modules/contrib/panels/panels/images/icon-css.png new file mode 100644 index 00000000..9a8addf4 Binary files /dev/null and b/sites/all/modules/contrib/panels/panels/images/icon-css.png differ diff --git a/sites/all/modules/contrib/panels/panels/includes/callbacks.inc b/sites/all/modules/contrib/panels/panels/includes/callbacks.inc index 255a3cdd..57ef7cfb 100644 --- a/sites/all/modules/contrib/panels/panels/includes/callbacks.inc +++ b/sites/all/modules/contrib/panels/panels/includes/callbacks.inc @@ -1,6 +1,6 @@ t('Custom layouts can add more, site-specific layouts that you can use in your panels.'), ); - // Load all mini panels and their displays. + // Load all mini panels and their displays. ctools_include('export'); $items = ctools_export_crud_load_all('panels_layout'); $count = 0; @@ -97,7 +97,7 @@ function template_preprocess_panels_dashboard(&$vars) { $function($vars); } - // Add in any default links for modules that are not active + // Add in any default links for modules that are not active. panels_dashboard_final_blocks($vars); // If page manager module is enabled, add a very low eight block to @@ -138,7 +138,7 @@ function template_preprocess_panels_dashboard(&$vars) { 'class' => 'dashboard-create', ); - // Turn the links into a block + // Turn the links into a block. foreach ($vars['links'] as $link) { $vars['blocks']['links']['content'] .= theme('panels_dashboard_link', array('link' => $link)); } @@ -148,7 +148,7 @@ function template_preprocess_panels_dashboard(&$vars) { $vars['left'] = ''; $vars['right'] = ''; - // Render all the blocks + // Render all the blocks. foreach ($vars['blocks'] as $block) { $section = !empty($block['section']) ? $block['section'] : 'left'; $vars[$section] .= theme('panels_dashboard_block', array('block' => $block)); @@ -202,4 +202,3 @@ function panels_admin_panel_context_page() { ctools_include('common', 'panels'); return drupal_get_form('panels_common_settings', 'panels_page'); } - diff --git a/sites/all/modules/contrib/panels/panels/includes/common.inc b/sites/all/modules/contrib/panels/panels/includes/common.inc index 9e150e31..31d1bfec 100644 --- a/sites/all/modules/contrib/panels/panels/includes/common.inc +++ b/sites/all/modules/contrib/panels/panels/includes/common.inc @@ -39,12 +39,11 @@ * * @see panels_edit_layout() * @see _panels_edit_layout() - * */ class panels_allowed_layouts { /** - * Specifies whether newly-added layouts (as in, new .inc files) should be automatically + * Specifies whether newly-added layouts (as in, new .inc files) should be automatically * allowed (TRUE) or disallowed (FALSE) for $this. Defaults to TRUE, which is more * permissive but less of an administrative hassle if/when you add new layouts. Note * that this parameter will be derived from $allowed_layouts if a value is passed in. @@ -52,19 +51,20 @@ class panels_allowed_layouts { var $allow_new = TRUE; /** - * Optional member. If provided, the Panels API will generate a drupal variable using + * Optional member. If provided, the Panels API will generate a drupal variable using * variable_set($module_name . 'allowed_layouts', serialize($this)), thereby handling the * storage of this object entirely within the Panels API. This object will be * called and rebuilt by panels_edit_layout() if the same $module_name string is passed in * for the $allowed_types parameter. \n * This is primarily intended for convenience - client modules doing heavy-duty implementations * of the Panels API will probably want to create their own storage method. + * * @see panels_edit_layout() */ var $module_name = NULL; /** - * An associative array of all available layouts, keyed by layout name (as defined + * An associative array of all available layouts, keyed by layout name (as defined * in the corresponding layout plugin definition), with value = 1 if the layout is * allowed, and value = 0 if the layout is not allowed. * Calling array_filter(panels_allowed_layouts::$allowed_layout_settings) will return an associative array @@ -82,15 +82,14 @@ class panels_allowed_layouts { /** * Constructor function; loads the $allowed_layout_settings array with initial values according - * to $start_allowed + * to $start_allowed. * * @param bool $start_allowed - * $start_allowed determines whether all available layouts will be marked - * as allowed or not allowed on the initial call to panels_allowed_layouts::set_allowed() - * + * $start_allowed determines whether all available layouts will be marked + * as allowed or not allowed on the initial call to panels_allowed_layouts::set_allowed() */ function __construct($start_allowed = TRUE) { - // TODO would be nice if there was a way to just fetch the names easily + // TODO would be nice if there was a way to just fetch the names easily. foreach ($this->list_layouts() as $layout_name) { $this->allowed_layout_settings[$layout_name] = $start_allowed ? 1 : 0; } @@ -121,6 +120,7 @@ class panels_allowed_layouts { * drupal_goto(''); * } * } + * * @endcode \n * * If $allowed_layouts->form_state == 'failed-validate' || 'render', then you'll need to return @@ -135,8 +135,8 @@ class panels_allowed_layouts { * you to control where the user ends up next. * * @param string $title - * Used to set the title of the allowed layouts form. If no value is given, defaults to - * 'Panels: Allowed Layouts'. + * Used to set the title of the allowed layouts form. If no value is given, defaults to + * 'Panels: Allowed Layouts'. * * @return mixed $result * - On the first passthrough when the form is being rendered, $result is the form's structured @@ -147,11 +147,11 @@ class panels_allowed_layouts { function set_allowed($title = 'Panels: Allowed Layouts') { $this->sync_with_available(); $form_id = 'panels_common_set_allowed_layouts'; - // TODO switch to drupal_build_form(); need to pass by ref + // TODO switch to drupal_build_form(); need to pass by ref. $form = drupal_retrieve_form($form_id, $this, $title); if ($result = drupal_process_form($form_id, $form)) { - // successful submit + // Successful submit. $this->form_state = 'submit'; return $result; } @@ -192,11 +192,10 @@ class panels_allowed_layouts { * If you don't serialize the second parameter of variable_get() and the variable name you provide * can't be found, an E_STRICT warning will be generated for trying to unserialize an entity * that has not been serialized. - * */ function save() { if (!is_null($this->module_name)) { - variable_set($this->module_name . '_allowed_layouts', serialize($this)); + variable_set($this->module_name . "_allowed_layouts", serialize($this)); } } @@ -217,6 +216,7 @@ class panels_allowed_layouts { } return $layouts; } + } /** @@ -272,11 +272,7 @@ function panels_common_settings($form, &$form_state, $module_name = 'panels_comm // each type its own checkboxes set unless it's 'single' in which // case it can go into our fake other set. $available_content_types = ctools_content_get_all_types(); - $allowed_content_types = db_select('panels_allowed_types', 'pat') - ->fields('pat', array('type', 'allowed')) - ->condition('module', $module_name) - ->execute() - ->fetchAllKeyed(); + $allowed_content_types = variable_get($module_name . '_allowed_types', array()); foreach ($available_content_types as $id => $types) { foreach ($types as $type => $info) { @@ -296,7 +292,7 @@ function panels_common_settings($form, &$form_state, $module_name = 'panels_comm '#tree' => TRUE, ); - // cheat a bit + // Cheat a bit. $content_types['other'] = array('title' => t('Other'), 'weight' => 10); foreach ($content_types as $id => $info) { if (isset($allowed[$id])) { @@ -342,14 +338,14 @@ function panels_common_settings($form, &$form_state, $module_name = 'panels_comm } /** - * Submit hook for panels_common_settings + * Submit hook for panels_common_settings. */ function panels_common_settings_validate($form, &$form_state) { panels_common_allowed_layouts_form_validate($form, $form_state); } /** - * Submit hook for panels_common_settings + * Submit hook for panels_common_settings. */ function panels_common_settings_submit($form, &$form_state) { panels_common_allowed_layouts_form_submit($form, $form_state); @@ -358,21 +354,21 @@ function panels_common_settings_submit($form, &$form_state) { if (!$form_state['skip']) { // Merge the broken apart array neatly back together. $allowed_content_types = array(); - $content_types = $form_state['values']['allowed']; - foreach ($content_types as $content_type) { - $allowed_content_types = array_merge($allowed_content_types, $form_state['values']['content_types'][$content_type]['options']); - foreach ($allowed_content_types as $type => $allowed) { - $allowed = empty($allowed) ? 0 : 1; - db_merge('panels_allowed_types') - ->key(array('module' => $module_name, 'type' => $type)) - ->fields(array( - 'module' => $module_name, - 'type' => $type, - 'allowed' => $allowed, - )) - ->execute(); + foreach ($form_state['values']['allowed'] as $allowed) { + $values = $form_state['values']['content_types'][$allowed]['options']; + // If new content of the type is not added, storing a lisy of disabled + // content is not needed. + if (!$form_state['values']['panels_common_default'][$allowed]) { + $values = array_filter($values); } + $allowed_content_types = array_merge($allowed_content_types, $values); } + // Values from checkboxes are the same string as they key, but we only need + // to store the boolean value. + foreach ($allowed_content_types as &$value) { + $value = (bool) $value; + } + variable_set($module_name . '_allowed_types', $allowed_content_types); } drupal_set_message(t('Your changes have been saved.')); } @@ -381,14 +377,9 @@ function panels_common_settings_submit($form, &$form_state) { * Based upon the settings, get the allowed types for this node. */ function panels_common_get_allowed_types($module, $contexts = array(), $has_content = FALSE, $default_defaults = array(), $default_allowed_types = array()) { - // Get a list of all types that are available + // Get a list of all types that are available. $default_types = variable_get($module . '_default', $default_defaults); - $allowed_types = db_select('panels_allowed_types', 'pat') - ->fields('pat', array('type', 'allowed')) - ->condition('module', $module) - ->execute() - ->fetchAllKeyed(); - $allowed_types = !empty($allowed_types) ? $allowed_types : $default_allowed_types; + $allowed_types = variable_get($module . '_allowed_types', $default_allowed_types); // By default, if they haven't gone and done the initial setup here, // let all 'other' types (which will be all types) be available. @@ -420,8 +411,8 @@ function panels_common_get_allowed_types($module, $contexts = array(), $has_cont * @ingroup forms * * @param array $allowed_layouts - * The set of allowed layouts that should be used as the default values - * for this form. If none is provided, then by default no layouts will be restricted. + * The set of allowed layouts that should be used as the default values + * for this form. If none is provided, then by default no layouts will be restricted. */ function panels_common_allowed_layouts_form(&$form, &$form_state, $module_name) { // Fetch our allowed layouts from variables. @@ -434,6 +425,7 @@ function panels_common_allowed_layouts_form(&$form, &$form_state, $module_name) $form_state['allowed_layouts'] = &$allowed_layouts; + ctools_add_js('panels-base', 'panels'); ctools_add_js('layout', 'panels'); $form['layout_selection'] = array( @@ -473,19 +465,19 @@ function panels_common_allowed_layouts_form_submit($form, &$form_state) { * Get the allowed layout object for the given module. */ function panels_common_get_allowed_layout_object($module_name) { - $allowed_layouts = unserialize(variable_get($module_name . '_allowed_layouts', serialize(''))); + $allowed_layouts = unserialize(variable_get($module_name . "_allowed_layouts", serialize(''))); - // if no parameter was provided, or the variable_get failed + // If no parameter was provided, or the variable_get failed. if (!$allowed_layouts) { - // still no dice. simply creates a dummy version where all layouts + // Still no dice. simply creates a dummy version where all layouts // are allowed. $allowed_layouts = new panels_allowed_layouts(); $allowed_layouts->allow_new = TRUE; $allowed_layouts->module_name = $module_name; } - // sanitize allowed layout listing; this is redundant if the - // $allowed_layouts param was null, but the data is cached anyway + // Sanitize allowed layout listing; this is redundant if the + // $allowed_layouts param was null, but the data is cached anyway. $allowed_layouts->sync_with_available(); return $allowed_layouts; @@ -500,7 +492,7 @@ function panels_common_get_allowed_layouts($module_name) { if (empty($module_name)) { return $available_layouts; } - else if (is_object($module_name)) { + elseif (is_object($module_name)) { $allowed_layouts = $module_name; } else { @@ -515,7 +507,7 @@ function panels_common_get_allowed_layouts($module_name) { } } - // Sort + // Sort. $layouts = array(); asort($order); @@ -603,7 +595,6 @@ function panels_common_print_layout_links($layouts, $base_path, $link_options = // We're doing these dependencies completely manualy, which is unusual, but // the process code only supports doing them in a form. // @todo modify dependent.inc to make this easier. - $dependencies = array(); foreach ($options as $category => $links) { $dependencies['panels-layout-category-' . $category] = array( diff --git a/sites/all/modules/contrib/panels/panels/includes/display-edit.inc b/sites/all/modules/contrib/panels/panels/includes/display-edit.inc index dbc4786c..d48c789f 100644 --- a/sites/all/modules/contrib/panels/panels/includes/display-edit.inc +++ b/sites/all/modules/contrib/panels/panels/includes/display-edit.inc @@ -1,6 +1,6 @@ panels[$region_id] = array(); if ($panes) { $pids = explode(',', $panes); - // need to filter the array, b/c passing it in a hidden field can generate trash + // Need to filter the array, b/c passing it in a hidden field can generate trash. foreach (array_filter($pids) as $pid) { if ($old_content[$pid]) { $display->panels[$region_id][] = $pid; @@ -221,7 +222,7 @@ function panels_edit_display_settings_form($form, &$form_state) { ctools_include('dependent'); if ($form_state['display_title']) { - $form['display_title'] = array ( + $form['display_title'] = array( '#tree' => TRUE, ); @@ -252,16 +253,15 @@ function panels_edit_display_settings_form($form, &$form_state) { // We have to create a manual fieldset because fieldsets do not support IDs. // Use 'hidden' instead of 'markup' so that the process will run. // Add js for collapsible fieldsets manually -// drupal_add_js('misc/form.js'); -// drupal_add_js('misc/collapse.js'); -// $form['display_title']['contexts_prefix'] = array( -// '#type' => 'hidden', -// '#id' => 'edit-display-substitutions', -// '#prefix' => '
', + // );. } } - // TODO doc the ability to do this as part of the API + // TODO doc the ability to do this as part of the API. if (!empty($layout['settings form']) && function_exists($layout['settings form'])) { $form['layout_settings'] = $layout['settings form']($display, $layout, $display->layout_settings); } diff --git a/sites/all/modules/contrib/panels/panels/includes/display-layout.inc b/sites/all/modules/contrib/panels/panels/includes/display-layout.inc index a21e6630..aac3fe66 100644 --- a/sites/all/modules/contrib/panels/panels/includes/display-layout.inc +++ b/sites/all/modules/contrib/panels/panels/includes/display-layout.inc @@ -2,7 +2,6 @@ /** * @file - * * Handle the forms for changing a display's layout. */ @@ -33,7 +32,7 @@ function _panels_edit_layout($display, $finish, $destination, $allowed_layouts) if (empty($_POST) || empty($_POST['form_id']) || $_POST['form_id'] != 'panels_change_layout') { $output = drupal_build_form('panels_choose_layout', $form_state); if (!empty($form_state['executed'])) { - // upon submission go to next form. + // Upon submission go to next form. $change_form_state['layout'] = $_SESSION['layout'][$display->did] = $form_state['layout']; $change_form = TRUE; } @@ -147,7 +146,6 @@ function panels_choose_layout($form, &$form_state) { $js['CTools']['dependent'] = $dependencies; drupal_add_js($js, 'setting'); - if (empty($form_state['no buttons'])) { $form['submit'] = array( '#type' => 'submit', @@ -293,7 +291,7 @@ function panels_change_layout_submit($form, &$form_state) { foreach ($form_state['values']['panel']['pane'] as $region_id => $panes) { if ($panes) { $pids = explode(',', $panes); - // need to filter the array, b/c passing it in a hidden field can generate trash + // Need to filter the array, b/c passing it in a hidden field can generate trash. foreach (array_filter($pids) as $pid) { $switch[$pid] = $region_id; } diff --git a/sites/all/modules/contrib/panels/panels/includes/legacy.inc b/sites/all/modules/contrib/panels/panels/includes/legacy.inc index c65f781d..224d05fb 100644 --- a/sites/all/modules/contrib/panels/panels/includes/legacy.inc +++ b/sites/all/modules/contrib/panels/panels/includes/legacy.inc @@ -1,22 +1,32 @@ legacy)) { $this->determineStatus(); @@ -29,7 +39,7 @@ class PanelsLegacyState { */ function determineStatus() { $this->legacy = array(); - foreach(get_class_methods($this) as $method) { + foreach (get_class_methods($this) as $method) { if (strtolower(substr($method, 0, 5)) == 'check') { $this->legacy[$method] = $this->$method(); } @@ -37,5 +47,4 @@ class PanelsLegacyState { $this->legacy = array_filter($this->legacy); } - // At this time there are no legacy checks. } diff --git a/sites/all/modules/contrib/panels/panels/includes/page-wizard.inc b/sites/all/modules/contrib/panels/panels/includes/page-wizard.inc index 732c13aa..516f78f5 100644 --- a/sites/all/modules/contrib/panels/panels/includes/page-wizard.inc +++ b/sites/all/modules/contrib/panels/panels/includes/page-wizard.inc @@ -35,7 +35,7 @@ function panels_page_wizard_add_layout(&$form, &$form_state) { '#value' => '', ); -// $form_state['cache'] = FALSE; + // $form_state['cache'] = FALSE;. } /** @@ -52,7 +52,6 @@ function panels_page_wizard_add_content(&$form, &$form_state) { // Panels provides this caching mechanism to make it easy to use the // wizard to cache the display. - $cache = panels_edit_cache_get('panels_page_wizard:' . $form_state['plugin']['name']); $form_state['renderer'] = panels_get_renderer_handler('editor', $cache->display); @@ -68,14 +67,14 @@ function panels_page_wizard_add_content(&$form, &$form_state) { } /** - * Add content form submit handler + * Add content form submit handler. * * This is not a proper submit handler, it is meant to be called by a form's * submit handler to handle submission. */ function panels_page_wizard_add_content_submit(&$form, &$form_state) { // Call the normal panels edit form submit to make sure values are stored - // on the display + // on the display. panels_edit_display_form_submit($form, $form_state); $cache = &$form_state['wizard cache']; @@ -83,4 +82,3 @@ function panels_page_wizard_add_content_submit(&$form, &$form_state) { $cache->display = &$form_state['display']; unset($cache->display_cache); } - diff --git a/sites/all/modules/contrib/panels/panels/includes/panels.pipelines.inc b/sites/all/modules/contrib/panels/panels/includes/panels.pipelines.inc index 3d95ac0c..5a3f1cb3 100644 --- a/sites/all/modules/contrib/panels/panels/includes/panels.pipelines.inc +++ b/sites/all/modules/contrib/panels/panels/includes/panels.pipelines.inc @@ -11,7 +11,7 @@ function panels_default_panels_renderer_pipeline() { $pipelines = array(); - $pipeline = new stdClass; + $pipeline = new stdClass(); $pipeline->disabled = FALSE; /* Edit this to true to make a default pipeline disabled initially */ $pipeline->api_version = 1; $pipeline->name = 'standard'; diff --git a/sites/all/modules/contrib/panels/panels/includes/plugins.inc b/sites/all/modules/contrib/panels/panels/includes/plugins.inc index be5cd257..05088830 100644 --- a/sites/all/modules/contrib/panels/panels/includes/plugins.inc +++ b/sites/all/modules/contrib/panels/panels/includes/plugins.inc @@ -2,7 +2,6 @@ /** * @file - * * Contains helper code for plugins and contexts. */ @@ -41,7 +40,7 @@ function panels_get_regions($layout, $display) { * The cached content, or FALSE to indicate no cached content exists. */ function panels_get_cached_content($display, $args, $context, $pane = NULL) { - // Never use cache on a POST + // Never use cache on a POST. if (!empty($_POST)) { return FALSE; } @@ -59,7 +58,7 @@ function panels_get_cached_content($display, $args, $context, $pane = NULL) { return FALSE; } - // restore it. + // Restore it. $cache->restore(); return $cache; } @@ -68,7 +67,7 @@ function panels_get_cached_content($display, $args, $context, $pane = NULL) { * Store cached content for a given display and possibly pane. */ function panels_set_cached_content($cache, $display, $args, $context, $pane = NULL) { - // Never use cache on a POST + // Never use cache on a POST. if (!empty($_POST)) { return FALSE; } @@ -82,7 +81,7 @@ function panels_set_cached_content($cache, $display, $args, $context, $pane = NU $conf = $pane ? $pane->cache['settings'] : $display->cache['settings']; - // snapshot it. + // Snapshot it. $cache->cache(); return $function($conf, $cache, $display, $args, $context, $pane); } @@ -154,7 +153,7 @@ class panels_cache_object { $this->ready = TRUE; - // Simple replacement for head + // Simple replacement for head. $this->head = str_replace($this->head, '', drupal_add_html_head()); // Slightly less simple for CSS: @@ -248,6 +247,7 @@ class panels_cache_object { } } } + } /** @@ -412,7 +412,7 @@ function panels_get_renderer_handler($plugin, &$display) { * Choose a renderer for a display based on a render pipeline setting. */ function panels_get_renderer($pipeline_name, &$display) { - // Load the pipeline + // Load the pipeline. ctools_include('export'); $pipeline = ctools_export_crud_load('panels_renderer_pipeline', $pipeline_name); @@ -443,7 +443,7 @@ function panels_get_renderer($pipeline_name, &$display) { return $renderer; } - // Fall through. If no renderer is selected, use the standard renderer + // Fall through. If no renderer is selected, use the standard renderer. return panels_get_renderer_handler('standard', $display); } @@ -454,9 +454,9 @@ function panels_get_renderer($pipeline_name, &$display) { */ function _panels_renderer_pipeline_sort($a, $b) { if ($a->weight == $b->weight) { - if ($a->admin_title == $b->admin_title) { - return 0; - } + if ($a->admin_title == $b->admin_title) { + return 0; + } return ($a->admin_title < $b->admin_title) ? -1 : 1; } return ($a->weight < $b->weight) ? -1 : 1; diff --git a/sites/all/modules/contrib/panels/panels/panels.api.php b/sites/all/modules/contrib/panels/panels/panels.api.php index 1aa1c6ad..3d148bae 100644 --- a/sites/all/modules/contrib/panels/panels/panels.api.php +++ b/sites/all/modules/contrib/panels/panels/panels.api.php @@ -11,7 +11,7 @@ * @param string $argument * The second half of the cache key. Full key module:TASK_NAME:HANDLER_NAME * passed part: TASK_NAME:HANDLER_NAME - * @param stdClass $cache + * @param object $cache * The display to cache. */ function hook_panels_cache_set($argument, $cache) { @@ -56,7 +56,7 @@ function hook_panels_cache_get($argument) { * @param string $argument * The second half of the cache key. Full key module:TASK_NAME:HANDLER_NAME * passed part: TASK_NAME:HANDLER_NAME - * @param stdClass $cache + * @param object $cache * The display to cache. * * @return stdClass @@ -78,7 +78,7 @@ function hook_panels_cache_save($argument, $cache) { * @param string $argument * The second half of the cache key. Full key module:TASK_NAME:HANDLER_NAME * passed part: TASK_NAME:HANDLER_NAME - * @param stdClass $cache + * @param object $cache * The cached display. */ function hook_panels_cache_clear($argument, $cache) { @@ -105,9 +105,9 @@ function hook_panels_dashboard_blocks(&$vars) { * * This happens after the keyword substitution. * - * @param stdClass $content + * @param object $content * The content block to render. - * @param stdClass $pane + * @param object $pane * The pane object. * @param array $args * The display arguments. @@ -125,7 +125,7 @@ function hook_panels_pane_content_alter($content, $pane, $args, $contexts) { * @param string $argument * The second half of the cache key. Full key module:TASK_NAME:HANDLER_NAME * passed part: TASK_NAME:HANDLER_NAME - * @param stdClass $cache + * @param object $cache * The cached display. */ function hook_panels_edit_cache_break_lock($argument, $cache) { @@ -140,7 +140,7 @@ function hook_panels_edit_cache_break_lock($argument, $cache) { * * @param panels_display $panels_display * The panels display that will be rendered. - * @param stdClass $renderer + * @param object $renderer * The renderer object that will be used to render. * * @return string @@ -158,7 +158,7 @@ function hook_panels_pre_render($panels_display, $renderer) { * * @param panels_display $panels_display * The rendered panels display. - * @param stdClass $renderer + * @param object $renderer * The used renderer object. * * @return string @@ -171,7 +171,7 @@ function hook_panels_post_render($panels_display, $renderer) { /** * Fired before a new pane is inserted in the storage. * - * @param stdClass $pane + * @param object $pane * Pane that will be rendered. */ function hook_panels_pane_insert($pane) { @@ -188,7 +188,7 @@ function hook_panels_pane_insert($pane) { /** * Fired before a changed pane is updated in the storage. * - * @param stdClass $pane + * @param object $pane * Pane that will be rendered. */ function hook_panels_pane_update($pane) { @@ -208,7 +208,7 @@ function hook_panels_pane_update($pane) { * Last chance to modify the pane before the keyword substitution runs and the * pane is rendered. * - * @param stdClass $pane + * @param object $pane * Pane that will be rendered. */ function hook_panels_pane_prerender($pane) { @@ -250,7 +250,7 @@ function hook_panels_display_save($display) { /** * Fired before a display is deleted. * - * @param integer $did + * @param int $did * Id of the display to delete. */ function hook_panels_delete_display($did) { diff --git a/sites/all/modules/contrib/panels/panels/panels.info b/sites/all/modules/contrib/panels/panels/panels.info index 6a6f29fe..6ad152c5 100644 --- a/sites/all/modules/contrib/panels/panels/panels.info +++ b/sites/all/modules/contrib/panels/panels/panels.info @@ -18,9 +18,9 @@ files[] = tests/PanelsNodeViewWebTestCase.test files[] = tests/PanelsTermViewWebTestCase.test files[] = tests/PanelsUserViewWebTestCase.test -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-3.8" +; Information added by Drupal.org packaging script on 2017-02-06 +version = "7.x-3.9" core = "7.x" project = "panels" -datestamp = "1476582295" +datestamp = "1486394388" diff --git a/sites/all/modules/contrib/panels/panels/panels.install b/sites/all/modules/contrib/panels/panels/panels.install index 11cf7a47..16b65afe 100644 --- a/sites/all/modules/contrib/panels/panels/panels.install +++ b/sites/all/modules/contrib/panels/panels/panels.install @@ -1,5 +1,9 @@ array('pid'), 'indexes' => array( - 'did_idx' => array('did') + 'did_idx' => array('did'), ), ); @@ -445,9 +449,7 @@ function panels_update_7300() { */ function panels_update_7301() { // Load the schema. - // Due to a previous failure, the field may already exist: - $schema = panels_schema_4(); $table = 'panels_pane'; $field = 'locks'; @@ -627,7 +629,7 @@ function panels_update_7306() { } if (!empty($page_manager_panels)) { - // Check panels displays that only have empty storage types + // Check panels displays that only have empty storage types. $result = db_query("SELECT pd.did FROM {panels_display} pd WHERE pd.did IN (:dids) AND storage_type = ''", array(':dids' => array_keys($page_manager_panels))); foreach ($result as $row) { db_update('panels_display') @@ -652,28 +654,15 @@ function panels_update_7307() { db_create_table($table_name, $schema[$table_name]); } - // Read existing allowed settings and store them in a new table. - $variables = db_select('variable', 'v') - ->fields('v', array('name')) - ->condition('name', '%' . db_like('_allowed_types'), 'LIKE') - ->execute() - ->fetchCol(); - foreach ($variables as $name) { - $module = str_replace('_allowed_types', '', $name); - $variable = variable_get($name); - foreach ($variable as $type => $allowed) { - $allowed = empty($allowed) ? 0 : 1; - db_merge('panels_allowed_types') - ->key(array('module' => $module, 'type' => $type)) - ->fields(array( - 'module' => $module, - 'type' => $type, - 'allowed' => $allowed, - )) - ->execute(); - } - variable_del($name); - } + /* + The version of this update hook in release 3.8 included code that + converted storage of allowed_types configuration from variables to the new + table, and also deleted existing allowed_types configuration variables. + See https://www.drupal.org/node/2479879. + + In order to prevent data loss on sites that had not yet updated to 3.8, the + conversion and variable-deletion code has been removed from this update hook. + */ } /** diff --git a/sites/all/modules/contrib/panels/panels/panels.module b/sites/all/modules/contrib/panels/panels/panels.module index fc25c09b..6374d17b 100644 --- a/sites/all/modules/contrib/panels/panels/panels.module +++ b/sites/all/modules/contrib/panels/panels/panels.module @@ -1,8 +1,7 @@ array('title' => NULL, 'id' => NULL, 'image' => NULL, 'link' => NULL, 'class' => NULL), + 'variables' => array( + 'title' => NULL, + 'id' => NULL, + 'image' => NULL, + 'link' => NULL, + 'class' => NULL, + ), ); $theme['panels_layout_icon'] = array( - 'variables' => array('id' => NULL, 'image' => NULL, 'title' => NULL), + 'variables' => array( + 'id' => NULL, + 'image' => NULL, + 'title' => NULL, + ), ); $theme['panels_pane'] = array( - 'variables' => array('content' => array(), 'pane' => array(), 'display' => array()), + 'variables' => array( + 'content' => array(), + 'pane' => array(), + 'display' => array(), + ), 'path' => drupal_get_path('module', 'panels') . '/templates', 'template' => 'panels-pane', ); @@ -92,25 +106,29 @@ function panels_theme() { ); $theme['panels_add_content_modal'] = array( - 'variables' => array('renderer' => NULL, 'categories' => array(), 'region' => NULL, 'category' => NULL, 'column_count' => 2), + 'variables' => array( + 'renderer' => NULL, + 'categories' => array(), + 'region' => NULL, + 'category' => NULL, + 'column_count' => 2, + ), 'path' => drupal_get_path('module', 'panels') . '/templates', 'file' => '../includes/add-content.inc', 'template' => 'panels-add-content-modal', ); $theme['panels_add_content_link'] = array( - 'variables' => array('renderer' => NULL, 'region' => NULL, 'content_type' => NULL), + 'variables' => array( + 'renderer' => NULL, + 'region' => NULL, + 'content_type' => NULL, + ), 'path' => drupal_get_path('module', 'panels') . '/templates', 'file' => '../includes/add-content.inc', 'template' => 'panels-add-content-link', ); - // We don't need layout and style themes in maintenance mode. - // Disabling this: See http://drupal.org/node/979912 for information. -// if (defined('MAINTENANCE_MODE')) { -// return $theme; -// } - // Register layout and style themes on behalf of all of these items. ctools_include('plugins', 'panels'); @@ -121,15 +139,23 @@ function panels_theme() { foreach (array('theme', 'admin theme') as $callback) { if (!empty($data[$callback])) { $theme[$data[$callback]] = array( - 'variables' => array('css_id' => NULL, 'content' => NULL, 'settings' => NULL, 'display' => NULL, 'layout' => NULL, 'renderer' => NULL), + 'variables' => array( + 'css_id' => NULL, + 'content' => NULL, + 'settings' => NULL, + 'display' => NULL, + 'layout' => NULL, + 'renderer' => NULL, + ), 'path' => $data['path'], 'file' => $data['file'], ); - // if no theme function exists, assume template. + // If no theme function exists, assume template. if (!function_exists("theme_$data[theme]")) { $theme[$data[$callback]]['template'] = str_replace('_', '-', $data[$callback]); - $theme[$data[$callback]]['file'] = $data['file']; // for preprocess. + // For preprocess. + $theme[$data[$callback]]['file'] = $data['file']; } } } @@ -139,14 +165,27 @@ function panels_theme() { foreach ($styles as $name => $data) { if (!empty($data['render pane'])) { $theme[$data['render pane']] = array( - 'variables' => array('content' => NULL, 'pane' => NULL, 'display' => NULL, 'style' => NULL, 'settings' => NULL), + 'variables' => array( + 'content' => NULL, + 'pane' => NULL, + 'display' => NULL, + 'style' => NULL, + 'settings' => NULL, + ), 'path' => $data['path'], 'file' => $data['file'], ); } if (!empty($data['render region'])) { $theme[$data['render region']] = array( - 'variables' => array('display' => NULL, 'owner_id' => NULL, 'panes' => NULL, 'settings' => NULL, 'region_id' => NULL, 'style' => NULL), + 'variables' => array( + 'display' => NULL, + 'owner_id' => NULL, + 'panes' => NULL, + 'settings' => NULL, + 'region_id' => NULL, + 'style' => NULL, + ), 'path' => $data['path'], 'file' => $data['file'], ); @@ -156,17 +195,16 @@ function panels_theme() { if (is_array($data['hook theme'])) { $theme += $data['hook theme']; } - else if (function_exists($data['hook theme'])) { + elseif (function_exists($data['hook theme'])) { $data['hook theme']($theme, $data); } } } - return $theme; } /** - * Implementation of hook_menu + * Implements hook_menu(). */ function panels_menu() { // Safety: go away if CTools is not at an appropriate version. @@ -234,13 +272,11 @@ function panels_menu() { if (is_array($data['hook menu'])) { $items += $data['hook menu']; } - else if (function_exists($data['hook menu'])) { + elseif (function_exists($data['hook menu'])) { $data['hook menu']($items, $data); } } } - - return $items; } @@ -261,7 +297,7 @@ function panels_edit_cache_load($cache_key) { } /** - * Implementation of hook_init() + * Implements hook_init(). */ function panels_init() { // Safety: go away if CTools is not at an appropriate version. @@ -276,7 +312,7 @@ function panels_init() { } /** - * Implementation of hook_permission(). + * Implements hook_permission(). * * @todo Almost all of these need to be moved into pipelines. */ @@ -286,11 +322,13 @@ function panels_permission() { 'title' => t("Use Panels Dashboard"), 'description' => t('Allows a user to access the Panels Dashboard.', array('@url' => url('admin/structure/panels'))), ), - 'view pane admin links' => array( // @todo + // @todo + 'view pane admin links' => array( 'title' => t("View administrative links on Panel panes"), - 'description' => t(""), + 'description' => "", ), - 'administer pane access' => array( // @todo should we really have a global perm for this, or should it be moved into a pipeline question? + // @todo should we really have a global perm for this, or should it be moved into a pipeline question? + 'administer pane access' => array( 'title' => t("Configure access settings on Panel panes"), 'description' => t("Access rules (often also called visibility rules) can be configured on a per-pane basis. This permission allows users to configure those settings."), ), @@ -309,7 +347,7 @@ function panels_permission() { ), 'administer advanced pane settings' => array( 'title' => t("Configure advanced settings on Panel panes"), - 'description' => t(""), + 'description' => "", ), 'administer panels layouts' => array( 'title' => t("Administer Panels layouts"), @@ -355,16 +393,17 @@ function panels_flush_caches() { } } -// --------------------------------------------------------------------------- -// CTools hook implementations -// -// These aren't core Drupal hooks but they are just as important. +/** + * CTools hook implementations. + * + * These aren't core Drupal hooks but they are just as important. + */ /** - * Implementation of hook_ctools_plugin_directory() to let the system know - * we implement task and task_handler plugins. + * Implements hook_ctools_plugin_directory(). */ function panels_ctools_plugin_directory($module, $plugin) { + // To let the system know we implement task and task_handler plugins. // Safety: go away if CTools is not at an appropriate version. if (!module_invoke('ctools', 'api_version', PANELS_REQUIRED_CTOOLS_API)) { return; @@ -373,8 +412,8 @@ function panels_ctools_plugin_directory($module, $plugin) { // We don't support the 'ctools' 'cache' plugin and pretending to causes // errors when they're in use. if ($module == 'ctools' && $plugin == 'cache') { + // If we did we'd make a plugin/ctools_cache or something. return; - // if we did we'd make a plugin/ctools_cache or something. } if ($module == 'page_manager' || $module == 'panels' || $module == 'ctools' || $module == 'stylizer') { @@ -383,7 +422,6 @@ function panels_ctools_plugin_directory($module, $plugin) { if ($module == 'ctools' && $plugin == 'cache') { return; } - return 'plugins/' . $plugin; } } @@ -397,7 +435,8 @@ function panels_ctools_plugin_directory($module, $plugin) { function panels_ctools_plugin_type() { return array( 'layouts' => array( - 'load themes' => TRUE, // Can define layouts in themes + // We can define layouts in themes. + 'load themes' => TRUE, 'process' => 'panels_layout_process', 'child plugins' => TRUE, ), @@ -425,18 +464,11 @@ function panels_layout_process(&$plugin) { } /** - * Implementation of hook_ctools_plugin_api(). - * - * Inform CTools about version information for various plugins implemented by - * Panels. - * - * @param string $owner - * The system name of the module owning the API about which information is - * being requested. - * @param string $api - * The name of the API about which information is being requested. + * Implements hook_ctools_plugin_api(). */ function panels_ctools_plugin_api($owner, $api) { + // Inform CTools about version information for various plugins implemented by + // panels. if ($owner == 'panels' && $api == 'styles') { // As of 6.x-3.6, Panels has a slightly new system for style plugins. return array('version' => 2.0); @@ -451,7 +483,7 @@ function panels_ctools_plugin_api($owner, $api) { } /** - * Implementation of hook_views_api(). + * Implements hook_views_api(). */ function panels_views_api() { return array( @@ -468,12 +500,12 @@ function panels_views_api() { * parameters to a style plugin in a hybrid environment of both new and old * plugins. * - * @see _ctools_process_data() - * * @param array $plugin * The style plugin that is being processed. * @param array $info * The style plugin type info array. + * + * @see _ctools_process_data() */ function panels_plugin_styles_process(&$plugin, $info) { $plugin += array( @@ -492,22 +524,49 @@ function panels_ctools_style_base_types() { 'region' => array( 'title' => t('Panel region'), 'preview' => 'panels_stylizer_region_preview', - 'theme variables' => array('settings' => NULL, 'class' => NULL, 'content' => NULL), + 'theme variables' => array( + 'settings' => NULL, + 'class' => NULL, + 'content' => NULL, + ), ), 'pane' => array( 'title' => t('Panel pane'), 'preview' => 'panels_stylizer_pane_preview', - 'theme variables' => array('settings' => NULL, 'content' => NULL, 'pane' => NULL, 'display' => NULL), + 'theme variables' => array( + 'settings' => NULL, + 'content' => NULL, + 'pane' => NULL, + 'display' => NULL, + ), ), ); } +/** + * Generates Lorem Ipsum. + * + * @return string + * Lorem ipsum string. + */ function panels_stylizer_lipsum() { - return " -

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus at velit dolor. Donec egestas tellus sit amet urna rhoncus adipiscing. Proin nec porttitor sem. Maecenas aliquam, purus nec tempus dignissim, nulla arcu aliquam diam, non tincidunt massa ante vel dolor. Aliquam sapien sapien, tincidunt id tristique at, pretium sagittis libero.

- -

Nulla facilisi. Curabitur lacinia, tellus sed tristique consequat, diam lorem scelerisque felis, at dictum purus augue facilisis lorem. Duis pharetra dignissim rutrum. Curabitur ac elit id dui dapibus tincidunt. Nulla eget sem quam, non eleifend eros. Cras porttitor tempus lectus ac scelerisque. Curabitur vehicula bibendum lorem, vitae ornare ligula venenatis ut.

- "; + return << + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus at + velit dolor. Donec egestas tellus sit amet urna rhoncus adipiscing. Proin + nec porttitor sem. Maecenas aliquam, purus nec tempus dignissim, nulla arcu + aliquam diam, non tincidunt massa ante vel dolor. Aliquam sapien sapien, + tincidunt id tristique at, pretium sagittis libero. +

+

+ Nulla facilisi. Curabitur lacinia, tellus sed tristique consequat, diam + lorem scelerisque felis, at dictum purus augue facilisis lorem. Duis + pharetra dignissim rutrum. Curabitur ac elit id dui dapibus tincidunt. + Nulla eget sem quam, non eleifend eros. Cras porttitor tempus lectus ac + scelerisque. Curabitur vehicula bibendum lorem, vitae ornare ligula + venenatis ut. +

+LIPSUM; } /** @@ -515,7 +574,14 @@ function panels_stylizer_lipsum() { */ function panels_stylizer_region_preview($plugin, $settings) { ctools_stylizer_add_css($plugin, $settings); - return theme($plugin['theme'], array('settings' => $settings, 'class' => ctools_stylizer_get_css_class($plugin, $settings), 'content' => panels_stylizer_lipsum())); + return theme( + $plugin['theme'], + array( + 'settings' => $settings, + 'class' => ctools_stylizer_get_css_class($plugin, $settings), + 'content' => panels_stylizer_lipsum(), + ) + ); } /** @@ -525,7 +591,7 @@ function panels_stylizer_pane_preview($plugin, $settings) { ctools_stylizer_add_css($plugin, $settings); $pane = new stdClass(); - $content = new stdClass; + $content = new stdClass(); $content->title = t('Lorem ipsum'); $content->content = panels_stylizer_lipsum(); $content->type = 'dummy'; @@ -536,78 +602,103 @@ function panels_stylizer_pane_preview($plugin, $settings) { $display = new panels_display(); if (!empty($plugin['theme'])) { - return theme($plugin['theme'], array('settings' => $settings, 'content' => $content, 'pane' => $pane, 'display' => $display)); + return theme( + $plugin['theme'], + array( + 'settings' => $settings, + 'content' => $content, + 'pane' => $pane, + 'display' => $display, + ) + ); } else { - return theme('panels_pane', array('content' => $content, 'pane' => $pane, 'display' => $display)); + return theme( + 'panels_pane', + array( + 'content' => $content, + 'pane' => $pane, + 'display' => $display, + ) + ); } } -// --------------------------------------------------------------------------- -// Panels display editing +/** + * Panels display editing. + */ /** - * @defgroup mainapi Functions comprising the main panels API - * @{ + * @defgroup mainapi Functions comprising the main panels API. */ /** * Main API entry point to edit a panel display. * - * Sample implementations utiltizing the the complex $destination behavior can be found - * in panels_page_edit_content() and, in a separate contrib module, OG Blueprints - * (http://drupal.org/project/og_blueprints), og_blueprints_blueprint_edit(). + * Sample implementations utiltizing the the complex $destination behavior can + * be found in panels_page_edit_content() and, in a separate contrib module, + * OG Blueprints (http://drupal.org/project/og_blueprints), + * og_blueprints_blueprint_edit(). + * + * @param object $display + * Instanceof panels_display. + * + * A fully loaded panels $display object, as returned from + * panels_load_display(). Merely passing a did is NOT sufficient. + * Note that 'fully loaded' means the $display must already be loaded with + * any contexts the caller wishes to have set for the display. + * @param mixed $destination + * The redirect destination that the user should be taken to on form + * submission or cancellation. With panels_edit, $destination has complex + * effects on the return values of panels_edit() once the form has been + * submitted. See the explanation of the return value below to understand the + * different types of values returned by panels_edit() at different stages of + * FAPI. Under most circumstances, simply passing in drupal_get_destination() + * is all that's necessary. + * @param array $content_types + * An associative array of allowed content types, typically as returned from + * panels_common_get_allowed_types(). Note that context partially governs + * available content types, so you will want to create any relevant contexts + * using panels_create_context() or panels_create_context_empty() to make sure + * all the appropriate content types are available. + * + * @return mixed + * Because the functions called by panels_edit() invoke the form API, + * this function returns different values depending on the stage of form + * submission we're at. In Drupal 5, the phase of form submission is indicated + * by the contents of $_POST['op']. Here is what you'll get at different + * stages: + * - If !$_POST['op']: then we're on on the initial passthrough and the + * form is being rendered, so it's the $form itself that's being + * returned. Because negative margins, a common CSS technique, bork the + * display editor's ajax drag-and-drop, it's important that the $output + * be printed, not returned. Use this syntax in the caller function: + * print theme('page', panels_edit($display, $destination, $content_types), FALSE); + * - If $_POST['op'] == t('Cancel'): form submission has been cancelled. + * If empty($destination) == FALSE, then there is no return value and the + * panels API takes care of redirecting to $destination. + * If empty($destination) == TRUE, then there's still no return value, + * but the caller function has to take care of form redirection. + * - If $_POST['op'] == ('Save'): the form has been submitted successfully + * and has run through panels_edit_display_submit(). + * $output depends on the value of $destination: + * - If empty($destination) == TRUE: $output contains the modified $display + * object, and no redirection will occur. This option is useful if the + * caller needs to perform additional operations on or with the modified + * $display before the page request is complete. Using hook_form_alter() + * to add an additional submit handler is typically the preferred method + * for something like this, but there are certain use cases where that is + * infeasible and $destination = NULL should be used instead. If this + * method is employed, the caller will need to handle form redirection. + * Note that having $_REQUEST['destination'] set, whether via + * drupal_get_destination() or some other method, will NOT interfere with + * this functionality; consequently, you can use drupal_get_destination() + * to safely store your desired redirect in the caller function, then + * simply use drupal_goto() once panels_edit() has done its business. + * - If empty($destination) == FALSE: the form will redirect to the URL + * string given in $destination and NO value will be returned. * * @ingroup mainapi - * - * @param object $display instanceof panels_display \n - * A fully loaded panels $display object, as returned from panels_load_display(). - * Merely passing a did is NOT sufficient. \n - * Note that 'fully loaded' means the $display must already be loaded with any contexts - * the caller wishes to have set for the display. - * @param mixed $destination \n - * The redirect destination that the user should be taken to on form submission or - * cancellation. With panels_edit, $destination has complex effects on the return - * values of panels_edit() once the form has been submitted. See the explanation of - * the return value below to understand the different types of values returned by panels_edit() - * at different stages of FAPI. Under most circumstances, simply passing in - * drupal_get_destination() is all that's necessary. - * @param array $content_types \n - * An associative array of allowed content types, typically as returned from - * panels_common_get_allowed_types(). Note that context partially governs available content types, - * so you will want to create any relevant contexts using panels_create_context() or - * panels_create_context_empty() to make sure all the appropriate content types are available. - * - * @return - * Because the functions called by panels_edit() invoke the form API, this function - * returns different values depending on the stage of form submission we're at. In Drupal 5, - * the phase of form submission is indicated by the contents of $_POST['op']. Here's what you'll - * get at different stages: - * -# If !$_POST['op']: then we're on on the initial passthrough and the form is being - * rendered, so it's the $form itself that's being returned. Because negative margins, - * a common CSS technique, bork the display editor's ajax drag-and-drop, it's important - * that the $output be printed, not returned. Use this syntax in the caller function: \n - * print theme('page', panels_edit($display, $destination, $content_types), FALSE); \n - * -# If $_POST['op'] == t('Cancel'): form submission has been cancelled. If empty($destination) == FALSE, - * then there is no return value and the panels API takes care of redirecting to $destination. - * If empty($destination) == TRUE, then there's still no return value, but the caller function - * has to take care of form redirection. - * -# If $_POST['op'] == ('Save'): the form has been submitted successfully and has run through - * panels_edit_display_submit(). $output depends on the value of $destination: - * - If empty($destination) == TRUE: $output contains the modified $display - * object, and no redirection will occur. This option is useful if the caller - * needs to perform additional operations on or with the modified $display before - * the page request is complete. Using hook_form_alter() to add an additional submit - * handler is typically the preferred method for something like this, but there - * are certain use cases where that is infeasible and $destination = NULL should - * be used instead. If this method is employed, the caller will need to handle form - * redirection. Note that having $_REQUEST['destination'] set, whether via - * drupal_get_destination() or some other method, will NOT interfere with this - * functionality; consequently, you can use drupal_get_destination() to safely store - * your desired redirect in the caller function, then simply use drupal_goto() once - * panels_edit() has done its business. - * - If empty($destination) == FALSE: the form will redirect to the URL string - * given in $destination and NO value will be returned. */ function panels_edit($display, $destination = NULL, $content_types = NULL, $title = FALSE) { ctools_include('display-edit', 'panels'); @@ -619,40 +710,47 @@ function panels_edit($display, $destination = NULL, $content_types = NULL, $titl /** * API entry point for selecting a layout for a given display. * - * Layout selection is nothing more than a list of radio items encompassing the available - * layouts for this display, as defined by .inc files in the panels/layouts subdirectory. - * The only real complexity occurs when a user attempts to change the layout of a display - * that has some content in it. + * Layout selection is nothing more than a list of radio items encompassing the + * available layouts for this display, as defined by .inc files in the + * panels/layouts subdirectory. The only real complexity occurs when a user + * attempts to change the layout of a display that has some content in it. * - * @param object $display instanceof panels_display \n - * A fully loaded panels $display object, as returned from panels_load_display(). - * Merely passing a did is NOT sufficient. + * @param object $display + * A fully loaded panels $display object, as returned from + * panels_load_display(). Merely passing a did is NOT sufficient. * @param string $finish - * A string that will be used for the text of the form submission button. If no value is provided, - * then the form submission button will default to t('Save'). + * A string that will be used for the text of the form submission button. If + * no value is provided, then the form submission button will default to + * t('Save'). * @param mixed $destination - * Basic usage is a string containing the URL that the form should redirect to upon submission. - * For a discussion of advanced usages, see panels_edit(). + * Basic usage is a string containing the URL that the form should redirect to + * upon submission. For a discussion of advanced usages, see panels_edit(). * @param mixed $allowed_layouts - * Allowed layouts has three different behaviors that depend on which of three value types - * are passed in by the caller: - * #- if $allowed_layouts instanceof panels_allowed_layouts (includes subclasses): the most - * complex use of the API. The caller is passing in a loaded panels_allowed_layouts object - * that the client module previously created and stored somewhere using a custom storage - * mechanism. - * #- if is_string($allowed_layouts): the string will be used in a call to variable_get() which - * will call the $allowed_layouts . '_allowed_layouts' var. If the data was stored properly - * in the system var, the $allowed_layouts object will be unserialized and recreated. - * @see panels_common_set_allowed_layouts() - * #- if is_null($allowed_layouts): the default behavior, which also provides backwards - * compatibility for implementations of the Panels2 API written before beta4. In this case, - * a dummy panels_allowed_layouts object is created which does not restrict any layouts. - * Subsequent behavior is indistinguishable from pre-beta4 behavior. + * Allowed layouts has three different behaviors that depend on which of three + * value types are passed in by the caller: + * #- if $allowed_layouts instanceof panels_allowed_layouts + * (includes subclasses): the most complex use of the API. The caller is + * passing in a loaded panels_allowed_layouts object that the client + * module previously created and stored somewhere using a custom storage + * mechanism. + * #- if is_string($allowed_layouts): the string will be used in a call to + * variable_get() which will call the + * $allowed_layouts . '_allowed_layouts' var. If the data was stored + * properly in the system var, the $allowed_layouts object will be + * unserialized and recreated. + * #- if is_null($allowed_layouts): the default behavior, which also + * provides backwards compatibility for implementations of the Panels2 + * API written before beta4. In this case, a dummy panels_allowed_layouts + * object is created which does not restrict any layouts. Subsequent + * behavior is indistinguishable from pre-beta4 behavior. + * + * @return mixed + * Can return nothing, or a modified $display object, or a redirection string; + * return values for the panels_edit* family of functions are quite complex. + * See panels_edit() for detailed discussion. * - * @return - * Can return nothing, or a modified $display object, or a redirection string; return values for the - * panels_edit* family of functions are quite complex. See panels_edit() for detailed discussion. * @see panels_edit() + * @see panels_common_set_allowed_layouts() */ function panels_edit_layout($display, $finish, $destination = NULL, $allowed_layouts = NULL) { ctools_include('display-layout', 'panels'); @@ -660,23 +758,27 @@ function panels_edit_layout($display, $finish, $destination = NULL, $allowed_lay return _panels_edit_layout($display, $finish, $destination, $allowed_layouts); } -// --------------------------------------------------------------------------- -// Panels database functions +/** + * Panels database functions. + */ /** - * Forms the basis of a panel display + * Forms the basis of a panel display. */ class panels_display { - var $args = array(); - var $content = array(); - var $panels = array(); - var $incoming_content = NULL; - var $css_id = NULL; - var $context = array(); - var $did = 'new'; - var $renderer = 'standard'; + public $args = array(); + public $content = array(); + public $panels = array(); + public $incoming_content = NULL; + public $css_id = NULL; + public $context = array(); + public $did = 'new'; + public $renderer = 'standard'; - function add_pane(&$pane, $location = NULL) { + /** + * Add a pane. + */ + public function add_pane(&$pane, $location = NULL) { // If no location specified, use what's set in the pane. if (empty($location)) { $location = $pane->panel; @@ -690,33 +792,30 @@ class panels_display { $pane->uuid = ctools_uuid_generate(); $pane->pid = 'new-' . $pane->uuid; - // Add the pane to the approprate spots. + // Add the pane to the appropriate spots. $this->content[$pane->pid] = &$pane; $this->panels[$location][] = $pane->pid; } - function duplicate_pane($pid, $location = FALSE) { + /** + * Duplicate a pane. + */ + public function duplicate_pane($pid, $location = FALSE) { $pane = $this->clone_pane($pid); $this->add_pane($pane, $location); } - function clone_pane($pid) { - $pane = clone $this->content[$pid]; - $pane->uuid = ctools_uuid_generate(); - return $pane; - } - /** * Get the title from a display. * * The display must have already been rendered, or the setting to set the * display's title from a pane's title will not have worked. * - * @return - * The title to use. If NULL, this means to let any default title that may be in use - * pass through. i.e, do not actually set the title. + * @return mixed + * The title to use. If NULL, this means to let any default title that may + * be in use pass through. i.e, do not actually set the title. */ - function get_title() { + public function get_title() { switch ($this->hide_title) { case PANELS_TITLE_NONE: return ''; @@ -725,7 +824,8 @@ class panels_display { return isset($this->stored_pane_title) ? $this->stored_pane_title : ''; case PANELS_TITLE_FIXED: - case FALSE; // For old exported panels that are not in the database. + case FALSE; + // For old exported panels that are not in the database. if (!empty($this->title)) { return filter_xss_admin(ctools_context_keyword_substitute($this->title, array(), $this->context)); } @@ -743,8 +843,11 @@ class panels_display { * An instantiated display renderer object, or the name of a display * renderer plugin+class to be fetched. Defaults to NULL. When NULL, the * predesignated display renderer will be used. + * + * @return mixed + * NULL or output of render function. */ - function render($renderer = NULL) { + public function render($renderer = NULL) { $layout = panels_get_layout($this->layout); if (!$layout) { return NULL; @@ -788,7 +891,7 @@ class panels_display { * @return bool * TRUE if access is granted; otherwise FALSE. */ - function access($op, $account = NULL) { + public function access($op, $account = NULL) { global $user; if (!$account) { @@ -825,10 +928,11 @@ class panels_display { return $access_callback($this->storage_type, $this->storage_id, $op, $account); } + } /** - * }@ End of 'defgroup mainapi', although other functions are specifically added later + * End of 'defgroup mainapi', although other functions are specifically added later. */ /** @@ -869,10 +973,10 @@ function panels_new_pane($type, $subtype, $set_defaults = FALSE) { * Helper function primarily for for panels_load_display(). * * @param array $dids - * An indexed array of dids to be loaded from the database. + * An indexed array of dids to be loaded from the database. * - * @return $displays - * An array of displays, keyed by their display dids. + * @return array + * An array of displays, keyed by their display dids. * * @todo schema API can drasticly simplify this code. */ @@ -882,7 +986,10 @@ function panels_load_displays($dids) { return $displays; } - $result = db_query("SELECT * FROM {panels_display} WHERE did IN (:dids)", array(':dids' => $dids)); + $result = db_query( + "SELECT * FROM {panels_display} WHERE did IN (:dids)", + array(':dids' => $dids) + ); ctools_include('export'); foreach ($result as $obj) { @@ -890,28 +997,28 @@ function panels_load_displays($dids) { // Modify the hide_title field to go from a bool to an int if necessary. } - $result = db_query("SELECT * FROM {panels_pane} WHERE did IN (:dids) ORDER BY did, panel, position", array(':dids' => $dids)); + $result = db_query( + "SELECT * FROM {panels_pane} WHERE did IN (:dids) ORDER BY did, panel, position", + array(':dids' => $dids) + ); foreach ($result as $obj) { $pane = ctools_export_unpack_object('panels_pane', $obj); $displays[$pane->did]->panels[$pane->panel][] = $pane->pid; $displays[$pane->did]->content[$pane->pid] = $pane; } - return $displays; } /** * Load a single display. * - * @ingroup mainapi - * * @param int $did - * The display id (did) of the display to be loaded. + * The display id (did) of the display to be loaded. * - * @return object $display instanceof panels_display \n - * Returns a partially-loaded panels_display object. $display objects returned from - * from this function have only the following data: + * @return object $display + * Returns a partially-loaded panels_display object. $display objects returned + * from this function have only the following data: * - $display->did (the display id) * - $display->name (the 'name' of the display, where applicable - it often isn't) * - $display->layout (a string with the system name of the display's layout) @@ -923,9 +1030,10 @@ function panels_load_displays($dids) { * - $display->cache (any relevant data from panels_simple_cache) * - $display->args * - $display->incoming_content + * While all of these members are defined, $display->context is NEVER defined in the returned $display; + * it must be set using one of the ctools_context_create() functions. * - * While all of these members are defined, $display->context is NEVER defined in the returned $display; - * it must be set using one of the ctools_context_create() functions. + * @ingroup mainapi */ function panels_load_display($did) { $displays = panels_load_displays(array($did)); @@ -937,8 +1045,6 @@ function panels_load_display($did) { /** * Save a display object. * - * @ingroup mainapi - * * Note that a new $display only receives a real did once it is run through * this function, and likewise for the pid of any new pane. * @@ -947,11 +1053,14 @@ function panels_load_display($did) { * universally-unique identifier (which is stored permanently in the 'uuid' * field). This format is also used in place of the real pid for exports. * - * @param object $display instanceof panels_display \n - * The display object to be saved. Passed by reference so the caller need not use - * the return value for any reason except convenience. + * @param object $display + * The display object to be saved. Passed by reference so the caller need not + * use the return value for any reason except convenience. * - * @return object $display instanceof panels_display \n + * @return object $display + * This display panel display object to return. + * + * @ingroup mainapi */ function panels_save_display(&$display) { $update = (isset($display->did) && is_numeric($display->did)) ? array('did') : array(); @@ -962,15 +1071,19 @@ function panels_save_display(&$display) { $pids = array(); if ($update) { - // Get a list of all panes currently in the database for this display so we can know if there - // are panes that need to be deleted. (i.e, aren't currently in our list of panes). - $result = db_query("SELECT pid FROM {panels_pane} WHERE did = :did", array(':did' => $display->did)); + // Get a list of all panes currently in the database for this display so we + // can know if there are panes that need to be deleted. (i.e, aren't + // currently in our list of panes). + $result = db_query( + "SELECT pid FROM {panels_pane} WHERE did = :did", + array(':did' => $display->did) + ); foreach ($result as $pane) { $pids[$pane->pid] = $pane->pid; } } - // update all the panes + // Update all the panes. ctools_include('plugins', 'panels'); ctools_include('content'); @@ -1007,7 +1120,7 @@ function panels_save_display(&$display) { // Remove the old new-* entry from the displays content. unset($display->content[$pid]); - // and put it back so our pids and positions can be used. + // Put it back so our pids and positions can be used. $display->content[$pane->pid] = $pane; // If the title pane was one of our panes that just got its ID changed, @@ -1019,7 +1132,7 @@ function panels_save_display(&$display) { // because it was needed to get the did. Chicken, egg, more chicken. db_update('panels_display') ->fields(array( - 'title_pane' => $pane->pid + 'title_pane' => $pane->pid, )) ->condition('did', $display->did) ->execute(); @@ -1049,7 +1162,7 @@ function panels_save_display(&$display) { // Allow other modules to take action when a display is saved. module_invoke_all('panels_display_save', $display); - // Log the change to watchdog, using the same style as node.module + // Log the change to watchdog, using the same style as node.module. $watchdog_args = array('%did' => $display->did); if (!empty($display->title)) { $watchdog_args['%title'] = $display->title; @@ -1059,7 +1172,7 @@ function panels_save_display(&$display) { watchdog('content', 'Panels: saved display with id %did', $watchdog_args, WATCHDOG_NOTICE); } - // to be nice, even tho we have a reference. + // To be nice, even though we have a reference. return $display; } @@ -1089,23 +1202,25 @@ function panels_delete_display($display) { * Only once panels_save_display() is called on the code version of $display * will the exported display be written to the database and permanently saved. * - * @see panels_page_export() or _panels_page_fetch_display() for sample implementations. - * - * @ingroup mainapi - * - * @param object $display instanceof panels_display \n - * This export function does no loading of additional data about the provided - * display. Consequently, the caller should make sure that all the desired data - * has been loaded into the $display before calling this function. + * @param object $display + * This export function does no loading of additional data about the provided + * display. Consequently, the caller should make sure that all the desired + * data has been loaded into the $display before calling this function. * @param string $prefix - * A string prefix that is prepended to each line of exported code. This is primarily - * used for prepending a double space when exporting so that the code indents and lines up nicely. + * A string prefix that is prepended to each line of exported code. This is + * primarily used for prepending a double space when exporting so that the + * code indents and lines up nicely. * * @return string $output - * The passed-in $display expressed as code, ready to be imported. Import by running - * eval($output) in the caller function; doing so will create a new $display variable - * with all the exported values. Note that if you have already defined a $display variable in - * the same scope as where you eval(), your existing $display variable WILL be overwritten. + * The passed-in $display expressed as code, ready to be imported. Import by + * running eval($output) in the caller function; doing so will create a new + * $display variable with all the exported values. Note that if you have + * already defined a $display variable in the same scope as where you eval(), + * your existing $display variable WILL be overwritten. + * + * @see panels_page_export() or _panels_page_fetch_display() for samples. + * + * @ingroup mainapi */ function panels_export_display($display, $prefix = '') { ctools_include('export'); @@ -1139,7 +1254,7 @@ function panels_export_display($display, $prefix = '') { if (!isset($region_counters[$pane->panel])) { $region_counters[$pane->panel] = 0; } - $output .= $prefix . '$display->panels[\'' . $pane->panel . '\'][' . $region_counters[$pane->panel]++ .'] = \'' . $pane->pid . "';\n"; + $output .= $prefix . '$display->panels[\'' . $pane->panel . '\'][' . $region_counters[$pane->panel]++ . '] = \'' . $pane->pid . "';\n"; } } $output .= $prefix . '$display->hide_title = '; @@ -1147,9 +1262,11 @@ function panels_export_display($display, $prefix = '') { case PANELS_TITLE_FIXED: $output .= 'PANELS_TITLE_FIXED'; break; + case PANELS_TITLE_NONE: $output .= 'PANELS_TITLE_NONE'; break; + case PANELS_TITLE_PANE: $output .= 'PANELS_TITLE_PANE'; break; @@ -1161,11 +1278,14 @@ function panels_export_display($display, $prefix = '') { } /** + * Panels Render Display. + * * Render a display by loading the content into an appropriate * array and then passing through to panels_render_layout. * * if $incoming_content is NULL, default content will be applied. Use * an empty string to indicate no content. + * * @ingroup hook_invocations */ function panels_render_display(&$display, $renderer = NULL) { @@ -1176,7 +1296,7 @@ function panels_render_display(&$display, $renderer = NULL) { if ($form_context = ctools_context_get_form($display->context)) { $form_context->form['#theme'] = 'panels_render_display_form'; if (empty($form_context->form['#theme_wrappers']) || !in_array('form', $form_context->form['#theme_wrappers'])) { - $form_context['#theme_wrappers'][] = 'form'; + $form_context->form['#theme_wrappers'][] = 'form'; } $form_context->form['#display'] = &$display; return $form_context->form; @@ -1197,16 +1317,32 @@ function theme_panels_render_display_form($vars) { return $vars['element']['#display']->render(); } -// @layout +/** + * Panels layout icon function. + */ function panels_print_layout_icon($id, $layout, $title = NULL) { ctools_add_css('panels_admin', 'panels'); $file = $layout['path'] . '/' . $layout['icon']; - return theme('panels_layout_icon', array('id' => $id, 'image' => theme('image', array('path' => $file, 'alt' => strip_tags($layout['title']), 'title' => strip_tags($layout['description']))), 'title' => $title)); + return theme( + 'panels_layout_icon', + array( + 'id' => $id, + 'image' => theme( + 'image', + array( + 'path' => $file, + 'alt' => strip_tags($layout['title']), + 'title' => strip_tags($layout['description']), + ) + ), + 'title' => $title, + ) + ); } /** - * Theme the layout icon image - * @layout + * Theme the layout icon image. + * * @todo move to theme.inc */ function theme_panels_layout_icon($vars) { @@ -1224,18 +1360,15 @@ function theme_panels_layout_icon($vars) { } /** - * Theme the layout link image + * Theme the layout link image. + * * @layout * * @todo Why isn't this a template at this point? * @todo Why does this take 4 arguments but only makes use of two? */ function theme_panels_layout_link($vars) { - $title = $vars['title']; - $image = $vars['image']; - $class = $vars['class']; - - $output = '
'; + $output = '
'; $output .= $vars['image']; $output .= '
' . $vars['title'] . '
'; $output .= '
'; @@ -1244,6 +1377,7 @@ function theme_panels_layout_link($vars) { /** * Print the layout link. Sends out to a theme function. + * * @layout */ function panels_print_layout_link($id, $layout, $link, $options = array(), $current_layout = FALSE) { @@ -1251,7 +1385,7 @@ function panels_print_layout_link($id, $layout, $link, $options = array(), $curr unset($options['query']['q']); } - // Setup classes for layout link, including current-layout information + // Setup classes for layout link, including current-layout information. $class = array('layout-link'); if ($current_layout == $id) { $options['attributes']['class'][] = 'current-layout-link'; @@ -1260,17 +1394,31 @@ function panels_print_layout_link($id, $layout, $link, $options = array(), $curr ctools_add_css('panels_admin', 'panels'); $file = $layout['path'] . '/' . $layout['icon']; - $image = l(theme('image', array('path' => $file)), $link, array('html' => true) + $options); + $image = l( + theme('image', array('path' => $file)), + $link, + array('html' => TRUE) + $options + ); $title = l($layout['title'], $link, $options); - return theme('panels_layout_link', array('title' => $title, 'image' => $image, 'class' => $class)); + return theme( + 'panels_layout_link', + array( + 'title' => $title, + 'image' => $image, + 'class' => $class, + ) + ); } /** + * Panels Get legacy state. + * * Gateway to the PanelsLegacyState class/object, which does all legacy state * checks and provides information about the cause of legacy states as needed. * * @return PanelsLegacyState $legacy + * Returns a legacy panels state. */ function panels_get_legacy_state() { static $legacy = NULL; @@ -1325,13 +1473,13 @@ function template_preprocess_panels_pane(&$vars) { ); unset($content->content['#contextual_links']); - // Add content to $element array + // Add content to $element array. if (is_array($content->content)) { $element['#element'] = $content->content; } $element = contextual_pre_render_links($element); - if(!empty($element['#links'])) { + if (!empty($element['#links'])) { $links += $element['#links']; } } @@ -1352,14 +1500,14 @@ function template_preprocess_panels_pane(&$vars) { } } - // basic classes + // Basic classes. $vars['classes_array'][] = 'panel-pane'; $vars['id'] = ''; - // Add some usable classes based on type/subtype + // Add some usable classes based on type/subtype. ctools_include('cleanstring'); - $type_class = $content->type ? 'pane-'. ctools_cleanstring($content->type, array('lower case' => TRUE)) : ''; - $subtype_class = $content->subtype ? 'pane-'. ctools_cleanstring($content->subtype, array('lower case' => TRUE)) : ''; + $type_class = $content->type ? 'pane-' . ctools_cleanstring($content->type, array('lower case' => TRUE)) : ''; + $subtype_class = $content->subtype ? 'pane-' . ctools_cleanstring($content->subtype, array('lower case' => TRUE)) : ''; // Sometimes type and subtype are the same. Avoid redundant classes. $vars['classes_array'][] = $type_class; @@ -1403,6 +1551,10 @@ function template_preprocess_panels_pane(&$vars) { $vars['more'] = l($content->more['title'], $content->more['href'], $content->more); } + if (!empty($content->attributes)) { + $vars['attributes_array'] = array_merge($vars['attributes_array'], $content->attributes); + } + $vars['content'] = !empty($content->content) ? $content->content : ''; } @@ -1483,22 +1635,21 @@ function panels_ajax_router() { } } -// -------------------------------------------------------------------------- -// Panels caching functions and callbacks -// -// When editing displays and the like, Panels has a caching system that relies -// on a callback to determine where to get the actual cache. - -// @todo This system needs to be better documented so that it can be -// better used. +/** + * Panels caching functions and callbacks. + * + * When editing displays and the like, Panels has a caching system that relies + * on a callback to determine where to get the actual cache. + * + * @todo This system needs to be better documented so that it can be better used. + */ /** * Get an object from cache. */ function panels_cache_get($obj, $did, $skip_cache = FALSE) { ctools_include('object-cache'); - // we often store contexts in cache, so let's just make sure we can load - // them. + // We often store contexts in cache, so let's just make sure we can load them. ctools_include('context'); return ctools_object_cache_get($obj, 'panels_display:' . $did, $skip_cache); } @@ -1544,6 +1695,8 @@ function panels_edit_cache_get_default(&$display, $content_types = NULL, $title } /** + * Panels Editor Cache Get. + * * Method to allow modules to provide their own caching mechanism for the * display editor. */ @@ -1553,11 +1706,13 @@ function panels_edit_cache_get($cache_key) { return module_invoke($module, 'panels_cache_get', $argument); } - // Fall back to our normal method: + // Fall back to our normal method. return panels_cache_get('display', $cache_key); } /** + * Panels Editor Cache Set. + * * Method to allow modules to provide their own caching mechanism for the * display editor. */ @@ -1568,11 +1723,13 @@ function panels_edit_cache_set($cache) { return module_invoke($module, 'panels_cache_set', $argument, $cache); } - // Fall back to our normal method: + // Fall back to our normal method. return panels_cache_set('display', $cache_key, $cache); } /** + * Panels Editor Cache Save. + * * Method to allow modules to provide their own mechanism to write the * cache used in the display editor. */ @@ -1585,11 +1742,13 @@ function panels_edit_cache_save($cache) { } } - // Fall back to our normal method: + // Fall back to our normal method. return panels_save_display($cache->display); } /** + * Panels Editor Cache Clear. + * * Method to allow modules to provide their own mechanism to clear the * cache used in the display editor. */ @@ -1602,7 +1761,7 @@ function panels_edit_cache_clear($cache) { } } - // Fall back to our normal method: + // Fall back to our normal method. return panels_cache_clear('display', $cache_key); } @@ -1624,16 +1783,16 @@ function panels_edit_cache_break_lock($cache) { // Normal panel display editing has no locks, so we do nothing if there is // no fallback. - return; } -// -------------------------------------------------------------------------- -// Callbacks on behalf of the panel_context plugin. -// -// The panel_context plugin lets Panels be used in page manager. These -// callbacks allow the display editing system to use the page manager -// cache rather than the default display cache. They are routed by the cache -// key via panels_edit_cache_* functions. +/** + * Callbacks on behalf of the panel_context plugin. + * + * The panel_context plugin lets Panels be used in page manager. These + * callbacks allow the display editing system to use the page manager + * cache rather than the default display cache. They are routed by the cache + * key via panels_edit_cache_* functions. + */ /** * Get display edit cache on behalf of panel context. @@ -1645,7 +1804,7 @@ function panel_context_panels_cache_get($key) { ctools_include('common', 'panels'); ctools_include('context'); ctools_include('context-task-handler'); - // this loads the panel context inc even if we don't use the plugin. + // This loads the panel context inc even if we don't use the plugin. $plugin = page_manager_get_task_handler('panel_context'); list($task_name, $handler_name, $args, $q) = explode('::', $key, 4); @@ -1663,7 +1822,6 @@ function panel_context_panels_cache_get($key) { $cache = new stdClass(); $task = page_manager_get_task($page->task_id); - //ctools_context_handler_get_all_contexts($page->task, $page->subtask, $handler); $arguments = array(); if ($args) { $arguments = explode('\\', $args); @@ -1734,20 +1892,21 @@ function panel_context_panels_cache_break_lock($key, $cache) { ctools_object_cache_clear_all('page_manager_page', $page->task_name); } -// -------------------------------------------------------------------------- -// Callbacks on behalf of the panels page wizards -// -// The page wizards are a pluggable set of 'wizards' to make it easy to create -// specific types of pages based upon whatever someone felt like putting -// together. Since they will very often have content editing, we provide -// a generic mechanism to allow them to store their editing cache in the -// wizard cache. -// -// For them to use this mechanism, they just need to use: -// $cache = panels_edit_cache_get('panels_page_wizard:' . $plugin['name']); +/** + * Callbacks on behalf of the panels page wizards. + * + * The page wizards are a pluggable set of 'wizards' to make it easy to create + * specific types of pages based upon whatever someone felt like putting + * together. Since they will very often have content editing, we provide + * a generic mechanism to allow them to store their editing cache in the + * wizard cache. + * + * For them to use this mechanism, they just need to use: + * $cache = panels_edit_cache_get('panels_page_wizard:' . $plugin['name']);. + */ /** - * Get display edit cache for the panels mini export UI + * Get display edit cache for the panels mini export UI. * * The key is the second half of the key in this form: * panels_page_wizard:TASK_NAME:HANDLER_NAME; @@ -1807,8 +1966,9 @@ function panels_default_page_manager_pages_alter(&$pages) { } } -// -------------------------------------------------------------------------- -// General utility functions +/** + * General utility functions. + */ /** * Perform a drupal_goto on a destination that may be an array like url(). @@ -1818,30 +1978,33 @@ function panels_goto($destination) { return drupal_goto($destination); } else { - // Prevent notices by adding defaults + // Prevent notices by adding defaults. $destination += array( 'query' => NULL, 'fragment' => NULL, 'http_response_code' => NULL, ); - return drupal_goto($destination['path'], $destination['query'], $destination['fragment'], $destination['http_response_code']); + return drupal_goto( + $destination['path'], + $destination['query'], + $destination['fragment'], + $destination['http_response_code'] + ); } } /** - * For external use: Given a layout ID and a $content array, return the - * panel display. + * For external use: Given a layout ID and $content array, return panel display. * * The content array is filled in based upon the content available in the - * layout. If it's a two column with a content array defined like + * layout. If it's a two column with a content array defined like. * @code * array( * 'left' => t('Left side'), * 'right' => t('Right side') * ), - * @endcode * * Then the $content array should be * @code @@ -1849,7 +2012,6 @@ function panels_goto($destination) { * 'left' => $output_left, * 'right' => $output_right, * ) - * @endcode * * The output within each panel region can be either a single rendered * HTML string or an array of rendered HTML strings as though they were @@ -1863,7 +2025,7 @@ function panels_print_layout($layout, $content, $meta = 'standard') { $display->layout = is_array($layout) ? $layout['name'] : $layout; $display->content = $content; - // Get our simple renderer + // Get our simple renderer. $renderer = panels_get_renderer_handler('simple', $display); $renderer->meta_location = $meta; @@ -1879,29 +2041,28 @@ function _panels_builder_filter($layout) { /** * Implements hook_get_pane_links_alter(). - * - * add links to the Panels pane dropdown menu. */ function panels_get_pane_links_alter(&$links, $pane, $content_type) { - if ($pane->type === "block"){ + // Add links to the Panels pane dropdown menu. + if ($pane->type === "block") { $prefixed_name = $pane->subtype; - // breakup the subtype string into parts. + // Breakup the subtype string into parts. $exploded_subtype = explode('-', $pane->subtype); - // get the first part of the string. + // Get the first part of the string. $subtype_prefix = $exploded_subtype[0]; - // get the first part of the string and add a hyphen. + // Get the first part of the string and add a hyphen. $subtype_prefix_hyphen = $exploded_subtype[0] . '-'; - // remove the prefix block- to get the name. - $name_of_block = ltrim( $prefixed_name, $subtype_prefix_hyphen); + // Remove the prefix block- to get the name. + $name_of_block = ltrim($prefixed_name, $subtype_prefix_hyphen); - // check for user added menus created at /admin/structure/menu/add - // menus of that type have a subtype that is prefixed with menu-menu- - if (substr($prefixed_name, 0, 10) === "menu-menu-"){ - // remove the first prefix menu- from menu-menu- to get the name. + // Check for user added menus created at /admin/structure/menu/add + // menus of that type have a subtype that is prefixed with menu-menu-. + if (substr($prefixed_name, 0, 10) === "menu-menu-") { + // Remove the first prefix menu- from menu-menu- to get the name. $name_of_block = substr($prefixed_name, 5); $links['top'][] = array( @@ -1917,10 +2078,10 @@ function panels_get_pane_links_alter(&$links, $pane, $content_type) { ); } - // check for module provided menu blocks like Devels or Features - // menus of that type have a subtype that is prefixed with menu- - elseif(substr($prefixed_name, 0, 5) === "menu-"){ - // remove the first prefix menu- to get the name. + // Check for module provided menu blocks like Devels or Features + // menus of that type have a subtype that is prefixed with menu-. + elseif (substr($prefixed_name, 0, 5) === "menu-") { + // Remove the first prefix menu- to get the name. $name_of_block = substr($prefixed_name, 5); $links['top'][] = array( @@ -1936,9 +2097,9 @@ function panels_get_pane_links_alter(&$links, $pane, $content_type) { ); } - // check for system blocks with menu links - elseif(substr($prefixed_name, 0, 7) === "system-") { - // remove the first prefix system- to get the name + // Check for system blocks with menu links. + elseif (substr($prefixed_name, 0, 7) === "system-") { + // Remove the first prefix system- to get the name. $name_of_block = substr($prefixed_name, 7); $names_of_system_menus = menu_list_system_menus(); @@ -1949,7 +2110,7 @@ function panels_get_pane_links_alter(&$links, $pane, $content_type) { 'attributes' => array('target' => array('_blank')), ); - if (array_key_exists($name_of_block, $names_of_system_menus)){ + if (array_key_exists($name_of_block, $names_of_system_menus)) { $links['top'][] = array( 'title' => t('Edit menu links'), 'href' => url('admin/structure/menu/manage/' . $name_of_block, array('absolute' => TRUE)), @@ -1958,8 +2119,8 @@ function panels_get_pane_links_alter(&$links, $pane, $content_type) { } } - // for all other blocks without menus - else{ + // For all other blocks without menus. + else { $links['top'][] = array( 'title' => t('Edit block'), 'href' => url('admin/structure/block/manage/' . $subtype_prefix . '/' . $name_of_block . '/configure', array('absolute' => TRUE)), @@ -1969,13 +2130,14 @@ function panels_get_pane_links_alter(&$links, $pane, $content_type) { } } -// -------------------------------------------------------------------------- -// Deprecated functions -// -// Everything below this line will eventually go away. +/** + * Deprecated functions. + * + * Everything below this line will eventually go away. + */ /** - * panels path helper function + * Panels path helper function. */ function panels_get_path($file, $base_path = FALSE, $module = 'panels') { $output = $base_path ? base_path() : ''; @@ -1983,7 +2145,7 @@ function panels_get_path($file, $base_path = FALSE, $module = 'panels') { } /** - * Remove default sidebar related body classes and provide own css classes + * Remove default sidebar related body classes and provide own css classes. */ function panels_preprocess_html(&$vars) { $panel_body_css = &drupal_static('panel_body_css'); diff --git a/sites/all/modules/contrib/panels/panels/panels_ipe/css/panels_ipe-rtl.css b/sites/all/modules/contrib/panels/panels/panels_ipe/css/panels_ipe-rtl.css index abfc50e1..7aea8b10 100644 --- a/sites/all/modules/contrib/panels/panels/panels_ipe/css/panels_ipe-rtl.css +++ b/sites/all/modules/contrib/panels/panels/panels_ipe/css/panels_ipe-rtl.css @@ -1,4 +1,3 @@ - div.panels-ipe-handlebar-wrapper ul { float: right; text-align: left; diff --git a/sites/all/modules/contrib/panels/panels/panels_ipe/css/panels_ipe.css b/sites/all/modules/contrib/panels/panels/panels_ipe/css/panels_ipe.css index e7896e26..43685472 100644 --- a/sites/all/modules/contrib/panels/panels/panels_ipe/css/panels_ipe.css +++ b/sites/all/modules/contrib/panels/panels/panels_ipe/css/panels_ipe.css @@ -21,12 +21,12 @@ html.overlay-open body.panels-ipe { } div.panels-ipe-handlebar-wrapper { - border-bottom: 1px solid #CCC; + border-bottom: 1px solid #ccc; } .panels-ipe-editing div.panels-ipe-portlet-wrapper { margin-top: 1em; - border: 1px solid #CCC; + border: 1px solid #ccc; width: 100%; } @@ -40,7 +40,7 @@ div.panels-ipe-handlebar-wrapper { } .panels-ipe-editing div.panels-ipe-portlet-wrapper:hover { - border: 1px dashed #CCC; + border: 1px dashed #ccc; } .panels-ipe-editing .panels-ipe-sort-container { @@ -57,12 +57,12 @@ div.panels-ipe-handlebar-wrapper { .panels-ipe-editing .panels-ipe-sort-container .ui-sortable-placeholder { border: 2px dashed #999; - background-color: #FFFF99; + background-color: #ffff99; margin: 1em 0; -moz-border-radius: 0; - -khtml-border-radius: 0; - -webkit-border-radius: 0; - border-radius: 0; + -khtml-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; } div.panels-ipe-handlebar-wrapper ul { @@ -83,20 +83,19 @@ div.panels-ipe-handlebar-wrapper li { div.panels-ipe-draghandle, div.panels-ipe-nodraghandle { - background: #E9E9E9; - background-image: linear-gradient(bottom, #D5D5D5 0%, #FCFCFC 100%); - background-image: -o-linear-gradient(bottom, #D5D5D5 0%, #FCFCFC 100%); - background-image: -moz-linear-gradient(bottom, #D5D5D5 0%, #FCFCFC 100%); - background-image: -webkit-linear-gradient(bottom, #D5D5D5 0%, #FCFCFC 100%); - background-image: -ms-linear-gradient(bottom, #D5D5D5 0%, #FCFCFC 100%); + background: #e9e9e9; + background-image: linear-gradient(bottom, #d5d5d5 0%, #fcfcfc 100%); + background-image: -o-linear-gradient(bottom, #d5d5d5 0%, #fcfcfc 100%); + background-image: -moz-linear-gradient(bottom, #d5d5d5 0%, #fcfcfc 100%); + background-image: -webkit-linear-gradient(bottom, #d5d5d5 0%, #fcfcfc 100%); + background-image: -ms-linear-gradient(bottom, #d5d5d5 0%, #fcfcfc 100%); background-image: -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #D5D5D5), - color-stop(1, #FCFCFC) + linear, + left bottom, + left top, + color-stop(0, #d5d5d5), + color-stop(1, #fcfcfc) ); - padding: 8px 7px; } @@ -121,7 +120,7 @@ div.panels-ipe-placeholder { padding: .5em; position: relative; margin-top: .5em; - background-color: #ECFAFF; + background-color: #ecfaff; color: #999; font: 15px/1.3em "Open Sans", "Lucida Grande", Tahoma, Verdana, sans-serif; text-transform: none; @@ -152,9 +151,9 @@ div.panels-ipe-placeholder h3 { } div.panels-ipe-newblock { - -webkit-box-shadow: 0px 0 5px 5px #ECFAFF; - -moz-box-shadow: 0px 0 5px 5px #ECFAFF; - box-shadow: 0px 0 5px 5px #ECFAFF; + -webkit-box-shadow: 0px 0 5px 5px #ecfaff; + -moz-box-shadow: 0px 0 5px 5px #ecfaff; + box-shadow: 0px 0 5px 5px #ecfaff; position: absolute; right: 10px; top: 50%; @@ -174,32 +173,30 @@ div.panels-ipe-newblock a, span.panels-ipe-draghandle-icon { display: inline-block; border: 1px solid #ccc; - padding: 0 8px 1px; - font: bold 12px/32px 'Open Sans', 'Lucida Sans', 'Lucida Grande', verdana sans-serif; - text-decoration: none; - height: 33px; - color: #666; - cursor: pointer; - outline: none; - -moz-border-radius: 3px; - -khtml-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - - background: #FAFAFA; - background-image: linear-gradient(bottom, #E9EAEC 0%, #FAFAFA 100%); - background-image: -o-linear-gradient(bottom, #E9EAEC 0%, #FAFAFA 100%); - background-image: -moz-linear-gradient(bottom, #E9EAEC 0%, #FAFAFA 100%); - background-image: -webkit-linear-gradient(bottom, #E9EAEC 0%, #FAFAFA 100%); - background-image: -ms-linear-gradient(bottom, #E9EAEC 0%, #FAFAFA 100%); + padding: 0 8px 1px; + font: bold 12px/32px 'Open Sans', 'Lucida Sans', 'Lucida Grande', verdana sans-serif; + text-decoration: none; + height: 33px; + color: #666; + cursor: pointer; + outline: none; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + background: #fafafa; + background-image: linear-gradient(bottom, #e9eaec 0%, #fafafa 100%); + background-image: -o-linear-gradient(bottom, #e9eaec 0%, #fafafa 100%); + background-image: -moz-linear-gradient(bottom, #e9eaec 0%, #fafafa 100%); + background-image: -webkit-linear-gradient(bottom, #e9eaec 0%, #fafafa 100%); + background-image: -ms-linear-gradient(bottom, #e9eaec 0%, #fafafa 100%); background-image: -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #E9EAEC), - color-stop(1, #FAFAFA) + linear, + left bottom, + left top, + color-stop(0, #e9eaec), + color-stop(1, #fafafa) ); - -webkit-box-shadow: 0px 3px 3px 0px #d2d2d2; -moz-box-shadow: 0px 3px 3px 0px #d2d2d2; box-shadow: 0px 3px 3px 0px #d2d2d2; @@ -220,6 +217,10 @@ div.panels-ipe-handlebar-wrapper li.edit a span { background-image: url(../images/icon-settings.png); } +div.panels-ipe-handlebar-wrapper li.css a span { + background-image: url(../images/icon-css.png); +} + div.panels-ipe-handlebar-wrapper li.style a span, div.panels-ipe-newblock a.style span { background-image: url(../images/icon-style.png); @@ -244,18 +245,18 @@ div.panels-ipe-newblock a:hover, span.panels-ipe-draghandle-icon:hover, div.panels-ipe-handlebar-wrapper li a:focus, div.panels-ipe-newblock a:focus { - background: #E6E6E6; - background-image: linear-gradient(bottom, #C5C5C5 0%, #FAFAFA 100%); - background-image: -o-linear-gradient(bottom, #C5C5C5 0%, #FAFAFA 100%); - background-image: -moz-linear-gradient(bottom, #C5C5C5 0%, #FAFAFA 100%); - background-image: -webkit-linear-gradient(bottom, #C5C5C5 0%, #FAFAFA 100%); - background-image: -ms-linear-gradient(bottom, #C5C5C5 0%, #FAFAFA 100%); + background: #e6e6e6; + background-image: linear-gradient(bottom, #c5c5c5 0%, #fafafa 100%); + background-image: -o-linear-gradient(bottom, #c5c5c5 0%, #fafafa 100%); + background-image: -moz-linear-gradient(bottom, #c5c5c5 0%, #fafafa 100%); + background-image: -webkit-linear-gradient(bottom, #c5c5c5 0%, #fafafa 100%); + background-image: -ms-linear-gradient(bottom, #c5c5c5 0%, #fafafa 100%); background-image: -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #C5C5C5), - color-stop(1, #FAFAFA) + linear, + left bottom, + left top, + color-stop(0, #c5c5c5), + color-stop(1, #fafafa) ); } @@ -264,19 +265,18 @@ div.panels-ipe-dragtitle span:active, div.panels-ipe-newblock a:active, span.panels-ipe-draghandle-icon:active { outline: none; - background-image: linear-gradient(bottom, #FFFFFF 0%, #E9EAEC 100%); - background-image: -o-linear-gradient(bottom, #FFFFFF 0%, #E9EAEC 100%); - background-image: -moz-linear-gradient(bottom, #FFFFFF 0%, #E9EAEC 100%); - background-image: -webkit-linear-gradient(bottom, #FFFFFF 0%, #E9EAEC 100%); - background-image: -ms-linear-gradient(bottom, #FFFFFF 0%, #E9EAEC 100%); + background-image: linear-gradient(bottom, #ffffff 0%, #e9eaec 100%); + background-image: -o-linear-gradient(bottom, #ffffff 0%, #e9eaec 100%); + background-image: -moz-linear-gradient(bottom, #ffffff 0%, #e9eaec 100%); + background-image: -webkit-linear-gradient(bottom, #ffffff 0%, #e9eaec 100%); + background-image: -ms-linear-gradient(bottom, #ffffff 0%, #e9eaec 100%); background-image: -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #FFFFFF), - color-stop(1, #E9EAEC) + linear, + left bottom, + left top, + color-stop(0, #ffffff), + color-stop(1, #e9eaec) ); - -webkit-box-shadow: 0px 0px 0px 0px #fff; -moz-box-shadow: 0px 0px 0px 0px #fff; box-shadow: 0px 0px 0px 0px #fff; @@ -359,19 +359,18 @@ div.panels-ipe-control .form-submit { background-image: -moz-linear-gradient(bottom, #383838 0%, #666666 100%); background-image: -webkit-linear-gradient(bottom, #383838 0%, #666666 100%); background-image: -ms-linear-gradient(bottom, #383838 0%, #666666 100%); - background-image: -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #383838), - color-stop(1, #666666) + linear, + left bottom, + left top, + color-stop(0, #383838), + color-stop(1, #666666) ); border: 0; -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; - color: #CCC; + color: #ccc; display: inline-block; font: bold 12px/33px "Open Sans", "Lucida Grande", Tahoma, Verdana, sans-serif; height: 33px; @@ -382,10 +381,14 @@ div.panels-ipe-control .form-submit { padding: 0 0.8em 2px 34px; } -div.panels-ipe-control input.panels-ipe-save, div.panels-ipe-control input.panels-ipe-cancel, -div.panels-ipe-control input.panels-ipe-save:hover, div.panels-ipe-control input.panels-ipe-cancel:hover, -div.panels-ipe-control input.panels-ipe-save:focus, div.panels-ipe-control input.panels-ipe-cancel:focus, -div.panels-ipe-control input.panels-ipe-save:active, div.panels-ipe-control input.panels-ipe-cancel:active { +div.panels-ipe-control input.panels-ipe-save, +div.panels-ipe-control input.panels-ipe-cancel, +div.panels-ipe-control input.panels-ipe-save:hover, +div.panels-ipe-control input.panels-ipe-cancel:hover, +div.panels-ipe-control input.panels-ipe-save:focus, +div.panels-ipe-control input.panels-ipe-cancel:focus, +div.panels-ipe-control input.panels-ipe-save:active, +div.panels-ipe-control input.panels-ipe-cancel:active { background-repeat: no-repeat; } @@ -393,7 +396,7 @@ div.panels-ipe-pseudobutton-container a { height: 33px; padding: 0 0.8em; display: inline-block; - color: #CCC; + color: #ccc; text-decoration: none; } @@ -404,13 +407,12 @@ div.panels-ipe-control .panels-ipe-save { background-image: url(../images/icon-save.png), -moz-linear-gradient(bottom, #383838 0%, #666666 100%); background-image: url(../images/icon-save.png), -webkit-linear-gradient(bottom, #383838 0%, #666666 100%); background-image: url(../images/icon-save.png), -ms-linear-gradient(bottom, #383838 0%, #666666 100%); - background-image: url(../images/icon-save.png), -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #383838), - color-stop(1, #666666) + linear, + left bottom, + left top, + color-stop(0, #383838), + color-stop(1, #666666) ); } @@ -421,13 +423,12 @@ div.panels-ipe-control .panels-ipe-cancel { background-image: url(../images/icon-close.png), -moz-linear-gradient(bottom, #383838 0%, #666666 100%); background-image: url(../images/icon-close.png), -webkit-linear-gradient(bottom, #383838 0%, #666666 100%); background-image: url(../images/icon-close.png), -ms-linear-gradient(bottom, #383838 0%, #666666 100%); - background-image: url(../images/icon-close.png), -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #383838), - color-stop(1, #666666) + linear, + left bottom, + left top, + color-stop(0, #383838), + color-stop(1, #666666) ); } @@ -436,58 +437,55 @@ div.panels-ipe-control .form-submit:hover, div.panels-ipe-pseudobutton-container:focus, div.panels-ipe-control .form-submit:focus { background: #999999; - background-image: linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: -o-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: -moz-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: -webkit-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: -ms-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); + background-image: linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: -o-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: -moz-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: -webkit-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: -ms-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); background-image: -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #3D3D3D), - color-stop(1, #999999) + linear, + left bottom, + left top, + color-stop(0, #3d3d3d), + color-stop(1, #999999) ); - - color: #FFF; + color: #fff; } div.panels-ipe-pseudobutton-container a:hover, div.panels-ipe-pseudobutton-container a:focus { - color: #FFF; + color: #fff; } div.panels-ipe-control .panels-ipe-cancel:hover, div.panels-ipe-control .panels-ipe-cancel:focus { - background-image: url(../images/icon-close.png), linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: url(../images/icon-close.png), -o-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: url(../images/icon-close.png), -moz-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: url(../images/icon-close.png), -webkit-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: url(../images/icon-close.png), -ms-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - + background-image: url(../images/icon-close.png), linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: url(../images/icon-close.png), -o-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: url(../images/icon-close.png), -moz-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: url(../images/icon-close.png), -webkit-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: url(../images/icon-close.png), -ms-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); background-image: url(../images/icon-close.png), -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #3D3D3D), - color-stop(1, #999999) + linear, + left bottom, + left top, + color-stop(0, #3d3d3d), + color-stop(1, #999999) ); } div.panels-ipe-control .panels-ipe-save:hover, div.panels-ipe-control .panels-ipe-save:focus { - background-image: url(../images/icon-save.png), linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: url(../images/icon-save.png), -o-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: url(../images/icon-save.png), -moz-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: url(../images/icon-save.png), -webkit-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - background-image: url(../images/icon-save.png), -ms-linear-gradient(bottom, #3D3D3D 0%, #999999 100%); - + background-image: url(../images/icon-save.png), linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: url(../images/icon-save.png), -o-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: url(../images/icon-save.png), -moz-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: url(../images/icon-save.png), -webkit-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); + background-image: url(../images/icon-save.png), -ms-linear-gradient(bottom, #3d3d3d 0%, #999999 100%); background-image: url(../images/icon-save.png), -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #3D3D3D), - color-stop(1, #999999) + linear, + left bottom, + left top, + color-stop(0, #3d3d3d), + color-stop(1, #999999) ); } @@ -499,20 +497,18 @@ div.panels-ipe-control .form-submit:active { background-image: -moz-linear-gradient(bottom, #616161 0%, #333333 100%); background-image: -webkit-linear-gradient(bottom, #616161 0%, #333333 100%); background-image: -ms-linear-gradient(bottom, #616161 0%, #333333 100%); - background-image: -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #616161), - color-stop(1, #333333) + linear, + left bottom, + left top, + color-stop(0, #616161), + color-stop(1, #333333) ); - - color: #CCC; + color: #ccc; } div.panels-ipe-pseudobutton-container a:active { - color: #CCC; + color: #ccc; } div.panels-ipe-control .panels-ipe-cancel:active { @@ -521,13 +517,12 @@ div.panels-ipe-control .panels-ipe-cancel:active { background-image: url(../images/icon-close.png), -moz-linear-gradient(bottom, #616161 0%, #333333 100%); background-image: url(../images/icon-close.png), -webkit-linear-gradient(bottom, #616161 0%, #333333 100%); background-image: url(../images/icon-close.png), -ms-linear-gradient(bottom, #616161 0%, #333333 100%); - background-image: url(../images/icon-close.png), -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #616161), - color-stop(1, #333333) + linear, + left bottom, + left top, + color-stop(0, #616161), + color-stop(1, #333333) ); } @@ -537,19 +532,21 @@ div.panels-ipe-control .panels-ipe-save:active { background-image: url(../images/icon-save.png), -moz-linear-gradient(bottom, #616161 0%, #333333 100%); background-image: url(../images/icon-save.png), -webkit-linear-gradient(bottom, #616161 0%, #333333 100%); background-image: url(../images/icon-save.png), -ms-linear-gradient(bottom, #616161 0%, #333333 100%); - background-image: url(../images/icon-save.png), -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0, #616161), - color-stop(1, #333333) + linear, + left bottom, + left top, + color-stop(0, #616161), + color-stop(1, #333333) ); } -div.panels-ipe-control .panels-ipe-save, div.panels-ipe-control .panels-ipe-cancel, -div.panels-ipe-control .panels-ipe-save:hover, div.panels-ipe-control .panels-ipe-cancel:hover, -div.panels-ipe-control .panels-ipe-save:active, div.panels-ipe-control .panels-ipe-cancel:active { +div.panels-ipe-control .panels-ipe-save, +div.panels-ipe-control .panels-ipe-cancel, +div.panels-ipe-control .panels-ipe-save:hover, +div.panels-ipe-control .panels-ipe-cancel:hover, +div.panels-ipe-control .panels-ipe-save:active, +div.panels-ipe-control .panels-ipe-cancel:active { background-repeat: no-repeat; } @@ -572,6 +569,6 @@ form#panels-ipe-edit-control-form { text-align: center; } -.panels-ipe-dragbar-admin-title{ +.panels-ipe-dragbar-admin-title { font-size: 0.9em; } diff --git a/sites/all/modules/contrib/panels/panels/panels_ipe/includes/panels_ipe.pipelines.inc b/sites/all/modules/contrib/panels/panels/panels_ipe/includes/panels_ipe.pipelines.inc index 5bc3b032..49763df9 100644 --- a/sites/all/modules/contrib/panels/panels/panels_ipe/includes/panels_ipe.pipelines.inc +++ b/sites/all/modules/contrib/panels/panels/panels_ipe/includes/panels_ipe.pipelines.inc @@ -11,7 +11,7 @@ function panels_ipe_default_panels_renderer_pipeline() { $pipelines = array(); - $pipeline = new stdClass; + $pipeline = new stdClass(); $pipeline->disabled = FALSE; /* Edit this to true to make a default pipeline disabled initially */ $pipeline->api_version = 1; $pipeline->name = 'ipe'; diff --git a/sites/all/modules/contrib/panels/panels/panels_ipe/js/panels_ipe.js b/sites/all/modules/contrib/panels/panels/panels_ipe/js/panels_ipe.js index f6cae923..4f1fcaf8 100644 --- a/sites/all/modules/contrib/panels/panels/panels_ipe/js/panels_ipe.js +++ b/sites/all/modules/contrib/panels/panels/panels_ipe/js/panels_ipe.js @@ -50,7 +50,7 @@ Drupal.behaviors.PanelsIPE = { Drupal.PanelsIPE.editors[key].showContainer(); }); } - $('.panels-ipe-hide-bar').once('panels-ipe-hide-bar-processed').click(function() { + $('.panels-ipe-hide-bar').once('panels-ipe-hide-bar').click(function() { Drupal.PanelsIPE.editors[key].hideContainer(); }); Drupal.PanelsIPE.bindClickDelete(context); @@ -83,6 +83,7 @@ function DrupalPanelsIPE(cache_key, cfg) { items: 'div.panels-ipe-portlet-wrapper', handle: 'div.panels-ipe-draghandle', cancel: '.panels-ipe-nodrag', + tolerance: 'pointer', dropOnEmpty: true }, cfg.sortableOptions || {}); @@ -311,6 +312,7 @@ function DrupalPanelsIPE(cache_key, cfg) { // @todo this isn't ideal but I can't seem to figure out how to keep an unprocessed backup // that will later get processed. $('.ctools-use-modal-processed', ipe.topParent).removeClass('ctools-use-modal-processed'); + $('.panels-ipe-hide-bar-processed', ipe.topParent).removeClass('panels-ipe-hide-bar-processed'); $('.pane-delete-processed', ipe.topParent).removeClass('pane-delete-processed'); ipe.topParent.fadeIn('medium'); Drupal.attachBehaviors(); diff --git a/sites/all/modules/contrib/panels/panels/panels_ipe/panels_ipe.info b/sites/all/modules/contrib/panels/panels/panels_ipe/panels_ipe.info index 299c694a..0b520909 100644 --- a/sites/all/modules/contrib/panels/panels/panels_ipe/panels_ipe.info +++ b/sites/all/modules/contrib/panels/panels/panels_ipe/panels_ipe.info @@ -6,9 +6,9 @@ core = 7.x configure = admin/structure/panels files[] = panels_ipe.module -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-3.8" +; Information added by Drupal.org packaging script on 2017-02-06 +version = "7.x-3.9" core = "7.x" project = "panels" -datestamp = "1476582295" +datestamp = "1486394388" diff --git a/sites/all/modules/contrib/panels/panels/panels_ipe/panels_ipe.module b/sites/all/modules/contrib/panels/panels/panels_ipe/panels_ipe.module index 35dfa6f5..0e33fd15 100644 --- a/sites/all/modules/contrib/panels/panels/panels_ipe/panels_ipe.module +++ b/sites/all/modules/contrib/panels/panels/panels_ipe/panels_ipe.module @@ -1,5 +1,9 @@ array( 'class' => array('ctools-use-modal', 'panels-ipe-hide-bar'), 'title' => isset($content_type['edit text']) ? $content_type['edit text'] : t('Settings'), - // 'id' => "pane-edit-panel-pane-$pane->pid", + // 'id' => "pane-edit-panel-pane-$pane->pid",. ), ); } - // Add option to configure style in IPE + // Add option to configure style in IPE. if (user_access('administer panels pane styles')) { $vars['links']['style'] = array( 'title' => '' . t('Style') . '', @@ -108,8 +112,21 @@ function template_preprocess_panels_ipe_pane_wrapper(&$vars) { ); } + // Add option to configure CSS. + if (user_access('administer advanced pane settings')) { + $vars['links']['css'] = array( + 'title' => '' . t('CSS') . '', + 'href' => $renderer->get_url('pane-css', $pane->pid), + 'html' => TRUE, + 'attributes' => array( + 'class' => array('ctools-use-modal', 'panels-ipe-hide-bar'), + 'title' => t('CSS'), + ), + ); + } + // Deleting is managed entirely in the js; this is just an attachment point - // for it + // for it. $vars['links']['delete'] = array( 'title' => '' . t('Delete') . '', 'href' => '#', @@ -124,7 +141,7 @@ function template_preprocess_panels_ipe_pane_wrapper(&$vars) { $context = array( 'pane' => $pane, 'display' => $display, - 'renderer' => $renderer + 'renderer' => $renderer, ); drupal_alter('panels_ipe_pane_links', $vars['links'], $context); @@ -140,12 +157,12 @@ function theme_panels_ipe_pane_wrapper($vars) { ); $type = ctools_get_content_type($pane->type); - $title ='' . ctools_content_admin_title($type, $pane->subtype, $pane->configuration, $display->context) . ''; + $title = '' . ctools_content_admin_title($type, $pane->subtype, $pane->configuration, $display->context) . ''; $links = theme('links', array('links' => $vars['links'], 'attributes' => $attributes)); if (!empty($pane->locks['type']) && $pane->locks['type'] == 'immovable') { - $links = '
' . $links .$title .'
'; + $links = '
' . $links . $title . '
'; } else { $links = '
' . $links . $title . '
'; @@ -164,9 +181,9 @@ function template_preprocess_panels_ipe_add_pane_button(&$vars) { $region_id = $vars['region_id']; $display = $vars['display']; $renderer = $vars['renderer']; - $vars['links'] = ''; + $vars['links'] = array(); - // Add option to configure style in IPE + // Add option to configure style in IPE. if (user_access('administer panels region styles')) { $vars['links']['style'] = array( 'title' => '' . t('Region style') . '', @@ -179,7 +196,7 @@ function template_preprocess_panels_ipe_add_pane_button(&$vars) { ); } - // Add option to add items in the IPE + // Add option to add items in the IPE. $vars['links']['add-pane'] = array( 'title' => '' . t('Add new pane') . '', 'href' => $renderer->get_url('select-content', $region_id), @@ -226,7 +243,7 @@ function panels_ipe_toolbar_add_button($cache_key, $id, $button) { } /** - * Implementation of hook_footer() + * Implementation of hook_footer(). * * Adds the IPE control container. * diff --git a/sites/all/modules/contrib/panels/panels/panels_ipe/plugins/display_renderers/ipe.inc b/sites/all/modules/contrib/panels/panels/panels_ipe/plugins/display_renderers/ipe.inc index ab63f9ee..e369abf9 100644 --- a/sites/all/modules/contrib/panels/panels/panels_ipe/plugins/display_renderers/ipe.inc +++ b/sites/all/modules/contrib/panels/panels/panels_ipe/plugins/display_renderers/ipe.inc @@ -1,5 +1,9 @@ 'panels_renderer_ipe', ); diff --git a/sites/all/modules/contrib/panels/panels/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php b/sites/all/modules/contrib/panels/panels/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php index 470c4e2e..361e53e9 100644 --- a/sites/all/modules/contrib/panels/panels/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php +++ b/sites/all/modules/contrib/panels/panels/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php @@ -1,5 +1,9 @@ clean_key = ctools_cleanstring($this->display->cache_key); $button = array( @@ -91,8 +94,8 @@ class panels_renderer_ipe extends panels_renderer_editor { 'ipe_cache_key' => $this->clean_key, ), - '#prefix' => '
', - '#suffix' => '
', + '#prefix' => '
', + '#suffix' => '
', ); panels_ipe_toolbar_add_button($this->display->cache_key, 'panels-ipe-change-layout', $button); @@ -156,13 +159,13 @@ class panels_renderer_ipe extends panels_renderer_editor { if (empty($pane->IPE_empty)) { // Add an inner layer wrapper to the pane content before placing it into - // draggable portlet + // draggable portlet. $output = "
$output
"; } else { $output = "
$output
"; } - // Hand it off to the plugin/theme for placing draggers/buttons + // Hand it off to the plugin/theme for placing draggers/buttons. $output = theme('panels_ipe_pane_wrapper', array('output' => $output, 'pane' => $pane, 'display' => $this->display, 'renderer' => $this)); if (!empty($pane->locks['type']) && $pane->locks['type'] == 'immovable') { @@ -259,13 +262,17 @@ class panels_renderer_ipe extends panels_renderer_editor { // Break the lock. panels_edit_cache_break_lock($this->cache); } - } + } + /** + * + */ function get_panels_storage_op_for_ajax($method) { switch ($method) { case 'ajax_unlock_ipe': case 'ajax_save_form': return 'update'; + case 'ajax_change_layout': case 'ajax_set_layout': return 'change layout'; @@ -299,7 +306,7 @@ class panels_renderer_ipe extends panels_renderer_editor { // Reset the $_POST['ajax_html_ids'] values to preserve // proper IDs on form elements when they are rebuilt - // by the Panels IPE without refreshing the page + // by the Panels IPE without refreshing the page. $_POST['ajax_html_ids'] = array(); $form_state = array( @@ -308,7 +315,7 @@ class panels_renderer_ipe extends panels_renderer_editor { 'content_types' => $this->cache->content_types, 'rerender' => FALSE, 'no_redirect' => TRUE, - // Panels needs this to make sure that the layout gets callbacks + // Panels needs this to make sure that the layout gets callbacks. 'layout' => $this->plugins['layout'], ); @@ -348,6 +355,9 @@ class panels_renderer_ipe extends panels_renderer_editor { $buttons = &drupal_static('panels_ipe_toolbar_buttons', array()); $output = theme('panels_ipe_toolbar', array('buttons' => $buttons)); $this->commands[] = ajax_command_replace('#panels-ipe-control-container', $output); + + $storage_id = $this->cache->display->storage_id; + cache_clear_all('panels_mini_load:' . $storage_id, 'cache_panels', TRUE); } else { // Cancelled. Clear the cache. @@ -383,13 +393,13 @@ class panels_renderer_ipe extends panels_renderer_editor { $layouts = panels_common_get_allowed_layouts('panels_page'); } - // Filter out builders + // Filter out builders. $layouts = array_filter($layouts, '_panels_builder_filter'); // Let other modules filter the layouts. drupal_alter('panels_layouts_available', $layouts); - // Define the current layout + // Define the current layout. $current_layout = $this->plugins['layout']['name']; $output = panels_common_print_layout_links($layouts, $this->get_url('set_layout'), array('attributes' => array('class' => array('use-ajax'))), $current_layout); @@ -414,7 +424,7 @@ class panels_renderer_ipe extends panels_renderer_editor { // Reset the $_POST['ajax_html_ids'] values to preserve // proper IDs on form elements when they are rebuilt - // by the Panels IPE without refreshing the page + // by the Panels IPE without refreshing the page. $_POST['ajax_html_ids'] = array(); $output = drupal_build_form('panels_change_layout', $form_state); @@ -485,6 +495,7 @@ class panels_renderer_ipe extends panels_renderer_editor { 'key' => $this->clean_key, ); } + } /** @@ -493,8 +504,7 @@ class panels_renderer_ipe extends panels_renderer_editor { function panels_ipe_edit_control_form($form, &$form_state) { $display = &$form_state['display']; // @todo -- this should be unnecessary as we ensure cache_key is set in add_meta() -// $display->cache_key = isset($display->cache_key) ? $display->cache_key : $display->did; - + // $display->cache_key = isset($display->cache_key) ? $display->cache_key : $display->did; // Annoyingly, theme doesn't have access to form_state so we have to do this. $form['#display'] = $display; diff --git a/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.info b/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.info index 49558562..b6b915e8 100644 --- a/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.info +++ b/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.info @@ -4,9 +4,10 @@ package = "Panels" dependencies[] = panels core = 7.x files[] = plugins/export_ui/panels_mini_ui.class.php -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-3.8" + +; Information added by Drupal.org packaging script on 2017-02-06 +version = "7.x-3.9" core = "7.x" project = "panels" -datestamp = "1476582295" +datestamp = "1486394388" diff --git a/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.install b/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.install index b3239dde..160a58b9 100644 --- a/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.install +++ b/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.install @@ -1,5 +1,9 @@ did); @@ -127,7 +131,7 @@ function panels_mini_uninstall() { * Implements hook_update_dependencies(). */ function panels_mini_update_dependencies() { - // Update 7301 requires panels storage support + // Update 7301 requires panels storage support. $dependencies['panels_mini'][7301] = array( 'panels' => 7305, ); @@ -140,19 +144,19 @@ function panels_mini_update_dependencies() { */ function panels_mini_update_7301() { if (!isset($sandbox['progress'])) { - // Initialize batch update information. - $sandbox['progress'] = (float)0; - $sandbox['current_did'] = -1; - $sandbox['max'] = db_query("SELECT COUNT(pd.did) + // Initialize batch update information. + $sandbox['progress'] = (float) 0; + $sandbox['current_did'] = -1; + $sandbox['max'] = db_query("SELECT COUNT(pd.did) FROM {panels_display} pd JOIN {panels_mini} pm ON pm.did = pd.did WHERE pd.storage_type = ''")->fetchField(); - } + } // Set a limit of how many rows to process per batch. $limit = 1000; - // Run the query + // Run the query. $result = db_query_range("SELECT pd.did, pm.name FROM {panels_display} pd JOIN {panels_mini} pm ON pm.did = pd.did diff --git a/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.module b/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.module index 2139de1c..485d9c71 100644 --- a/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.module +++ b/sites/all/modules/contrib/panels/panels/panels_mini/panels_mini.module @@ -39,7 +39,7 @@ function panels_mini_menu() { 'type' => MENU_LOCAL_TASK, ); - // Also provide settings on the main panel UI + // Also provide settings on the main panel UI. $items['admin/structure/panels/settings/panels-mini'] = array( 'title' => 'Mini panels', 'page callback' => 'panels_mini_settings', @@ -59,8 +59,7 @@ function panels_mini_settings() { } // --------------------------------------------------------------------------- -// Allow the rest of the system access to mini panels - +// Allow the rest of the system access to mini panels. /** * Implementation of hook_block_info(). */ @@ -91,7 +90,7 @@ function panels_mini_block_info() { * @see panels_mini_panels_mini_content_type_render(). */ function panels_mini_block_view($delta = 0) { - // static recursion protection. + // Static recursion protection. static $viewing = array(); if (!empty($viewing[$delta])) { return; @@ -114,7 +113,7 @@ function panels_mini_block_view($delta = 0) { } drupal_alter('panels_mini_block_contexts', $contexts, $panel_mini); - $panel_mini->context = $panel_mini->display->context = ctools_context_load_contexts($panel_mini, FALSE, $contexts); + $panel_mini->context = $panel_mini->display->context = ctools_context_load_contexts($panel_mini, FALSE, $contexts); $panel_mini->display->css_id = panels_mini_get_id($panel_mini->name); $panel_mini->display->owner = $panel_mini; @@ -133,7 +132,7 @@ function panels_mini_block_view($delta = 0) { function panels_mini_block_configure($delta = 0) { return array( 'admin_shortcut' => array( - '#markup' => l(t('Manage this mini-panel'), 'admin/structure/mini-panels/list/' . $delta . '/edit') + '#markup' => l(t('Manage this mini-panel'), 'admin/structure/mini-panels/list/' . $delta . '/edit'), ), ); } @@ -241,7 +240,6 @@ function panels_mini_get_id($name) { // --------------------------------------------------------------------------- // Database functions. - /** * Create a new page with defaults appropriately set from schema. */ @@ -331,7 +329,7 @@ function panels_mini_load_all($reset = FALSE) { $dids[$mini->did] = $mini->name; } else { - // Translate old style titles into new titles. + // Translate old style titles into new titles. if (!empty($mini->title) && empty($mini->display->title)) { $mini->display->title = $mini->title; } @@ -400,7 +398,7 @@ function panels_mini_delete($mini) { function panels_mini_export($mini, $indent = '') { ctools_include('export'); $output = ctools_export_object('panels_mini', $mini, $indent); - // Export the primary display + // Export the primary display. $display = !empty($mini->display) ? $mini->display : panels_load_display($mini->did); $output .= panels_export_display($display, $indent); $output .= $indent . '$mini->display = $display' . ";\n"; @@ -462,7 +460,7 @@ function _panels_mini_panels_cache_get($key) { } /** - * Get display edit cache for the panels mini export UI + * Get display edit cache for the panels mini export UI. * * The key is the second half of the key in this form: * panels_mini:TASK_NAME:HANDLER_NAME; diff --git a/sites/all/modules/contrib/panels/panels/panels_mini/plugins/content_types/panels_mini.inc b/sites/all/modules/contrib/panels/panels/panels_mini/plugins/content_types/panels_mini.inc index 2d092bed..e1760012 100644 --- a/sites/all/modules/contrib/panels/panels/panels_mini/plugins/content_types/panels_mini.inc +++ b/sites/all/modules/contrib/panels/panels/panels_mini/plugins/content_types/panels_mini.inc @@ -6,7 +6,6 @@ * need to be broken out into a .inc file, it's convenient that we do so * that we don't load code unnecessarily. Plus it demonstrates plugins * in modules other than Panels itself. - * */ /** @@ -105,7 +104,7 @@ function panels_mini_panels_mini_content_type_render($subtype, $conf, $panel_arg $mini->display->args = $panel_args; $mini->display->css_id = panels_mini_get_id($subtype); $mini->display->owner = $mini; - // unique ID of this mini. + // Unique ID of this mini. $mini->display->owner->id = $mini->name; $block = new stdClass(); diff --git a/sites/all/modules/contrib/panels/panels/panels_mini/plugins/export_ui/panels_mini.inc b/sites/all/modules/contrib/panels/panels/panels_mini/plugins/export_ui/panels_mini.inc index 46cb8947..78e1d84d 100644 --- a/sites/all/modules/contrib/panels/panels/panels_mini/plugins/export_ui/panels_mini.inc +++ b/sites/all/modules/contrib/panels/panels/panels_mini/plugins/export_ui/panels_mini.inc @@ -1,5 +1,9 @@ 'panels_mini', 'access' => 'administer mini panels', @@ -38,4 +42,3 @@ $plugin = array( ), ); - diff --git a/sites/all/modules/contrib/panels/panels/panels_mini/plugins/export_ui/panels_mini_ui.class.php b/sites/all/modules/contrib/panels/panels/panels_mini/plugins/export_ui/panels_mini_ui.class.php index cff8fe63..5b988daa 100644 --- a/sites/all/modules/contrib/panels/panels/panels_mini/plugins/export_ui/panels_mini_ui.class.php +++ b/sites/all/modules/contrib/panels/panels/panels_mini/plugins/export_ui/panels_mini_ui.class.php @@ -1,5 +1,8 @@ sorts[$item->name] = empty($item->disabled) . $item->admin_title; break; + case 'title': $this->sorts[$item->name] = $item->admin_title; break; + case 'name': $this->sorts[$item->name] = $item->name; break; + case 'category': $this->sorts[$item->name] = ($item->category ? $item->category : t('Mini panels')) . $item->admin_title; break; + case 'layout': $this->sorts[$item->name] = $item->display->layout . $item->admin_title; break; + case 'storage': $this->sorts[$item->name] = $item->type . $item->admin_title; break; @@ -115,7 +123,7 @@ class panels_mini_ui extends ctools_export_ui { } function edit_form(&$form, &$form_state) { - // Get the basic edit form + // Get the basic edit form. parent::edit_form($form, $form_state); // Set the admin title machine name length. @@ -295,4 +303,5 @@ class panels_mini_ui extends ctools_export_ui { panels_edit_display_form_submit($form, $form_state); $form_state['item']->display = $form_state['display']; } + } diff --git a/sites/all/modules/contrib/panels/panels/panels_mini/plugins/panels_storage/panels_mini.inc b/sites/all/modules/contrib/panels/panels/panels_mini/plugins/panels_storage/panels_mini.inc index c9ba35d7..2ba46be6 100644 --- a/sites/all/modules/contrib/panels/panels/panels_mini/plugins/panels_storage/panels_mini.inc +++ b/sites/all/modules/contrib/panels/panels/panels_mini/plugins/panels_storage/panels_mini.inc @@ -5,7 +5,7 @@ * Provides a panels_storage plugin for mini panels. */ -// Plugin definition +// Plugin definition. $plugin = array( 'access callback' => 'panels_mini_panels_storage_access', ); diff --git a/sites/all/modules/contrib/panels/panels/panels_node/panels_node.info b/sites/all/modules/contrib/panels/panels/panels_node/panels_node.info index 98bf72db..04543e42 100644 --- a/sites/all/modules/contrib/panels/panels/panels_node/panels_node.info +++ b/sites/all/modules/contrib/panels/panels/panels_node/panels_node.info @@ -6,9 +6,9 @@ configure = admin/structure/panels core = 7.x files[] = panels_node.module -; Information added by Drupal.org packaging script on 2016-10-16 -version = "7.x-3.8" +; Information added by Drupal.org packaging script on 2017-02-06 +version = "7.x-3.9" core = "7.x" project = "panels" -datestamp = "1476582295" +datestamp = "1486394388" diff --git a/sites/all/modules/contrib/panels/panels/panels_node/panels_node.install b/sites/all/modules/contrib/panels/panels/panels_node/panels_node.install index 1af682fc..baaebd71 100644 --- a/sites/all/modules/contrib/panels/panels/panels_node/panels_node.install +++ b/sites/all/modules/contrib/panels/panels/panels_node/panels_node.install @@ -1,5 +1,9 @@ 7305, ); @@ -69,7 +73,7 @@ function panels_node_update_dependencies() { } /** - * Implementation of hook_update to handle adding a pipeline + * Implementation of hook_update to handle adding a pipeline. */ function panels_node_update_6001() { $ret = array(); @@ -125,19 +129,19 @@ function panels_node_update_7301() { */ function panels_node_update_7302() { if (!isset($sandbox['progress'])) { - // Initialize batch update information. - $sandbox['progress'] = (float)0; - $sandbox['current_did'] = -1; - $sandbox['max'] = db_query("SELECT COUNT(pd.did) + // Initialize batch update information. + $sandbox['progress'] = (float) 0; + $sandbox['current_did'] = -1; + $sandbox['max'] = db_query("SELECT COUNT(pd.did) FROM {panels_display} pd JOIN {panels_node} pn ON pn.did = pd.did WHERE pd.storage_type = ''")->fetchField(); - } + } // Set a limit of how many rows to process per batch. $limit = 1000; - // Run the query + // Run the query. $result = db_query_range("SELECT pd.did, pn.nid FROM {panels_display} pd JOIN {panels_node} pn ON pn.did = pd.did diff --git a/sites/all/modules/contrib/panels/panels/panels_node/panels_node.module b/sites/all/modules/contrib/panels/panels/panels_node/panels_node.module index bc9d56f9..e93fe264 100644 --- a/sites/all/modules/contrib/panels/panels/panels_node/panels_node.module +++ b/sites/all/modules/contrib/panels/panels/panels_node/panels_node.module @@ -1,6 +1,4 @@ panels_node)) { @@ -113,8 +110,7 @@ function panels_node_add() { } // --------------------------------------------------------------------------- -// Node hooks - +// Node hooks. /** * Implementation of hook_node_info(). */ @@ -202,7 +198,7 @@ function panels_node_hook_form(&$node, &$form_state) { ); // Support for different rendering pipelines - // Mostly borrowed from panel_context.inc + // Mostly borrowed from panel_context.inc. $pipelines = panels_get_renderer_pipelines(); $options = array(); @@ -257,7 +253,7 @@ function panels_node_hook_insert(&$node) { // Special handling for nodes being imported from an export.module data dump. if (!empty($node->export_display)) { - // This works by overriding the $display set above + // This works by overriding the $display set above. eval($node->export_display); unset($node->export_display); } @@ -336,8 +332,7 @@ function panels_node_hook_view($node, $view_mode) { } // --------------------------------------------------------------------------- -// Administrative pages - +// Administrative pages. /** * Settings for panel nodes. */ @@ -347,8 +342,7 @@ function panels_node_settings() { } // --------------------------------------------------------------------------- -// Meat of the Panels API; almost completely passing through to panels.module - +// Meat of the Panels API; almost completely passing through to panels.module. /** * Pass through to the panels layout editor. */ @@ -385,7 +379,7 @@ function panels_node_get_context(&$node) { } /** - * Implementation of hook_export_node_alter() + * Implementation of hook_export_node_alter(). * * Integrate with export.module for saving panel_nodes into code. */ @@ -423,13 +417,12 @@ function panels_node_panels_ipe_access($display) { // Only allow access to use the IPE if the user has 'update' access to // the underlying node. $node = $display->context['panel-node']->data; - return node_access('update', $node); + return node_access('update', $node); } } // --------------------------------------------------------------------------- // Callbacks for panel caching. - /** * Get display edit cache for a panel node being edited. * @@ -451,7 +444,7 @@ function panels_node_panels_cache_get($nid) { $cache->display->css_id = $node->panels_node['css_id']; $cache->display->context = panels_node_get_context($node); $cache->display->cache_key = 'panels_node:' . $node->nid; - $cache->content_types = panels_common_get_allowed_types('panels_node', $cache->display->context); + $cache->content_types = panels_common_get_allowed_types('panels_node', $cache->display->context); $cache->allwed_layouts = panels_common_get_allowed_layouts('panels_node'); } diff --git a/sites/all/modules/contrib/panels/panels/panels_node/plugins/panels_storage/panels_node.inc b/sites/all/modules/contrib/panels/panels/panels_node/plugins/panels_storage/panels_node.inc index a7a7a3b2..1696fc04 100644 --- a/sites/all/modules/contrib/panels/panels/panels_node/plugins/panels_storage/panels_node.inc +++ b/sites/all/modules/contrib/panels/panels/panels_node/plugins/panels_storage/panels_node.inc @@ -5,7 +5,7 @@ * Provides a panels_storage plugin for panels node. */ -// Plugin definition +// Plugin definition. $plugin = array( 'access callback' => 'panels_node_panels_storage_access', ); diff --git a/sites/all/modules/contrib/panels/panels/plugins/cache/simple.inc b/sites/all/modules/contrib/panels/panels/plugins/cache/simple.inc index 6b76678c..26682c66 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/cache/simple.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/cache/simple.inc @@ -5,7 +5,7 @@ * Provides a simple time-based caching option for panel panes. */ -// Plugin definition +// Plugin definition. $plugin = array( 'title' => t("Simple cache"), 'description' => t('Simple caching is a time-based cache. This is a hard limit, and once cached it will remain that way until the time limit expires.'), @@ -128,7 +128,7 @@ function panels_simple_cache_get_id($conf, $display, $args, $contexts, $pane) { $id .= ':' . $language->language; } - if(!empty($pane->configuration['use_pager']) && !empty($_GET['page'])) { + if (!empty($pane->configuration['use_pager']) && !empty($_GET['page'])) { $id .= ':p' . check_plain($_GET['page']); } @@ -158,4 +158,3 @@ function panels_simple_cache_settings_form($conf, $display, $pid) { return $form; } - diff --git a/sites/all/modules/contrib/panels/panels/plugins/display_renderers/editor.inc b/sites/all/modules/contrib/panels/panels/plugins/display_renderers/editor.inc index 6bfdf845..c570e2ad 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/display_renderers/editor.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/display_renderers/editor.inc @@ -1,5 +1,9 @@ 'panels_renderer_editor', ); diff --git a/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_editor.class.php b/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_editor.class.php index 0d3dfa6b..897f983e 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_editor.class.php +++ b/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_editor.class.php @@ -4,7 +4,6 @@ * @file * Class file to control the main Panels editor. */ - class panels_renderer_editor extends panels_renderer_standard { /** @@ -20,8 +19,10 @@ class panels_renderer_editor extends panels_renderer_standard { * builder that do not actually have real content. */ var $no_edit_links = FALSE; - // ------------------------------------------------------------------------- - // Display edit rendering. + // -------------------------------------------------------------------------. + /** + * Display edit rendering. + */ function edit() { $form_state = array( @@ -119,7 +120,6 @@ class panels_renderer_editor extends panels_renderer_standard { $buttons = $this->get_pane_links($pane, $content_type); // Render administrative buttons for the pane. - $block = new stdClass(); if (empty($content_type)) { $block->title = '' . t('Missing content type') . ''; @@ -136,7 +136,7 @@ class panels_renderer_editor extends panels_renderer_standard { $settings['Panels']['RegionLock'][$pane->pid] = $pane->locks['regions']; drupal_add_js($settings, 'setting'); } - else if ($pane->locks['type'] == 'immovable') { + elseif ($pane->locks['type'] == 'immovable') { $grabber_class = 'grab-title not-grabber'; } } @@ -163,15 +163,15 @@ class panels_renderer_editor extends panels_renderer_standard { $output .= '' . $buttons . ''; } $output .= '' . $title . ''; - $output .= '
'; // grabber - + $output .= ''; + // Grabber. $output .= '
'; $output .= '
' . $block->title . '
'; $output .= '
' . filter_xss_admin(render($block->content)) . '
'; - $output .= '
'; // panel-pane-collapsible - - $output .= ''; // panel-pane - + $output .= ''; + // panel-pane-collapsible. + $output .= ''; + // panel-pane. return $output; } @@ -360,7 +360,7 @@ class panels_renderer_editor extends panels_renderer_standard { if (user_access('administer pane access')) { $contexts = $this->display->context; - // Make sure we have the logged in user context + // Make sure we have the logged in user context. if (!isset($contexts['logged-in-user'])) { $contexts['logged-in-user'] = ctools_access_get_loggedin_context(); } @@ -408,9 +408,11 @@ class panels_renderer_editor extends panels_renderer_standard { case 'immovable': $lock_method = t('Immovable'); break; + case 'regions': $lock_method = t('Regions'); break; + case 'none': default: $lock_method = t('No lock'); @@ -464,7 +466,7 @@ class panels_renderer_editor extends panels_renderer_standard { ); // Allow others to add/remove links from pane context menu. - // Grouped by 'top', 'style', 'visibility', 'lock', 'cache' and 'bottom' + // Grouped by 'top', 'style', 'visibility', 'lock', 'cache' and 'bottom'. drupal_alter('get_pane_links', $links, $pane, $content_type); $dropdown_links = $links['top']; @@ -499,7 +501,6 @@ class panels_renderer_editor extends panels_renderer_standard { // ----------------------------------------------------------------------- // Display edit AJAX callbacks and helpers. - /** * Generate a URL path for the AJAX editor. */ @@ -612,7 +613,7 @@ class panels_renderer_editor extends panels_renderer_standard { if (!empty($content_type['top level'])) { $category = 'root'; } - else if (isset($content_type['category'])) { + elseif (isset($content_type['category'])) { if (is_array($content_type['category'])) { list($category, $weight) = $content_type['category']; } @@ -668,7 +669,7 @@ class panels_renderer_editor extends panels_renderer_standard { } } - // Now sort + // Now sort. natcasesort($category_names); foreach ($category_names as $category => $name) { $output[$category] = $categories[$category]; @@ -733,17 +734,17 @@ class panels_renderer_editor extends panels_renderer_standard { $pane = $form_state['pane']; unset($this->cache->new_pane); - // Add the pane to the display + // Add the pane to the display. $this->display->add_pane($pane, $region); panels_edit_cache_set($this->cache); - // Tell the client to draw the pane + // Tell the client to draw the pane. $this->command_add_pane($pane); // Dismiss the modal. $this->commands[] = ctools_modal_command_dismiss(); } - else if (!empty($form_state['cancel'])) { + elseif (!empty($form_state['cancel'])) { // If cancelling, return to the activity. list($category_key, $category) = $this->get_category($subtype); $this->ajax_select_content($region, $category_key); @@ -786,14 +787,14 @@ class panels_renderer_editor extends panels_renderer_standard { 'cancel callback' => 'panels_ajax_edit_pane_cancel', ); - $output = ctools_content_form('edit', $form_info, $form_state, $content_type, $pane->subtype, $subtype, $pane->configuration, $step); + $output = ctools_content_form('edit', $form_info, $form_state, $content_type, $pane->subtype, $subtype, $pane->configuration, $step); // If $rc is FALSE, there was no actual form. if ($output === FALSE || !empty($form_state['cancel'])) { // Dismiss the modal. $this->commands[] = ctools_modal_command_dismiss(); } - else if (!empty($form_state['complete'])) { + elseif (!empty($form_state['complete'])) { // References get blown away with AJAX caching. This will fix that. $this->cache->display->content[$pid] = $form_state['pane']; @@ -852,7 +853,7 @@ class panels_renderer_editor extends panels_renderer_standard { $conf = &$this->display->cache; $title = t('Cache method for this display'); } - else if (!empty($this->display->content[$pid])) { + elseif (!empty($this->display->content[$pid])) { $pane = &$this->display->content[$pid]; $subtype = ctools_content_get_subtype($pane->type, $pane->subtype); $conf = &$pane->cache; @@ -896,7 +897,7 @@ class panels_renderer_editor extends panels_renderer_standard { else { $this->cache->method = $form_state['method']; panels_edit_cache_set($this->cache); - // send them to next form. + // Send them to next form. return $this->ajax_cache_settings($pid); } } @@ -917,7 +918,7 @@ class panels_renderer_editor extends panels_renderer_standard { $conf = &$this->display->cache; $title = t('Cache settings for this display'); } - else if (!empty($this->display->content[$pid])) { + elseif (!empty($this->display->content[$pid])) { $pane = &$this->display->content[$pid]; $subtype = ctools_content_get_subtype($pane->type, $pane->subtype); @@ -979,7 +980,8 @@ class panels_renderer_editor extends panels_renderer_standard { break; case 'region': - $style = isset($this->display->panel_settings[$pid]['style']) ? $this->display->panel_settings[$pid]['style'] : '-1'; // -1 signifies to use the default setting. + $style = isset($this->display->panel_settings[$pid]['style']) ? $this->display->panel_settings[$pid]['style'] : '-1'; + // -1 signifies to use the default setting. $title = t('Panel style for region "!region"', array('!region' => $this->plugins['layout']['regions'][$pid])); break; @@ -1032,7 +1034,7 @@ class panels_renderer_editor extends panels_renderer_standard { } // If there's no settings form, just change the style and exit. - switch($type) { + switch ($type) { case 'display': $this->display->panel_settings['style'] = $form_state['style']; if (isset($this->display->panel_settings['style_settings']['default'])) { @@ -1062,7 +1064,7 @@ class panels_renderer_editor extends panels_renderer_standard { if ($type == 'pane') { $this->command_update_pane($pane); } - else if ($type == 'region') { + elseif ($type == 'region') { $this->command_update_region_links($pid); } else { @@ -1075,7 +1077,7 @@ class panels_renderer_editor extends panels_renderer_standard { panels_edit_cache_set($this->cache); } - // send them to next form. + // Send them to next form. return $this->ajax_style_settings($type, $pid); } } @@ -1214,11 +1216,11 @@ class panels_renderer_editor extends panels_renderer_standard { } // Copy settings from form state back into the cache. - if(!empty($form_state['values']['settings'])) { + if (!empty($form_state['values']['settings'])) { if ($type == 'pane') { $this->cache->display->content[$pid]->style['settings'] = $form_state['values']['settings']; } - else if($type == 'region') { + elseif ($type == 'region') { $this->cache->display->panel_settings['style_settings'][$pid] = $form_state['values']['settings']; } } @@ -1230,7 +1232,7 @@ class panels_renderer_editor extends panels_renderer_standard { if ($type == 'pane') { $this->command_update_pane($pane); } - else if ($type == 'region') { + elseif ($type == 'region') { $this->command_update_region_links($pid); } else { @@ -1354,12 +1356,12 @@ class panels_renderer_editor extends panels_renderer_standard { $output = ctools_modal_form_wrapper('panels_edit_add_access_test_form', $form_state); if (!empty($form_state['executed'])) { - // Set up the plugin in cache + // Set up the plugin in cache. $plugin = ctools_get_access_plugin($form_state['values']['type']); $this->cache->new_plugin = ctools_access_new_test($plugin); panels_edit_cache_set($this->cache); - // go to the next step. + // Go to the next step. return $this->ajax_access_configure_test($pid, 'add'); } @@ -1387,7 +1389,7 @@ class panels_renderer_editor extends panels_renderer_standard { $pane->access['plugins'][] = $this->cache->new_plugin; $id = max(array_keys($pane->access['plugins'])); } - else if (empty($pane->access['plugins'][$id])) { + elseif (empty($pane->access['plugins'][$id])) { ctools_modal_render(t('Error'), t('Invalid test id.')); } @@ -1407,7 +1409,7 @@ class panels_renderer_editor extends panels_renderer_standard { return; } - // Unset the new plugin + // Unset the new plugin. if (isset($this->cache->new_plugin)) { unset($this->cache->new_plugin); } @@ -1483,7 +1485,6 @@ class panels_renderer_editor extends panels_renderer_standard { // // These are used to make sure that child implementations can control their // own AJAX commands as needed. - /** * Create a command array to redraw a pane. */ @@ -1527,6 +1528,7 @@ class panels_renderer_editor extends panels_renderer_standard { function command_update_region_links($id) { $this->commands[] = ajax_command_replace('.panels-region-links-' . $id, $this->get_region_links($id)); } + } /** @@ -1559,10 +1561,9 @@ function panels_ajax_edit_pane_cancel(&$form_state) { } // -------------------------------------------------------------------------- -// Forms for the editor object - +// Forms for the editor object. /** - * Choose cache method form + * Choose cache method form. */ function panels_edit_cache_method_form($form, &$form_state) { ctools_form_include($form_state, 'plugins', 'panels'); @@ -1612,7 +1613,7 @@ function panels_edit_cache_method_form_submit($form, &$form_state) { } /** - * Cache settings form + * Cache settings form. */ function panels_edit_cache_settings_form($form, &$form_state) { ctools_form_include($form_state, 'plugins', 'panels'); @@ -1674,7 +1675,7 @@ function panels_edit_cache_settings_form_submit($form, &$form_state) { } /** - * Choose style form + * Choose style form. */ function panels_edit_style_type_form($form, &$form_state) { ctools_form_include($form_state, 'plugins', 'panels'); @@ -1726,7 +1727,7 @@ function panels_edit_style_type_form_submit($form, &$form_state) { } /** - * Style settings form + * Style settings form. */ function panels_edit_style_settings_form($form, &$form_state) { ctools_form_include($form_state, 'plugins', 'panels'); @@ -1755,7 +1756,6 @@ function panels_edit_style_settings_form($form, &$form_state) { '#value' => t('Save'), ); - // Need a cancel button since the style cache can persist and impact the wrong // pane (or region, or display). $form['cancel_style'] = array( @@ -2038,7 +2038,7 @@ function panels_edit_configure_access_test_form($form, &$form_state) { } /** - * Validate handler for visibility rule settings + * Validate handler for visibility rule settings. */ function panels_edit_configure_access_test_form_validate(&$form, &$form_state) { if (!empty($form_state['clicked_button']['#remove'])) { @@ -2051,7 +2051,7 @@ function panels_edit_configure_access_test_form_validate(&$form, &$form_state) { } /** - * Submit handler for visibility rule settings + * Submit handler for visibility rule settings. */ function panels_edit_configure_access_test_form_submit(&$form, &$form_state) { if (!empty($form_state['clicked_button']['#remove'])) { @@ -2069,4 +2069,3 @@ function panels_edit_configure_access_test_form_submit(&$form, &$form_state) { } $form_state['test']['not'] = !empty($form_state['values']['not']); } - diff --git a/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_simple.class.php b/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_simple.class.php index a4779b89..deff976d 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_simple.class.php +++ b/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_simple.class.php @@ -23,10 +23,11 @@ class panels_renderer_simple extends panels_renderer_standard { } function render_panes() { - // NOP + // NOP. } function prepare($external_settings = NULL) { $this->prep_run = TRUE; } + } diff --git a/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_standard.class.php b/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_standard.class.php index 58a72ee6..88ac1df2 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_standard.class.php +++ b/sites/all/modules/contrib/panels/panels/plugins/display_renderers/panels_renderer_standard.class.php @@ -1,5 +1,9 @@ prep_run = TRUE. * * @param mixed $external_settings - * An optional parameter allowing external code to pass in additional - * settings for use in the preparation process. Not used in the default - * renderer, but included for interface consistency. + * An optional parameter allowing external code to pass in additional + * settings for use in the preparation process. Not used in the default + * renderer, but included for interface consistency. */ function prepare($external_settings = NULL) { $this->prepare_panes($this->display->content); @@ -232,22 +239,24 @@ class panels_renderer_standard { * regularly make additions to the set of panes that will be rendered. * * @param array $panes - * An associative array of pane data (stdClass objects), keyed on pane id. + * An associative array of pane data (stdClass objects), keyed on pane id. + * * @return array * An associative array of panes to be rendered, keyed on pane id and sorted * into proper rendering order. */ function prepare_panes($panes) { ctools_include('content'); - // Use local variables as writing to them is very slightly faster + // Use local variables as writing to them is very slightly faster. $first = $normal = $last = array(); - // Prepare the list of panes to be rendered + // Prepare the list of panes to be rendered. foreach ($panes as $pid => $pane) { if (empty($this->admin)) { - // TODO remove in 7.x and ensure the upgrade path weeds out any stragglers; it's been long enough - $pane->shown = !empty($pane->shown); // guarantee this field exists. - // If this pane is not visible to the user, skip out and do the next one + // TODO remove in 7.x and ensure the upgrade path weeds out any stragglers; it's been long enough. + $pane->shown = !empty($pane->shown); + // Guarantee this field exists. + // If this pane is not visible to the user, skip out and do the next one. if (!$pane->shown || !panels_pane_access($pane, $this->display)) { continue; } @@ -272,7 +281,7 @@ class panels_renderer_standard { // If it wants to render first, add it to the $first array. This is used // by panes that need to do some processing before other panes are // rendered. - else if (!empty($content_type['render first'])) { + elseif (!empty($content_type['render first'])) { $first[$pid] = $pane; } // Otherwise, render it in the normal order. @@ -318,6 +327,7 @@ class panels_renderer_standard { * @param array $settings * All known region style settings, including both the top-level display's * settings (if any) and all region-specific settings (if any). + * * @return array * An array of regions prepared for rendering. */ @@ -497,9 +507,10 @@ class panels_renderer_standard { case 'standard': drupal_add_css($filename); break; + case 'inline': $url = base_path() . $filename; - $this->prefix .= ''."\n"; + $this->prefix .= '' . "\n"; break; } } @@ -533,8 +544,8 @@ class panels_renderer_standard { * an individual pane can be bubbled up to take over the title for the entire * display. * - * @param stdClass $pane - * A Panels pane object, as loaded from the database. + * @param object $pane + * A Panels pane object, as loaded from the database. */ function render_pane(&$pane) { module_invoke_all('panels_pane_prerender', $pane); @@ -567,7 +578,7 @@ class panels_renderer_standard { } } - // fallback + // Fallback. return theme('panels_pane', array('content' => $content, 'pane' => $pane, 'display' => $this->display)); } } @@ -578,8 +589,9 @@ class panels_renderer_standard { * This method retrieves pane content and produces a ready-to-render content * object. It also manages pane-specific caching. * - * @param stdClass $pane + * @param object $pane * A Panels pane object, as loaded from the database. + * * @return stdClass $content * A renderable object, containing a subject, content, etc. Based on the * renderable objects used by the block system. @@ -693,4 +705,5 @@ class panels_renderer_standard { $output = theme($style['render region'], array('display' => $this->display, 'owner_id' => $owner_id, 'panes' => $panes, 'settings' => $style_settings, 'region_id' => $region_id, 'style' => $style)); return $output; } + } diff --git a/sites/all/modules/contrib/panels/panels/plugins/display_renderers/simple.inc b/sites/all/modules/contrib/panels/panels/plugins/display_renderers/simple.inc index a3702165..b3b8fb55 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/display_renderers/simple.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/display_renderers/simple.inc @@ -1,5 +1,6 @@ 'panels_renderer_standard', ); diff --git a/sites/all/modules/contrib/panels/panels/plugins/export_ui/panels_layouts.inc b/sites/all/modules/contrib/panels/panels/plugins/export_ui/panels_layouts.inc index 20bf44da..6fc8de36 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/export_ui/panels_layouts.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/export_ui/panels_layouts.inc @@ -1,5 +1,9 @@ 'panels_layout', 'access' => 'administer panels layouts', @@ -20,4 +24,3 @@ $plugin = array( 'class' => 'panels_layouts_ui', ), ); - diff --git a/sites/all/modules/contrib/panels/panels/plugins/export_ui/panels_layouts_ui.class.php b/sites/all/modules/contrib/panels/panels/plugins/export_ui/panels_layouts_ui.class.php index ecf3b7bd..bb32f280 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/export_ui/panels_layouts_ui.class.php +++ b/sites/all/modules/contrib/panels/panels/plugins/export_ui/panels_layouts_ui.class.php @@ -4,7 +4,6 @@ * @file * Contains the administrative UI for reusable layouts. */ - class panels_layouts_ui extends ctools_export_ui { var $lipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam egestas congue nibh, vel dictum ante posuere vitae. Cras gravida massa tempor metus eleifend sed elementum tortor scelerisque. Vivamus egestas, tortor quis luctus tristique, sem velit adipiscing risus, et tempus enim felis in massa. Morbi viverra, nisl quis rhoncus imperdiet, turpis massa vestibulum turpis, egestas faucibus nibh metus vel nunc. In hac habitasse platea dictumst. Nunc sit amet nisi quis ipsum tincidunt semper. Donec ac urna enim, et placerat arcu. Morbi eu laoreet justo. Nullam nec velit eu neque mattis pulvinar sed non libero. Sed sed vulputate erat. Fusce sit amet dui nibh."; @@ -18,7 +17,7 @@ class panels_layouts_ui extends ctools_export_ui { // Change the item to a tab on the Panels page. $this->plugin['menu']['items']['list callback']['type'] = MENU_LOCAL_TASK; - // Establish a base for adding plugins + // Establish a base for adding plugins. $base = $this->plugin['menu']['items']['add']; // Remove the default 'add' menu item. unset($this->plugin['menu']['items']['add']); @@ -27,7 +26,7 @@ class panels_layouts_ui extends ctools_export_ui { $this->builders = panels_get_layout_builders(); asort($this->builders); foreach ($this->builders as $name => $builder) { - // Create a new menu item for the builder + // Create a new menu item for the builder. $item = $base; $item['title'] = !empty($builder['builder tab title']) ? $builder['builder tab title'] : 'Add ' . $builder['title']; $item['page arguments'][] = $name; @@ -78,6 +77,8 @@ class panels_layouts_ui extends ctools_export_ui { $display->layout_settings = $form_state['item']->settings; $display->cache_key = $cache_key; $display->editing_layout = TRUE; + $display->storage_type = 'panels_layouts_ui'; + $display->storage_id = 'panels_layouts_ui'; $cache->display = $display; $cache->content_types = $content_types; @@ -193,23 +194,28 @@ class panels_layouts_ui extends ctools_export_ui { } function list_build_row($item, &$form_state, $operations) { - // Set up sorting + // Set up sorting. switch ($form_state['values']['order']) { case 'disabled': $this->sorts[$item->name] = empty($item->disabled) . $item->admin_title; break; + case 'title': $this->sorts[$item->name] = $item->admin_title; break; + case 'name': $this->sorts[$item->name] = $item->name; break; + case 'category': $this->sorts[$item->name] = ($item->category ? $item->category : t('Miscellaneous')) . $item->admin_title; break; + case 'plugin': $this->sorts[$item->name] = $item->plugin; break; + case 'storage': $this->sorts[$item->name] = $item->type . $item->admin_title; break; @@ -242,4 +248,5 @@ class panels_layouts_ui extends ctools_export_ui { array('data' => t('Operations'), 'class' => array('ctools-export-ui-operations')), ); } + } diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible-admin.css b/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible-admin.css index 744e46e9..8445050c 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible-admin.css +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible-admin.css @@ -1,4 +1,3 @@ - #panels-dnd-main .panel-flexible-edit-layout div.panels-display .pane-add-link, .panel-flexible-edit-layout .panel-pane { display: none; @@ -54,8 +53,8 @@ float: left; margin-left: -7px; margin-right: -6px; - cursor: e-resize; /* in case col-resize isn't supported */ - cursor: col-resize; + cursor: e-resize; /* in case col-resize isn't supported */ + cursor: col-resize; height: 30px; position: relative; z-index: 1; @@ -84,4 +83,3 @@ #panels-edit-display .helperclass { margin: .5em; } - diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible.css b/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible.css index 0d1fbe63..ce7f4200 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible.css +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible.css @@ -1,4 +1,3 @@ - .panel-flexible .panel-separator { margin: 0 0 1em 0; } diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible.inc b/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible.inc index 4cdb216b..93bc4e79 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/flexible/flexible.inc @@ -1,9 +1,14 @@ t('Flexible'), 'category' => t('Builders'), @@ -18,14 +23,13 @@ $plugin = array( 'regions function' => 'panels_flexible_panels', 'hook menu' => 'panels_flexible_menu', - // Reuisable layout Builder specific directives + // Reusable layout Builder specific directives. 'builder' => TRUE, - 'builder tab title' => 'Add flexible layout', // menu so translated elsewhere - + 'builder tab title' => 'Add flexible layout', 'get child' => 'panels_flexible_get_sublayout', 'get children' => 'panels_flexible_get_sublayouts', - // Define ajax callbacks + // Define ajax callbacks. 'ajax' => array( 'settings' => 'panels_ajax_flexible_edit_settings', 'add' => 'panels_ajax_flexible_edit_add', @@ -79,9 +83,16 @@ function panels_flexible_get_sublayouts($plugin, $layout_name) { } /** + * Flexible panel settings converter. + * * Convert settings from old style to new, or provide defaults for * empty settings. - * @param $settings + * + * @param array $settings + * Drupal settings for the layout. + * + * @return null + * Nothing to return. */ function panels_flexible_convert_settings(&$settings, &$layout) { // This indicates that this is a layout that they used the checkbox @@ -99,7 +110,7 @@ function panels_flexible_convert_settings(&$settings, &$layout) { } if (empty($settings)) { - // set up a default + // Set up a default. $settings = array( 'items' => array( // The 'canvas' is a special row that does not get rendered @@ -133,7 +144,7 @@ function panels_flexible_convert_settings(&$settings, &$layout) { ), ); } - else if (!isset($settings['items'])) { + elseif (!isset($settings['items'])) { // Convert an old style flexible to a new style flexible. $old = $settings; $settings = array(); @@ -143,7 +154,7 @@ function panels_flexible_convert_settings(&$settings, &$layout) { 'children' => array(), 'parent' => NULL, ); - // add the left sidebar column, row and region if it exists. + // Add the left sidebar column, row and region if it exists. if (!empty($old['sidebars']['left'])) { $settings['items']['canvas']['children'][] = 'sidebar-left'; $settings['items']['sidebar-left'] = array( @@ -205,28 +216,28 @@ function panels_flexible_convert_settings(&$settings, &$layout) { // Add rows and regions. for ($row = 1; $row <= intval($old['rows']); $row++) { - // Create entry for the row + // Create entry for the row: $settings['items']["row_$row"] = array( 'type' => 'row', 'contains' => 'region', 'children' => array(), 'parent' => 'main', ); - // Add the row to the parent's children + // Add the row to the parent's children: $settings['items']['main']['children'][] = "row_$row"; for ($col = 1; $col <= intval($old["row_$row"]['columns']); $col++) { - // Create entry for the region + // Create entry for the region: $settings['items']["row_${row}_$col"] = array( 'type' => 'region', 'width' => $old["row_$row"]["width_$col"], 'width_type' => '%', 'parent' => "row_$row", ); - // Add entry for the region to the row's children + // Add entry for the region to the row's children: $settings['items']["row_$row"]['children'][] = "row_${row}_$col"; - // Apply the proper title to the region + // Apply the proper title to the region: if (!empty($old["row_$row"]['names'][$col - 1])) { $settings['items']["row_${row}_$col"]['title'] = $old["row_$row"]['names'][$col - 1]; } @@ -236,7 +247,7 @@ function panels_flexible_convert_settings(&$settings, &$layout) { } } } - else if (isset($settings['canvas'])) { + elseif (isset($settings['canvas'])) { // Convert the old 'canvas' to the new canvas row. $settings['items']['canvas'] = array( 'type' => 'row', @@ -259,7 +270,7 @@ function panels_flexible_panels($display, $settings, $layout) { if (!isset($item['type'])) { unset($items[$id]); } - else if ($item['type'] == 'region') { + elseif ($item['type'] == 'region') { $items[$id] = $item['title']; } } @@ -276,13 +287,13 @@ function panels_flexible_panels($display, $settings, $layout) { * @todo Convert the functions to methods and make this properly OO. */ function panels_flexible_create_renderer($admin, $css_id, $content, $settings, &$display, $layout, $handler) { - $renderer = new stdClass; + $renderer = new stdClass(); $renderer->settings = $settings; $renderer->content = $content; $renderer->css_id = $css_id; $renderer->did = &$display->did; if ($admin) { - // always scale in admin mode. + // Always scale in admin mode. $renderer->scale_base = 99.0; } else { @@ -325,7 +336,6 @@ function panels_flexible_create_renderer($admin, $css_id, $content, $settings, & $renderer->row_separation = !empty($settings['items']['canvas']['row_separation']) ? $settings['items']['canvas']['row_separation'] : '0.5em'; // Make some appended classes so it's easier to reference them. - $renderer->base['column'] = $renderer->item_class['column'] . '-' . $renderer->base_class; $renderer->base['row'] = $renderer->item_class['row'] . '-' . $renderer->base_class; $renderer->base['region'] = $renderer->item_class['region'] . '-' . $renderer->base_class; @@ -386,7 +396,7 @@ function theme_panels_flexible($vars) { } // Also store the CSS on the display in case the live preview or something - // needs it + // needs it. $display->add_css = $css; $output = "
base['canvas'] . " clearfix\" $renderer->id_str>\n"; @@ -394,7 +404,7 @@ function theme_panels_flexible($vars) { $output .= panels_flexible_render_items($renderer, $settings['items']['canvas']['children'], $renderer->base['canvas']); - // Wrap the whole thing up nice and snug + // Wrap the whole thing up nice and snug. $output .= "
\n\n"; return $output; @@ -443,7 +453,7 @@ function theme_panels_flexible_admin($vars) { $content = panels_flexible_render_items($renderer, $settings['items']['canvas']['children'], $renderer->base['row'] . '-canvas'); $output .= panels_flexible_render_item($renderer, $settings['items']['canvas'], $content, 'canvas', 0, 0, TRUE); - // Wrap the whole thing up nice and snug + // Wrap the whole thing up nice and snug. $output .= "\n\n"; drupal_add_js($layout['path'] . '/flexible-admin.js'); @@ -464,7 +474,7 @@ function panels_flexible_render_items($renderer, $list, $owner_id) { $item = $renderer->settings['items'][$id]; $location = isset($renderer->positions[$id]) ? $renderer->positions[$id] : 'middle'; - if ($renderer->admin && $item['type'] != 'row' && $prev ) { + if ($renderer->admin && $item['type'] != 'row' && $prev) { $groups[$location] .= panels_flexible_render_splitter($renderer, $prev, $id); } @@ -475,12 +485,14 @@ function panels_flexible_render_items($renderer, $list, $owner_id) { $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max); } break; + case 'row': $content = panels_flexible_render_items($renderer, $item['children'], $renderer->base['row'] . '-' . $id); if (empty($renderer->settings['items'][$id]['hide_empty']) || trim($content)) { $groups[$location] .= panels_flexible_render_item($renderer, $item, $content, $id, $position, $max, TRUE); } break; + case 'region': if (empty($renderer->settings['items'][$id]['hide_empty'])) { $content = isset($renderer->content[$id]) ? $renderer->content[$id] : " "; @@ -611,7 +623,7 @@ function panels_flexible_render_splitter($renderer, $left_id, $right_id) { $output = '
'; - // Name the left object + // Name the left object: $output .= ''; $output .= '.' . $left_class; $output .= ''; @@ -632,7 +644,7 @@ function panels_flexible_render_splitter($renderer, $left_id, $right_id) { $output .= $left['width_type']; $output .= ''; - // Name the right object + // Name the right object: $output .= ''; $output .= '.' . $right_class; $output .= ''; @@ -677,7 +689,7 @@ function panels_flexible_render_item_links($renderer, $id, $item) { $add2 = t('Add row to bottom'); } } - else if ($item['type'] == 'row') { + elseif ($item['type'] == 'row') { if ($id == 'canvas') { $title = t('Canvas'); $settings = t('Canvas settings'); @@ -697,7 +709,7 @@ function panels_flexible_render_item_links($renderer, $id, $item) { $add2 = $item['contains'] == 'region' ? t('Add region to right') : t('Add column to right'); } } - else if ($item['type'] == 'region') { + elseif ($item['type'] == 'region') { $title = t('Region'); $settings = t('Region settings'); $remove = t('Remove region'); @@ -757,7 +769,7 @@ function panels_flexible_render_css($renderer) { function panels_flexible_render_css_group($renderer, $list, $owner_id, $type, $id) { $css = array(); - // Start off with some generic CSS to properly pad regions + // Start off with some generic CSS to properly pad regions. $css[$owner_id . ' .' . $renderer->item_class['region']] = array( 'padding' => '0', ); @@ -792,7 +804,7 @@ function panels_flexible_render_css_group($renderer, $list, $owner_id, $type, $i 'padding-right' => '0', ); - // And properly pad rows too + // And properly pad rows too: $css[$owner_id . ' .' . $renderer->item_class['row']] = array( 'padding' => '0 0 ' . $renderer->row_separation . ' 0', 'margin' => '0', @@ -818,7 +830,6 @@ function panels_flexible_get_css_group(&$css, $renderer, $list, $owner_id, $type if ($type != 'row') { // Go through our items and break up into right/center/right groups so we // can figure out our offsets. - // right == any items on the right that are 'fixed'. // middle == all fluid items. // right == any items on the right that are 'fixed'. @@ -827,7 +838,7 @@ function panels_flexible_get_css_group(&$css, $renderer, $list, $owner_id, $type $current = 'left'; foreach ($list as $id) { if ($renderer->settings['items'][$id]['width_type'] == 'px') { - // fixed + // Fixed: if ($current == 'left') { $left[] = $id; $renderer->positions[$id] = 'left'; @@ -841,14 +852,14 @@ function panels_flexible_get_css_group(&$css, $renderer, $list, $owner_id, $type } } else { - // fluid + // Fluid: if ($current != 'right') { $current = 'middle'; $middle[] = $id; $renderer->positions[$id] = 'middle'; $middle_total += $renderer->settings['items'][$id]['width']; } - // fall through: if current is 'right' and we ran into a 'fluid' then + // Fall through: if current is 'right' and we ran into a 'fluid' then // it gets *dropped* because that is invalid. } } @@ -903,7 +914,7 @@ function panels_flexible_get_css_group(&$css, $renderer, $list, $owner_id, $type $css["$owner_id-inside"]['padding-left'] = '0px'; if ($renderer->admin || count($middle)) { $css["$owner_id-middle"]['margin-left'] = $left_total . 'px'; - // IE hack + // IE hack! $css["* html $owner_id-left"]['left'] = $left_total . "px"; // Make this one very specific to the admin CSS so that preview // does not stomp it. @@ -912,7 +923,7 @@ function panels_flexible_get_css_group(&$css, $renderer, $list, $owner_id, $type else { $css["$owner_id-inside"]['margin-left'] = '-' . $left_total . 'px'; $css["$owner_id-inside"]['padding-left'] = $left_total . 'px'; - // IE hack + // IE hack! $css["* html $owner_id-inside"]['left'] = $left_total . "px"; } } @@ -958,8 +969,10 @@ function panels_flexible_get_css_group(&$css, $renderer, $list, $owner_id, $type /** * AJAX responder to edit flexible settings for an item. * - * $handler object + * @param object $handler * The display renderer handler object. + * @param mixed $id + * Id for the panel. */ function panels_ajax_flexible_edit_settings($handler, $id) { $settings = &$handler->display->layout_settings; @@ -976,11 +989,11 @@ function panels_ajax_flexible_edit_settings($handler, $id) { $siblings = $settings['items'][$item['parent']]['children']; } - switch ($item['type']) { case 'column': $title = t('Configure column'); break; + case 'row': if ($id == 'canvas') { $title = t('Configure canvas'); @@ -989,6 +1002,7 @@ function panels_ajax_flexible_edit_settings($handler, $id) { $title = t('Configure row'); } break; + case 'region': $title = t('Configure region'); break; @@ -1026,9 +1040,9 @@ function panels_ajax_flexible_edit_settings($handler, $id) { $output[] = ajax_command_replace('.flexible-links-' . $id, panels_flexible_render_item_links($renderer, $id, $item)); - // If editing the canvas, reset the CSS width + // If editing the canvas, reset the CSS width. if ($id == 'canvas') { - // update canvas CSS. + // Update canvas CSS. $css = array( '.' . $renderer->item_class['column'] . '-inside' => array( 'padding-left' => $renderer->column_separation, @@ -1061,9 +1075,6 @@ function panels_ajax_flexible_edit_settings($handler, $id) { /** * Configure a row, column or region on the flexible page. - * - * @param $form_state - * @return */ function panels_flexible_config_item_form($form, &$form_state) { $display = &$form_state['display']; @@ -1162,8 +1173,9 @@ function panels_flexible_config_item_form($form, &$form_state) { if ($sibling == $id) { $current = 'right'; } - else if ($settings['items'][$sibling]['width_type'] == '%') { - $$current = TRUE; // Indirection. + elseif ($settings['items'][$sibling]['width_type'] == '%') { + // Indirection. + $$current = TRUE; } } @@ -1234,7 +1246,7 @@ function panels_flexible_config_item_form_submit(&$form, &$form_state) { $item['region_separation'] = $form_state['values']['region_separation']; $item['row_separation'] = $form_state['values']['row_separation']; } - else if ($item['type'] != 'row') { + elseif ($item['type'] != 'row') { $item['width_type'] = $form_state['values']['width_type']; } else { @@ -1270,6 +1282,7 @@ function panels_ajax_flexible_edit_add($handler, $id, $location = 'left') { 'parent' => $id, ); break; + case 'row': switch ($parent['contains']) { case 'region': @@ -1282,6 +1295,7 @@ function panels_ajax_flexible_edit_add($handler, $id, $location = 'left') { 'parent' => $id, ); break; + case 'column': $title = $location == 'left' ? t('Add column to left') : t('Add column to right'); $item = array( @@ -1295,6 +1309,7 @@ function panels_ajax_flexible_edit_add($handler, $id, $location = 'left') { } // Create the new item with defaults. break; + case 'region': // Cannot add items to regions. break; @@ -1344,8 +1359,8 @@ function panels_ajax_flexible_edit_add($handler, $id, $location = 'left') { } - // render the item - $parent_class = $renderer->base[$parent['type']] . '-' . $id; + // Render the item. + $parent_class = $renderer->base[$parent['type']] . '-' . $id; $item_output = panels_flexible_render_item($renderer, $item, $content, $form_state['key'], 0, 0, $item['type'] == 'row'); // Get all the CSS necessary for the entire row (as width adjustments may @@ -1364,22 +1379,24 @@ function panels_ajax_flexible_edit_add($handler, $id, $location = 'left') { $item_output .= panels_flexible_render_splitter($renderer, $form_state['key'], $form_state['sibling']); $output[] = ajax_command_prepend('#panels-dnd-main .' . $parent_class . '-left', $item_output); } - else if ($location == 'right') { + elseif ($location == 'right') { // If we are adding to the right side of the left box, there is // a splitter that we have to remove; then we add our box normally, // and then add a new splitter for just our guy. $output[] = ajax_command_remove('panels-flexible-splitter-for-' . $renderer->base[$item['type']] . '-' . $form_state['key']); - $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output; + $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output; $item_output .= panels_flexible_render_splitter($renderer, $form_state['key'], NULL); $output[] = ajax_command_append('#panels-dnd-main .' . $parent_class . '-left', $item_output); } break; + case 'right': if (!empty($form_state['sibling'])) { - $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output; + $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output; } $output[] = ajax_command_append('#panels-dnd-main .' . $parent_class . '-right', $item_output); break; + case 'middle': if ($location == 'left') { if (!empty($form_state['sibling'])) { @@ -1389,7 +1406,7 @@ function panels_ajax_flexible_edit_add($handler, $id, $location = 'left') { } else { if (!empty($form_state['sibling'])) { - $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output; + $item_output = panels_flexible_render_splitter($renderer, $form_state['sibling'], $form_state['key']) . $item_output; } $output[] = ajax_command_append('#panels-dnd-main .' . $parent_class . '-middle', $item_output); } @@ -1429,8 +1446,6 @@ function panels_ajax_flexible_edit_add($handler, $id, $location = 'left') { } /** * Form to add a row, column or region to a flexible layout. - * @param $form_state - * @return */ function panels_flexible_add_item_form($form, &$form_state) { $display = &$form_state['display']; @@ -1543,7 +1558,7 @@ function panels_flexible_add_item_form_submit(&$form, &$form_state) { $item['hide_empty'] = $form_state['values']['hide_empty']; if ($item['type'] == 'region') { - // derive the region key from the title + // Derive the region key from the title. $key = preg_replace("/[^a-z0-9]/", '_', drupal_strtolower($item['title'])); while (isset($settings['items'][$key])) { $key .= '_'; @@ -1569,7 +1584,7 @@ function panels_flexible_add_item_form_submit(&$form, &$form_state) { // If there is no sibling, or the sibling is of a different type, // the default 100 will work for either fixed or fluid. if ($form_state['sibling'] && $settings['items'][$form_state['sibling']]['width_type'] == $item['width_type']) { - // steal half of the sibling's space. + // Steal half of the sibling's space. $width = $settings['items'][$form_state['sibling']]['width'] / 2; $settings['items'][$form_state['sibling']]['width'] = $width; $item['width'] = $width; @@ -1587,8 +1602,9 @@ function panels_flexible_add_item_form_submit(&$form, &$form_state) { } /** - * AJAX responder to remove an existing row, column or region from a flexible - * layout. + * Panels remove AJAX responder. + * + * Removes an existing row, column or region from a flexible layout. */ function panels_ajax_flexible_edit_remove($handler, $id) { $settings = &$handler->display->layout_settings; @@ -1602,10 +1618,8 @@ function panels_ajax_flexible_edit_remove($handler, $id) { $css_id = isset($handler->display->css_id) ? $handler->display->css_id : ''; // Create a renderer object so we can render our new stuff. $renderer = panels_flexible_create_renderer(TRUE, $css_id, array(), $settings, $handler->display, $handler->plugins['layout'], $handler); - - $siblings = &$settings['items'][$item['parent']]['children']; - $parent_class = '.' . $renderer->base[$settings['items'][$item['parent']]['type']] . '-' . $item['parent']; + $parent_class = '.' . $renderer->base[$settings['items'][$item['parent']]['type']] . '-' . $item['parent']; // Find the offset of our array. This will also be the key because // this is a simple array. @@ -1627,7 +1641,7 @@ function panels_ajax_flexible_edit_remove($handler, $id) { $settings['items'][$next]['width'] += $item['width']; } // If that failed, try the previous one. - else if (isset($prev) && $settings['items'][$prev]['width_type'] == '%') { + elseif (isset($prev) && $settings['items'][$prev]['width_type'] == '%') { $settings['items'][$prev]['width'] += $item['width']; } } @@ -1687,8 +1701,7 @@ function panels_ajax_flexible_edit_remove($handler, $id) { } /** - * AJAX responder to store resize information when the user adjusts the - * splitter. + * AJAX responder to store resize information when the user adjusts splitter. */ function panels_ajax_flexible_edit_resize($handler) { ctools_include('ajax'); diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/onecol.css b/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/onecol.css index 83f284aa..70ff1738 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/onecol.css +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/onecol.css @@ -1,4 +1,3 @@ - .panel-1col { /* overflow: hidden; */ } diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/onecol.inc b/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/onecol.inc index 4043566c..b2335a7c 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/onecol.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/onecol.inc @@ -1,9 +1,10 @@ t('Single column'), 'category' => t('Columns: 1'), diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/panels-onecol.tpl.php b/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/panels-onecol.tpl.php index 73ad5b83..04765d37 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/panels-onecol.tpl.php +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/onecol/panels-onecol.tpl.php @@ -12,7 +12,7 @@ * $content['middle']: The only panel in the layout. */ ?> -
> +
>
diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/panels-threecol-25-50-25.tpl.php b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/panels-threecol-25-50-25.tpl.php index 588e593d..eca0359f 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/panels-threecol-25-50-25.tpl.php +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/panels-threecol-25-50-25.tpl.php @@ -14,7 +14,7 @@ * - $content['right']: Content in the right column. */ ?> -
> +
>
diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/threecol_25_50_25.css b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/threecol_25_50_25.css index 2bffe57d..96ec6c69 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/threecol_25_50_25.css +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/threecol_25_50_25.css @@ -1,32 +1,31 @@ - -.panel-3col { +.panel-3col { /* overflow: hidden; */ } -.panel-3col .panel-col-first { - float: left; - width: 25%; +.panel-3col .panel-col-first { + float: left; + width: 25%; } -.panel-3col .panel-col-first .inside { +.panel-3col .panel-col-first .inside { margin: 0 .5em 1em 0; } -.panel-3col .panel-col { - float: left; - width: 50%; +.panel-3col .panel-col { + float: left; + width: 50%; } -.panel-3col .panel-col .inside { +.panel-3col .panel-col .inside { margin: 0 .5em 1em .5em; } -.panel-3col .panel-col-last { - float: left; - width: 25%; +.panel-3col .panel-col-last { + float: left; + width: 25%; } -.panel-3col .panel-col-last .inside { +.panel-3col .panel-col-last .inside { margin: 0 0 1em .5em; } diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/threecol_25_50_25.inc b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/threecol_25_50_25.inc index 78ab682e..138236ab 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/threecol_25_50_25.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25/threecol_25_50_25.inc @@ -1,9 +1,10 @@ t('Three column 25/50/25'), 'category' => t('Columns: 3'), @@ -14,7 +15,6 @@ $plugin = array( 'regions' => array( 'left' => t('Left side'), 'middle' => t('Middle column'), - 'right' => t('Right side') + 'right' => t('Right side'), ), ); - diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/panels-threecol-25-50-25-stacked.tpl.php b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/panels-threecol-25-50-25-stacked.tpl.php index 48aa5231..f9d64229 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/panels-threecol-25-50-25-stacked.tpl.php +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/panels-threecol-25-50-25-stacked.tpl.php @@ -17,7 +17,7 @@ * - $content['bottom']: Content in the bottom row. */ ?> -
> +
>
diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css index c24dabf9..0954fdcd 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.css @@ -1,11 +1,10 @@ - -.panel-3col-stacked { +.panel-3col-stacked { /* overflow: hidden; */ } .panel-3col-stacked .panel-col-top, -.panel-3col-stacked .panel-col-bottom { - width: 100%; +.panel-3col-stacked .panel-col-bottom { + width: 100%; clear: both; } @@ -13,30 +12,30 @@ margin-bottom: .5em; } -.panel-3col-stacked .panel-col-first { - float: left; - width: 25%; +.panel-3col-stacked .panel-col-first { + float: left; + width: 25%; } -.panel-3col-stacked .panel-col-first .inside { +.panel-3col-stacked .panel-col-first .inside { margin: 0 .5em 1em .5em; } -.panel-3col-stacked .panel-col { - float: left; - width: 50%; +.panel-3col-stacked .panel-col { + float: left; + width: 50%; } -.panel-3col-stacked .panel-col .inside { +.panel-3col-stacked .panel-col .inside { margin: 0 .5em 1em .5em; } -.panel-3col-stacked .panel-col-last { - float: left; - width: 25%; +.panel-3col-stacked .panel-col-last { + float: left; + width: 25%; } -.panel-3col-stacked .panel-col-last .inside { +.panel-3col-stacked .panel-col-last .inside { margin: 0 0 1em .5em; } diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.inc b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.inc index a5a450d6..acee9f5a 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_25_50_25_stacked/threecol_25_50_25_stacked.inc @@ -1,6 +1,9 @@ t('Three column 25/50/25 stacked'), 'category' => t('Columns: 3'), diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/panels-threecol-33-34-33.tpl.php b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/panels-threecol-33-34-33.tpl.php index 73a74371..8a065bee 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/panels-threecol-33-34-33.tpl.php +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/panels-threecol-33-34-33.tpl.php @@ -16,7 +16,7 @@ */ ?> -
> +
>
diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/threecol_33_34_33.css b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/threecol_33_34_33.css index da2d9310..23de423c 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/threecol_33_34_33.css +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/threecol_33_34_33.css @@ -1,32 +1,31 @@ - -.panel-3col-33 { +.panel-3col-33 { /* overflow: hidden; */ } -.panel-3col-33 .panel-col-first { - float: left; - width: 33%; +.panel-3col-33 .panel-col-first { + float: left; + width: 33%; } -.panel-3col-33 .panel-col-first .inside { +.panel-3col-33 .panel-col-first .inside { margin: 0 .5em 1em 0; } -.panel-3col-33 .panel-col { - float: left; - width: 33%; +.panel-3col-33 .panel-col { + float: left; + width: 33%; } -.panel-3col-33 .panel-col .inside { +.panel-3col-33 .panel-col .inside { margin: 0 .5em 1em .5em; } -.panel-3col-33 .panel-col-last { - float: left; - width: 33%; +.panel-3col-33 .panel-col-last { + float: left; + width: 33%; } -.panel-3col-33 .panel-col-last .inside { +.panel-3col-33 .panel-col-last .inside { margin: 0 0 1em .5em; } diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/threecol_33_34_33.inc b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/threecol_33_34_33.inc index ea4809a7..7e6e8c02 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/threecol_33_34_33.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33/threecol_33_34_33.inc @@ -1,6 +1,9 @@ t('Three column 33/34/33'), 'category' => t('Columns: 3'), @@ -10,6 +13,6 @@ $plugin = array( 'regions' => array( 'left' => t('Left side'), 'middle' => t('Middle column'), - 'right' => t('Right side') - ), + 'right' => t('Right side'), + ), ); diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/panels-threecol-33-34-33-stacked.tpl.php b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/panels-threecol-33-34-33-stacked.tpl.php index 276e2bf9..3bfdffd3 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/panels-threecol-33-34-33-stacked.tpl.php +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/panels-threecol-33-34-33-stacked.tpl.php @@ -17,7 +17,7 @@ * - $content['bottom']: Content in the bottom row. */ ?> -
> +
>
diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.css b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.css index 57b87ee3..531b0a97 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.css +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.css @@ -1,11 +1,10 @@ - -.panel-3col-33-stacked { +.panel-3col-33-stacked { /* overflow: hidden; */ } .panel-3col-33-stacked .panel-col-top, -.panel-3col-33-stacked .panel-col-bottom { - width: 100%; +.panel-3col-33-stacked .panel-col-bottom { + width: 100%; clear: both; } @@ -13,30 +12,30 @@ margin-bottom: 1em; } -.panel-3col-33-stacked .panel-col-first { - float: left; - width: 33%; +.panel-3col-33-stacked .panel-col-first { + float: left; + width: 33%; } -.panel-3col-33-stacked .panel-col-first .inside { +.panel-3col-33-stacked .panel-col-first .inside { margin: 0 .5em 1em 0; } -.panel-3col-33-stacked .panel-col { - float: left; - width: 33%; +.panel-3col-33-stacked .panel-col { + float: left; + width: 33%; } -.panel-3col-33-stacked .panel-col .inside { +.panel-3col-33-stacked .panel-col .inside { margin: 0 .5em 1em .5em; } -.panel-3col-33-stacked .panel-col-last { - float: left; - width: 33%; +.panel-3col-33-stacked .panel-col-last { + float: left; + width: 33%; } -.panel-3col-33-stacked .panel-col-last .inside { +.panel-3col-33-stacked .panel-col-last .inside { margin: 0 0 1em .5em; } diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.inc b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.inc index 3ac011bc..e9a9a179 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/threecol_33_34_33_stacked/threecol_33_34_33_stacked.inc @@ -1,6 +1,9 @@ t('Three column 33/34/33 stacked'), 'category' => t('Columns: 3'), @@ -12,6 +15,6 @@ $plugin = array( 'left' => t('Left side'), 'middle' => t('Middle column'), 'right' => t('Right side'), - 'bottom' => t('Bottom') + 'bottom' => t('Bottom'), ), ); diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/panels-twocol.tpl.php b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/panels-twocol.tpl.php index 2cda08e0..64ecd7cc 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/panels-twocol.tpl.php +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/panels-twocol.tpl.php @@ -14,7 +14,7 @@ * - $content['right']: Content in the right column. */ ?> -
> +
>
diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/twocol.css b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/twocol.css index 6e53ecaf..d0774318 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/twocol.css +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/twocol.css @@ -1,29 +1,28 @@ - -.panel-2col { +.panel-2col { /* overflow: hidden; */ } -.panel-2col .panel-col-first { - float: left; - width: 50%; +.panel-2col .panel-col-first { + float: left; + width: 50%; } * html .panel-2col .panel-col-first { width: 49.9%; } -.panel-2col .panel-col-first .inside { +.panel-2col .panel-col-first .inside { margin: 0 .5em 1em 0; } -.panel-2col .panel-col-last { - float: left; - width: 50%; +.panel-2col .panel-col-last { + float: left; + width: 50%; } * html .panel-2col .panel-col-last { width: 49.9%; } -.panel-2col .panel-col-last .inside { +.panel-2col .panel-col-last .inside { margin: 0 0 1em .5em; } diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/twocol.inc b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/twocol.inc index 1faedcaf..47e59737 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/twocol.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol/twocol.inc @@ -1,6 +1,9 @@ t('Two column'), 'category' => t('Columns: 2'), @@ -9,6 +12,6 @@ $plugin = array( 'css' => 'twocol.css', 'regions' => array( 'left' => t('Left side'), - 'right' => t('Right side') + 'right' => t('Right side'), ), ); diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/panels-twocol-bricks.tpl.php b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/panels-twocol-bricks.tpl.php index e626844a..32016fc2 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/panels-twocol-bricks.tpl.php +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/panels-twocol-bricks.tpl.php @@ -22,7 +22,7 @@ * - $content['bottom']: Content in the bottom row. */ ?> -
> +
>
diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/twocol_bricks.css b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/twocol_bricks.css index 4997ce60..083b34d2 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/twocol_bricks.css +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/twocol_bricks.css @@ -1,5 +1,4 @@ - -.panel-2col-bricks { +.panel-2col-bricks { /* overflow: hidden; */ margin-top: 0; padding-top: 0; @@ -7,8 +6,8 @@ .panel-2col-bricks .panel-col-top, .panel-2col-bricks .panel-col-middle, -.panel-2col-bricks .panel-col-bottom { - width: 99.9%; +.panel-2col-bricks .panel-col-bottom { + width: 99.9%; clear: both; } @@ -17,27 +16,27 @@ margin-bottom: .5em; } -.panel-2col-bricks .panel-col-first { - float: left; - width: 50%; +.panel-2col-bricks .panel-col-first { + float: left; + width: 50%; } * html .panel-2col-bricks .panel-col-first { width: 49.9%; } -.panel-2col-bricks .panel-col-first .inside { +.panel-2col-bricks .panel-col-first .inside { margin: 0 .5em .5em 0; } -.panel-2col-bricks .panel-col-last { - float: left; - width: 50%; +.panel-2col-bricks .panel-col-last { + float: left; + width: 50%; } * html .panel-2col-bricks .panel-col-last { width: 49.9%; } -.panel-2col-bricks .panel-col-last .inside { +.panel-2col-bricks .panel-col-last .inside { margin: 0 0 .5em .5em; } diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/twocol_bricks.inc b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/twocol_bricks.inc index 0cb6f1a2..dbf1a9ea 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/twocol_bricks.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_bricks/twocol_bricks.inc @@ -2,10 +2,10 @@ /** * @file - * Implementation for the two column bricked layout + * Implementation for the two column bricked layout. */ -// Plugin definition +// Plugin definition. $plugin = array( 'title' => t('Two column bricks'), 'category' => t('Columns: 2'), @@ -22,4 +22,3 @@ $plugin = array( 'bottom' => t('Bottom'), ), ); - diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/panels-twocol-stacked.tpl.php b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/panels-twocol-stacked.tpl.php index 901d27c0..b9ba058f 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/panels-twocol-stacked.tpl.php +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/panels-twocol-stacked.tpl.php @@ -16,7 +16,7 @@ * - $content['bottom']: Content in the bottom row. */ ?> -
> +
>
diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/twocol_stacked.css b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/twocol_stacked.css index 56eb3e34..c5a63bca 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/twocol_stacked.css +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/twocol_stacked.css @@ -1,13 +1,12 @@ - -.panel-2col-stacked { +.panel-2col-stacked { /* overflow: hidden; */ margin-top: 0; padding-top: 0; } .panel-2col-stacked .panel-col-top, -.panel-2col-stacked .panel-col-bottom { - width: 99.9%; +.panel-2col-stacked .panel-col-bottom { + width: 99.9%; clear: both; } @@ -15,24 +14,24 @@ margin-bottom: .5em; } -.panel-2col-stacked .panel-col-first { - float: left; - width: 50%; +.panel-2col-stacked .panel-col-first { + float: left; + width: 50%; } * html .panel-2col-stacked .panel-col-first { width: 49.9%; } -.panel-2col-stacked .panel-col-first .inside { +.panel-2col-stacked .panel-col-first .inside { margin: 0 .5em 1em 0; } -.panel-2col-stacked .panel-col-last { - float: left; - width: 49.9%; +.panel-2col-stacked .panel-col-last { + float: left; + width: 49.9%; } -.panel-2col-stacked .panel-col-last .inside { +.panel-2col-stacked .panel-col-last .inside { margin: 0 0 1em .5em; } diff --git a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/twocol_stacked.inc b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/twocol_stacked.inc index 5916a159..8b6dc2b4 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/twocol_stacked.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/layouts/twocol_stacked/twocol_stacked.inc @@ -1,6 +1,9 @@ t('Two column stacked'), 'category' => t('Columns: 2'), @@ -11,6 +14,6 @@ $plugin = array( 'top' => t('Top'), 'left' => t('Left side'), 'right' => t('Right side'), - 'bottom' => t('Bottom') + 'bottom' => t('Bottom'), ), ); diff --git a/sites/all/modules/contrib/panels/panels/plugins/page_wizards/landing_page.inc b/sites/all/modules/contrib/panels/panels/plugins/page_wizards/landing_page.inc index 030318f1..33bb8c8f 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/page_wizards/landing_page.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/page_wizards/landing_page.inc @@ -103,7 +103,7 @@ function panels_landing_page_basic($form, &$form_state) { '#default_value' => $cache->admin_description, ); - // path + // Path. $form['path'] = array( '#type' => 'textfield', '#title' => t('Path'), @@ -136,7 +136,7 @@ function panels_landing_page_basic($form, &$form_state) { '#options' => menu_get_menus(), '#default_value' => $cache->menu['name'], '#process' => array('ctools_dependent_process'), - '#dependency' => array('edit-menu-entry' => array(1)), + '#dependency' => array('edit-menu-entry' => array(1)), ); } else { @@ -185,7 +185,7 @@ function panels_landing_page_basic_validate(&$form, &$form_state) { form_error($form['path'], t('%, !, ?, #, or & cannot appear in the path.')); } - // Check to see if something is already using the path + // Check to see if something is already using the path. $result = db_query("SELECT * FROM {menu_router} WHERE path = :path", array(':path' => $form_state['values']['path']))->fetch(); if ($result) { form_error($form['path'], t('That path is already in use. This system cannot override existing paths.')); @@ -256,7 +256,7 @@ function panels_landing_page_finish(&$form_state) { $subtask->path = $cache->path; $subtask->menu = $cache->menu; - // Create the the panel context variant configured with our display + // Create the the panel context variant configured with our display. $plugin = page_manager_get_task_handler('panel_context'); // Set the storage id. @@ -274,7 +274,7 @@ function panels_landing_page_finish(&$form_state) { page_manager_page_new_page_cache($subtask, $page); page_manager_handler_add_to_page($page, $handler); - // Save it + // Save it. page_manager_save_page_cache($page); // Send us to the new page immediately. diff --git a/sites/all/modules/contrib/panels/panels/plugins/panels_storage/page_manager.inc b/sites/all/modules/contrib/panels/panels/plugins/panels_storage/page_manager.inc index afb3aec2..c88a443c 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/panels_storage/page_manager.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/panels_storage/page_manager.inc @@ -5,7 +5,7 @@ * Provides a panels_storage plugin for page_manager. */ -// Plugin definition +// Plugin definition. $plugin = array( 'access callback' => 'page_manager_panels_storage_access', ); diff --git a/sites/all/modules/contrib/panels/panels/plugins/panels_storage/panels_layouts_ui.inc b/sites/all/modules/contrib/panels/panels/plugins/panels_storage/panels_layouts_ui.inc new file mode 100644 index 00000000..1d8cc7fd --- /dev/null +++ b/sites/all/modules/contrib/panels/panels/plugins/panels_storage/panels_layouts_ui.inc @@ -0,0 +1,18 @@ + 'panels_layouts_ui_panels_storage_access', +); + +/** + * Access callback for panels storage. + */ +function panels_layouts_ui_panels_storage_access($storage_type, $storage_id, $op, $account) { + return user_access('administer panels layouts', $account); +} diff --git a/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_plain_box/pane-plain-box.css b/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_plain_box/pane-plain-box.css index 5a013366..2e343653 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_plain_box/pane-plain-box.css +++ b/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_plain_box/pane-plain-box.css @@ -8,4 +8,3 @@ color: %header-text; background-color: %header-background; } - diff --git a/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.css b/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.css index 86eea4a6..c85e4027 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.css +++ b/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_rounded_shadow/pane-rounded-shadow.css @@ -1,12 +1,16 @@ /* Show only to IE7 */ *:first-child+html .rounded-shadow-background, /* Show only to IE6 */ -* html .rounded-shadow-background { +* html .rounded-shadow-background { margin: 0 -10px 0 0 !important; padding: 10px 0 5px 0 !important; } -.rounded-shadow-top-edge, .rounded-shadow-bottom-edge, .rounded-shadow-left-edge, .rounded-shadow-right-edge, .rounded-shadow-wrap-corner { +.rounded-shadow-top-edge, +.rounded-shadow-bottom-edge, +.rounded-shadow-left-edge, +.rounded-shadow-right-edge, +.rounded-shadow-wrap-corner { position: relative; /* hasLayout -1 ? For IE only */ zoom: 1; @@ -88,7 +92,8 @@ } %style .panel-pane { - position: relative; top: -6px; + position: relative; + top: -6px; } /* diff --git a/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_rounded_shadow/pane_rounded_shadow.inc b/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_rounded_shadow/pane_rounded_shadow.inc index ff582ca7..a4713336 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_rounded_shadow/pane_rounded_shadow.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/style_bases/pane/pane_rounded_shadow/pane_rounded_shadow.inc @@ -96,4 +96,3 @@ function panels_pane_rounded_shadow_style_base_build($plugin, $settings, &$css, ctools_stylizer_font_apply_style($css, '%style .pane-content', $settings['text_font']); ctools_stylizer_padding_apply_style($css, '%style', $settings['padding']); } - diff --git a/sites/all/modules/contrib/panels/panels/plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.css b/sites/all/modules/contrib/panels/panels/plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.css index 924a6bf2..07b092e6 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.css +++ b/sites/all/modules/contrib/panels/panels/plugins/style_bases/region/region_rounded_shadow/region-rounded-shadow.css @@ -1,12 +1,16 @@ /* Show only to IE7 */ *:first-child+html .rounded-shadow-background, /* Show only to IE6 */ -* html .rounded-shadow-background { +* html .rounded-shadow-background { margin: 0 -10px 0 0 !important; padding: 10px 0 5px 0 !important; } -.rounded-shadow-top-edge, .rounded-shadow-bottom-edge, .rounded-shadow-left-edge, .rounded-shadow-right-edge, .rounded-shadow-wrap-corner { +.rounded-shadow-top-edge, +.rounded-shadow-bottom-edge, +.rounded-shadow-left-edge, +.rounded-shadow-right-edge, +.rounded-shadow-wrap-corner { position: relative; /* hasLayout -1 ? For IE only */ zoom: 1; diff --git a/sites/all/modules/contrib/panels/panels/plugins/style_bases/region/region_rounded_shadow/region_rounded_shadow.inc b/sites/all/modules/contrib/panels/panels/plugins/style_bases/region/region_rounded_shadow/region_rounded_shadow.inc index b73da907..9eb353a2 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/style_bases/region/region_rounded_shadow/region_rounded_shadow.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/style_bases/region/region_rounded_shadow/region_rounded_shadow.inc @@ -68,4 +68,3 @@ function panels_region_rounded_shadow_style_base_build($plugin, $settings, &$css ctools_stylizer_font_apply_style($css, '%style', $settings['font']); ctools_stylizer_padding_apply_style($css, '%style', $settings['padding']); } - diff --git a/sites/all/modules/contrib/panels/panels/plugins/styles/block.inc b/sites/all/modules/contrib/panels/panels/plugins/styles/block.inc index 58815a32..e1ec4325 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/styles/block.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/styles/block.inc @@ -5,7 +5,7 @@ * Definition of the 'block' panel style. */ -// Plugin definition +// Plugin definition. $plugin = array( 'title' => t('System block'), 'description' => t('Display the pane as a system block; this is more restrictive than the default.'), @@ -56,4 +56,3 @@ function theme_panels_block_style_render_pane($vars) { // might want to utilize. return drupal_render($build); } - diff --git a/sites/all/modules/contrib/panels/panels/plugins/styles/corners/rounded_corners.inc b/sites/all/modules/contrib/panels/panels/plugins/styles/corners/rounded_corners.inc index a1d800b7..bf952f97 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/styles/corners/rounded_corners.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/styles/corners/rounded_corners.inc @@ -5,7 +5,7 @@ * Definition of the 'rounded_corners' panel style. */ -// Plugin definition +// Plugin definition. $plugin = array( 'title' => t('Rounded corners'), 'description' => t('Presents the panes or panels with a rounded corner box around them'), diff --git a/sites/all/modules/contrib/panels/panels/plugins/styles/default.inc b/sites/all/modules/contrib/panels/panels/plugins/styles/default.inc index 9e89cbcd..2b958599 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/styles/default.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/styles/default.inc @@ -5,7 +5,7 @@ * Definition of the 'default' panel style. */ -// Plugin definition +// Plugin definition. $plugin = array( 'title' => t('No style'), 'description' => t('The default panel rendering style; displays each pane with a separator.'), @@ -24,4 +24,3 @@ function theme_panels_default_style_render_region($vars) { // $output .= '
'; return $output; } - diff --git a/sites/all/modules/contrib/panels/panels/plugins/styles/list.inc b/sites/all/modules/contrib/panels/panels/plugins/styles/list.inc index c13c532c..d97b5a98 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/styles/list.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/styles/list.inc @@ -6,7 +6,7 @@ * Definition of the 'list' panel style. */ -// Plugin definition +// Plugin definition. $plugin = array( 'title' => t('List'), 'description' => t('Presents the panes in the form of an HTML list.'), @@ -55,4 +55,3 @@ function panels_list_style_settings_form($style_settings) { return $form; } - diff --git a/sites/all/modules/contrib/panels/panels/plugins/styles/naked.inc b/sites/all/modules/contrib/panels/panels/plugins/styles/naked.inc index 1fdb3e26..19571771 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/styles/naked.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/styles/naked.inc @@ -5,7 +5,7 @@ * Definition of the 'naked' panel style. */ -// Plugin definition +// Plugin definition. $plugin = array( 'title' => t('No markup at all'), 'description' => t('Display the pane or region with no markup, not even a title.'), @@ -31,4 +31,3 @@ function theme_panels_naked_style_render_region($vars) { function theme_panels_naked_style_render_pane($vars) { return render($vars['content']->content); } - diff --git a/sites/all/modules/contrib/panels/panels/plugins/styles/stylizer.inc b/sites/all/modules/contrib/panels/panels/plugins/styles/stylizer.inc index f892024b..665a060e 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/styles/stylizer.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/styles/stylizer.inc @@ -6,7 +6,7 @@ */ if (module_exists('stylizer')) { - // Plugin definition + // Plugin definition. $plugin = array( 'title' => t('Custom style'), 'weight' => -10, @@ -22,7 +22,7 @@ if (module_exists('stylizer')) { 'get child' => 'panels_stylizer_get_substyle', 'get children' => 'panels_stylizer_get_substyles', - // Set up an AJAX callback for the style + // Set up an AJAX callback for the style. 'ajax' => array( 'custom' => 'panels_stylizer_pane_add_style', ), @@ -140,13 +140,13 @@ function theme_panels_stylizer_stylizer_style_render_region($vars) { return theme($plugin['theme'], array('settings' => $settings, 'class' => ctools_stylizer_get_css_class($plugin, $settings), 'content' => $output)); } else { - // if the style is gone, just display the output. + // If the style is gone, just display the output. return $output; } } /** - * Pane render theme + * Pane render theme. */ function theme_panels_stylizer_stylizer_style_render_pane($vars) { $content = $vars['content']; @@ -174,7 +174,7 @@ function theme_panels_stylizer_stylizer_style_render_pane($vars) { } } - // if the style is gone or has no theme of its own, just display the output. + // If the style is gone or has no theme of its own, just display the output. return theme('panels_pane', array('content' => $content, 'pane' => $pane, 'display' => $display)); } @@ -257,7 +257,7 @@ function panels_stylizer_pane_add_style(&$renderer, $plugin, &$conf, $type, $pid if ($type == 'pane') { $renderer->command_update_pane($pid); } - else if ($type == 'region') { + elseif ($type == 'region') { $renderer->command_update_region_links($pid); } else { @@ -308,7 +308,7 @@ function panels_stylizer_edit_pane_style_form(&$form, &$form_state) { '#dependency' => array('edit-preconfigured' => array(1)), ); - // Add the checkbox, set the weight early + // Add the checkbox, set the weight early. $form['panels']['preconfigured'] = array( '#type' => 'checkbox', '#title' => t('Make this style available to other regions or panes'), @@ -365,7 +365,7 @@ function panels_stylizer_edit_pane_style_form_submit(&$form, &$form_state) { $form_state['owner info']['owner settings']['admin_title'] = $form_state['values']['admin_title']; $form_state['owner info']['owner settings']['admin_description'] = $form_state['values']['admin_description']; - // Clean up preview files before we set the name + // Clean up preview files before we set the name. ctools_stylizer_cleanup_style($form_state['plugin'], $form_state['settings']); $form_state['settings']['name'] = $form_state['values']['name']; diff --git a/sites/all/modules/contrib/panels/panels/plugins/task_handlers/panel_context.inc b/sites/all/modules/contrib/panels/panels/plugins/task_handlers/panel_context.inc index daa98ac7..34758db0 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/task_handlers/panel_context.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/task_handlers/panel_context.inc @@ -2,22 +2,21 @@ /** * @file - * * This is the task handler plugin to handle attaching a panel to any * task that advertises itself as a 'context' type, which all of the * basic page tasks provided by page_manager.module do by default. */ -// Plugin definition +// Plugin definition. $plugin = array( - // is a 'context' handler type, meaning it supports the API of the + // Is a 'context' handler type, meaning it supports the API of the // context handlers provided by ctools context plugins. 'handler type' => 'context', 'visible' => TRUE, // may be added up front. // Administrative fields. 'title' => t('Panel'), - 'admin summary' =>'panels_panel_context_admin_summary', + 'admin summary' => 'panels_panel_context_admin_summary', 'admin title' => 'panels_panel_context_title', 'operations' => array( 'settings' => array( @@ -115,7 +114,7 @@ $plugin = array( // Callback to render the data. 'render' => 'panels_panel_context_render', - // Callback to return addressable data + // Callback to return addressable data. 'addressable callback' => 'panels_panel_context_get_addressable', // Various callbacks for operations performed on the handler to ensure @@ -216,7 +215,7 @@ function panels_panel_context_tab_operation($handler, $contexts, $args) { * simply means that the display has been modified and is awaiting * save. The modified one should always be used for editing purposes. * - If none of the above is true, then a new display needs to be created - * for the handler and pla + * for the handler and pla. */ function &panels_panel_context_get_display(&$handler) { if (!isset($handler->conf['display'])) { @@ -269,7 +268,7 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR ctools_include('context-task-handler'); ctools_include('plugins', 'panels'); - // Add my contexts + // Add my contexts. $contexts = ctools_context_handler_get_handler_contexts($base_contexts, $handler); // Test. @@ -281,7 +280,7 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR ctools_context_handler_pre_render($handler, $contexts, $args); } - // Load the display + // Load the display. $display = panels_panel_context_get_display($handler); $display->context = $contexts; @@ -298,7 +297,7 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR $css_id = 'panel_context:' . $handler->name; $filename = ctools_css_retrieve($css_id); if (!$filename) { - // Add keywords from context + // Add keywords from context. $css = ctools_context_keyword_substitute($handler->conf['css'], array(), $contexts, array('css safe' => TRUE)); $filename = ctools_css_store($css_id, $css); } @@ -311,13 +310,12 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR $renderer = panels_get_renderer($handler->conf['pipeline'], $display); // If the IPE is enabled, but the user does not have access to edit // load the standard renderer instead. - $parents = class_parents($renderer); if (!empty($parents['panels_renderer_editor']) && !user_access('user page manager') && !user_access('use ipe with page manager')) { $renderer = panels_get_renderer_handler('standard', $display); } - // Remove and add body element classes + // Remove and add body element classes. $panel_body_css = &drupal_static('panel_body_css'); if (isset($handler->conf['body_classes_to_remove'])) { @@ -325,17 +323,17 @@ function panels_panel_context_render($handler, $base_contexts, $args, $test = TR if (!isset($panel_body_css['body_classes_to_remove'])) { $panel_body_css['body_classes_to_remove'] = check_plain($classes); } - else{ + else { $panel_body_css['body_classes_to_remove'] .= ' ' . check_plain($classes); } } if (isset($handler->conf['body_classes_to_add'])) { $classes = ctools_context_keyword_substitute($handler->conf['body_classes_to_add'], array(), $contexts, array('css safe' => TRUE)); if (!isset($panel_body_css['body_classes_to_add'])) { - $panel_body_css['body_classes_to_add'] = check_plain($classes); + $panel_body_css['body_classes_to_add'] = check_plain($classes); } else { - $panel_body_css['body_classes_to_add'] .= ' '. check_plain($classes); + $panel_body_css['body_classes_to_add'] .= ' ' . check_plain($classes); } } @@ -399,7 +397,7 @@ function panels_panel_context_export(&$handler, $indent) { /** * When a handler is cloned, we have to clone the display. */ - function panels_panel_context_clone(&$handler) { +function panels_panel_context_clone(&$handler) { $old_display = panels_panel_context_get_display($handler); $code = panels_export_display($old_display); eval($code); @@ -454,7 +452,7 @@ function panels_panel_context_admin_summary($handler, $task, $subtask, $page, $s ctools_include('context'); ctools_include('context-task-handler'); - // Get the operations + // Get the operations. $operations = page_manager_get_operations($page); // Get operations for just this handler. @@ -529,7 +527,7 @@ function panels_panel_context_admin_summary($handler, $task, $subtask, $page, $s $output .= '
'; if ($show_title) { - $output .= '
'; + $output .= '
'; $output .= '
' . $rendered_operations['actions'] . '
'; $output .= '' . $title . ''; } @@ -537,24 +535,23 @@ function panels_panel_context_admin_summary($handler, $task, $subtask, $page, $s $output .= '
'; $output .= $info; $output .= '
'; -/* + /* $output .= '
'; $output .= '

' . t('Contexts') . $context_link . '

'; $output .= $contexts; $output .= '
'; $output .= '
'; -// $output .= $icon; + // $output .= $icon; $output .= '

' . t('Content') . $content_link . '

'; $output .= $content; $output .= '
'; -*/ + */ return $output; } // -------------------------------------------------------------------------- -// Forms - +// Forms. /** * General notes about forms: The handler is automatically cached by the form * wizard, so anything we store on $form_state['handler'] anywhere will get @@ -689,10 +686,9 @@ function panels_panel_context_edit_move($form, &$form_state) { $form = panels_change_layout($form, $form_state); // Change the 'back' button to just go directly to the previous form -// $task_id = $form_state['task']['name']; -// $handler_id = $form_state['handler']->handler; -// $name = $form_state['handler']->name; - + // $task_id = $form_state['task']['name']; + // $handler_id = $form_state['handler']->handler; + // $name = $form_state['handler']->name; // This form is outside the normal wizard list, so we need to specify the // previous/next forms. $form['buttons']['previous']['#next'] = 'layout'; @@ -750,7 +746,7 @@ function panels_panel_context_edit_content_submit(&$form, &$form_state) { panels_edit_display_form_submit($form, $form_state); $handler = &$form_state['handler']; - // update the cached display: + // Update the cached display: $display = $form_state['page']->display_cache[$form_state['handler_id']]->display; $handler->conf['display'] = $display; unset($form_state['page']->display_cache[$form_state['handler_id']]); @@ -761,7 +757,7 @@ function panels_panel_context_edit_content_submit(&$form, &$form_state) { } /** - * General settings for the panel + * General settings for the panel. */ function panels_panel_context_edit_settings($form, &$form_state) { $conf = $form_state['handler']->conf; @@ -874,7 +870,7 @@ function panels_panel_context_edit_preview($form, &$form_state) { $form['preview'] = array(); ctools_context_replace_form($form['preview'], $contexts); - // automatically preview if there are no argument placeholders. + // Automatically preview if there are no argument placeholders. if (empty($form['preview'])) { $display = panels_panel_context_get_display($form_state['handler']); $display->context = $contexts; @@ -913,7 +909,7 @@ function panels_panel_context_edit_preview_submit(&$form, &$form_state) { } function panels_panel_context_get_addressable($task, $subtask_name, $handler, $address, $contexts, $arguments, $type) { - // Load the display + // Load the display. $display = panels_panel_context_get_display($handler); $display->context = $contexts; diff --git a/sites/all/modules/contrib/panels/panels/plugins/views/panels.views.inc b/sites/all/modules/contrib/panels/panels/plugins/views/panels.views.inc index 2418da53..e1f8e67c 100644 --- a/sites/all/modules/contrib/panels/panels/plugins/views/panels.views.inc +++ b/sites/all/modules/contrib/panels/panels/plugins/views/panels.views.inc @@ -1,7 +1,11 @@ theme_functions(), array('view' => view, 'options' => $this->options, 'row' => $row, 'field_alias' => $this->field_alias)); + return theme($this->theme_functions(), array('view' => $this->view, 'options' => $this->options, 'row' => $row)); + } // Store a backup copy of the array because we're going to be screwing @@ -148,10 +149,11 @@ class panels_views_plugin_row_fields extends views_plugin_row_fields { // Now that we have a rendered content array, render it. return panels_print_layout($layout, $content, $meta); } + } /** - * Override handler for views_ui_edit_display_form + * Override handler for views_ui_edit_display_form. */ function panels_change_layout_button($form, &$form_state) { $display = &$form_state['view']->display[$form_state['display_id']]; diff --git a/sites/all/modules/contrib/panels/panels/templates/panels-dashboard-block.tpl.php b/sites/all/modules/contrib/panels/panels/templates/panels-dashboard-block.tpl.php index c2a665e8..3c57069f 100644 --- a/sites/all/modules/contrib/panels/panels/templates/panels-dashboard-block.tpl.php +++ b/sites/all/modules/contrib/panels/panels/templates/panels-dashboard-block.tpl.php @@ -1,4 +1,8 @@

diff --git a/sites/all/modules/contrib/panels/panels/templates/panels-dashboard-link.tpl.php b/sites/all/modules/contrib/panels/panels/templates/panels-dashboard-link.tpl.php index 22f1241f..23d55175 100644 --- a/sites/all/modules/contrib/panels/panels/templates/panels-dashboard-link.tpl.php +++ b/sites/all/modules/contrib/panels/panels/templates/panels-dashboard-link.tpl.php @@ -1,4 +1,8 @@
diff --git a/sites/all/modules/contrib/panels/panels/templates/panels-dashboard.tpl.php b/sites/all/modules/contrib/panels/panels/templates/panels-dashboard.tpl.php index 109deabc..8000685e 100644 --- a/sites/all/modules/contrib/panels/panels/templates/panels-dashboard.tpl.php +++ b/sites/all/modules/contrib/panels/panels/templates/panels-dashboard.tpl.php @@ -1,4 +1,8 @@
diff --git a/sites/all/modules/contrib/panels/panels/templates/panels-pane.tpl.php b/sites/all/modules/contrib/panels/panels/templates/panels-pane.tpl.php index 0aa01021..9dd92e3f 100644 --- a/sites/all/modules/contrib/panels/panels/templates/panels-pane.tpl.php +++ b/sites/all/modules/contrib/panels/panels/templates/panels-pane.tpl.php @@ -1,7 +1,7 @@ type: the content type inside this pane