Passed
Branch master (974a6c)
by Mark
02:27
created
lang/en/settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
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 :
Please login to merge, or discard this patch.
lang/de/settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
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 :
Please login to merge, or discard this patch.
syntax.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -7,11 +7,19 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 // must be run within Dokuwiki
10
-if(!defined('DOKU_INC')) die();
10
+if(!defined('DOKU_INC')) {
11
+    die();
12
+}
11 13
 
12
-if (!defined('DOKU_LF')) define('DOKU_LF', "\n");
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_LF')) {
15
+    define('DOKU_LF', "\n");
16
+}
17
+if (!defined('DOKU_TAB')) {
18
+    define('DOKU_TAB', "\t");
19
+}
20
+if (!defined('DOKU_PLUGIN')) {
21
+    define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
22
+}
15 23
 
16 24
 require_once(DOKU_PLUGIN.'syntax.php');
17 25
 
@@ -36,7 +44,9 @@  discard block
 block discarded – undo
36 44
         global $conf;
37 45
         global $ID;       
38 46
         $description = $data[0];
39
-        if(empty($description)) return false;
47
+        if(empty($description)) {
48
+            return false;
49
+        }
40 50
 
41 51
         if ($mode == 'metadata') {
42 52
             $renderer->meta['plugin_description']['keywords'] = $description;
Please login to merge, or discard this patch.
conf/default.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
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 :
Please login to merge, or discard this patch.
conf/metadata.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
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 :
Please login to merge, or discard this patch.
action.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Braces   +24 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,8 +9,12 @@  discard block
 block discarded – undo
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')) {
13
+    die();
14
+}
15
+if(!defined('DOKU_PLUGIN')) {
16
+    define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
17
+}
14 18
 
15 19
 require_once(DOKU_PLUGIN.'action.php');
16 20
 
@@ -28,11 +32,15 @@  discard block
 block discarded – undo
28 32
      * Add an abstract, global value or a specified string to meta header
29 33
      */
30 34
     function description(&$event, $param) {
31
-        if(empty($event->data) || empty($event->data['meta'])) return;
35
+        if(empty($event->data) || empty($event->data['meta'])) {
36
+            return;
37
+        }
32 38
         
33 39
         global $ID;
34 40
         $source = $this->getConf('keyword_source');
35
-        if(empty($source)) $source = 'abstract';
41
+        if(empty($source)) {
42
+            $source = 'abstract';
43
+        }
36 44
         
37 45
         if($source == KEYWORD_SOURCE_ABSTRACT) {
38 46
             if (auth_quickaclcheck($ID) < AUTH_READ) {
@@ -41,15 +49,21 @@  discard block
 block discarded – undo
41 49
             }
42 50
 
43 51
             $d = p_get_metadata($ID, 'description');
44
-            if(empty($d)) return;
52
+            if(empty($d)) {
53
+                return;
54
+            }
45 55
     
46 56
             $a = str_replace("\n", " ", $d['abstract']);
47
-            if(empty($a)) return;
57
+            if(empty($a)) {
58
+                return;
59
+            }
48 60
         }
49 61
         
50 62
         if($source == KEYWORD_SOURCE_GLOBAL) {
51 63
             $a = $this->getConf('global_description');
52
-            if(empty($a)) return;
64
+            if(empty($a)) {
65
+                return;
66
+            }
53 67
         }
54 68
 
55 69
         if($source == KEYWORD_SOURCE_SYNTAX) {
@@ -59,7 +73,9 @@  discard block
 block discarded – undo
59 73
             }
60 74
             $metadata = p_get_metadata($ID);
61 75
             $a = $metadata['plugin_description']['keywords'];
62
-            if(empty($a)) return;
76
+            if(empty($a)) {
77
+                return;
78
+            }
63 79
         }
64 80
         
65 81
         $m = array("name" => "description", "content" => $a);
Please login to merge, or discard this patch.