1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- // $Id$
- /**
- * @file
- * Automatically adds a table of contents block on advanced_help pages.
- *
- * @copyright Ouest Systèmes Informatiques (OSInet)
- *
- * @license Licensed under the General Public License version 2 and later.
- */
- /**
- * Module name
- * @var string
- */
- define('AH_TOC_MODULE', 'ah_toc');
- /**
- * Implementation of hook_help().
- *
- * @return string
- */
- function ah_toc_help($section, $arg) {
- if ($section == 'admin/help#'. AH_TOC_MODULE) {
- $ret = t('The AH Table Of Contents module automatically builds a table of contents block on advanced_help pages. This building is done entirely client-side using jQuery.');
- }
- else {
- $ret = NULL;
- }
- return $ret;
- }
- /**
- * Implementation of hook_init().
- *
- * Add the AH TOC CSS and JS only on AH pages, and not on main AH index page.
- *
- * @return void
- */
- function ah_toc_init() {
- if (arg(0) != 'help') {
- return;
- }
- $path = drupal_get_path('module', AH_TOC_MODULE);
- drupal_add_js($path .'/'. AH_TOC_MODULE .'.js');
- drupal_add_css($path .'/'. AH_TOC_MODULE .'.css');
- }
|