| 1 |
<?php
|
| 2 |
// $Id: $
|
| 3 |
/*
|
| 4 |
* Drupal Module: Purple
|
| 5 |
* See http://en.wikipedia.org/wiki/Purple_Numbers
|
| 6 |
* and also http://blueoxen.net/c/purple/purple-include/
|
| 7 |
*
|
| 8 |
* @author: Boris Mann <boris@bmannconsulting.com>
|
| 9 |
*/
|
| 10 |
|
| 11 |
|
| 12 |
function purple_help($section) {
|
| 13 |
switch ($section) {
|
| 14 |
case 'admin/settings/purple':
|
| 15 |
return t('Purple does interesting things with fragment identifiers and transclusion. Check out an <a href="http://www.eekim.com/software/purple/purple.html">Intro to Purple</a>, <a href="http://blueoxen.net/c/purple/purple-include/">purple-include</a>, and <a href="http://en.wikipedia.org/wiki/Purple_Numbers">Purple Numbers on Wikipedia</a>.');
|
| 16 |
}
|
| 17 |
}
|
| 18 |
|
| 19 |
|
| 20 |
function purple_menu($maycache) {
|
| 21 |
$items = array();
|
| 22 |
if ($maycache) {
|
| 23 |
$items[] = array(
|
| 24 |
'path' => 'admin/settings/purple',
|
| 25 |
'title' => t('Purple'),
|
| 26 |
'description' => t('Configure Purple options'),
|
| 27 |
'callback' => 'drupal_get_form',
|
| 28 |
'callback arguments' => 'purple_admin_settings',
|
| 29 |
'access' => user_access('administer site configuration'),
|
| 30 |
'type' => MENU_NORMAL_ITEM,
|
| 31 |
);
|
| 32 |
}
|
| 33 |
return $items;
|
| 34 |
}
|
| 35 |
|
| 36 |
/**
|
| 37 |
* Implementation of hook_footer()
|
| 38 |
*/
|
| 39 |
function purple_footer() {
|
| 40 |
$path = drupal_get_path('module', 'purple');
|
| 41 |
drupal_add_css($path .'/purple.css', 'module', 'screen');
|
| 42 |
drupal_add_js($path . '/purple-include.js','module');
|
| 43 |
drupal_set_html_head('<meta name="purple_proxy_path" content="/' . $path . '/purple-proxy.php" />');
|
| 44 |
}
|
| 45 |
|
| 46 |
/**
|
| 47 |
* Implementation of hook_admin_settings() for configuring the module
|
| 48 |
*/
|
| 49 |
function purple_admin_settings() {
|
| 50 |
return system_settings_form($form);
|
| 51 |
}
|