| 1 |
<?php |
<?php |
| 2 |
// $Id: marksmarty.module,v 1.20 2008/01/22 21:57:25 weitzman Exp $ |
// $Id: marksmarty.module,v 1.21 2008/01/22 22:25:27 weitzman Exp $ |
| 3 |
|
|
| 4 |
/******************************************************************** |
/******************************************************************** |
| 5 |
* Drupal Hooks |
* Drupal Hooks |
| 112 |
********************************************************************/ |
********************************************************************/ |
| 113 |
|
|
| 114 |
function _marksmarty_process($text, $format) { |
function _marksmarty_process($text, $format) { |
| 115 |
require_once(dirname(__FILE__) .'/markdown.php'); |
if (!empty($text) && variable_get("marksmarty_is_markdown_on_$format", 1) == 1) { |
| 116 |
require_once(dirname(__FILE__) .'/smartypants.php'); |
require_once(dirname(__FILE__) .'/markdown.php'); |
|
if (variable_get("marksmarty_is_markdown_on_$format", 1) == 1) { |
|
| 117 |
$text = Markdown($text); |
$text = Markdown($text); |
| 118 |
} |
} |
| 119 |
if (variable_get("marksmarty_is_smarty_on_$format", 1) == 1) { |
if (!empty($text) && variable_get("marksmarty_is_smarty_on_$format", 1) == 1) { |
| 120 |
global $smartypants_attr; |
global $smartypants_attr; |
| 121 |
|
require_once(dirname(__FILE__) .'/smartypants.php'); |
| 122 |
|
|
| 123 |
$smartypants_attr = variable_get("marksmarty_smarty_hyphens_$format", 0) + 1; |
$smartypants_attr = variable_get("marksmarty_smarty_hyphens_$format", 0) + 1; |
| 124 |
$text = SmartyPants($text); |
$text = SmartyPants($text); |
| 125 |
} |
} |