| 252 |
} // endfunction freelinking_settings (admin settings) |
} // endfunction freelinking_settings (admin settings) |
| 253 |
|
|
| 254 |
/** |
/** |
| 255 |
|
* Implementation of hook_filter_tips() |
| 256 |
|
*/ |
| 257 |
|
function freelinking_filter_tips($delta, $format, $long = FALSE) { |
| 258 |
|
if(variable_get('freelinking_markdown_mode', FALSE)) { |
| 259 |
|
$pattern = '<tt>[Title](indicator:target)</tt>'; |
| 260 |
|
} |
| 261 |
|
else { |
| 262 |
|
$pattern = '<tt>[[indicator:target|Title]]</tt>'; |
| 263 |
|
} |
| 264 |
|
$text .= t('Freelinking helps you easily create HTML links. Links take the form of !pattern.', |
| 265 |
|
array('!pattern' => $pattern)); |
| 266 |
|
|
| 267 |
|
if($long == FALSE) { |
| 268 |
|
return $text; |
| 269 |
|
} |
| 270 |
|
|
| 271 |
|
$text = '<h4>' . t('Freelinking') . '</h4>' . $text; |
| 272 |
|
$text .= '<br />'; |
| 273 |
|
$text .= t('Below is a list of available types of freelinks you may use, organized as <strong>Plugin Name</strong>: <em>[indicator]</em>.'); |
| 274 |
|
|
| 275 |
|
foreach(freelinking_get_plugins() as $name => $plugin) { |
| 276 |
|
$tips[$name] = '<strong>' . ucfirst($name) .'</strong> <em>[' . $plugin['indicator'] . ']</em>'; |
| 277 |
|
if($plugin['tip']) { |
| 278 |
|
$tips[$name] .= ' — ' . $plugin['tip']; |
| 279 |
|
} |
| 280 |
|
} |
| 281 |
|
$text .= theme('item_list', $tips); |
| 282 |
|
return $text; |
| 283 |
|
} |
| 284 |
|
|
| 285 |
|
/** |
| 286 |
* Freelinking API |
* Freelinking API |
| 287 |
*/ |
*/ |
| 288 |
|
|