NODEWORDS_TYPE_TERM, 'id' => $id ) ); } else { $tags = array(); } $form['nodewords'] = nodewords_tags_edit_fields( array('type' => NODEWORDS_TYPE_TERM, 'id' => isset($id) ? $id : 0), $tags, array('fieldset' => TRUE) ); $form['submit']['#weight'] = 45; $form['delete']['#weight'] = 50; } } /** * Implements hook_form_FORM_ID_alter(). */ function nodewords_admin_form_taxonomy_form_vocabulary_alter(&$form, &$form_state) { if (isset($form['vid']['#value'])) { $id = $form['vid']['#value']; if (!empty($form_state['values']['nodewords'])) { $tags = $form_state['values']['nodewords']; } elseif (isset($id) && is_numeric($id)) { $tags = nodewords_load_tags( array( 'type' => NODEWORDS_TYPE_VOCABULARY, 'id' => $id ) ); } else { $tags = array(); } $form['nodewords'] = nodewords_tags_edit_fields( array('type' => NODEWORDS_TYPE_VOCABULARY, 'id' => $id), $tags, array('fieldset' => TRUE) ); $form['submit']['#weight'] = 45; $form['delete']['#weight'] = 50; } } /** * Implemenation of hook_help(). */ function nodewords_admin_help($path, $arg) { switch ($path) { case 'admin/content/nodewords/meta-tags': $output = '
' . t('On this page you can enter the default values for the meta tags.') . '
'; break; case 'admin/content/nodewords/meta-tags/errorpage_403': $output = '' . t('On this page you can enter the meta tags for the access denied
error page of your site.') . '
' . t('On this page you can enter the meta tags for the page not found
error page of your site.') . '
' . t('On this page you can enter the meta tags for the front page of your site. If the front page is a node, the meta tags edit fields will not appear in the node edit form.') . '
'; break; default: $output = ''; break; } return $output; } /** * Implements hook_menu(). */ function nodewords_admin_menu() { $admin_access = array('administer meta tags'); $items = array(); $items['admin/content/nodewords'] = array( 'title' => 'Meta tags', 'page callback' => 'drupal_get_form', 'page arguments' => array('nodewords_admin_settings_form'), 'description' => 'Configure HTML meta tags for all the content.', 'access arguments' => $admin_access, 'type' => MENU_NORMAL_ITEM, 'file' => 'nodewords_admin.admin.inc', ); $items['admin/content/nodewords/settings'] = array( 'title' => 'Settings', 'access arguments' => $admin_access, 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -1, 'file' => 'nodewords_admin.admin.inc', ); $items['admin/content/nodewords/settings/general'] = array( 'title' => 'General settings', 'access arguments' => $admin_access, 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -1, 'file' => 'nodewords_admin.admin.inc', ); $items['admin/content/nodewords/meta-tags'] = array( 'title' => 'Specific meta tags', 'page callback' => 'drupal_get_form', 'page arguments' => array( 'nodewords_admin_tags_edit_form', array( 'type' => NODEWORDS_TYPE_DEFAULT, ) ), 'access arguments' => $admin_access, 'type' => MENU_LOCAL_TASK, 'file' => 'nodewords_admin.admin.inc', ); $items['admin/content/nodewords/meta-tags/default'] = array( 'title' => 'Default meta tags', 'access arguments' => $admin_access, 'type' => MENU_DEFAULT_LOCAL_TASK, 'file' => 'nodewords_admin.admin.inc', ); $items['admin/content/nodewords/meta-tags/errorpage_403'] = array( 'title' => 'Error 403 page', 'access arguments' => $admin_access, 'type' => MENU_LOCAL_TASK, 'file' => 'nodewords_admin.admin.inc', ); $items['admin/content/nodewords/meta-tags/errorpage_404'] = array( 'title' => 'Error 404 page', 'page callback' => 'drupal_get_form', 'page arguments' => array( 'nodewords_admin_tags_edit_form', array( 'type' => NODEWORDS_TYPE_ERRORPAGE, 'id' => 404, ) ), 'access arguments' => $admin_access, 'type' => MENU_LOCAL_TASK, 'file' => 'nodewords_admin.admin.inc', ); return $items; } /** * Implements hook_theme(). */ function nodewords_admin_theme() { return array( 'nodewords_admin_enabled_metatags' => array( 'arguments' => array('form' => array()), 'file' => 'nodewords_admin.admin.inc', ), 'nodewords_admin_output_fieldset' => array( 'arguments' => array('form' => array()), 'file' => 'nodewords_admin.admin.inc', ), ); }