| 1 |
<?php
|
| 2 |
// $Id: seochecklist.module,v 1.9 2009/10/29 00:01:19 davereid Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* SEO Checklist module allows users to track important SEO techniques on the website.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Implementation of hook_help().
|
| 11 |
*/
|
| 12 |
function seochecklist_help($path, $arg) {
|
| 13 |
if ($path == 'admin/settings/seochecklist') {
|
| 14 |
return '<p><strong>' . t("Check off each SEO-related task as you complete it. Do not forget to click <em>Save</em>!") . '</strong></p>';
|
| 15 |
}
|
| 16 |
}
|
| 17 |
|
| 18 |
/**
|
| 19 |
* Implementation of hook_perm().
|
| 20 |
*/
|
| 21 |
function seochecklist_perm() {
|
| 22 |
return array('access seochecklist content');
|
| 23 |
}
|
| 24 |
|
| 25 |
/**
|
| 26 |
* Implementation of hook_menu().
|
| 27 |
*/
|
| 28 |
function seochecklist_menu() {
|
| 29 |
$items['admin/settings/seochecklist'] = array(
|
| 30 |
'title' => 'SEO Checklist',
|
| 31 |
'description' => t('Keep track of your Drupal Search Engine Optimization tasks.'),
|
| 32 |
'page callback' => 'drupal_get_form',
|
| 33 |
'page arguments' => array('seochecklist_admin_settings'),
|
| 34 |
'access arguments' => array('access seochecklist content'),
|
| 35 |
'file' => 'seochecklist.admin.inc',
|
| 36 |
);
|
| 37 |
return $items;
|
| 38 |
}
|
| 39 |
|
| 40 |
/**
|
| 41 |
* Implementation of hook_footer().
|
| 42 |
*/
|
| 43 |
function seochecklist_footer($main = 0) {
|
| 44 |
if (variable_get('seo_checklist_link', 0)) {
|
| 45 |
return '<div align="center"><a href="http://www.volacci.com/" target="_blank">Drupal SEO</a></div>';
|
| 46 |
}
|
| 47 |
}
|
| 48 |
|
| 49 |
/**
|
| 50 |
* Implementation of hook_form_FORM_ID_alter().
|
| 51 |
*
|
| 52 |
* Add vertical tabs to the checklist page.
|
| 53 |
*/
|
| 54 |
function seochecklist_form_seochecklist_admin_settings_alter(&$form, $form_state) {
|
| 55 |
if (module_exists('vertical_tabs') && function_exists('vertical_tabs_add_vertical_tabs')) {
|
| 56 |
vertical_tabs_add_vertical_tabs($form);
|
| 57 |
$form['save_above']['#attributes']['class'] = 'js-hide';
|
| 58 |
}
|
| 59 |
else {
|
| 60 |
drupal_set_message(t('Your SEO Checklist interface will be greatly enhanced by installing the <a href="@vertical-tabs">Vertical Tabs module</a>.', array('@vertical-tabs' => 'http://drupal.org/project/vertical_tabs')), 'status', FALSE);
|
| 61 |
}
|
| 62 |
}
|
| 63 |
|
| 64 |
function seochecklist_get_book_references($tid) {
|
| 65 |
$references = array(
|
| 66 |
1 => 59,
|
| 67 |
39 => 59,
|
| 68 |
2 => 68,
|
| 69 |
6 => 83,
|
| 70 |
5 => 72,
|
| 71 |
7 => 20,
|
| 72 |
9 => 23,
|
| 73 |
10 => 22,
|
| 74 |
11 => 22,
|
| 75 |
12 => 23,
|
| 76 |
13 => 26,
|
| 77 |
15 => 96,
|
| 78 |
16 => 182,
|
| 79 |
17 => 201,
|
| 80 |
18 => 18,
|
| 81 |
19 => 148,
|
| 82 |
21 => 109,
|
| 83 |
46 => 125,
|
| 84 |
24 => 118,
|
| 85 |
40 => 205,
|
| 86 |
39 => 205,
|
| 87 |
);
|
| 88 |
|
| 89 |
return isset($references[$tid]) ? $references[$tid] : NULL;
|
| 90 |
}
|