/[drupal]/contributions/modules/taxonomy_context/taxonomy_context.module
ViewVC logotype

Diff of /contributions/modules/taxonomy_context/taxonomy_context.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.82.4.10, Sat Oct 3 20:11:30 2009 UTC revision 1.82.4.11, Mon Oct 5 18:23:10 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: taxonomy_context.module,v 1.82.4.9 2009/10/03 19:44:14 nancyw Exp $  // $Id: taxonomy_context.module,v 1.82.4.10 2009/10/03 20:11:30 nancyw Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 240  function taxonomy_context_get_links($typ Line 240  function taxonomy_context_get_links($typ
240   */   */
241  function taxonomy_context_form_alter(&$form, &$form_state, $form_id) {  function taxonomy_context_form_alter(&$form, &$form_state, $form_id) {
242    if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {    if ($form_id == 'node_type_form' && isset($form['identity']['type'])) {
243      $options = $endis;      $options = array(t('Disabled'), t('Enabled'));
244      $form['taxonomy_context'] = array('#type' => 'fieldset', '#title' => t('Taxonomy context'), '#weight' => 0);      $form['taxonomy_context'] = array('#type' => 'fieldset', '#title' => t('Taxonomy context'), '#weight' => 0);
245      $form['taxonomy_context']['taxonomy_context_inline'] = array(      $form['taxonomy_context']['taxonomy_context_inline'] = array(
246        '#type' => 'radios',        '#type' => 'radios',
247        '#title' => t('Display taxonomy inline'),        '#title' => t('Display taxonomy inline'),
248        '#default_value' => variable_get('taxonomy_context_inline_'. $form['#node_type']->type, 0),        '#default_value' => variable_get('taxonomy_context_inline_'. $form['#node_type']->type, 0),
249        '#options' => $options,        '#options' => $options,
250        '#description' => t('Display taxonomy information in node body.'),        '#description' => t('Display taxonomy information in node body. "Disabled" is standard Drupal behavior; "enabled" adds the taxonomy context information to the content area.'),
251      );        '#attributes' => array('class' => 'container-inline'),
252          );
253        $form['taxonomy_context']['taxonomy_context_inline_weight'] = array(
254          '#type' => 'weight',
255          '#delta' => 10,
256          '#title' => t('Display taxonomy inline weight'),
257          '#default_value' => variable_get('taxonomy_context_inline_weight_'. $form['#node_type']->type, 10),
258          '#options' => $options,
259          '#description' => t('Control where the taxonomy information displays in node body.'),
260          '#attributes' => array('class' => 'container-inline'),
261          );
262      $form['taxonomy_context']['taxonomy_context_breadcrumb'] = array(      $form['taxonomy_context']['taxonomy_context_breadcrumb'] = array(
263        '#type' => 'radios',        '#type' => 'radios',
264        '#title' => t('Show taxonomy breadcrumb'),        '#title' => t('Show taxonomy breadcrumb'),
265        '#default_value' => variable_get('taxonomy_context_breadcrumb_'. $form['#node_type']->type, 0),        '#default_value' => variable_get('taxonomy_context_breadcrumb_'. $form['#node_type']->type, 0),
266        '#options' => $options,        '#options' => $options,
267        '#description' => t('Display a breadcrumb with full taxonomy context.'),        '#description' => t('Display a breadcrumb with full taxonomy context.'),
268      );        '#attributes' => array('class' => 'container-inline'),
269          );
270    }    }
271    
272    if (in_array($form_id, array('taxonomy_form_term', 'taxonomy_form_vocabulary'))) {    if (in_array($form_id, array('taxonomy_form_term', 'taxonomy_form_vocabulary'))) {
# Line 287  function taxonomy_context_load($type, &$ Line 298  function taxonomy_context_load($type, &$
298  function taxonomy_context_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {  function taxonomy_context_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
299    switch ($op) {    switch ($op) {
300      case 'view':      case 'view':
301        if ((arg(0) == 'node') && variable_get("taxonomy_context_inline_$node->type", 0)) {        if ((arg(0) == 'node') && variable_get('taxonomy_context_inline_' . $node->type, 0)) {
302          $node->content['taxonomy_context_taxonomy'] = array(          $node->content['taxonomy_context_taxonomy'] = array(
303            '#value' => '',            '#value' => '',
304            '#weight' => 10,            '#weight' => variable_get('taxonomy_context_inline_weight_'. $node->type, 10),
305          );            );
306          $vocabularies = taxonomy_get_vocabularies($node->type);          $vocabularies = taxonomy_get_vocabularies($node->type);
307          foreach ($vocabularies as $vocabulary) {          foreach ($vocabularies as $vocabulary) {
308            if ($vocabulary->terms = taxonomy_node_get_terms_by_vocabulary($node, $vocabulary->vid)) {            if ($vocabulary->terms = taxonomy_node_get_terms_by_vocabulary($node, $vocabulary->vid)) {

Legend:
Removed from v.1.82.4.10  
changed lines
  Added in v.1.82.4.11

  ViewVC Help
Powered by ViewVC 1.1.2