Révision c304a780
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/ctools/plugins/content_types/node_context/node_title.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 title'), |
... | ... | |
23 | 25 |
* Render the custom content type. |
24 | 26 |
*/ |
25 | 27 |
function ctools_node_title_content_type_render($subtype, $conf, $panel_args, $context) { |
26 |
if (!empty($context) && ( empty($context->data) || empty($context->data->nid)) ){
|
|
28 |
if (!empty($context) && (empty($context->data) || empty($context->data->nid))) {
|
|
27 | 29 |
return; |
28 | 30 |
} |
29 | 31 |
|
... | ... | |
33 | 35 |
// Load information about the node type. |
34 | 36 |
$type = node_type_get_type($node); |
35 | 37 |
|
36 |
// Generate the title |
|
38 |
// Generate the title.
|
|
37 | 39 |
$content = !empty($conf['link']) ? l($node->title, 'node/' . $node->nid) : check_plain($node->title); |
38 | 40 |
|
39 |
// Build any surrounding markup if so configured |
|
41 |
// Build any surrounding markup if so configured.
|
|
40 | 42 |
if (isset($conf['markup']) && $conf['markup'] != 'none') { |
41 | 43 |
$markup = '<' . $conf['markup']; |
42 | 44 |
if (!empty($conf['id'])) { |
... | ... | |
50 | 52 |
} |
51 | 53 |
|
52 | 54 |
// Build the content type block. |
53 |
$block = new stdClass(); |
|
55 |
$block = new stdClass();
|
|
54 | 56 |
$block->module = 'node_title'; |
55 | 57 |
$block->title = $type->title_label; |
56 | 58 |
$block->content = $content; |
Formats disponibles : Unified diff
Weekly update of contrib modules