| 1 |
<?php |
<?php |
| 2 |
// $Id: marksmarty.module,v 1.17 2006/07/15 20:35:19 teradome Exp $ |
// $Id: marksmarty.module,v 1.18 2006/10/07 19:28:17 teradome Exp $ |
| 3 |
|
|
| 4 |
/******************************************************************** |
/******************************************************************** |
| 5 |
* Drupal Hooks |
* Drupal Hooks |
| 60 |
********************************************************************/ |
********************************************************************/ |
| 61 |
|
|
| 62 |
function _marksmarty_process($text, $format) { |
function _marksmarty_process($text, $format) { |
| 63 |
require_once(dirname(__FILE__) . '/markdown.php'); |
if (!empty($text) && variable_get("marksmarty_is_markdown_on_$format", 1) == 1) { |
| 64 |
require_once(dirname(__FILE__) . '/smartypants.php'); |
require_once(dirname(__FILE__) . '/markdown.php'); |
|
if (variable_get("marksmarty_is_markdown_on_$format", 1) == 1) { |
|
| 65 |
$text = Markdown($text); |
$text = Markdown($text); |
| 66 |
} |
} |
| 67 |
if (variable_get("marksmarty_is_smarty_on_$format", 1) == 1) { |
if (!empty($text) && variable_get("marksmarty_is_smarty_on_$format", 1) == 1) { |
| 68 |
global $smartypants_attr; |
global $smartypants_attr; |
| 69 |
|
require_once(dirname(__FILE__) . '/smartypants.php'); |
| 70 |
|
|
| 71 |
$smartypants_attr = variable_get("marksmarty_smarty_hyphens_$format", 0) + 1; |
$smartypants_attr = variable_get("marksmarty_smarty_hyphens_$format", 0) + 1; |
| 72 |
$text = SmartyPants($text); |
$text = SmartyPants($text); |
| 73 |
} |
} |