| 1 |
<?php
|
| 2 |
/**
|
| 3 |
* Implementation of hook_ulink_others()
|
| 4 |
*/
|
| 5 |
function ulink_ulink_others($link, $object=NULL){
|
| 6 |
$path = $link['path'];
|
| 7 |
$text = $link['text'];
|
| 8 |
$attributes = $link['attributes'];
|
| 9 |
switch (variable_get('ulink_others_settings_option', 1)) {
|
| 10 |
case 1:
|
| 11 |
$text = $text ? $text : $path;
|
| 12 |
return l($text, $path, $attributes);
|
| 13 |
case 2:
|
| 14 |
if (module_exists('token')) {
|
| 15 |
return token_replace(variable_get('ulink_others_2_tag', '<a href="[ulink-path]" [ulink-attributes-string]>[ulink-text]</a>'), $type = 'ulink', $link);
|
| 16 |
}
|
| 17 |
else {
|
| 18 |
return $text;
|
| 19 |
}
|
| 20 |
case 3:
|
| 21 |
return eval(variable_get('ulink_others_3_code', 'return l($text." ( external file )", $path, $link["attributes"]);'));
|
| 22 |
}
|
| 23 |
}
|
| 24 |
/**
|
| 25 |
* Implementation of hook_ulink_settings()
|
| 26 |
*/
|
| 27 |
function ulink_ulink_others_settings() {
|
| 28 |
return _ulink_ulink_settings_builder('others');
|
| 29 |
}
|
| 30 |
|
| 31 |
/**
|
| 32 |
* Implementation of hook_ulink_info()
|
| 33 |
*/
|
| 34 |
function ulink_ulink_others_info() {
|
| 35 |
return t(' Three modes of rendering are possible. Hardcoded rendering for novice users and PHPcode for advanced users. In the macro mode TOKENS can be used. Use configurations to individually configure them to match the requirement.');
|
| 36 |
}
|
| 37 |
|
| 38 |
|
| 39 |
/*
|
| 40 |
* support functions to provide extra settings pages.
|
| 41 |
*/
|
| 42 |
function _ulink_others_settings_2() {
|
| 43 |
return system_settings_form(_ulink_xxx_settings_2('others'));
|
| 44 |
}
|
| 45 |
|
| 46 |
function _ulink_others_settings_3() {
|
| 47 |
return system_settings_form(_ulink_xxx_settings_3('others'));
|
| 48 |
}
|