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

Diff of /contributions/modules/nodewords_nodetype/nodewords_nodetype.module

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

revision 1.2.2.1, Mon Jun 1 17:36:37 2009 UTC revision 1.2.2.2, Mon Jun 1 18:30:19 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /* $Id: nodewords_nodetype.module,v 1.2 2009/06/01 17:24:11 hanoii Exp $ */  /* $Id: nodewords_nodetype.module,v 1.2.2.1 2009/06/01 17:36:37 hanoii Exp $ */
3    
4  function nodewords_nodetype_form_alter(&$form, &$form_state, $form_id) {  function nodewords_nodetype_form_alter(&$form, &$form_state, $form_id) {
5    if ($form_id == 'node_type_form' && isset($form['#node_type'])) {    if ($form_id == 'node_type_form' && isset($form['#node_type'])) {
# Line 8  function nodewords_nodetype_form_alter(& Line 8  function nodewords_nodetype_form_alter(&
8          '#type' => 'fieldset',          '#type' => 'fieldset',
9          '#title' => t('Meta tags node type'),          '#title' => t('Meta tags node type'),
10          '#collapsible' => TRUE,          '#collapsible' => TRUE,
11          '#collapsed' => FALSE,          '#collapsed' => TRUE,
12        );        );
13            $form['nodewords_nodetype']['nodewords_nodetype_robots'] = array(
14            '#type' => 'select',
15                '#title' => t('Default robots meta tag'),
16            '#options' => array(
17                  '' => t('Use Meta tags default'),
18                  'index,follow' => 'ALL=INDEX,FOLLOW',
19            'noindex,follow' => 'NOINDEX,FOLLOW',
20            'index,nofollow' => 'INDEX,NOFOLLOW',
21            'noindex,nofollow' => 'NONE=NOINDEX,NOFOLLOW',
22            ),
23            '#multiple' => FALSE,
24          '#default_value' => variable_get('nodewords_nodetype_robots_'. $form['#node_type']->type, ''),
25            '#description' => t('The ROBOTS meta tag offers a simple mechanism to indicate to web robots and crawlers wether the page should be indexed (INDEX or NOINDEX) and whether links on the page should be followed (FOLLOW or NOFOLLOW). Here you can enter the default robots meta tag to use for all pages. If unsure, select "ALL=INDEX,FOLLOW".'),
26            );
27      $form['nodewords_nodetype']['nodewords_nodetype_keywords'] = array(      $form['nodewords_nodetype']['nodewords_nodetype_keywords'] = array(
28        '#type' => 'textfield',        '#type' => 'textfield',
29        '#title' => t('Default "keywords" meta tag'),        '#title' => t('Default "keywords" meta tag'),
# Line 89  function nodewords_nodetype_nodewords(&$ Line 102  function nodewords_nodetype_nodewords(&$
102          if ( ( $keywords = variable_get('nodewords_nodetype_keywords_'. $node->type, '') ) !== '' ) {          if ( ( $keywords = variable_get('nodewords_nodetype_keywords_'. $node->type, '') ) !== '' ) {
103            $tags['keywords'] = _nodewords_check_content(token_replace($keywords, 'node', $node));            $tags['keywords'] = _nodewords_check_content(token_replace($keywords, 'node', $node));
104          }          }
105            if ( ( $robots = variable_get('nodewords_nodetype_robots_'. $node->type, '') ) !== '' ) {
106              $tags['robots'] = _nodewords_check_content(token_replace($robots, 'node', $node));
107            }
108        }        }
109    
110        break;        break;

Legend:
Removed from v.1.2.2.1  
changed lines
  Added in v.1.2.2.2

  ViewVC Help
Powered by ViewVC 1.1.2