2 // $Id: stationary.inc.php,v 1.4 2005/04/02 06:33:39 henoheno Exp $
5 // License: The same as PukiWiki
7 // Define someting like this
8 define('PLUGIN_STATIONARY_MAX', 10);
11 function plugin_stationary_init()
13 if (PKWK_SAFE_MODE || PKWK_READONLY) return; // Do nothing
16 '_plugin_stationary_A' => 'a',
17 '_plugin_stationary_B' => array('C' => 'c', 'D'=>'d'),
19 set_plugin_messages($messages);
22 // Convert-type plugin: #stationary or #stationary(foo)
23 function plugin_stationary_convert()
25 // If you don't want this to work at secure/productive site,
26 if (PKWK_SAFE_MODE) return ''; // Show nothing
28 // If this plugin will write someting,
29 if (PKWK_READONLY) return ''; // Show nothing
36 if (func_num_args()) {
37 $args = func_get_args();
38 foreach (array_keys($args) as $key)
39 $args[$key] = htmlspecialchars(trim($args[$key]));
40 $result = '(' . join(',', $args) . ')';
43 return '#stationary' . $result . '<br />';
46 // In-line type plugin: &stationary; or &stationary(foo); , or &stationary(foo){bar};
47 function plugin_stationary_inline()
49 if (PKWK_SAFE_MODE || PKWK_READONLY) return ''; // See above
51 $result = '&stationary(){};';
53 return htmlspecialchars($result);
56 // Action-type plugin: ?plugin=stationary&foo=bar
57 function plugin_stationary_action()
60 if (PKWK_SAFE_MODE || PKWK_READONLY)
61 die_message('PKWK_SAFE_MODE or PKWK_READONLY prohibits this');
64 $body = 'Message body';
66 return array('msg'=>htmlspecialchars($msg), 'body'=>htmlspecialchars($body));