Révision c2ac6d1d
Ajouté par Assos Assos il y a environ 5 ans
drupal7/sites/all/modules/ctools/bulk_export/bulk_export.info | ||
---|---|---|
3 | 3 |
core = 7.x |
4 | 4 |
dependencies[] = ctools |
5 | 5 |
package = Chaos tool suite |
6 |
version = CTOOLS_MODULE_VERSION |
|
7 | 6 |
|
8 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
9 |
version = "7.x-1.14"
|
|
7 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
8 |
version = "7.x-1.15"
|
|
10 | 9 |
core = "7.x" |
11 | 10 |
project = "ctools" |
12 |
datestamp = "1519455788" |
|
13 |
|
|
11 |
datestamp = "1549603691" |
drupal7/sites/all/modules/ctools/css/dropbutton.css | ||
---|---|---|
19 | 19 |
height: auto; |
20 | 20 |
position: absolute; |
21 | 21 |
right: 0; |
22 |
text-indent: -9999px; /* LTR */ |
|
23 | 22 |
top: 0; |
24 | 23 |
width: 17px; |
25 | 24 |
} |
... | ... | |
50 | 49 |
right: 6px; |
51 | 50 |
position: absolute; |
52 | 51 |
top: 0.75em; |
52 |
white-space: nowrap; |
|
53 | 53 |
} |
54 | 54 |
|
55 | 55 |
.ctools-dropbutton-processed.open .ctools-twisty { |
drupal7/sites/all/modules/ctools/ctools.info | ||
---|---|---|
19 | 19 |
files[] = tests/object_cache_unit.test |
20 | 20 |
files[] = tests/page_tokens.test |
21 | 21 |
|
22 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
23 |
version = "7.x-1.14"
|
|
22 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
23 |
version = "7.x-1.15"
|
|
24 | 24 |
core = "7.x" |
25 | 25 |
project = "ctools" |
26 |
datestamp = "1519455788" |
|
27 |
|
|
26 |
datestamp = "1549603691" |
drupal7/sites/all/modules/ctools/ctools.module | ||
---|---|---|
22 | 22 |
* simply include a dependency line in that module's info file, e.g.: |
23 | 23 |
* ; Requires CTools v7.x-1.4 or newer. |
24 | 24 |
* dependencies[] = ctools (>=1.4) |
25 |
* |
|
26 |
* @deprecated in CTools 1.15 and will be removed before CTools 2.0.0. |
|
27 |
* Use the version provided by the drupal.org packaging system. |
|
25 | 28 |
*/ |
26 | 29 |
define('CTOOLS_MODULE_VERSION', '7.x-1.13'); |
27 | 30 |
|
drupal7/sites/all/modules/ctools/ctools_access_ruleset/ctools_access_ruleset.info | ||
---|---|---|
2 | 2 |
description = Create custom, exportable, reusable access rulesets for applications like Panels. |
3 | 3 |
core = 7.x |
4 | 4 |
package = Chaos tool suite |
5 |
version = CTOOLS_MODULE_VERSION |
|
6 | 5 |
dependencies[] = ctools |
7 | 6 |
|
8 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
9 |
version = "7.x-1.14"
|
|
7 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
8 |
version = "7.x-1.15"
|
|
10 | 9 |
core = "7.x" |
11 | 10 |
project = "ctools" |
12 |
datestamp = "1519455788" |
|
13 |
|
|
11 |
datestamp = "1549603691" |
drupal7/sites/all/modules/ctools/ctools_ajax_sample/ctools_ajax_sample.info | ||
---|---|---|
1 | 1 |
name = Chaos Tools (CTools) AJAX Example |
2 | 2 |
description = Shows how to use the power of Chaos AJAX. |
3 | 3 |
package = Chaos tool suite |
4 |
version = CTOOLS_MODULE_VERSION |
|
5 | 4 |
dependencies[] = ctools |
6 | 5 |
core = 7.x |
7 | 6 |
|
8 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
9 |
version = "7.x-1.14"
|
|
7 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
8 |
version = "7.x-1.15"
|
|
10 | 9 |
core = "7.x" |
11 | 10 |
project = "ctools" |
12 |
datestamp = "1519455788" |
|
13 |
|
|
11 |
datestamp = "1549603691" |
drupal7/sites/all/modules/ctools/ctools_custom_content/ctools_custom_content.info | ||
---|---|---|
2 | 2 |
description = Create custom, exportable, reusable content panes for applications like Panels. |
3 | 3 |
core = 7.x |
4 | 4 |
package = Chaos tool suite |
5 |
version = CTOOLS_MODULE_VERSION |
|
6 | 5 |
dependencies[] = ctools |
7 | 6 |
|
8 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
9 |
version = "7.x-1.14"
|
|
7 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
8 |
version = "7.x-1.15"
|
|
10 | 9 |
core = "7.x" |
11 | 10 |
project = "ctools" |
12 |
datestamp = "1519455788" |
|
13 |
|
|
11 |
datestamp = "1549603691" |
drupal7/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.info | ||
---|---|---|
1 | 1 |
name = Chaos Tools (CTools) Plugin Example |
2 | 2 |
description = Shows how an external module can provide ctools plugins (for Panels, etc.). |
3 | 3 |
package = Chaos tool suite |
4 |
version = CTOOLS_MODULE_VERSION |
|
5 | 4 |
dependencies[] = ctools |
6 | 5 |
dependencies[] = panels |
7 | 6 |
dependencies[] = page_manager |
8 | 7 |
dependencies[] = advanced_help |
9 | 8 |
core = 7.x |
10 | 9 |
|
11 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
12 |
version = "7.x-1.14"
|
|
10 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
11 |
version = "7.x-1.15"
|
|
13 | 12 |
core = "7.x" |
14 | 13 |
project = "ctools" |
15 |
datestamp = "1519455788" |
|
16 |
|
|
14 |
datestamp = "1549603691" |
drupal7/sites/all/modules/ctools/ctools_plugin_example/ctools_plugin_example.pages_default.inc | ||
---|---|---|
95 | 95 |
'access' => array( |
96 | 96 |
'logic' => 'and', |
97 | 97 |
), |
98 |
'pipeline' => 'standard', |
|
98 | 99 |
); |
99 | 100 |
$display = new panels_display(); |
100 | 101 |
$display->layout = 'threecol_33_34_33_stacked'; |
... | ... | |
154 | 155 |
$pane->configuration = array( |
155 | 156 |
'title' => 'Long Arg Visibility Block', |
156 | 157 |
'body' => 'This block will be here when the argument is longer than configured arg length. It uses the \'arg_length\' access plugin to test against the length of the argument used for Simplecontext.', |
157 |
'format' => '1',
|
|
158 |
'format' => 'filtered_html',
|
|
158 | 159 |
'substitute' => 1, |
159 | 160 |
); |
160 | 161 |
$pane->cache = array(); |
... | ... | |
185 | 186 |
$pane->configuration = array( |
186 | 187 |
'title' => 'Short Arg Visibility', |
187 | 188 |
'body' => 'This block appears when the simplecontext argument is <i>less than</i> the configured length.', |
188 |
'format' => '1',
|
|
189 |
'format' => 'filtered_html',
|
|
189 | 190 |
'substitute' => 1, |
190 | 191 |
); |
191 | 192 |
$pane->cache = array(); |
... | ... | |
297 | 298 |
item1 is %sc:item1 |
298 | 299 |
item2 is %sc:item2 |
299 | 300 |
description is %sc:description', |
300 |
'format' => '1',
|
|
301 |
'format' => 'filtered_html',
|
|
301 | 302 |
'substitute' => 1, |
302 | 303 |
); |
303 | 304 |
$pane->cache = array(); |
... | ... | |
363 | 364 |
'body' => 'The CTools Plugin Example module (and this panel page) are just here to demonstrate how to build CTools plugins. |
364 | 365 |
|
365 | 366 |
', |
366 |
'format' => '2',
|
|
367 |
'format' => 'full_html',
|
|
367 | 368 |
'substitute' => 1, |
368 | 369 |
); |
369 | 370 |
$pane->cache = array(); |
... | ... | |
408 | 409 |
'css' => '', |
409 | 410 |
'contexts' => array(), |
410 | 411 |
'relationships' => array(), |
412 |
'pipeline' => 'standard', |
|
411 | 413 |
); |
412 | 414 |
$display = new panels_display(); |
413 | 415 |
$display->layout = 'onecol'; |
... | ... | |
428 | 430 |
$pane->configuration = array( |
429 | 431 |
'title' => 'Use this page with an argument', |
430 | 432 |
'body' => 'This demo page works if you use an argument, like <a href="ctools_plugin_example/xxxxx">ctools_plugin_example/xxxxx</a>.', |
431 |
'format' => '1',
|
|
433 |
'format' => 'filtered_html',
|
|
432 | 434 |
'substitute' => NULL, |
433 | 435 |
); |
434 | 436 |
$pane->cache = array(); |
drupal7/sites/all/modules/ctools/drush/ctools.drush.inc | ||
---|---|---|
452 | 452 |
* all arg handling etc in one place. |
453 | 453 |
*/ |
454 | 454 |
function ctools_drush_export_op_command() { |
455 |
$args = func_get_args(); |
|
455 | 456 |
// Get all info for the current drush command. |
456 | 457 |
$command = drush_get_command(); |
457 | 458 |
$op = ''; |
... | ... | |
495 | 496 |
} |
496 | 497 |
} |
497 | 498 |
else { |
498 |
$args = func_get_args(); |
|
499 | 499 |
// Table name should always be first arg... |
500 | 500 |
$table_name = array_shift($args); |
501 | 501 |
// Any additional args are assumed to be exportable names. |
drupal7/sites/all/modules/ctools/includes/dropbutton.theme.inc | ||
---|---|---|
104 | 104 |
|
105 | 105 |
$output .= '<div class="ctools-link">'; |
106 | 106 |
if ($vars['image']) { |
107 |
$output .= '<a href="#" class="ctools-twisty ctools-image">' . $vars['title'] . '</a>';
|
|
107 |
$output .= '<a href="#" class="ctools-twisty ctools-image"><span class="element-invisible">' . $vars['title'] . '</span></a>';
|
|
108 | 108 |
} |
109 | 109 |
else { |
110 |
$output .= '<a href="#" class="ctools-twisty ctools-text">' . $vars['title'] . '</a>';
|
|
110 |
$output .= '<a href="#" class="ctools-twisty ctools-text"><span class="element-invisible">' . $vars['title'] . '</span></a>';
|
|
111 | 111 |
} |
112 | 112 |
// ctools-link. |
113 | 113 |
$output .= '</div>'; |
drupal7/sites/all/modules/ctools/includes/export-ui.inc | ||
---|---|---|
333 | 333 |
|
334 | 334 |
$plugin['strings']['confirmation']['delete'] += array( |
335 | 335 |
'question' => t('Are you sure you want to delete %title?'), |
336 |
'information' => t('This action will permanently remove this item from your database..'),
|
|
336 |
'information' => t('This action will permanently remove this item from your database.'), |
|
337 | 337 |
'success' => t('The item has been deleted.'), |
338 | 338 |
); |
339 | 339 |
|
drupal7/sites/all/modules/ctools/includes/wizard.inc | ||
---|---|---|
503 | 503 |
$form_info = $form_info + $defaults; |
504 | 504 |
// Set form callbacks if they aren't defined. |
505 | 505 |
foreach ($form_info['forms'] as $step => $params) { |
506 |
if (!$params['form id']) {
|
|
506 |
if (empty($params['form id'])) {
|
|
507 | 507 |
$form_callback = $hook . '_' . $step . '_form'; |
508 | 508 |
$form_info['forms'][$step]['form id'] = $form_callback; |
509 | 509 |
} |
drupal7/sites/all/modules/ctools/js/modal.js | ||
---|---|---|
378 | 378 |
} |
379 | 379 |
} |
380 | 380 |
|
381 |
if (!speed) { |
|
381 |
if (!speed && 0 !== speed) {
|
|
382 | 382 |
speed = 'fast'; |
383 | 383 |
} |
384 | 384 |
|
... | ... | |
555 | 555 |
// Create our content div, get the dimensions, and hide it |
556 | 556 |
var modalContent = $('#modalContent').css('top','-1000px'); |
557 | 557 |
var $modalHeader = modalContent.find('.modal-header'); |
558 |
var mdcTop = wt + ( winHeight / 2 ) - ( modalContent.outerHeight() / 2);
|
|
558 |
var mdcTop = wt + Math.max((winHeight / 2) - (modalContent.outerHeight() / 2), 0);
|
|
559 | 559 |
var mdcLeft = ( winWidth / 2 ) - ( modalContent.outerWidth() / 2); |
560 | 560 |
$('#modalBackdrop').css(css).css('top', 0).css('height', docHeight + 'px').css('width', docWidth + 'px').show(); |
561 | 561 |
modalContent.css({top: mdcTop + 'px', left: mdcLeft + 'px'}).hide()[animation](speed); |
... | ... | |
588 | 588 |
$('body').unbind( 'keypress', modalEventHandler ); |
589 | 589 |
$('body').unbind( 'keydown', modalTabTrapHandler ); |
590 | 590 |
$('.close', $modalHeader).unbind('click', modalContentClose); |
591 |
$('body').unbind('keypress', modalEventEscapeCloseHandler);
|
|
591 |
$(document).unbind('keydown', modalEventEscapeCloseHandler);
|
|
592 | 592 |
$(document).trigger('CToolsDetachBehaviors', $('#modalContent')); |
593 | 593 |
|
594 |
// Set our animation parameters and use them |
|
595 |
if ( animation == 'fadeIn' ) animation = 'fadeOut'; |
|
596 |
if ( animation == 'slideDown' ) animation = 'slideUp'; |
|
597 |
if ( animation == 'show' ) animation = 'hide'; |
|
594 |
// Closing animation. |
|
595 |
switch (animation) { |
|
596 |
case 'fadeIn': |
|
597 |
modalContent.fadeOut(speed, modalContentRemove); |
|
598 |
break; |
|
598 | 599 |
|
599 |
// Close the content |
|
600 |
modalContent.hide()[animation](speed); |
|
600 |
case 'slideDown': |
|
601 |
modalContent.slideUp(speed, modalContentRemove); |
|
602 |
break; |
|
601 | 603 |
|
602 |
// Remove the content |
|
604 |
case 'show': |
|
605 |
modalContent.hide(speed, modalContentRemove); |
|
606 |
break; |
|
607 |
} |
|
608 |
} |
|
609 |
|
|
610 |
// Remove the content. |
|
611 |
modalContentRemove = function () { |
|
603 | 612 |
$('#modalContent').remove(); |
604 | 613 |
$('#modalBackdrop').remove(); |
605 | 614 |
|
606 |
// Restore focus to where it was before opening the dialog |
|
615 |
// Restore focus to where it was before opening the dialog.
|
|
607 | 616 |
$(oldFocus).focus(); |
608 | 617 |
}; |
609 | 618 |
|
610 | 619 |
// Move and resize the modalBackdrop and modalContent on window resize. |
611 |
modalContentResize = function(){ |
|
612 |
|
|
620 |
modalContentResize = function () { |
|
613 | 621 |
// Reset the backdrop height/width to get accurate document size. |
614 | 622 |
$('#modalBackdrop').css('height', '').css('width', ''); |
615 | 623 |
|
616 | 624 |
// Position code lifted from: |
617 | 625 |
// http://www.quirksmode.org/viewport/compatibility.html |
618 | 626 |
if (self.pageYOffset) { // all except Explorer |
619 |
var wt = self.pageYOffset; |
|
627 |
var wt = self.pageYOffset;
|
|
620 | 628 |
} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict |
621 | 629 |
var wt = document.documentElement.scrollTop; |
622 | 630 |
} else if (document.body) { // all other Explorers |
... | ... | |
632 | 640 |
|
633 | 641 |
// Get where we should move content to |
634 | 642 |
var modalContent = $('#modalContent'); |
635 |
var mdcTop = wt + ( winHeight / 2 ) - ( modalContent.outerHeight() / 2);
|
|
643 |
var mdcTop = wt + Math.max((winHeight / 2) - (modalContent.outerHeight() / 2), 0);
|
|
636 | 644 |
var mdcLeft = ( winWidth / 2 ) - ( modalContent.outerWidth() / 2); |
637 | 645 |
|
638 | 646 |
// Apply the changes |
drupal7/sites/all/modules/ctools/page_manager/page_manager.info | ||
---|---|---|
3 | 3 |
core = 7.x |
4 | 4 |
dependencies[] = ctools |
5 | 5 |
package = Chaos tool suite |
6 |
version = CTOOLS_MODULE_VERSION |
|
7 | 6 |
|
8 | 7 |
files[] = tests/head_links.test |
9 | 8 |
|
10 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
11 |
version = "7.x-1.14"
|
|
9 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
10 |
version = "7.x-1.15"
|
|
12 | 11 |
core = "7.x" |
13 | 12 |
project = "ctools" |
14 |
datestamp = "1519455788" |
|
15 |
|
|
13 |
datestamp = "1549603691" |
drupal7/sites/all/modules/ctools/page_manager/plugins/tasks/page.inc | ||
---|---|---|
261 | 261 |
* creating named arguments in the path. |
262 | 262 |
*/ |
263 | 263 |
function page_manager_page_execute($subtask_id) { |
264 |
$func_args = func_get_args(); |
|
264 | 265 |
$page = page_manager_page_load($subtask_id); |
265 | 266 |
$task = page_manager_get_task($page->task); |
266 | 267 |
$subtask = page_manager_get_task_subtask($task, $subtask_id); |
... | ... | |
268 | 269 |
// Turn the contexts into a properly keyed array. |
269 | 270 |
$contexts = array(); |
270 | 271 |
$args = array(); |
271 |
foreach (func_get_args() as $count => $arg) {
|
|
272 |
foreach ($func_args as $count => $arg) {
|
|
272 | 273 |
if (is_object($arg) && get_class($arg) == 'ctools_context') { |
273 | 274 |
$contexts[$arg->id] = $arg; |
274 | 275 |
$args[] = $arg->original_argument; |
... | ... | |
430 | 431 |
/** |
431 | 432 |
* Remove a page subtask. |
432 | 433 |
*/ |
433 |
function page_manager_page_delete($page) { |
|
434 |
function page_manager_page_delete($page, $skip_menu_rebuild = FALSE) {
|
|
434 | 435 |
$task = page_manager_get_task($page->task); |
435 | 436 |
if ($function = ctools_plugin_get_function($task, 'delete')) { |
436 | 437 |
$function($page); |
... | ... | |
448 | 449 |
// rebuild this page again. |
449 | 450 |
ctools_include('export'); |
450 | 451 |
ctools_export_load_object_reset('page_manager_pages'); |
451 |
menu_rebuild(); |
|
452 |
// Allow menu rebuild to be skipped when calling code is deleting multiple |
|
453 |
// pages. |
|
454 |
if (!$skip_menu_rebuild) { |
|
455 |
menu_rebuild(); |
|
456 |
} |
|
452 | 457 |
} |
453 | 458 |
|
454 | 459 |
/** |
drupal7/sites/all/modules/ctools/plugins/content_types/node_form/node_form_attachments.inc | ||
---|---|---|
21 | 21 |
|
22 | 22 |
function ctools_node_form_attachments_content_type_render($subtype, $conf, $panel_args, &$context) { |
23 | 23 |
$block = new stdClass(); |
24 |
$block->module = t('node_form');
|
|
24 |
$block->module = 'node_form';
|
|
25 | 25 |
|
26 | 26 |
$block->title = t('Attach files'); |
27 | 27 |
$block->delta = 'url-path-options'; |
drupal7/sites/all/modules/ctools/plugins/content_types/node_form/node_form_author.inc | ||
---|---|---|
17 | 17 |
|
18 | 18 |
function ctools_node_form_author_content_type_render($subtype, $conf, $panel_args, &$context) { |
19 | 19 |
$block = new stdClass(); |
20 |
$block->module = t('node_form');
|
|
20 |
$block->module = 'node_form';
|
|
21 | 21 |
|
22 | 22 |
$block->title = t('Authoring information'); |
23 | 23 |
$block->delta = 'author-options'; |
drupal7/sites/all/modules/ctools/plugins/content_types/node_form/node_form_book.inc | ||
---|---|---|
21 | 21 |
|
22 | 22 |
function ctools_node_form_book_content_type_render($subtype, $conf, $panel_args, &$context) { |
23 | 23 |
$block = new stdClass(); |
24 |
$block->module = t('node_form');
|
|
24 |
$block->module = 'node_form';
|
|
25 | 25 |
|
26 | 26 |
$block->title = t('Book outline'); |
27 | 27 |
$block->delta = 'book-outline'; |
drupal7/sites/all/modules/ctools/plugins/content_types/node_form/node_form_buttons.inc | ||
---|---|---|
17 | 17 |
|
18 | 18 |
function ctools_node_form_buttons_content_type_render($subtype, $conf, $panel_args, &$context) { |
19 | 19 |
$block = new stdClass(); |
20 |
$block->module = t('node_form');
|
|
20 |
$block->module = 'node_form';
|
|
21 | 21 |
|
22 | 22 |
$block->title = ''; |
23 | 23 |
$block->delta = 'buttons'; |
drupal7/sites/all/modules/ctools/plugins/content_types/node_form/node_form_comment.inc | ||
---|---|---|
21 | 21 |
|
22 | 22 |
function ctools_node_form_comment_content_type_render($subtype, $conf, $panel_args, &$context) { |
23 | 23 |
$block = new stdClass(); |
24 |
$block->module = t('node_form');
|
|
24 |
$block->module = 'node_form';
|
|
25 | 25 |
|
26 | 26 |
$block->title = t('Comment options'); |
27 | 27 |
$block->delta = 'comment-options'; |
drupal7/sites/all/modules/ctools/plugins/content_types/node_form/node_form_language.inc | ||
---|---|---|
17 | 17 |
|
18 | 18 |
function ctools_node_form_language_content_type_render($subtype, $conf, $panel_args, &$context) { |
19 | 19 |
$block = new stdClass(); |
20 |
$block->module = t('node_form');
|
|
20 |
$block->module = 'node_form';
|
|
21 | 21 |
|
22 | 22 |
$block->delta = 'language-options'; |
23 | 23 |
|
drupal7/sites/all/modules/ctools/plugins/content_types/node_form/node_form_log.inc | ||
---|---|---|
17 | 17 |
|
18 | 18 |
function ctools_node_form_log_content_type_render($subtype, $conf, $panel_args, &$context) { |
19 | 19 |
$block = new stdClass(); |
20 |
$block->module = t('node_form');
|
|
20 |
$block->module = 'node_form';
|
|
21 | 21 |
$block->title = t('Revision information'); |
22 | 22 |
|
23 | 23 |
if (isset($context->form)) { |
drupal7/sites/all/modules/ctools/plugins/content_types/node_form/node_form_menu.inc | ||
---|---|---|
21 | 21 |
|
22 | 22 |
function ctools_node_form_menu_content_type_render($subtype, $conf, $panel_args, &$context) { |
23 | 23 |
$block = new stdClass(); |
24 |
$block->module = t('node_form');
|
|
24 |
$block->module = 'node_form';
|
|
25 | 25 |
|
26 | 26 |
$block->title = t('Menu options'); |
27 | 27 |
$block->delta = 'menu-options'; |
drupal7/sites/all/modules/ctools/plugins/content_types/node_form/node_form_path.inc | ||
---|---|---|
21 | 21 |
|
22 | 22 |
function ctools_node_form_path_content_type_render($subtype, $conf, $panel_args, &$context) { |
23 | 23 |
$block = new stdClass(); |
24 |
$block->module = t('node_form');
|
|
24 |
$block->module = 'node_form';
|
|
25 | 25 |
|
26 | 26 |
$block->title = t('URL path options'); |
27 | 27 |
$block->delta = 'url-path-options'; |
drupal7/sites/all/modules/ctools/plugins/content_types/node_form/node_form_publishing.inc | ||
---|---|---|
23 | 23 |
$block = new stdClass(); |
24 | 24 |
|
25 | 25 |
$block->title = t('Publishing options'); |
26 |
$block->module = t('node_form');
|
|
26 |
$block->module = 'node_form';
|
|
27 | 27 |
$block->delta = 'publishing-options'; |
28 | 28 |
|
29 | 29 |
if (isset($context->form)) { |
drupal7/sites/all/modules/ctools/plugins/content_types/node_form/node_form_title.inc | ||
---|---|---|
17 | 17 |
|
18 | 18 |
function ctools_node_form_title_content_type_render($subtype, $conf, $panel_args, &$context) { |
19 | 19 |
$block = new stdClass(); |
20 |
$block->module = t('node_form');
|
|
20 |
$block->module = 'node_form';
|
|
21 | 21 |
|
22 | 22 |
$block->delta = 'title-options'; |
23 | 23 |
|
drupal7/sites/all/modules/ctools/plugins/contexts/user.inc | ||
---|---|---|
152 | 152 |
*/ |
153 | 153 |
function ctools_context_user_convert_list() { |
154 | 154 |
$tokens = token_info(); |
155 |
$list = array(); |
|
155 | 156 |
foreach ($tokens['tokens']['user'] as $id => $info) { |
156 | 157 |
if (!isset($list[$id])) { |
157 | 158 |
$list[$id] = $info['name']; |
drupal7/sites/all/modules/ctools/plugins/export_ui/ctools_export_ui.class.php | ||
---|---|---|
644 | 644 |
} |
645 | 645 |
|
646 | 646 |
public function add_page($js, $input, $step = NULL) { |
647 |
$args = func_get_args(); |
|
647 | 648 |
drupal_set_title($this->get_page_title('add'), PASS_THROUGH); |
648 | 649 |
|
649 | 650 |
// If a step not set, they are trying to create a new item. If a step |
... | ... | |
666 | 667 |
'no_redirect' => TRUE, |
667 | 668 |
'step' => $step, |
668 | 669 |
// Store these in case additional args are needed. |
669 |
'function args' => func_get_args(),
|
|
670 |
'function args' => $args,
|
|
670 | 671 |
); |
671 | 672 |
|
672 | 673 |
$output = $this->edit_execute_form($form_state); |
... | ... | |
681 | 682 |
* Main entry point to edit an item. |
682 | 683 |
*/ |
683 | 684 |
public function edit_page($js, $input, $item, $step = NULL) { |
685 |
$args = func_get_args(); |
|
684 | 686 |
drupal_set_title($this->get_page_title('edit', $item), PASS_THROUGH); |
685 | 687 |
|
686 | 688 |
// Check to see if there is a cached item to get if we're using the wizard. |
... | ... | |
702 | 704 |
'no_redirect' => TRUE, |
703 | 705 |
'step' => $step, |
704 | 706 |
// Store these in case additional args are needed. |
705 |
'function args' => func_get_args(),
|
|
707 |
'function args' => $args,
|
|
706 | 708 |
); |
707 | 709 |
|
708 | 710 |
$output = $this->edit_execute_form($form_state); |
... | ... | |
717 | 719 |
* Main entry point to clone an item. |
718 | 720 |
*/ |
719 | 721 |
public function clone_page($js, $input, $original, $step = NULL) { |
722 |
$args = func_get_args(); |
|
720 | 723 |
drupal_set_title($this->get_page_title('clone', $original), PASS_THROUGH); |
721 | 724 |
|
722 | 725 |
// If a step not set, they are trying to create a new clone. If a step |
... | ... | |
756 | 759 |
'no_redirect' => TRUE, |
757 | 760 |
'step' => $step, |
758 | 761 |
// Store these in case additional args are needed. |
759 |
'function args' => func_get_args(),
|
|
762 |
'function args' => $args,
|
|
760 | 763 |
); |
761 | 764 |
|
762 | 765 |
$output = $this->edit_execute_form($form_state); |
... | ... | |
1237 | 1240 |
* Page callback to import information for an exportable item. |
1238 | 1241 |
*/ |
1239 | 1242 |
public function import_page($js, $input, $step = NULL) { |
1243 |
$args = func_get_args(); |
|
1240 | 1244 |
drupal_set_title($this->get_page_title('import'), PASS_THROUGH); |
1241 | 1245 |
// Import is basically a multi step wizard form, so let's go ahead and |
1242 | 1246 |
// use CTools' wizard.inc for it. |
... | ... | |
1261 | 1265 |
'no_redirect' => TRUE, |
1262 | 1266 |
'step' => $step, |
1263 | 1267 |
// Store these in case additional args are needed. |
1264 |
'function args' => func_get_args(),
|
|
1268 |
'function args' => $args,
|
|
1265 | 1269 |
); |
1266 | 1270 |
|
1267 | 1271 |
// import always uses the wizard. |
drupal7/sites/all/modules/ctools/stylizer/stylizer.info | ||
---|---|---|
2 | 2 |
description = Create custom styles for applications such as Panels. |
3 | 3 |
core = 7.x |
4 | 4 |
package = Chaos tool suite |
5 |
version = CTOOLS_MODULE_VERSION |
|
6 | 5 |
dependencies[] = ctools |
7 | 6 |
dependencies[] = color |
8 | 7 |
|
9 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
10 |
version = "7.x-1.14"
|
|
8 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
9 |
version = "7.x-1.15"
|
|
11 | 10 |
core = "7.x" |
12 | 11 |
project = "ctools" |
13 |
datestamp = "1519455788" |
|
14 |
|
|
12 |
datestamp = "1549603691" |
drupal7/sites/all/modules/ctools/term_depth/term_depth.info | ||
---|---|---|
3 | 3 |
core = 7.x |
4 | 4 |
dependencies[] = ctools |
5 | 5 |
package = Chaos tool suite |
6 |
version = CTOOLS_MODULE_VERSION |
|
7 | 6 |
|
8 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
9 |
version = "7.x-1.14"
|
|
7 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
8 |
version = "7.x-1.15"
|
|
10 | 9 |
core = "7.x" |
11 | 10 |
project = "ctools" |
12 |
datestamp = "1519455788" |
|
13 |
|
|
11 |
datestamp = "1549603691" |
drupal7/sites/all/modules/ctools/tests/ctools_export_test/ctools_export_test.info | ||
---|---|---|
2 | 2 |
description = CTools export test module |
3 | 3 |
core = 7.x |
4 | 4 |
package = Chaos tool suite |
5 |
version = CTOOLS_MODULE_VERSION |
|
6 | 5 |
dependencies[] = ctools |
7 | 6 |
hidden = TRUE |
8 | 7 |
|
9 | 8 |
files[] = ctools_export.test |
10 | 9 |
|
11 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
12 |
version = "7.x-1.14"
|
|
10 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
11 |
version = "7.x-1.15"
|
|
13 | 12 |
core = "7.x" |
14 | 13 |
project = "ctools" |
15 |
datestamp = "1519455788" |
|
16 |
|
|
14 |
datestamp = "1549603691" |
drupal7/sites/all/modules/ctools/tests/ctools_plugin_test.info | ||
---|---|---|
1 | 1 |
name = Chaos tools plugins test |
2 | 2 |
description = Provides hooks for testing ctools plugins. |
3 | 3 |
package = Chaos tool suite |
4 |
version = CTOOLS_MODULE_VERSION |
|
5 | 4 |
core = 7.x |
6 | 5 |
dependencies[] = ctools |
7 | 6 |
hidden = TRUE |
8 | 7 |
|
9 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
10 |
version = "7.x-1.14"
|
|
8 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
9 |
version = "7.x-1.15"
|
|
11 | 10 |
core = "7.x" |
12 | 11 |
project = "ctools" |
13 |
datestamp = "1519455788" |
|
14 |
|
|
12 |
datestamp = "1549603691" |
drupal7/sites/all/modules/ctools/views_content/plugins/relationships/node_from_view.inc | ||
---|---|---|
33 | 33 |
views_content_context_get_output($context); |
34 | 34 |
|
35 | 35 |
$row = intval($conf['row']) - 1; |
36 |
if (isset($view->result[$row])) { |
|
36 |
if (isset($view->result[$row]) && isset($view->base_field) && isset($view->result[$row]->{$view->base_field})) {
|
|
37 | 37 |
$nid = $view->result[$row]->{$view->base_field}; |
38 | 38 |
if ($nid) { |
39 | 39 |
$node = node_load($nid); |
drupal7/sites/all/modules/ctools/views_content/views_content.info | ||
---|---|---|
5 | 5 |
dependencies[] = views |
6 | 6 |
core = 7.x |
7 | 7 |
package = Chaos tool suite |
8 |
version = CTOOLS_MODULE_VERSION |
|
9 | 8 |
files[] = plugins/views/views_content_plugin_display_ctools_context.inc |
10 | 9 |
files[] = plugins/views/views_content_plugin_display_panel_pane.inc |
11 | 10 |
files[] = plugins/views/views_content_plugin_style_ctools_context.inc |
12 | 11 |
|
13 |
; Information added by Drupal.org packaging script on 2018-02-24
|
|
14 |
version = "7.x-1.14"
|
|
12 |
; Information added by Drupal.org packaging script on 2019-02-08
|
|
13 |
version = "7.x-1.15"
|
|
15 | 14 |
core = "7.x" |
16 | 15 |
project = "ctools" |
17 |
datestamp = "1519455788" |
|
18 |
|
|
16 |
datestamp = "1549603691" |
drupal7/sites/all/modules/nodeaccess/CHANGELOG.txt | ||
---|---|---|
1 |
Nodeaccess 7.x-1.6 |
|
2 |
================== |
|
3 |
Corrected issues surrounding security advisory SA-CONTRIB-2019-009 |
|
4 |
Addressed compatibility issues with SQL queries regarding PostgreSQL |
|
5 |
Rebuilding of node permissions required after update. |
|
6 |
|
|
1 | 7 |
Nodeaccess 7.x-1.x |
2 | 8 |
=================== |
9 |
Issue #2427345 by trigdog: fix Database Error - nodeaccess_author duplicate entry |
|
10 |
|
|
11 |
Nodeaccess 7.x-1.5 |
|
12 |
=================== |
|
13 |
Add SimpleTest automated testing. |
|
14 |
Issue #2037899 by vlad.pavlovic: Expose operations as API. |
|
15 |
Issue #2334555 by joelpittet: Casting consistency (boolean) to (bool). |
|
16 |
Issue #2342327 by willzyx: node_access_write_grants should not be called directly. |
|
17 |
Issue #2228713 by willzyx: Unpublished nodes are visible. |
|
18 |
Issue #2140819 by justdave: "Preserve hidden grants" setting ignored. |
|
19 |
Issue #2364463 by nathanweeks, vlad.pavlovic: Incorrect SQL list quoting causes PostgreSQL error. |
|
3 | 20 |
|
4 | 21 |
Nodeaccess 7.x-1.4 |
5 | 22 |
=================== |
drupal7/sites/all/modules/nodeaccess/nodeaccess.admin.inc | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
/** |
|
4 |
* @file Nodeaccess admin forms. |
|
5 |
*/ |
|
6 |
|
|
7 |
/** |
|
8 |
* Menu callback. Draws the admin page. |
|
9 |
*/ |
|
10 |
function nodeaccess_admin() { |
|
11 |
return drupal_get_form('nodeaccess_admin_form'); |
|
12 |
} |
|
13 |
|
|
14 |
/** |
|
15 |
* Menu callback. Draws the admin page. |
|
16 |
* |
|
17 |
* @param $form |
|
18 |
* @param $form_state |
|
19 |
* |
|
20 |
* @return array $form |
|
21 |
*/ |
|
22 |
function nodeaccess_admin_form($form, $form_state) { |
|
23 |
// Set defaults from variable_get. |
|
24 |
$show = variable_get('nodeaccess-types', array()); |
|
25 |
$roles = nodeaccess_get_role_aliases(); |
|
26 |
$allowed_roles = variable_get('nodeaccess-roles', array()); |
|
27 |
$allowed_grants = variable_get('nodeaccess-grants', array()); |
|
28 |
|
|
29 |
$form['priority'] = array( |
|
30 |
'#type' => 'checkbox', |
|
31 |
'#title' => t('Give node grants priority'), |
|
32 |
'#default_value' => variable_get('nodeaccess-priority', 0), |
|
33 |
'#description' => t('If you are only using this access control module, |
|
34 |
you can safely ignore this. If you are using multiple access control |
|
35 |
modules, and you want the grants given on individual nodes to override |
|
36 |
any grants given by other modules, you should check this box.'), |
|
37 |
); |
|
38 |
|
|
39 |
// Select whether to preserve hidden grants. |
|
40 |
$form['preserve'] = array( |
|
41 |
'#type' => 'checkbox', |
|
42 |
'#title' => t('Preserve hidden grants'), |
|
43 |
'#default_value' => variable_get('nodeaccess-preserve', 1), |
|
44 |
'#description' => '<small>' . t('If you check this box, any hidden grants |
|
45 |
are preserved when you save grants. Otherwise all grants users are not |
|
46 |
allowed to view or edit are revoked on save.') . '</small>', |
|
47 |
); |
|
48 |
|
|
49 |
// Select permissions you want to allow users to view and edit. |
|
50 |
$form['grant'] = array( |
|
51 |
'#type' => 'fieldset', |
|
52 |
'#collapsible' => TRUE, |
|
53 |
'#collapsed' => TRUE, |
|
54 |
'#title' => t('Allowed Grants'), |
|
55 |
'#tree' => TRUE, |
|
56 |
'#description' => '<small>' . t('The selected grants will be listed on |
|
57 |
individual node grants. If you wish for certain grants to be hidden from |
|
58 |
users on the node grants tab, make sure they are not selected here.') . |
|
59 |
'</small>', |
|
60 |
); |
|
61 |
$form['grant']['view'] = array( |
|
62 |
'#type' => 'checkbox', |
|
63 |
'#title' => t('View'), |
|
64 |
'#default_value' => $allowed_grants['view'], |
|
65 |
); |
|
66 |
$form['grant']['edit'] = array( |
|
67 |
'#type' => 'checkbox', |
|
68 |
'#title' => t('Edit'), |
|
69 |
'#default_value' => $allowed_grants['edit'], |
|
70 |
); |
|
71 |
$form['grant']['delete'] = array( |
|
72 |
'#type' => 'checkbox', |
|
73 |
'#title' => t('Delete'), |
|
74 |
'#default_value' => $allowed_grants['delete'], |
|
75 |
); |
|
76 |
|
|
77 |
// Select roles the permissions of which you want to allow users to |
|
78 |
// view and edit, and the aliases and weights of those roles. |
|
79 |
$form['role'] = array( |
|
80 |
'#type' => 'fieldset', |
|
81 |
'#collapsible' => TRUE, |
|
82 |
'#collapsed' => TRUE, |
|
83 |
'#title' => t('Allowed Roles'), |
|
84 |
'#tree' => TRUE, |
|
85 |
'#theme' => 'nodeaccess_admin_form_roles', |
|
86 |
'#description' => t('The selected roles will be listed on individual node |
|
87 |
grants. If you wish for certain roles to be hidden from users on the node |
|
88 |
grants tab, make sure they are not selected here. You may also provide an |
|
89 |
alias for each role to be displayed to the user and a weight to order them |
|
90 |
by. This is useful if your roles have machine-readable names not intended |
|
91 |
for human users.'), |
|
92 |
); |
|
93 |
|
|
94 |
foreach ($roles as $id => $role) { |
|
95 |
// Catch NULL values. |
|
96 |
if (!$role['alias']) { |
|
97 |
$role['alias'] = ''; |
|
98 |
} |
|
99 |
if (!$role['weight']) { |
|
100 |
$role['weight'] = 0; |
|
101 |
} |
|
102 |
$form['role'][$id]['name'] = array( |
|
103 |
'#type' => 'hidden', |
|
104 |
'#value' => $role['name'], |
|
105 |
); |
|
106 |
$form['role'][$id]['allow'] = array( |
|
107 |
'#type' => 'checkbox', |
|
108 |
'#title' => check_plain($role['name']), |
|
109 |
'#default_value' => isset($allowed_roles[$id]) ? $allowed_roles[$id] : 0, |
|
110 |
); |
|
111 |
$form['role'][$id]['alias'] = array( |
|
112 |
'#type' => 'textfield', |
|
113 |
'#default_value' => $role['alias'], |
|
114 |
'#size' => 50, |
|
115 |
'#maxlength' => 50, |
|
116 |
); |
|
117 |
$form['role'][$id]['weight'] = array( |
|
118 |
'#type' => 'weight', |
|
119 |
'#default_value' => $role['weight'], |
|
120 |
'#delta' => 10, |
|
121 |
); |
|
122 |
} |
|
123 |
|
|
124 |
// Grant tab to node types. |
|
125 |
$form['nodeaccess']['tabs'] = array( |
|
126 |
'#type' => 'fieldset', |
|
127 |
'#collapsible' => TRUE, |
|
128 |
'#collapsed' => TRUE, |
|
129 |
'#title' => t('Content Type Grant Tab Access'), |
|
130 |
'#tree' => TRUE, |
|
131 |
'#description' => t('Show grant tab for the following node types.'), |
|
132 |
); |
|
133 |
|
|
134 |
$options = array(); |
|
135 |
foreach (node_type_get_types() as $type => $bundle) { |
|
136 |
$options[$type] = array( |
|
137 |
'content_type' => check_plain($bundle->name), |
|
138 |
); |
|
139 |
} |
|
140 |
$form['nodeaccess']['tabs']['show'] = array( |
|
141 |
'#type' => 'tableselect', |
|
142 |
'#header' => array( |
|
143 |
'content_type' => t('Content type'), |
|
144 |
), |
|
145 |
'#options' => $options, |
|
146 |
'#default_value' => $show, |
|
147 |
'#empty' => t('No content types to add a grant tab.'), |
|
148 |
); |
|
149 |
|
|
150 |
// Generate fieldsets for each node type. |
|
151 |
foreach (node_type_get_types() as $type => $bundle) { |
|
152 |
$form['nodeaccess'][$type] = array( |
|
153 |
'#type' => 'fieldset', |
|
154 |
'#collapsible' => TRUE, |
|
155 |
'#collapsed' => TRUE, |
|
156 |
'#title' => check_plain($bundle->name), |
|
157 |
'#tree' => TRUE, |
|
158 |
'#theme' => 'nodeaccess_admin_form_types', |
|
159 |
); |
|
160 |
|
|
161 |
// Set default author permissions for node type. |
|
162 |
$author_prefs = variable_get('nodeaccess_authors', array()); |
|
163 |
$form['nodeaccess'][$type]['author']['grant_view'] = array( |
|
164 |
'#type' => 'checkbox', |
|
165 |
'#default_value' => $author_prefs[$type]['grant_view'], |
|
166 |
); |
|
167 |
$form['nodeaccess'][$type]['author']['grant_update'] = array( |
|
168 |
'#type' => 'checkbox', |
|
169 |
'#default_value' => $author_prefs[$type]['grant_update'], |
|
170 |
); |
|
171 |
$form['nodeaccess'][$type]['author']['grant_delete'] = array( |
|
172 |
'#type' => 'checkbox', |
|
173 |
'#default_value' => $author_prefs[$type]['grant_delete'], |
|
174 |
); |
|
175 |
|
|
176 |
$perms = variable_get('nodeaccess_' . $type, array()); |
|
177 |
foreach ($perms as $perm) { |
|
178 |
$opts[$perm['gid']] = $perm; |
|
179 |
} |
|
180 |
|
|
181 |
// Set default role permissions for node type. |
|
182 |
foreach (user_roles() as $id => $role) { |
|
183 |
$form['nodeaccess'][$type]['roles'][$id]['name'] = array('#markup' => $role); |
|
184 |
$form['nodeaccess'][$type]['roles'][$id]['grant_view'] = array( |
|
185 |
'#type' => 'checkbox', |
|
186 |
'#default_value' => isset($opts[$id]['grant_view']) ? $opts[$id]['grant_view'] : 0, |
|
187 |
); |
|
188 |
$form['nodeaccess'][$type]['roles'][$id]['grant_update'] = array( |
|
189 |
'#type' => 'checkbox', |
|
190 |
'#default_value' => isset($opts[$id]['grant_update']) ? $opts[$id]['grant_update'] : 0, |
|
191 |
); |
|
192 |
$form['nodeaccess'][$type]['roles'][$id]['grant_delete'] = array( |
|
193 |
'#type' => 'checkbox', |
|
194 |
'#default_value' => isset($opts[$id]['grant_delete']) ? $opts[$id]['grant_delete'] : 0, |
|
195 |
); |
|
196 |
} |
|
197 |
|
|
198 |
// Set the default permissions if userreference exists and is enabled on |
|
199 |
// the content type. |
|
200 |
if (module_exists('user_reference')) { |
|
201 |
$bundle = field_extract_bundle('node', $bundle); |
|
202 |
$fields = field_info_instances('node', $bundle); |
|
203 |
$user_reference_perms = variable_get('nodeaccess_' . $type . '_user_reference', array()); |
|
204 |
|
|
205 |
$field_types = field_info_field_types(); |
|
206 |
|
|
207 |
foreach ($fields as $field) { |
|
208 |
$field = field_info_field($field['field_name']); |
|
209 |
if ($field['type'] == 'user_reference') { |
|
210 |
$enabled = isset($user_reference_perms[$field['field_name']]['enabled']) ? |
|
211 |
$user_reference_perms[$field['field_name']]['enabled'] : 0; |
|
212 |
$view = isset($user_reference_perms[$field['field_name']]['grant_view']) ? |
|
213 |
$user_reference_perms[$field['field_name']]['grant_view'] : 0; |
|
214 |
$update = isset($user_reference_perms[$field['field_name']]['grant_update']) ? |
|
215 |
$user_reference_perms[$field['field_name']]['grant_update'] : 0; |
|
216 |
$delete = isset($user_reference_perms[$field['field_name']]['grant_delete']) ? |
|
217 |
$user_reference_perms[$field['field_name']]['grant_delete'] : 0; |
|
218 |
|
|
219 |
$form['nodeaccess'][$type]['user_reference'][$field['field_name']]['name'] = array( |
|
220 |
'#value' => t($field_types[$field['type']]['label']), |
|
221 |
); |
|
222 |
$form['nodeaccess'][$type]['user_reference'][$field['field_name']]['enabled'] = array( |
|
223 |
'#type' => 'checkbox', |
|
224 |
'#default_value' => $enabled, |
|
225 |
); |
|
226 |
$form['nodeaccess'][$type]['user_reference'][$field['field_name']]['grant_view'] = array( |
|
227 |
'#type' => 'checkbox', |
|
228 |
'#default_value' => $view, |
|
229 |
); |
|
230 |
$form['nodeaccess'][$type]['user_reference'][$field['field_name']]['grant_update'] = array( |
|
231 |
'#type' => 'checkbox', |
|
232 |
'#default_value' => $update, |
|
233 |
); |
|
234 |
$form['nodeaccess'][$type]['user_reference'][$field['field_name']]['grant_delete'] = array( |
|
235 |
'#type' => 'checkbox', |
|
236 |
'#default_value' => $delete, |
|
237 |
); |
|
238 |
} |
|
239 |
} |
|
240 |
} |
|
241 |
} |
|
242 |
$form['submit'] = array( |
|
243 |
'#type' => 'submit', |
|
244 |
'#value' => t('Save Grants'), |
|
245 |
); |
|
246 |
return $form; |
|
247 |
} |
|
248 |
|
|
249 |
/** |
|
250 |
* Submit function for nodeaccess_admin_form. |
|
251 |
* |
|
252 |
* @param $form |
|
253 |
* @param $form_state |
|
254 |
*/ |
|
255 |
function nodeaccess_admin_form_submit($form, $form_state) { |
|
256 |
$form_values = $form_state['values']; |
|
257 |
$allowed_grants = array(); |
|
258 |
// Save priority. |
|
259 |
variable_set('nodeaccess-priority', $form_values['priority']); |
|
260 |
// Save preserve. |
|
261 |
variable_set('nodeaccess-preserve', $form_values['preserve']); |
|
262 |
// Save allowed grants. |
|
263 |
foreach ($form_values['grant'] as $id => $val) { |
|
264 |
$allowed_grants[$id] = $val; |
|
265 |
} |
|
266 |
variable_set('nodeaccess-grants', $allowed_grants); |
|
267 |
// Save allowed roles, role aliases and weights. |
|
268 |
$alias_prefs = array(); |
|
269 |
$allowed_roles = array(); |
|
270 |
foreach ($form_values['role'] as $id => $val) { |
|
271 |
$allowed_roles[$id] = $val['allow']; |
|
272 |
// Save alias and weight only for allowed roles. |
|
273 |
if ($val['allow']) { |
|
274 |
// If alias is empty, default to role name. |
|
275 |
if ($val['alias']) { |
|
276 |
$alias_prefs[$id]['name'] = $val['alias']; |
|
277 |
} |
|
278 |
else { |
|
279 |
$alias_prefs[$id]['name'] = $val['name']; |
|
280 |
} |
|
281 |
$alias_prefs[$id]['weight'] = $val['weight']; |
|
282 |
} |
|
283 |
else { |
|
284 |
// Otherwise, we only save alias if one was specified. |
|
285 |
if ($val['alias']) { |
|
286 |
$alias_prefs[$id]['name'] = $val['alias']; |
|
287 |
$alias_prefs[$id]['weight'] = $val['weight']; |
|
288 |
} |
|
289 |
} |
|
290 |
} |
|
291 |
variable_set('nodeaccess-roles', $allowed_roles); |
|
292 |
nodeaccess_save_role_aliases($alias_prefs); |
|
293 |
// Save author and role permissions for each node type. |
|
294 |
$author_prefs = array(); |
|
295 |
foreach (node_type_get_types() as $type => $name) { |
|
296 |
$grants = array(); |
|
297 |
foreach ($form_values[$type]['roles'] as $role => $val) { |
|
298 |
$grants[] = array( |
|
299 |
'gid' => $role, |
|
300 |
'realm' => 'nodeaccess_rid', |
|
301 |
'grant_view' => $val['grant_view'], |
|
302 |
'grant_update' => $val['grant_update'], |
|
303 |
'grant_delete' => $val['grant_delete'], |
|
304 |
); |
|
305 |
} |
|
306 |
variable_set('nodeaccess_' . $type, $grants); |
|
307 |
$author_prefs[$type] = $form_values[$type]['author']; |
|
308 |
// Also save userreference default permissions if enabled. |
|
309 |
if (module_exists('user_reference') && isset($form_values[$type]['user_reference'])) { |
|
310 |
$user_reference_grants = array(); |
|
311 |
foreach ($form_values[$type]['user_reference'] as $user_reference_field => $val) { |
|
312 |
$user_reference_grants[$user_reference_field] = array( |
|
313 |
'gid' => 'nodeaccess_uid', |
|
314 |
'enabled' => $val['enabled'], |
|
315 |
'grant_view' => $val['grant_view'], |
|
316 |
'grant_update' => $val['grant_update'], |
|
317 |
'grant_delete' => $val['grant_delete'], |
|
318 |
); |
|
319 |
} |
|
320 |
variable_set('nodeaccess_' . $type . '_user_reference', $user_reference_grants); |
|
321 |
} |
|
322 |
} |
|
323 |
variable_set('nodeaccess_authors', $author_prefs); |
|
324 |
|
|
325 |
// Save allowed node type grant tab. |
|
326 |
$allowed_types = array(); |
|
327 |
foreach ($form_values['tabs']['show'] as $type => $value) { |
|
328 |
$allowed_types[$type] = (bool) $value; |
|
329 |
} |
|
330 |
|
|
331 |
nodeaccess_set_type_grants($allowed_types); |
|
332 |
|
|
333 |
drupal_set_message(t('Grants saved.')); |
|
334 |
} |
|
335 |
|
|
336 |
/** |
|
337 |
* Theme function for nodeaccess_admin_form_roles. |
|
338 |
* |
|
339 |
* @param $variables |
|
340 |
* @throws Exception |
|
341 |
* @return string |
|
342 |
*/ |
|
343 |
function theme_nodeaccess_admin_form_roles($variables) { |
|
344 |
$output = ''; |
|
345 |
$form = $variables['form']; |
|
346 |
$rows = array(); |
|
347 |
foreach (element_children($form) as $rid) { |
|
348 |
// Classify the weight element for TableDrag. |
|
349 |
$form[$rid]['weight']['#attributes']['class'] = array('roles-order-weight'); |
|
350 |
|
|
351 |
// Mark the table row as draggable for TableDrag. |
|
352 |
$row = array( |
|
353 |
'data' => array(), |
|
354 |
'class' => array('draggable'), |
|
355 |
); |
|
356 |
// Render the table columns. |
|
357 |
$row['data'][] = drupal_render($form[$rid]['allow']); |
|
358 |
$row['data'][] = drupal_render($form[$rid]['alias']); |
|
359 |
$row['data'][] = drupal_render($form[$rid]['weight']); |
|
360 |
$rows[] = $row; |
|
361 |
} |
|
362 |
|
|
363 |
$header = array(t('Allow Role'), t('Alias'), t('Weight')); |
|
364 |
$output .= theme('table', array( |
|
365 |
'header' => $header, |
|
366 |
'rows' => $rows, |
|
367 |
'attributes' => array('id' => 'roles-order'), |
|
368 |
)); |
|
369 |
$output .= drupal_render_children($form); |
|
370 |
|
|
371 |
// Attach TableDrag to the table ID and contained weight elements. |
|
372 |
drupal_add_tabledrag('roles-order', 'order', 'sibling', 'roles-order-weight'); |
|
373 |
|
|
374 |
return $output; |
|
375 |
} |
|
376 |
|
|
377 |
|
|
378 |
/** |
|
379 |
* Theme function to render admin form. |
|
380 |
* |
|
381 |
* @param $variables |
|
382 |
* |
|
383 |
* @return string |
|
384 |
*/ |
|
385 |
function theme_nodeaccess_admin_form_types($variables) { |
|
386 |
$form = $variables['form']; |
|
387 |
$output = drupal_render($form['show']); |
|
388 |
$roles = element_children($form['roles']); |
|
389 |
$header = array(t('Role'), t('View'), t('Edit'), t('Delete')); |
|
390 |
$rows = array(); |
|
391 |
foreach ($roles as $role) { |
|
392 |
$row = array(); |
|
393 |
$row[] = drupal_render($form['roles'][$role]['name']); |
|
394 |
$row[] = drupal_render($form['roles'][$role]['grant_view']); |
|
395 |
$row[] = drupal_render($form['roles'][$role]['grant_update']); |
|
396 |
$row[] = drupal_render($form['roles'][$role]['grant_delete']); |
|
397 |
$rows[] = $row; |
|
398 |
} |
|
399 |
$output .= theme('table', array('header' => $header, 'rows' => $rows)); |
|
400 |
$header = array(t('Author Settings'), t('View'), t('Edit'), t('Delete')); |
|
401 |
$row = array(); |
|
402 |
$row[] = t('Node author'); |
|
403 |
$row[] = drupal_render($form['author']['grant_view']); |
|
404 |
$row[] = drupal_render($form['author']['grant_update']); |
|
405 |
$row[] = drupal_render($form['author']['grant_delete']); |
|
406 |
|
|
407 |
$output .= theme('table', array('header' => $header, 'rows' => array($row))); |
|
408 |
|
|
409 |
$output .= '<small>' . t('The settings selected for the node author will |
|
410 |
define what permissions the node author has. This cannot be changed on |
|
411 |
individual node grants.') . '</small>'; |
|
412 |
|
|
413 |
if (module_exists('user_reference') && isset($form['user_reference'])) { |
|
414 |
$user_reference_fields = element_children($form['user_reference']); |
|
415 |
$header = array(t('User Reference Field'), |
|
416 |
t('Enable this field'), |
|
417 |
t('View'), |
|
418 |
t('Edit'), |
|
419 |
t('Delete'), |
|
420 |
); |
|
421 |
$rows = array(); |
|
422 |
foreach ($user_reference_fields as $user_reference_field) { |
|
423 |
$row = array(); |
|
424 |
|
|
425 |
$row[] = $form['user_reference'][$user_reference_field]['name']['#value']; |
|
426 |
$row[] = drupal_render($form['user_reference'][$user_reference_field]['enabled']); |
|
427 |
$row[] = drupal_render($form['user_reference'][$user_reference_field]['grant_view']); |
|
428 |
$row[] = drupal_render($form['user_reference'][$user_reference_field]['grant_update']); |
|
429 |
$row[] = drupal_render_children($form['user_reference'][$user_reference_field]['grant_delete']); |
|
430 |
$rows[] = $row; |
|
431 |
} |
|
432 |
$output .= theme('table', array( |
|
433 |
'header' => $header, |
|
434 |
'rows' => $rows, |
|
435 |
)); |
|
436 |
$output .= '<small>' . t('If enabled, the value of the user reference field |
|
437 |
will be granted the associated permissions. If a user changes the value of |
|
438 |
the user reference field on a node, the associated user will be modified |
|
439 |
in the node-specific access table.') . '</small>'; |
|
440 |
} |
|
441 |
return $output; |
|
442 |
} |
drupal7/sites/all/modules/nodeaccess/nodeaccess.api.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
/** |
|
4 |
* @file |
|
5 |
* API documentation for Nodeaccess module. |
|
6 |
*/ |
|
7 |
|
|
8 |
|
|
9 |
/** |
|
10 |
* Allow for changes to be made on the entire grants array for a node before |
|
11 |
* saving. |
|
12 |
* |
|
13 |
* @param array &$grants |
|
14 |
* array( |
|
15 |
* array( |
|
16 |
* 'gid' => (int) gid for realm, |
|
17 |
* 'realm' => (string) what realm the access grant belongs to (ex: nodeaccess_rid). |
|
18 |
* 'grant_view' => (int) view access being granted, |
|
19 |
* 'grant_update' => (int) update access being granted, |
|
20 |
* 'grant_delete' => (int) delete access being granted, |
|
21 |
* ), |
|
22 |
* ... |
|
23 |
* ) |
|
24 |
* @param $node |
|
25 |
* Node object the grant is being applied to. |
|
26 |
*/ |
|
27 |
function hook_nodeaccess_grants_alter(&$grants, $node) { |
|
28 |
foreach ($grants as $gid => $grant) { |
|
29 |
// Make some changes to the grants. |
|
30 |
} |
|
31 |
} |
|
32 |
|
|
33 |
|
|
34 |
/** |
|
35 |
* Allow for changes to be made on the single grant item prior to saving. |
|
36 |
* |
|
37 |
* @param array &$grant |
|
38 |
* array( |
|
39 |
* 'gid' => (int) gid for realm, |
|
40 |
* 'realm' => (string) what realm the access grant belongs to (ex: nodeaccess_rid). |
|
41 |
* 'grant_view' => (int) view access being granted, |
|
42 |
* 'grant_update' => (int) update access being granted, |
|
43 |
* 'grant_delete' => (int) delete access being granted, |
|
44 |
* ) |
|
45 |
* @param $node |
|
46 |
* Node object the grant is being applied to. |
|
47 |
*/ |
|
48 |
function hook_nodeaccess_grant_alter(&$grant, $node) { |
|
49 |
// Make some change to the individual grant. |
|
50 |
} |
drupal7/sites/all/modules/nodeaccess/nodeaccess.info | ||
---|---|---|
4 | 4 |
package = Access control |
5 | 5 |
configure = admin/config/people/nodeaccess |
6 | 6 |
|
7 |
; Information added by Drupal.org packaging script on 2014-10-06 |
|
8 |
version = "7.x-1.4" |
|
7 |
files[] = tests/nodeaccess_grant.test |
|
8 |
files[] = tests/nodeaccess_role.test |
|
9 |
files[] = tests/nodeaccess_publish.test |
|
10 |
|
|
11 |
; Information added by Drupal.org packaging script on 2019-02-09 |
|
12 |
version = "7.x-1.6" |
|
9 | 13 |
core = "7.x" |
10 | 14 |
project = "nodeaccess" |
11 |
datestamp = "1412639629" |
|
12 |
|
|
15 |
datestamp = "1549753983" |
drupal7/sites/all/modules/nodeaccess/nodeaccess.install | ||
---|---|---|
164 | 164 |
// Remove tables. |
165 | 165 |
drupal_uninstall_schema('nodeaccess'); |
166 | 166 |
} |
167 |
|
|
168 |
/** |
|
169 |
* Flag nodeaccess permissions as needing a rebuild. Rebuild permissions from the status page. |
|
170 |
*/ |
|
171 |
function nodeaccess_update_7105() { |
|
172 |
node_access_needs_rebuild(); |
|
173 |
} |
drupal7/sites/all/modules/nodeaccess/nodeaccess.module | ||
---|---|---|
5 | 5 |
* Provide per node access control |
6 | 6 |
*/ |
7 | 7 |
|
8 |
|
|
8 | 9 |
/** |
9 | 10 |
* Implements hook_help(). |
11 |
* |
|
12 |
* @param string $path |
|
13 |
* @param $arg |
|
14 |
* |
|
15 |
* @return string|NULL |
|
10 | 16 |
*/ |
11 | 17 |
function nodeaccess_help($path, $arg) { |
12 | 18 |
switch ($path) { |
13 | 19 |
case 'node/%/grant': |
14 |
return t("You can set grants for individual users. Enter a name or a partial name in the box and click Search or press return. You must check the 'Keep?' checkbox if you want to keep the user for granting. Note that user grants are in addition to those coming from roles."); |
|
20 |
return t("You can set grants for individual users. Enter a name or a |
|
21 |
partial name in the box and click Search or press return. You must check |
|
22 |
the 'Keep?' checkbox if you want to keep the user for granting. Note |
|
23 |
that user grants are in addition to those coming from roles."); |
|
15 | 24 |
} |
16 | 25 |
} |
17 | 26 |
|
27 |
|
|
18 | 28 |
/** |
19 | 29 |
* Implements hook_menu(). |
30 |
* |
|
31 |
* @return array |
|
20 | 32 |
*/ |
21 | 33 |
function nodeaccess_menu() { |
34 |
$items = array(); |
|
35 |
|
|
22 | 36 |
$items['admin/config/people/nodeaccess'] = array( |
23 | 37 |
'title' => 'Nodeaccess', |
24 | 38 |
'description' => 'Change default settings for the Nodeaccess module.', |
25 | 39 |
'page callback' => 'nodeaccess_admin', |
40 |
'file' => 'nodeaccess.admin.inc', |
|
26 | 41 |
'access arguments' => array('administer nodeaccess'), |
27 | 42 |
); |
43 |
|
|
28 | 44 |
$items['node/%node/grant'] = array( |
29 | 45 |
'title' => 'Grant', |
30 |
'page callback' => 'nodeaccess_grants',
|
|
46 |
'page callback' => 'nodeaccess_grant_tab',
|
|
31 | 47 |
'page arguments' => array(1), |
32 | 48 |
'access callback' => 'nodeaccess_access', |
33 | 49 |
'access arguments' => array('grant', 1), |
34 | 50 |
'weight' => 5, |
35 | 51 |
'type' => MENU_LOCAL_TASK, |
36 | 52 |
); |
53 |
|
|
37 | 54 |
return $items; |
38 | 55 |
} |
39 | 56 |
|
57 |
|
|
40 | 58 |
/** |
41 | 59 |
* Implements hook_admin_paths(). |
60 |
* |
|
61 |
* @return array |
|
42 | 62 |
*/ |
43 | 63 |
function nodeaccess_admin_paths() { |
44 | 64 |
$paths = array( |
45 | 65 |
'node/*/grant' => TRUE, |
46 | 66 |
'admin/config/people/nodeaccess' => TRUE, |
47 | 67 |
); |
68 |
|
|
48 | 69 |
return $paths; |
49 | 70 |
} |
50 | 71 |
|
51 | 72 |
/** |
52 | 73 |
* Implements hook_permission(). |
74 |
* |
|
75 |
* @return array |
|
53 | 76 |
*/ |
54 | 77 |
function nodeaccess_permission() { |
55 | 78 |
|
... | ... | |
72 | 95 |
); |
73 | 96 |
} |
74 | 97 |
|
98 |
|
|
75 | 99 |
/** |
76 | 100 |
* Implements hook_node_access(). |
101 |
* |
|
102 |
* @param $node |
|
103 |
* @param $op |
|
104 |
* @param $account |
|
105 |
* |
|
106 |
* @return string |
|
77 | 107 |
*/ |
78 | 108 |
function nodeaccess_node_access($node, $op, $account) { |
109 |
|
|
79 | 110 |
switch ($op) { |
80 | 111 |
case 'update': |
81 | 112 |
case 'delete': |
... | ... | |
85 | 116 |
} |
86 | 117 |
// If the node belongs to a deleted user. |
87 | 118 |
if ($account->uid == 0 && $node->uid == 0) { |
119 |
$grants = nodeaccess_get_grants($node); |
|
88 | 120 |
// We check if the role has particular access to this node. |
89 |
$grants = _nodeaccess_get_grants($node); |
|
90 | 121 |
// If anonymous has rights to this node, we allow them. |
91 |
if (($grants['rid'][1]['grant_update'] && $op == 'update') ||
|
|
92 |
($grants['rid'][1]['grant_delete'] && $op == 'delete')) {
|
|
122 |
if ((!empty($grants['rid'][DRUPAL_ANONYMOUS_RID]['grant_update']) && $op == 'update') ||
|
|
123 |
(!empty($grants['rid'][DRUPAL_ANONYMOUS_RID]['grant_delete']) && $op == 'delete')) {
|
|
93 | 124 |
return NODE_ACCESS_ALLOW; |
94 | 125 |
} |
95 | 126 |
return NODE_ACCESS_DENY; |
96 | 127 |
} |
97 | 128 |
break; |
98 |
|
|
99 |
case 'view': |
|
100 |
if (!isset($account->uid)) { |
|
101 |
global $user; |
|
102 |
$account = $user; |
|
103 |
} |
|
104 |
// If the node is not published. We check other permissions. |
|
105 |
if (!$node->status) { |
|
106 |
// If the current user is the author and not anonymous. |
|
107 |
if ($node->uid == $account->uid && $account->uid > 0) { |
|
108 |
// We check to see if they have access to view own unpublished. |
|
109 |
if (user_access('view own unpublished content') || user_access('bypass node access')) { |
|
110 |
return NODE_ACCESS_ALLOW; |
|
111 |
} |
|
112 |
} |
|
113 |
elseif (user_access('bypass node access')) { |
|
114 |
return NODE_ACCESS_ALLOW; |
|
115 |
} |
|
116 |
return NODE_ACCESS_IGNORE; |
|
117 |
} |
|
118 |
break; |
|
119 |
|
|
120 | 129 |
} |
121 | 130 |
} |
122 | 131 |
|
123 | 132 |
/** |
124 | 133 |
* Determine access to Grant tab. |
134 |
* |
|
135 |
* @param $op |
|
136 |
* @param $node |
Formats disponibles : Unified diff
Weekly update of contrib modules