| 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'])) { |
| 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'), |
| 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; |