| 1 |
<?php |
<?php |
| 2 |
// $Id: marksmarty.module,v 1.19 2008/01/22 21:19:06 weitzman Exp $ |
// $Id: marksmarty.module,v 1.20 2008/01/22 21:57:25 weitzman Exp $ |
| 3 |
|
|
| 4 |
/******************************************************************** |
/******************************************************************** |
| 5 |
* Drupal Hooks |
* Drupal Hooks |
| 24 |
} |
} |
| 25 |
} |
} |
| 26 |
|
|
| 27 |
|
function marksmarty_block($op = 'list', $delta = 0, $edit = array()) { |
| 28 |
|
if ($op == 'list') { |
| 29 |
|
$blocks[0] = array('info' => t('Marksmarty Filter Tips')); |
| 30 |
|
return $blocks; |
| 31 |
|
} |
| 32 |
|
else if ($op == 'view') { |
| 33 |
|
switch($delta) { |
| 34 |
|
case 0: |
| 35 |
|
$block = array('subject' => t('Title of block #1'), |
| 36 |
|
'content' => marksmarty_display_block_1()); |
| 37 |
|
break; |
| 38 |
|
} |
| 39 |
|
return $block; |
| 40 |
|
} |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
function marksmarty_display_block_1(){ |
| 44 |
|
$content = <<<END_MARKSMARTY_BLOCK |
| 45 |
|
<pre> |
| 46 |
|
## Header 2 ## |
| 47 |
|
### Header 3 ### |
| 48 |
|
#### Header 4 #### |
| 49 |
|
##### Header 5 ##### |
| 50 |
|
(Hashes on right are optional) |
| 51 |
|
|
| 52 |
|
Link [Drupal](http://drupal.org) |
| 53 |
|
|
| 54 |
|
Inline markup like _italics_, |
| 55 |
|
**bold**, and `code()`. |
| 56 |
|
|
| 57 |
|
> Blockquote. Like email replies |
| 58 |
|
>> And, they can be nested |
| 59 |
|
|
| 60 |
|
* Bullet lists are easy too |
| 61 |
|
- Another one |
| 62 |
|
+ Another one |
| 63 |
|
|
| 64 |
|
1. A numbered list |
| 65 |
|
2. Which is numbered |
| 66 |
|
3. With periods and a space |
| 67 |
|
|
| 68 |
|
And now some code: |
| 69 |
|
// Code is indented text |
| 70 |
|
is_easy() to_remember(); |
| 71 |
|
</pre> |
| 72 |
|
END_MARKSMARTY_BLOCK; |
| 73 |
|
|
| 74 |
|
return $content; |
| 75 |
|
|
| 76 |
|
} |
| 77 |
|
|
| 78 |
function marksmarty_filter_tips($delta = 0, $format = -1, $long) { |
function marksmarty_filter_tips($delta = 0, $format = -1, $long) { |
| 79 |
if ($long) { |
if ($long) { |
| 80 |
$the_output = t('Quick Tips:<ul> |
$the_output = t('Quick Tips:<ul> |