/[drupal]/contributions/modules/chili_highlighter/chili_highlighter.module
ViewVC logotype

Contents of /contributions/modules/chili_highlighter/chili_highlighter.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Sun Feb 15 03:40:43 2009 UTC (9 months, 1 week ago) by kourge
Branch: MAIN
CVS Tags: DRUPAL-5--1-1, HEAD
Changes since 1.2: +4 -4 lines
File MIME type: text/x-php
Changed code to reflect new directory structure
1 <?php
2 // $Id: chili_highlighter.module,v 1.2 2009/02/15 03:37:26 kourge Exp $
3
4 /**
5 * Implementation of hook_menu().
6 */
7 function chili_highlighter_menu($maycache) {
8 if (!$maycache) {
9 $path = drupal_get_path('module', 'chili_highlighter') .'/chili';
10 drupal_add_js($path .'/jquery.chili-2.2.js');
11 $settings = array(
12 'ChiliBook.recipeFolder', 'ChiliBook.stylesheetFolder',
13 "'". url($path) ."/';"
14 );
15 drupal_add_js(implode(' = ', $settings), 'inline');
16 $selector = variable_get('chili_highlighter_selector', 'code');
17 $code = array(
18 'jQuery(function(){jQuery(', drupal_to_js($selector), ').chili();});'
19 );
20 drupal_add_js(implode('', $code), 'inline');
21 } else {
22 return array(array(
23 'path' => 'admin/settings/chili_highlighter',
24 'title' => t('Chili Highlighter'),
25 'callback' => 'drupal_get_form',
26 'callback arguments' => 'chili_highlighter_settings',
27 'access' => user_access('administer site configuration'),
28 'description' => t('Configure which parts of the page should be highlighted as code.')
29 ));
30 }
31 }
32
33 function chili_highlighter_settings() {
34 return system_settings_form(array(
35 'chili_highlighter_selector' => array(
36 '#type' => 'textfield',
37 '#title' => t('Code Section CSS Selector'),
38 '#default_value' => variable_get('chili_highlighter_selector', 'code'),
39 '#description' => t('This is a CSS selector that specifies which elements are considered "code" and should be highlighted.')
40 )
41 ));
42 }

  ViewVC Help
Powered by ViewVC 1.1.2