node_meta.inc File Reference

(1.1.2.1 2008/08/03 03:06:48 sdboyer)

Go to the source code of this file.

Functions

 panels_admin_content_types_node_meta ()
 panels_admin_edit_node_meta ($id, $parents, $conf=array())
 panels_admin_title_node_meta ($conf, $context)
 panels_content_node_meta ($conf, $panel_args, $context)
 panels_node_meta_panels_content_types ()
 theme_panels_node_meta ($node, $conf)


Function Documentation

panels_admin_content_types_node_meta (  ) 

Return all content types available.

Definition at line 23 of file node_meta.inc.

References panels_get_path().

00023                                                 {
00024   return array(
00025     'content' => array(
00026       'title' => t('Node meta data'),
00027       'icon' => 'icon_node.png',
00028       'path' => panels_get_path('content_types/node'),
00029       'description' => t('Meta data of the referenced node.'),
00030       'required context' => new panels_required_context(t('Node'), 'node'),
00031       'category' => array(t('Node context'), -9),
00032     ),
00033   );
00034 }

Here is the call graph for this function:

panels_admin_edit_node_meta ( id,
parents,
conf = array() 
)

Returns an edit form for the custom type.

Definition at line 104 of file node_meta.inc.

00104                                                                      {
00105   $conf += array(
00106     'override_title' => FALSE,
00107     'override_title_text' => '',
00108     'title' => TRUE,
00109     'author' => FALSE,
00110     'created' => FALSE,
00111     'modified' => FALSE,
00112   );
00113 
00114   $form['aligner_start'] = array(
00115     '#value' => '<div class="option-text-aligner">',
00116   );
00117   $form['override_title'] = array(
00118     '#type' => 'checkbox',
00119     '#default_value' => $conf['override_title'],
00120     '#title' => t('Override title'),
00121     '#id' => 'override-title-checkbox',
00122   );
00123   $form['override_title_text'] = array(
00124     '#type' => 'textfield',
00125     '#default_value' => $conf['override_title_text'],
00126     '#size' => 35,
00127     '#id' => 'override-title-textfield',
00128   );
00129   $form['aligner_stop'] = array(
00130     '#value' => '</div><div style="clear: both; padding: 0; margin: 0"></div>',
00131   );
00132   $form['title'] = array(
00133     '#title' => t('Title'),
00134     '#type' => 'checkbox',
00135     '#default_value' => $conf['title'],
00136     '#description' => t('Check here to display the title of the node.'),
00137   );
00138   $form['author'] = array(
00139     '#title' => t('Author'),
00140     '#type' => 'checkbox',
00141     '#default_value' => $conf['author'],
00142     '#description' => t('Check here to display the author of the node.'),
00143   );
00144   $form['created'] = array(
00145     '#title' => t('Created date'),
00146     '#type' => 'checkbox',
00147     '#default_value' => $conf['created'],
00148     '#description' => t('Check here to display the creation date of the node.'),
00149   );
00150   $form['changed'] = array(
00151     '#title' => t('Modified date'),
00152     '#type' => 'checkbox',
00153     '#default_value' => $conf['modified'],
00154     '#description' => t('Check here to display the modification date of the node.'),
00155   );
00156   return $form;
00157 }

panels_admin_title_node_meta ( conf,
context 
)

Definition at line 159 of file node_meta.inc.

00159                                                        {
00160   return t('"@s" meta content', array('@s' => $context->identifier));
00161 }

panels_content_node_meta ( conf,
panel_args,
context 
)

Definition at line 36 of file node_meta.inc.

00036                                                                 {
00037   if (!empty($context) && empty($context->data)) {
00038     return;
00039   }
00040 
00041   $node = isset($context->data) ? drupal_clone($context->data) : NULL;
00042   $block = new stdClass();
00043   $block->module = 'node';
00044   $block->delta  = $node->nid;
00045 
00046   if (empty($node)) {
00047     $block->delta   = 'placeholder';
00048     $block->subject = t('Node title.');
00049     $block->content = t('Node meta content goes here.');
00050   }
00051   else {
00052     $block->content = theme('panels_node_meta', $node, $conf);
00053   }
00054   if (empty($block->content)) {
00055     return;
00056   }
00057 
00058   if (node_access('update', $node)) {
00059     $block->admin_links['update'] = array(
00060       'title' => t('Edit node'),
00061       'alt' => t("Edit this node"),
00062       'href' => "node/$node->nid/edit",
00063       'query' => drupal_get_destination(),
00064     );
00065   }
00066 
00067   return $block;
00068 }

panels_node_meta_panels_content_types (  ) 

Callback function to supply a list of content types.

Definition at line 8 of file node_meta.inc.

00008                                                  {
00009   $items['node_meta'] = array(
00010     'single' => TRUE,
00011     'content_types' => 'panels_admin_content_types_node_meta',
00012     'render callback' => 'panels_content_node_meta',
00013     'add callback' => 'panels_admin_edit_node_meta',
00014     'edit callback' => 'panels_admin_edit_node_meta',
00015     'title callback' => 'panels_admin_title_node_meta',
00016   );
00017   return $items;
00018 }

theme_panels_node_meta ( node,
conf 
)

Render the provided node's meta data. Can be overridden using the normal theming techniques.

Definition at line 74 of file node_meta.inc.

00074                                               {
00075   $output = '';
00076   if ($conf['title']) {
00077     $output .= '<div class="node-title">';
00078     $output .= check_plain($node->title);
00079     $output .= '</div>';
00080   }
00081   if ($conf['author']) {
00082     $output .= '<div class="node-author">';
00083     // 2nd parameter for User Display API support.
00084     $output .= theme('username', $node, 'panels_node_meta_'. $node->type);
00085     $output .= '</div>';
00086   }
00087   if ($conf['created']) {
00088     $output .= '<div class="node-created">';
00089     $output .= format_date($node->created);
00090     $output .= '</div>';
00091   }
00092   if ($conf['changed']) {
00093     $output .= '<div class="node-modified">';
00094     $output .= format_date($node->changed);
00095     $output .= '</div>';
00096   }
00097 
00098   return $output;
00099 }


Generated on Thu Jul 29 05:00:16 2010 for Panels 2 by  doxygen 1.5.6