/[drupal]/contributions/modules/ulink/ulink_others.inc
ViewVC logotype

Contents of /contributions/modules/ulink/ulink_others.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Tue Jul 17 16:32:54 2007 UTC (2 years, 4 months ago) by garthee
Branch: MAIN
CVS Tags: DRUPAL-5--5-0, DRUPAL-5--6-0, HEAD
Changes since 1.2: +12 -4 lines
File MIME type: text/x-php
added inline api doc
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 }

  ViewVC Help
Powered by ViewVC 1.1.2