term.inc File Reference

(1.1.2.7 2008/06/03 13:18:07 pancho)


Detailed Description

Plugin to provide a term context

Definition in file term.inc.

Go to the source code of this file.

Functions

 panels_context_create_term ($empty, $data=NULL, $conf=FALSE)
 panels_context_term_settings_form ($conf, $external=FALSE)
 panels_context_term_settings_form_validate ($form, $form_values)
 panels_term_panels_contexts ()


Function Documentation

panels_context_create_term ( empty,
data = NULL,
conf = FALSE 
)

It's important to remember that $conf is optional here, because contexts are not always created from the UI.

Definition at line 29 of file term.inc.

00029                                                                          {
00030   $context = new panels_context('term');
00031   $context->plugin = 'term';
00032 
00033   if ($empty) {
00034     return $context;
00035   }
00036 
00037   if ($conf) {
00038     $data = taxonomy_get_term($data['tid']);
00039   }
00040 
00041   if (!empty($data)) {
00042     $context->data     = $data;
00043     $context->title    = $data->name;
00044     $context->argument = $data->tid;
00045     return $context;
00046   }
00047 }

panels_context_term_settings_form ( conf,
external = FALSE 
)

Definition at line 49 of file term.inc.

00049                                                                      {
00050   $form = array();
00051   if ($external) {
00052     $form['external'] = array(
00053       '#type' => 'checkbox',
00054       '#default_value' => $conf['external'],
00055       '#title' => t('Require this context from an external source (such as a containing panel page).'),
00056       '#description' => t('If selected, term selection (below) will be ignored'),
00057     );
00058   }
00059   return $form;
00060 }

panels_context_term_settings_form_validate ( form,
form_values 
)

Validate a term.

Definition at line 65 of file term.inc.

00065                                                                          {
00066 }

panels_term_panels_contexts (  ) 

Definition at line 11 of file term.inc.

00011                                        {
00012   $args['term'] = array(
00013     'title' => t("Taxonomy term"),
00014     'description' => t('A single taxonomy term object.'),
00015     'context' => 'panels_context_create_term',
00016     'settings form' => 'panels_context_term_settings_form',
00017     'settings form validate' => 'panels_context_term_settings_form_validate',
00018     'keyword' => 'term',
00019     'no ui' => TRUE,
00020     'context name' => 'term',
00021   );
00022   return $args;
00023 }


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