| 1 |
<?php
|
| 2 |
// $Id: easylists.module,v 1.2 2008/04/02 08:22:13 deelight Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* Implementation of hook_help().
|
| 6 |
*/
|
| 7 |
function easylists_help($section) {
|
| 8 |
if ($section == 'admin/help#easylists')
|
| 9 |
return '<p>'.t('Allow the use of EasyLists in posts.').'</p>';
|
| 10 |
}
|
| 11 |
|
| 12 |
/**
|
| 13 |
* Implementation of hook_filter().
|
| 14 |
*/
|
| 15 |
function easylists_filter($op, $delta = 0, $format = -1, $text = '') {
|
| 16 |
switch ($op) {
|
| 17 |
case 'list':
|
| 18 |
return array(0 => 'EasyLists');
|
| 19 |
case 'description':
|
| 20 |
return t('Converts EasyLists to HTML.');
|
| 21 |
case 'process':
|
| 22 |
include_once(drupal_get_path('module', 'easylists') .'/easylists-filter.inc');
|
| 23 |
return _easylists_filter_process($text, $format);
|
| 24 |
case 'settings':
|
| 25 |
$form = array();
|
| 26 |
$form['easylists'] = array(
|
| 27 |
'#type' => 'fieldset',
|
| 28 |
'#title' => t('EasyLists'),
|
| 29 |
'#collapsible' => TRUE,
|
| 30 |
);
|
| 31 |
$form['easylists']['easylists_character_' . $format] = array(
|
| 32 |
'#type' => 'textfield',
|
| 33 |
'#title' => t('Bullet character'),
|
| 34 |
'#default_value' => variable_get('easylists_character_' . $format, '-'),
|
| 35 |
'#description' => t('The character that will be changed into a bullet point'),
|
| 36 |
);
|
| 37 |
return $form;
|
| 38 |
default:
|
| 39 |
return $text;
|
| 40 |
}
|
| 41 |
}
|
| 42 |
|
| 43 |
/**
|
| 44 |
* Implementation of hook_filter_tips().
|
| 45 |
*/
|
| 46 |
function easylists_filter_tips($delta, $format, $long = FALSE) {
|
| 47 |
return t('Make a bullet list by starting each line with a \'!char\'. Add more for sublists.', array('!char' => variable_get('easylists_character_' . $format, '-')));
|
| 48 |
}
|