@@ -7,7 +7,7 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // for the configuration manager |
10 | -$lang['keyword_source'] = 'Source of the values for the description header'; |
|
10 | +$lang['keyword_source'] = 'Source of the values for the description header'; |
|
11 | 11 | $lang['global_description'] = 'Description of a global header'; |
12 | 12 | |
13 | 13 | //Setup VIM: ex: et ts=2 : |
@@ -7,7 +7,7 @@ |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // for the configuration manager |
10 | -$lang['keyword_source'] = 'Quelle, aus der der Header generiert werden soll'; |
|
10 | +$lang['keyword_source'] = 'Quelle, aus der der Header generiert werden soll'; |
|
11 | 11 | $lang['global_description'] = 'Beschreibung für einen globalen Header'; |
12 | 12 | |
13 | 13 | //Setup VIM: ex: et ts=2 : |
@@ -7,11 +7,11 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | // must be run within Dokuwiki |
10 | -if(!defined('DOKU_INC')) die(); |
|
10 | +if (!defined('DOKU_INC')) die(); |
|
11 | 11 | |
12 | 12 | if (!defined('DOKU_LF')) define('DOKU_LF', "\n"); |
13 | 13 | if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t"); |
14 | -if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); |
|
14 | +if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC.'lib/plugins/'); |
|
15 | 15 | |
16 | 16 | require_once(DOKU_PLUGIN.'syntax.php'); |
17 | 17 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | global $conf; |
37 | 37 | global $ID; |
38 | 38 | $description = $data[0]; |
39 | - if(empty($description)) return false; |
|
39 | + if (empty($description)) return false; |
|
40 | 40 | |
41 | 41 | if ($mode == 'metadata') { |
42 | 42 | $renderer->meta['plugin_description']['keywords'] = $description; |
@@ -3,7 +3,7 @@ |
||
3 | 3 | * Options for the description Plugin |
4 | 4 | */ |
5 | 5 | |
6 | -$conf['keyword_source'] = 'abstract'; // where to get the keywords from |
|
7 | -$conf['global_description'] = ''; // Take this as keyword string when option is set to 'global' |
|
6 | +$conf['keyword_source'] = 'abstract'; // where to get the keywords from |
|
7 | +$conf['global_description'] = ''; // Take this as keyword string when option is set to 'global' |
|
8 | 8 | |
9 | 9 | //Setup VIM: ex: et ts=2 : |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * @author Matthias Schulte <[email protected]> |
7 | 7 | */ |
8 | 8 | |
9 | -$meta['keyword_source'] = array('multichoice','_choices' => array('abstract', 'global','syntax')); |
|
9 | +$meta['keyword_source'] = array('multichoice', '_choices' => array('abstract', 'global', 'syntax')); |
|
10 | 10 | $meta['global_description'] = array('string'); |
11 | 11 | |
12 | 12 | //Setup VIM: ex: et ts=2 : |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | * @version 2012-07-02 |
10 | 10 | */ |
11 | 11 | |
12 | -if(!defined('DOKU_INC')) die(); |
|
13 | -if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); |
|
12 | +if (!defined('DOKU_INC')) die(); |
|
13 | +if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC.'lib/plugins/'); |
|
14 | 14 | |
15 | 15 | require_once(DOKU_PLUGIN.'action.php'); |
16 | 16 | |
@@ -21,45 +21,45 @@ discard block |
||
21 | 21 | class action_plugin_description extends DokuWiki_Action_Plugin { |
22 | 22 | |
23 | 23 | function register(Doku_Event_Handler $controller) { |
24 | - $controller->register_hook('TPL_METAHEADER_OUTPUT','BEFORE',$this,'description',array()); |
|
24 | + $controller->register_hook('TPL_METAHEADER_OUTPUT', 'BEFORE', $this, 'description', array()); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Add an abstract, global value or a specified string to meta header |
29 | 29 | */ |
30 | 30 | function description(&$event, $param) { |
31 | - if(empty($event->data) || empty($event->data['meta'])) return; |
|
31 | + if (empty($event->data) || empty($event->data['meta'])) return; |
|
32 | 32 | |
33 | 33 | global $ID; |
34 | 34 | $source = $this->getConf('keyword_source'); |
35 | - if(empty($source)) $source = 'abstract'; |
|
35 | + if (empty($source)) $source = 'abstract'; |
|
36 | 36 | |
37 | - if($source == KEYWORD_SOURCE_ABSTRACT) { |
|
37 | + if ($source == KEYWORD_SOURCE_ABSTRACT) { |
|
38 | 38 | if (auth_quickaclcheck($ID) < AUTH_READ) { |
39 | 39 | // don't add meta header when user has no read permissions |
40 | 40 | return; |
41 | 41 | } |
42 | 42 | |
43 | 43 | $d = p_get_metadata($ID, 'description'); |
44 | - if(empty($d)) return; |
|
44 | + if (empty($d)) return; |
|
45 | 45 | |
46 | 46 | $a = str_replace("\n", " ", $d['abstract']); |
47 | - if(empty($a)) return; |
|
47 | + if (empty($a)) return; |
|
48 | 48 | } |
49 | 49 | |
50 | - if($source == KEYWORD_SOURCE_GLOBAL) { |
|
50 | + if ($source == KEYWORD_SOURCE_GLOBAL) { |
|
51 | 51 | $a = $this->getConf('global_description'); |
52 | - if(empty($a)) return; |
|
52 | + if (empty($a)) return; |
|
53 | 53 | } |
54 | 54 | |
55 | - if($source == KEYWORD_SOURCE_SYNTAX) { |
|
55 | + if ($source == KEYWORD_SOURCE_SYNTAX) { |
|
56 | 56 | if (auth_quickaclcheck($ID) < AUTH_READ) { |
57 | 57 | // don't add meta header when user has no read permissions |
58 | 58 | return; |
59 | 59 | } |
60 | 60 | $metadata = p_get_metadata($ID); |
61 | 61 | $a = $metadata['plugin_description']['keywords']; |
62 | - if(empty($a)) return; |
|
62 | + if (empty($a)) return; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | $m = array("name" => "description", "content" => $a); |