Révision 64156087
Ajouté par Assos Assos il y a plus de 7 ans
drupal7/sites/all/modules/panels/panels_node/panels_node.module | ||
---|---|---|
1 | 1 |
<?php |
2 |
|
|
3 |
|
|
4 | 2 |
/** |
5 | 3 |
* @file panels_node.module |
6 | 4 |
* |
... | ... | |
10 | 8 |
*/ |
11 | 9 |
|
12 | 10 |
// --------------------------------------------------------------------------- |
13 |
// General Drupal hooks |
|
14 |
|
|
11 |
// General Drupal hooks. |
|
15 | 12 |
/** |
16 | 13 |
* Implementation of hook_permission(). |
17 | 14 |
*/ |
... | ... | |
81 | 78 |
} |
82 | 79 |
|
83 | 80 |
/** |
84 |
* Access callback to determine if a user has edit access |
|
81 |
* Access callback to determine if a user has edit access.
|
|
85 | 82 |
*/ |
86 | 83 |
function panels_node_edit_node($node) { |
87 | 84 |
if (!isset($node->panels_node)) { |
... | ... | |
113 | 110 |
} |
114 | 111 |
|
115 | 112 |
// --------------------------------------------------------------------------- |
116 |
// Node hooks |
|
117 |
|
|
113 |
// Node hooks. |
|
118 | 114 |
/** |
119 | 115 |
* Implementation of hook_node_info(). |
120 | 116 |
*/ |
... | ... | |
202 | 198 |
); |
203 | 199 |
|
204 | 200 |
// Support for different rendering pipelines |
205 |
// Mostly borrowed from panel_context.inc |
|
201 |
// Mostly borrowed from panel_context.inc.
|
|
206 | 202 |
$pipelines = panels_get_renderer_pipelines(); |
207 | 203 |
|
208 | 204 |
$options = array(); |
... | ... | |
257 | 253 |
|
258 | 254 |
// Special handling for nodes being imported from an export.module data dump. |
259 | 255 |
if (!empty($node->export_display)) { |
260 |
// This works by overriding the $display set above |
|
256 |
// This works by overriding the $display set above.
|
|
261 | 257 |
eval($node->export_display); |
262 | 258 |
unset($node->export_display); |
263 | 259 |
} |
... | ... | |
336 | 332 |
} |
337 | 333 |
|
338 | 334 |
// --------------------------------------------------------------------------- |
339 |
// Administrative pages |
|
340 |
|
|
335 |
// Administrative pages. |
|
341 | 336 |
/** |
342 | 337 |
* Settings for panel nodes. |
343 | 338 |
*/ |
... | ... | |
347 | 342 |
} |
348 | 343 |
|
349 | 344 |
// --------------------------------------------------------------------------- |
350 |
// Meat of the Panels API; almost completely passing through to panels.module |
|
351 |
|
|
345 |
// Meat of the Panels API; almost completely passing through to panels.module. |
|
352 | 346 |
/** |
353 | 347 |
* Pass through to the panels layout editor. |
354 | 348 |
*/ |
... | ... | |
385 | 379 |
} |
386 | 380 |
|
387 | 381 |
/** |
388 |
* Implementation of hook_export_node_alter() |
|
382 |
* Implementation of hook_export_node_alter().
|
|
389 | 383 |
* |
390 | 384 |
* Integrate with export.module for saving panel_nodes into code. |
391 | 385 |
*/ |
... | ... | |
423 | 417 |
// Only allow access to use the IPE if the user has 'update' access to |
424 | 418 |
// the underlying node. |
425 | 419 |
$node = $display->context['panel-node']->data; |
426 |
return node_access('update', $node);
|
|
420 |
return node_access('update', $node); |
|
427 | 421 |
} |
428 | 422 |
} |
429 | 423 |
|
430 | 424 |
// --------------------------------------------------------------------------- |
431 | 425 |
// Callbacks for panel caching. |
432 |
|
|
433 | 426 |
/** |
434 | 427 |
* Get display edit cache for a panel node being edited. |
435 | 428 |
* |
... | ... | |
451 | 444 |
$cache->display->css_id = $node->panels_node['css_id']; |
452 | 445 |
$cache->display->context = panels_node_get_context($node); |
453 | 446 |
$cache->display->cache_key = 'panels_node:' . $node->nid; |
454 |
$cache->content_types = panels_common_get_allowed_types('panels_node', $cache->display->context);
|
|
447 |
$cache->content_types = panels_common_get_allowed_types('panels_node', $cache->display->context); |
|
455 | 448 |
$cache->allwed_layouts = panels_common_get_allowed_layouts('panels_node'); |
456 | 449 |
} |
457 | 450 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules