Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/plugins/content_types/node_context/node_content.inc | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
|
3 | 3 |
/** |
4 |
* @file |
|
4 | 5 |
* Plugins are described by creating a $plugin array which will be used |
5 | 6 |
* by the system that includes this file. |
6 | 7 |
*/ |
8 |
|
|
7 | 9 |
$plugin = array( |
8 | 10 |
'single' => TRUE, |
9 | 11 |
'title' => t('Node content'), |
... | ... | |
27 | 29 |
* Render the node content. |
28 | 30 |
*/ |
29 | 31 |
function ctools_node_content_content_type_render($subtype, $conf, $panel_args, $context) { |
30 |
if (!empty($context) && ( empty($context->data) || empty($context->data->nid)) ){
|
|
32 |
if (!empty($context) && (empty($context->data) || empty($context->data->nid))) {
|
|
31 | 33 |
return; |
32 | 34 |
} |
33 | 35 |
|
34 | 36 |
$node = isset($context->data) ? clone $context->data : NULL; |
35 | 37 |
$block = new stdClass(); |
36 | 38 |
$block->module = 'node'; |
37 |
$block->delta = $node->nid;
|
|
39 |
$block->delta = $node->nid; |
|
38 | 40 |
|
39 | 41 |
if (empty($node)) { |
40 | 42 |
$block->delta = 'placeholder'; |
41 |
$block->title = t('Node title.'); |
|
43 |
$block->title = t('Node title.');
|
|
42 | 44 |
$block->content = t('Node content goes here.'); |
43 | 45 |
} |
44 | 46 |
else { |
... | ... | |
86 | 88 |
$links['node-readmore'] = array( |
87 | 89 |
'title' => t('Read more'), |
88 | 90 |
'href' => 'node/' . $node->nid, |
89 |
'attributes' => array('rel' => 'tag', 'title' => strip_tags($node->title)) |
|
91 |
'attributes' => array('rel' => 'tag', 'title' => strip_tags($node->title)),
|
|
90 | 92 |
); |
91 | 93 |
} |
92 | 94 |
|
... | ... | |
201 | 203 |
function ctools_node_content_content_type_admin_title($subtype, $conf, $context) { |
202 | 204 |
return t('"@s" content', array('@s' => $context->identifier)); |
203 | 205 |
} |
204 |
|
Formats disponibles : Unified diff
Weekly update of contrib modules