GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — develop (#1957)
by
unknown
39:18 queued 26:49
created
modules/tag/tag.class.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 		$oModuleController = getController('module');
16 16
 		$oDB = &DB::getInstance();
17 17
 
18
-		$oDB->addIndex("tags","idx_tag", array("document_srl","tag"));
18
+		$oDB->addIndex("tags", "idx_tag", array("document_srl", "tag"));
19 19
 		// 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument trigger property for
20 20
 		$oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
21 21
 		$oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 		$oModuleModel = getModel('module');
37 37
 		$oDB = &DB::getInstance();
38 38
 		// 2007. 10. 17 trigger registration, if registered upset
39
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true;
40
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true;
41
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true;
42
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true;
43
-		if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) return true;
39
+		if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true;
40
+		if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true;
41
+		if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true;
42
+		if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true;
43
+		if (!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) return true;
44 44
 		// 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag
45
-		if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) return true;
45
+		if (!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) return true;
46 46
 		// tag in the index column of the table tag
47
-		if(!$oDB->isIndexExists("tags","idx_tag")) return true;
47
+		if (!$oDB->isIndexExists("tags", "idx_tag")) return true;
48 48
 
49 49
 		return false;
50 50
 	}
@@ -58,26 +58,26 @@  discard block
 block discarded – undo
58 58
 		$oModuleController = getController('module');
59 59
 		$oDB = &DB::getInstance();
60 60
 		// 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument trigger property for
61
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) 
61
+		if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) 
62 62
 			$oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
63 63
 
64
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) 
64
+		if (!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) 
65 65
 			$oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
66 66
 
67
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) 
67
+		if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) 
68 68
 			$oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
69 69
 
70
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) 
70
+		if (!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) 
71 71
 			$oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
72 72
 
73
-		if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) 
73
+		if (!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) 
74 74
 			$oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after');
75 75
 		// 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag
76
-		if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'))
76
+		if (!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'))
77 77
 			$oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after');
78 78
 		// tag in the index column of the table tag
79
-		if(!$oDB->isIndexExists("tags","idx_tag")) 
80
-			$oDB->addIndex("tags","idx_tag", array("document_srl","tag"));
79
+		if (!$oDB->isIndexExists("tags", "idx_tag")) 
80
+			$oDB->addIndex("tags", "idx_tag", array("document_srl", "tag"));
81 81
 
82 82
 		return new Object(0, 'success_updated');
83 83
 	}
Please login to merge, or discard this patch.
Braces   +42 added lines, -21 removed lines patch added patch discarded remove patch
@@ -36,15 +36,29 @@  discard block
 block discarded – undo
36 36
 		$oModuleModel = getModel('module');
37 37
 		$oDB = &DB::getInstance();
38 38
 		// 2007. 10. 17 trigger registration, if registered upset
39
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true;
40
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true;
41
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true;
42
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true;
43
-		if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) return true;
39
+		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) {
40
+			return true;
41
+		}
42
+		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) {
43
+			return true;
44
+		}
45
+		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) {
46
+			return true;
47
+		}
48
+		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) {
49
+			return true;
50
+		}
51
+		if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) {
52
+			return true;
53
+		}
44 54
 		// 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag
45
-		if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) return true;
55
+		if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) {
56
+			return true;
57
+		}
46 58
 		// tag in the index column of the table tag
47
-		if(!$oDB->isIndexExists("tags","idx_tag")) return true;
59
+		if(!$oDB->isIndexExists("tags","idx_tag")) {
60
+			return true;
61
+		}
48 62
 
49 63
 		return false;
50 64
 	}
@@ -58,26 +72,33 @@  discard block
 block discarded – undo
58 72
 		$oModuleController = getController('module');
59 73
 		$oDB = &DB::getInstance();
60 74
 		// 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument trigger property for
61
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) 
62
-			$oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
75
+		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) {
76
+					$oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
77
+		}
63 78
 
64
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) 
65
-			$oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
79
+		if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) {
80
+					$oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
81
+		}
66 82
 
67
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) 
68
-			$oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
83
+		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) {
84
+					$oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before');
85
+		}
69 86
 
70
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) 
71
-			$oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
87
+		if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) {
88
+					$oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after');
89
+		}
72 90
 
73
-		if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) 
74
-			$oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after');
91
+		if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) {
92
+					$oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after');
93
+		}
75 94
 		// 2007. 10. 17 modules are deleted when you delete all registered triggers that add tag
76
-		if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'))
77
-			$oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after');
95
+		if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) {
96
+					$oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after');
97
+		}
78 98
 		// tag in the index column of the table tag
79
-		if(!$oDB->isIndexExists("tags","idx_tag")) 
80
-			$oDB->addIndex("tags","idx_tag", array("document_srl","tag"));
99
+		if(!$oDB->isIndexExists("tags","idx_tag")) {
100
+					$oDB->addIndex("tags","idx_tag", array("document_srl","tag"));
101
+		}
81 102
 
82 103
 		return new Object(0, 'success_updated');
83 104
 	}
Please login to merge, or discard this patch.
modules/tag/tag.controller.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -19,20 +19,20 @@  discard block
 block discarded – undo
19 19
 	 */
20 20
 	function triggerArrangeTag(&$obj)
21 21
 	{
22
-		if(!$obj->tags) return new Object();
22
+		if (!$obj->tags) return new Object();
23 23
 		// tags by variable
24 24
 		$tag_list = explode(',', $obj->tags);
25 25
 		$tag_count = count($tag_list);
26 26
 		$tag_list = array_unique($tag_list);
27
-		if(!count($tag_list)) return new Object();
27
+		if (!count($tag_list)) return new Object();
28 28
 
29
-		foreach($tag_list as $tag)
29
+		foreach ($tag_list as $tag)
30 30
 		{
31
-			if(!trim($tag)) continue;
31
+			if (!trim($tag)) continue;
32 32
 			$arranged_tag_list[] = trim($tag); 
33 33
 		}
34
-		if(!count($arranged_tag_list)) $obj->tags = null;
35
-		else $obj->tags = implode(',',$arranged_tag_list);
34
+		if (!count($arranged_tag_list)) $obj->tags = null;
35
+		else $obj->tags = implode(',', $arranged_tag_list);
36 36
 		return new Object();
37 37
 	}
38 38
 
@@ -45,24 +45,24 @@  discard block
 block discarded – undo
45 45
 		$module_srl = $obj->module_srl;
46 46
 		$document_srl = $obj->document_srl;
47 47
 		$tags = $obj->tags;
48
-		if(!$document_srl) return new Object();
48
+		if (!$document_srl) return new Object();
49 49
 		// Remove all tags that article
50 50
 		$output = $this->triggerDeleteTag($obj);
51
-		if(!$output->toBool()) return $output;
51
+		if (!$output->toBool()) return $output;
52 52
 		// Re-enter the tag
53 53
 		$args = new stdClass();
54 54
 		$args->module_srl = $module_srl;
55 55
 		$args->document_srl = $document_srl;
56 56
 
57
-		$tag_list = explode(',',$tags);
57
+		$tag_list = explode(',', $tags);
58 58
 		$tag_count = count($tag_list);
59
-		for($i=0;$i<$tag_count;$i++)
59
+		for ($i = 0; $i < $tag_count; $i++)
60 60
 		{
61 61
 			unset($args->tag);
62 62
 			$args->tag = trim($tag_list[$i]);
63
-			if(!$args->tag) continue;
63
+			if (!$args->tag) continue;
64 64
 			$output = executeQuery('tag.insertTag', $args);
65
-			if(!$output->toBool()) return $output;
65
+			if (!$output->toBool()) return $output;
66 66
 		}
67 67
 
68 68
 		return new Object();
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	function triggerDeleteTag(&$obj)
76 76
 	{
77 77
 		$document_srl = $obj->document_srl;
78
-		if(!$document_srl) return new Object();
78
+		if (!$document_srl) return new Object();
79 79
 
80 80
 		$args = new stdClass();
81 81
 		$args->document_srl = $document_srl;
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	function triggerDeleteModuleTags(&$obj)
89 89
 	{
90 90
 		$module_srl = $obj->module_srl;
91
-		if(!$module_srl) return new Object();
91
+		if (!$module_srl) return new Object();
92 92
 
93 93
 		$oTagController = getAdminController('tag');
94 94
 		return $oTagController->deleteModuleTags($module_srl);
Please login to merge, or discard this patch.
Braces   +32 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,20 +19,29 @@  discard block
 block discarded – undo
19 19
 	 */
20 20
 	function triggerArrangeTag(&$obj)
21 21
 	{
22
-		if(!$obj->tags) return new Object();
22
+		if(!$obj->tags) {
23
+			return new Object();
24
+		}
23 25
 		// tags by variable
24 26
 		$tag_list = explode(',', $obj->tags);
25 27
 		$tag_count = count($tag_list);
26 28
 		$tag_list = array_unique($tag_list);
27
-		if(!count($tag_list)) return new Object();
29
+		if(!count($tag_list)) {
30
+			return new Object();
31
+		}
28 32
 
29 33
 		foreach($tag_list as $tag)
30 34
 		{
31
-			if(!trim($tag)) continue;
35
+			if(!trim($tag)) {
36
+				continue;
37
+			}
32 38
 			$arranged_tag_list[] = trim($tag); 
33 39
 		}
34
-		if(!count($arranged_tag_list)) $obj->tags = null;
35
-		else $obj->tags = implode(',',$arranged_tag_list);
40
+		if(!count($arranged_tag_list)) {
41
+			$obj->tags = null;
42
+		} else {
43
+			$obj->tags = implode(',',$arranged_tag_list);
44
+		}
36 45
 		return new Object();
37 46
 	}
38 47
 
@@ -45,10 +54,14 @@  discard block
 block discarded – undo
45 54
 		$module_srl = $obj->module_srl;
46 55
 		$document_srl = $obj->document_srl;
47 56
 		$tags = $obj->tags;
48
-		if(!$document_srl) return new Object();
57
+		if(!$document_srl) {
58
+			return new Object();
59
+		}
49 60
 		// Remove all tags that article
50 61
 		$output = $this->triggerDeleteTag($obj);
51
-		if(!$output->toBool()) return $output;
62
+		if(!$output->toBool()) {
63
+			return $output;
64
+		}
52 65
 		// Re-enter the tag
53 66
 		$args = new stdClass();
54 67
 		$args->module_srl = $module_srl;
@@ -60,9 +73,13 @@  discard block
 block discarded – undo
60 73
 		{
61 74
 			unset($args->tag);
62 75
 			$args->tag = trim($tag_list[$i]);
63
-			if(!$args->tag) continue;
76
+			if(!$args->tag) {
77
+				continue;
78
+			}
64 79
 			$output = executeQuery('tag.insertTag', $args);
65
-			if(!$output->toBool()) return $output;
80
+			if(!$output->toBool()) {
81
+				return $output;
82
+			}
66 83
 		}
67 84
 
68 85
 		return new Object();
@@ -75,7 +92,9 @@  discard block
 block discarded – undo
75 92
 	function triggerDeleteTag(&$obj)
76 93
 	{
77 94
 		$document_srl = $obj->document_srl;
78
-		if(!$document_srl) return new Object();
95
+		if(!$document_srl) {
96
+			return new Object();
97
+		}
79 98
 
80 99
 		$args = new stdClass();
81 100
 		$args->document_srl = $document_srl;
@@ -88,7 +107,9 @@  discard block
 block discarded – undo
88 107
 	function triggerDeleteModuleTags(&$obj)
89 108
 	{
90 109
 		$module_srl = $obj->module_srl;
91
-		if(!$module_srl) return new Object();
110
+		if(!$module_srl) {
111
+			return new Object();
112
+		}
92 113
 
93 114
 		$oTagController = getAdminController('tag');
94 115
 		return $oTagController->deleteModuleTags($module_srl);
Please login to merge, or discard this patch.
modules/trash/model/TrashVO.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 	function getTitle()
26 26
 	{
27
-		if(empty($this->title)) return $lang->untitle;
27
+		if (empty($this->title)) return $lang->untitle;
28 28
 		return htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
29 29
 	}
30 30
 	function setTitle($title)
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 	function getOriginModule()
35 35
 	{
36
-		if(empty($this->originModule)) return 'document';
36
+		if (empty($this->originModule)) return 'document';
37 37
 		return $this->originModule;
38 38
 	}
39 39
 	function setOriginModule($originModule)
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	}
99 99
 	function getRegdate()
100 100
 	{
101
-		if(empty($this->regdate)) return date('YmdHis');
101
+		if (empty($this->regdate)) return date('YmdHis');
102 102
 
103 103
 		return $this->regdate;
104 104
 	}
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,9 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 	function getTitle()
26 26
 	{
27
-		if(empty($this->title)) return $lang->untitle;
27
+		if(empty($this->title)) {
28
+			return $lang->untitle;
29
+		}
28 30
 		return htmlspecialchars($this->title, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
29 31
 	}
30 32
 	function setTitle($title)
@@ -33,7 +35,9 @@  discard block
 block discarded – undo
33 35
 	}
34 36
 	function getOriginModule()
35 37
 	{
36
-		if(empty($this->originModule)) return 'document';
38
+		if(empty($this->originModule)) {
39
+			return 'document';
40
+		}
37 41
 		return $this->originModule;
38 42
 	}
39 43
 	function setOriginModule($originModule)
@@ -98,7 +102,9 @@  discard block
 block discarded – undo
98 102
 	}
99 103
 	function getRegdate()
100 104
 	{
101
-		if(empty($this->regdate)) return date('YmdHis');
105
+		if(empty($this->regdate)) {
106
+			return date('YmdHis');
107
+		}
102 108
 
103 109
 		return $this->regdate;
104 110
 	}
Please login to merge, or discard this patch.
modules/trash/trash.admin.view.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	function init()
18 18
 	{
19 19
 		// 템플릿 경로 지정 (board의 경우 tpl에 관리자용 템플릿 모아놓음)
20
-		$template_path = sprintf("%stpl/",$this->module_path);
20
+		$template_path = sprintf("%stpl/", $this->module_path);
21 21
 		$this->setTemplatePath($template_path);
22 22
 	}
23 23
 
@@ -51,20 +51,20 @@  discard block
 block discarded – undo
51 51
 		$oModuleModel = getModel('module');
52 52
 		$module_list = array();
53 53
 		$mod_srls = array();
54
-		foreach($output->data as $oTrashVO)
54
+		foreach ($output->data as $oTrashVO)
55 55
 		{
56 56
 			$mod_srls[] = $oTrashVO->unserializedObject['module_srl'];
57 57
 		}
58 58
 		$mod_srls = array_unique($mod_srls);
59 59
 		// Module List
60 60
 		$mod_srls_count = count($mod_srls);
61
-		if($mod_srls_count)
61
+		if ($mod_srls_count)
62 62
 		{
63 63
 			$columnList = array('module_srl', 'mid', 'browser_title');
64 64
 			$module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList);
65
-			if($module_output && is_array($module_output))
65
+			if ($module_output && is_array($module_output))
66 66
 			{
67
-				foreach($module_output as $module)
67
+				foreach ($module_output as $module)
68 68
 				{
69 69
 					$module_list[$module->module_srl] = $module;
70 70
 				}
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
 
87 87
 		$oTrashModel = getModel('trash');
88 88
 		$output = $oTrashModel->getTrash($trash_srl);
89
-		if(!$output->data->getTrashSrl()) return new Object(-1, 'msg_invalid_request');
89
+		if (!$output->data->getTrashSrl()) return new Object(-1, 'msg_invalid_request');
90 90
 
91 91
 		$originObject = unserialize($output->data->getSerializedObject());
92
-		if(is_array($originObject)) $originObject = (object)$originObject;
92
+		if (is_array($originObject)) $originObject = (object) $originObject;
93 93
 
94
-		Context::set('oTrashVO',$output->data);
95
-		Context::set('oOrigin',$originObject);
94
+		Context::set('oTrashVO', $output->data);
95
+		Context::set('oOrigin', $originObject);
96 96
 
97 97
 		$oMemberModel = &getModel('member');
98 98
 		$remover_info = $oMemberModel->getMemberInfoByMemberSrl($output->data->getRemoverSrl());
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
 		$module_info = $oModuleModel->getModuleInfoByModuleSrl($originObject->module_srl);
103 103
 		Context::set('module_info', $module_info);
104 104
 
105
-		if($originObject) {
105
+		if ($originObject) {
106 106
 			$args_extra->module_srl = $originObject->module_srl;
107 107
 			$args_extra->document_srl = $originObject->document_srl;
108 108
 			$output_extra = executeQueryArray('trash.getDocumentExtraVars', $args_extra);				
109
-			Context::set('oOriginExtraVars',$output_extra->data);
109
+			Context::set('oOriginExtraVars', $output_extra->data);
110 110
 		}
111 111
 		$this->setTemplateFile('trash_view');
112 112
 	}
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,10 +86,14 @@
 block discarded – undo
86 86
 
87 87
 		$oTrashModel = getModel('trash');
88 88
 		$output = $oTrashModel->getTrash($trash_srl);
89
-		if(!$output->data->getTrashSrl()) return new Object(-1, 'msg_invalid_request');
89
+		if(!$output->data->getTrashSrl()) {
90
+			return new Object(-1, 'msg_invalid_request');
91
+		}
90 92
 
91 93
 		$originObject = unserialize($output->data->getSerializedObject());
92
-		if(is_array($originObject)) $originObject = (object)$originObject;
94
+		if(is_array($originObject)) {
95
+			$originObject = (object)$originObject;
96
+		}
93 97
 
94 98
 		Context::set('oTrashVO',$output->data);
95 99
 		Context::set('oOrigin',$originObject);
Please login to merge, or discard this patch.
modules/trash/trash.model.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	function getTrash($trashSrl, $columnList = array())
20 20
 	{
21 21
 		$oTrashVO = new TrashVO();
22
-		if(!$trashSrl) return $oTrashVO;
22
+		if (!$trashSrl) return $oTrashVO;
23 23
 
24 24
 		$args = new stdClass();
25 25
 		$args->trashSrl = $trashSrl;
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
 	{
42 42
 		$output = executeQueryArray('trash.getTrashList', $args, $columnList);
43 43
 
44
-		if(is_array($output->data))
44
+		if (is_array($output->data))
45 45
 		{
46
-			foreach($output->data AS $key=>$value)
46
+			foreach ($output->data AS $key=>$value)
47 47
 			{
48 48
 				$oTrashVO = new TrashVO();
49 49
 				$this->_setTrashObject($oTrashVO, $value);
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
63 63
 	{
64 64
 		$output = executeQueryArray('trash.getTrashAllList', $args, $columnList);
65 65
 
66
-		if(is_array($output->data))
66
+		if (is_array($output->data))
67 67
 		{
68
-			foreach($output->data AS $key=>$value)
68
+			foreach ($output->data AS $key=>$value)
69 69
 			{
70 70
 				$oTrashVO = new TrashVO();
71 71
 				$this->_setTrashObject($oTrashVO, $value);
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,9 @@
 block discarded – undo
19 19
 	function getTrash($trashSrl, $columnList = array())
20 20
 	{
21 21
 		$oTrashVO = new TrashVO();
22
-		if(!$trashSrl) return $oTrashVO;
22
+		if(!$trashSrl) {
23
+			return $oTrashVO;
24
+		}
23 25
 
24 26
 		$args = new stdClass();
25 27
 		$args->trashSrl = $trashSrl;
Please login to merge, or discard this patch.
modules/widget/widget.admin.view.php 2 patches
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@  discard block
 block discarded – undo
32 32
 			if($widget->widget)
33 33
 			{
34 34
 				$widget_list[$no]->description = nl2br(trim($widget->description));
35
-			}
36
-			else
35
+			} else
37 36
 			{
38 37
 				unset($widget_list[$no]);
39 38
 			}
@@ -59,7 +58,9 @@  discard block
 block discarded – undo
59 58
 	function dispWidgetAdminAddContent()
60 59
 	{
61 60
 		$module_srl = Context::get('module_srl');
62
-		if(!$module_srl) return $this->stop("msg_invalid_request");
61
+		if(!$module_srl) {
62
+			return $this->stop("msg_invalid_request");
63
+		}
63 64
 
64 65
 		$document_srl = Context::get('document_srl');
65 66
 		$oDocumentModel = getModel('document');
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 		$security = new Security($widget_list);
28 28
 		$widget_list = $security->encodeHTML('..', '..author..');
29 29
 
30
-		foreach($widget_list as $no => $widget)
30
+		foreach ($widget_list as $no => $widget)
31 31
 		{
32
-			if($widget->widget)
32
+			if ($widget->widget)
33 33
 			{
34 34
 				$widget_list[$no]->description = nl2br(trim($widget->description));
35 35
 			}
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	function dispWidgetAdminAddContent()
60 60
 	{
61 61
 		$module_srl = Context::get('module_srl');
62
-		if(!$module_srl) return $this->stop("msg_invalid_request");
62
+		if (!$module_srl) return $this->stop("msg_invalid_request");
63 63
 
64 64
 		$document_srl = Context::get('document_srl');
65 65
 		$oDocumentModel = getModel('document');
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		Context::set('module_info', $module_info);
73 73
 		// Editors settings of the module by calling getEditor
74 74
 		$oEditorModel = getModel('editor');
75
-		$editor = $oEditorModel->getModuleEditor('document',$module_srl, $module_srl,'module_srl','content');
75
+		$editor = $oEditorModel->getModuleEditor('document', $module_srl, $module_srl, 'module_srl', 'content');
76 76
 		Context::set('editor', $editor);
77 77
 
78 78
 		$security = new Security();
Please login to merge, or discard this patch.
modules/widget/widget.class.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	{
30 30
 		$oModuleModel = getModel('module');
31 31
 		// widget compile display.after trigger for further (04/14/2009)
32
-		if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
32
+		if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
33 33
 
34 34
 		return false;
35 35
 	}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 		$oModuleModel = getModel('module');
43 43
 		$oModuleController = getController('module');
44 44
 		// widget compile display.after trigger for further (04/14/2009)
45
-		if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before'))
45
+		if (!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before'))
46 46
 		{
47 47
 			$oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before');
48 48
 		}
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,9 @@
 block discarded – undo
29 29
 	{
30 30
 		$oModuleModel = getModel('module');
31 31
 		// widget compile display.after trigger for further (04/14/2009)
32
-		if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
32
+		if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) {
33
+			return true;
34
+		}
33 35
 
34 36
 		return false;
35 37
 	}
Please login to merge, or discard this patch.
modules/widget/widget.model.php 2 patches
Braces   +74 added lines, -27 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@  discard block
 block discarded – undo
21 21
 	function getWidgetPath($widget_name)
22 22
 	{
23 23
 		$path = sprintf('./widgets/%s/', $widget_name);
24
-		if(is_dir($path)) return $path;
24
+		if(is_dir($path)) {
25
+			return $path;
26
+		}
25 27
 
26 28
 		return "";
27 29
 	}
@@ -32,7 +34,9 @@  discard block
 block discarded – undo
32 34
 	function getWidgetStylePath($widgetStyle_name)
33 35
 	{
34 36
 		$path = sprintf('./widgetstyles/%s/', $widgetStyle_name);
35
-		if(is_dir($path)) return $path;
37
+		if(is_dir($path)) {
38
+			return $path;
39
+		}
36 40
 
37 41
 		return "";
38 42
 	}
@@ -58,7 +62,9 @@  discard block
 block discarded – undo
58 62
 		// 've Downloaded the widget and the widget's list of installed Wanted
59 63
 		$searched_list = FileHandler::readDir('./widgets');
60 64
 		$searched_count = count($searched_list);
61
-		if(!$searched_count) return;
65
+		if(!$searched_count) {
66
+			return;
67
+		}
62 68
 		sort($searched_list);
63 69
 		// D which pertain to the list of widgets loop spins return statement review the information you need
64 70
 		for($i=0;$i<$searched_count;$i++)
@@ -101,7 +107,9 @@  discard block
 block discarded – undo
101 107
 		// 've Downloaded the widget and the widget's list of installed Wanted
102 108
 		$searched_list = FileHandler::readDir('./widgetstyles');
103 109
 		$searched_count = count($searched_list);
104
-		if(!$searched_count) return;
110
+		if(!$searched_count) {
111
+			return;
112
+		}
105 113
 		sort($searched_list);
106 114
 		// D which pertain to the list of widgets loop spins return statement review the information you need
107 115
 		for($i=0;$i<$searched_count;$i++)
@@ -124,10 +132,14 @@  discard block
 block discarded – undo
124 132
 	{
125 133
 		// Get a path of the requested module. Return if not exists.
126 134
 		$widget_path = $this->getWidgetPath($widget);
127
-		if(!$widget_path) return;
135
+		if(!$widget_path) {
136
+			return;
137
+		}
128 138
 		// Read the xml file for module skin information
129 139
 		$xml_file = sprintf("%sconf/info.xml", $widget_path);
130
-		if(!file_exists($xml_file)) return;
140
+		if(!file_exists($xml_file)) {
141
+			return;
142
+		}
131 143
 		// If the problem by comparing the cache file and include the return variable $widget_info
132 144
 		$cache_file = sprintf(_XE_PATH_ . 'files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType());
133 145
 
@@ -140,7 +152,9 @@  discard block
 block discarded – undo
140 152
 		$oXmlParser = new XmlParser();
141 153
 		$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
142 154
 		$xml_obj = $tmp_xml_obj->widget;
143
-		if(!$xml_obj) return;
155
+		if(!$xml_obj) {
156
+			return;
157
+		}
144 158
 
145 159
 		$buff = '$widget_info = new stdClass;';
146 160
 
@@ -161,8 +175,11 @@  discard block
 block discarded – undo
161 175
 			$buff .= sprintf('$widget_info->widget_srl = $widget_srl;');
162 176
 			$buff .= sprintf('$widget_info->widget_title = $widget_title;');
163 177
 			// Author information
164
-			if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
165
-			else $author_list = $xml_obj->author;
178
+			if(!is_array($xml_obj->author)) {
179
+				$author_list[] = $xml_obj->author;
180
+			} else {
181
+				$author_list = $xml_obj->author;
182
+			}
166 183
 
167 184
 			for($i=0; $i < count($author_list); $i++)
168 185
 			{
@@ -171,8 +188,7 @@  discard block
 block discarded – undo
171 188
 				$buff .= sprintf('$widget_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address);
172 189
 				$buff .= sprintf('$widget_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link);
173 190
 			}
174
-		}
175
-		else
191
+		} else
176 192
 		{
177 193
 			// Title of the widget, version
178 194
 			$buff .= sprintf('$widget_info->widget = "%s";', $widget);
@@ -193,12 +209,18 @@  discard block
 block discarded – undo
193 209
 		}
194 210
 		// Extra vars (user defined variables to use in a template)
195 211
 		$extra_var_groups = $xml_obj->extra_vars->group;
196
-		if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
197
-		if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
212
+		if(!$extra_var_groups) {
213
+			$extra_var_groups = $xml_obj->extra_vars;
214
+		}
215
+		if(!is_array($extra_var_groups)) {
216
+			$extra_var_groups = array($extra_var_groups);
217
+		}
198 218
 		foreach($extra_var_groups as $group)
199 219
 		{
200 220
 			$extra_vars = $group->var;
201
-			if(!is_array($group->var)) $extra_vars = array($group->var);
221
+			if(!is_array($group->var)) {
222
+				$extra_vars = array($group->var);
223
+			}
202 224
 
203 225
 			if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name)
204 226
 			{
@@ -228,9 +250,13 @@  discard block
 block discarded – undo
228 250
 					$buff .= sprintf('$widget_info->extra_var->%s->description = "%s";', $id, str_replace('"','\"',$var->description->body));
229 251
 
230 252
 					$options = $var->options;
231
-					if(!$options) continue;
253
+					if(!$options) {
254
+						continue;
255
+					}
232 256
 
233
-					if(!is_array($options)) $options = array($options);
257
+					if(!is_array($options)) {
258
+						$options = array($options);
259
+					}
234 260
 					$options_count = count($options);
235 261
 					for($j=0;$j<$options_count;$j++)
236 262
 					{
@@ -253,7 +279,9 @@  discard block
 block discarded – undo
253 279
 		$buff = '<?php if(!defined("__XE__")) exit(); '.$buff.' ?>';
254 280
 		FileHandler::writeFile($cache_file, $buff);
255 281
 
256
-		if(file_exists($cache_file)) @include($cache_file);
282
+		if(file_exists($cache_file)) {
283
+			@include($cache_file);
284
+		}
257 285
 		return $widget_info;
258 286
 	}
259 287
 
@@ -264,9 +292,13 @@  discard block
 block discarded – undo
264 292
 	function getWidgetStyleInfo($widgetStyle)
265 293
 	{
266 294
 		$widgetStyle_path = $this->getWidgetStylePath($widgetStyle);
267
-		if(!$widgetStyle_path) return;
295
+		if(!$widgetStyle_path) {
296
+			return;
297
+		}
268 298
 		$xml_file = sprintf("%sskin.xml", $widgetStyle_path);
269
-		if(!file_exists($xml_file)) return;
299
+		if(!file_exists($xml_file)) {
300
+			return;
301
+		}
270 302
 		// If the problem by comparing the cache file and include the return variable $widgetStyle_info
271 303
 		$cache_file = sprintf(_XE_PATH_ . 'files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType());
272 304
 
@@ -279,7 +311,9 @@  discard block
 block discarded – undo
279 311
 		$oXmlParser = new XmlParser();
280 312
 		$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
281 313
 		$xml_obj = $tmp_xml_obj->widgetstyle;
282
-		if(!$xml_obj) return;
314
+		if(!$xml_obj) {
315
+			return;
316
+		}
283 317
 
284 318
 		$buff = array();
285 319
 		$buff[] = '<?php if(!defined("__XE__")) exit();';
@@ -299,13 +333,20 @@  discard block
 block discarded – undo
299 333
 		$buff[] = sprintf('$widgetStyle_info->license_link = "%s";', $xml_obj->license->attrs->link);
300 334
 
301 335
 		// preview
302
-		if(!$xml_obj->preview->body) $xml_obj->preview->body = 'preview.jpg';
336
+		if(!$xml_obj->preview->body) {
337
+			$xml_obj->preview->body = 'preview.jpg';
338
+		}
303 339
 		$preview_file = sprintf("%s%s", $widgetStyle_path,$xml_obj->preview->body);
304
-		if(file_exists($preview_file)) $buff[] = sprintf('$widgetStyle_info->preview = "%s";', $preview_file);
340
+		if(file_exists($preview_file)) {
341
+			$buff[] = sprintf('$widgetStyle_info->preview = "%s";', $preview_file);
342
+		}
305 343
 
306 344
 		// Author information
307
-		if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
308
-		else $author_list = $xml_obj->author;
345
+		if(!is_array($xml_obj->author)) {
346
+			$author_list[] = $xml_obj->author;
347
+		} else {
348
+			$author_list = $xml_obj->author;
349
+		}
309 350
 
310 351
 		foreach($author_list as $idx => $author)
311 352
 		{
@@ -317,8 +358,12 @@  discard block
 block discarded – undo
317 358
 
318 359
 		// Extra vars (user defined variables to use in a template)
319 360
 		$extra_var_groups = $xml_obj->extra_vars->group;
320
-		if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
321
-		if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
361
+		if(!$extra_var_groups) {
362
+			$extra_var_groups = $xml_obj->extra_vars;
363
+		}
364
+		if(!is_array($extra_var_groups)) {
365
+			$extra_var_groups = array($extra_var_groups);
366
+		}
322 367
 
323 368
 		$extra_var_count = 0;
324 369
 		$buff[] = sprintf('$widgetStyle_info->extra_var = new stdClass();', $extra_var_count);
@@ -362,7 +407,9 @@  discard block
 block discarded – undo
362 407
 
363 408
 		FileHandler::writeFile($cache_file, implode(PHP_EOL, $buff));
364 409
 
365
-		if(file_exists($cache_file)) @include($cache_file);
410
+		if(file_exists($cache_file)) {
411
+			@include($cache_file);
412
+		}
366 413
 
367 414
 		return $widgetStyle_info;
368 415
 	}
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	function getWidgetPath($widget_name)
22 22
 	{
23 23
 		$path = sprintf('./widgets/%s/', $widget_name);
24
-		if(is_dir($path)) return $path;
24
+		if (is_dir($path)) return $path;
25 25
 
26 26
 		return "";
27 27
 	}
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	function getWidgetStylePath($widgetStyle_name)
33 33
 	{
34 34
 		$path = sprintf('./widgetstyles/%s/', $widgetStyle_name);
35
-		if(is_dir($path)) return $path;
35
+		if (is_dir($path)) return $path;
36 36
 
37 37
 		return "";
38 38
 	}
@@ -58,17 +58,17 @@  discard block
 block discarded – undo
58 58
 		// 've Downloaded the widget and the widget's list of installed Wanted
59 59
 		$searched_list = FileHandler::readDir('./widgets');
60 60
 		$searched_count = count($searched_list);
61
-		if(!$searched_count) return;
61
+		if (!$searched_count) return;
62 62
 		sort($searched_list);
63 63
 		// D which pertain to the list of widgets loop spins return statement review the information you need
64
-		for($i=0;$i<$searched_count;$i++)
64
+		for ($i = 0; $i < $searched_count; $i++)
65 65
 		{
66 66
 			// The name of the widget
67 67
 			$widget = $searched_list[$i];
68 68
 			// Wanted information on the Widget
69 69
 			$widget_info = $this->getWidgetInfo($widget);
70 70
 
71
-			if(!$widget_info)
71
+			if (!$widget_info)
72 72
 			{
73 73
 				$widget_info = new stdClass();
74 74
 			}
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
 		// 've Downloaded the widget and the widget's list of installed Wanted
102 102
 		$searched_list = FileHandler::readDir('./widgetstyles');
103 103
 		$searched_count = count($searched_list);
104
-		if(!$searched_count) return;
104
+		if (!$searched_count) return;
105 105
 		sort($searched_list);
106 106
 		// D which pertain to the list of widgets loop spins return statement review the information you need
107
-		for($i=0;$i<$searched_count;$i++)
107
+		for ($i = 0; $i < $searched_count; $i++)
108 108
 		{
109 109
 			// The name of the widget
110 110
 			$widgetStyle = $searched_list[$i];
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
 	{
125 125
 		// Get a path of the requested module. Return if not exists.
126 126
 		$widget_path = $this->getWidgetPath($widget);
127
-		if(!$widget_path) return;
127
+		if (!$widget_path) return;
128 128
 		// Read the xml file for module skin information
129 129
 		$xml_file = sprintf("%sconf/info.xml", $widget_path);
130
-		if(!file_exists($xml_file)) return;
130
+		if (!file_exists($xml_file)) return;
131 131
 		// If the problem by comparing the cache file and include the return variable $widget_info
132
-		$cache_file = sprintf(_XE_PATH_ . 'files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType());
132
+		$cache_file = sprintf(_XE_PATH_.'files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType());
133 133
 
134
-		if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file))
134
+		if (file_exists($cache_file) && filemtime($cache_file) > filemtime($xml_file))
135 135
 		{
136 136
 			@include($cache_file);
137 137
 			return $widget_info;
@@ -140,11 +140,11 @@  discard block
 block discarded – undo
140 140
 		$oXmlParser = new XmlParser();
141 141
 		$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
142 142
 		$xml_obj = $tmp_xml_obj->widget;
143
-		if(!$xml_obj) return;
143
+		if (!$xml_obj) return;
144 144
 
145 145
 		$buff = '$widget_info = new stdClass;';
146 146
 
147
-		if($xml_obj->version && $xml_obj->attrs->version == '0.2')
147
+		if ($xml_obj->version && $xml_obj->attrs->version == '0.2')
148 148
 		{
149 149
 			// Title of the widget, version
150 150
 			$buff .= sprintf('$widget_info->widget = "%s";', $widget);
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 			$buff .= sprintf('$widget_info->widget_srl = $widget_srl;');
162 162
 			$buff .= sprintf('$widget_info->widget_title = $widget_title;');
163 163
 			// Author information
164
-			if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
164
+			if (!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
165 165
 			else $author_list = $xml_obj->author;
166 166
 
167
-			for($i=0; $i < count($author_list); $i++)
167
+			for ($i = 0; $i < count($author_list); $i++)
168 168
 			{
169 169
 				$buff .= '$widget_info->author['.$i.'] = new stdClass;';
170 170
 				$buff .= sprintf('$widget_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body);
@@ -193,29 +193,29 @@  discard block
 block discarded – undo
193 193
 		}
194 194
 		// Extra vars (user defined variables to use in a template)
195 195
 		$extra_var_groups = $xml_obj->extra_vars->group;
196
-		if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
197
-		if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
198
-		foreach($extra_var_groups as $group)
196
+		if (!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
197
+		if (!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
198
+		foreach ($extra_var_groups as $group)
199 199
 		{
200 200
 			$extra_vars = $group->var;
201
-			if(!is_array($group->var)) $extra_vars = array($group->var);
201
+			if (!is_array($group->var)) $extra_vars = array($group->var);
202 202
 
203
-			if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name)
203
+			if ($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name)
204 204
 			{
205 205
 				$extra_var_count = count($extra_vars);
206 206
 
207 207
 				$buff .= sprintf('$widget_info->extra_var_count = "%s";', $extra_var_count);
208
-				for($i=0;$i<$extra_var_count;$i++)
208
+				for ($i = 0; $i < $extra_var_count; $i++)
209 209
 				{
210 210
 					unset($var);
211 211
 					unset($options);
212 212
 					$var = $extra_vars[$i];
213 213
 
214
-					$id = $var->attrs->id?$var->attrs->id:$var->attrs->name;
215
-					$name = $var->name->body?$var->name->body:$var->title->body;
216
-					$type = $var->attrs->type?$var->attrs->type:$var->type->body;
214
+					$id = $var->attrs->id ? $var->attrs->id : $var->attrs->name;
215
+					$name = $var->name->body ? $var->name->body : $var->title->body;
216
+					$type = $var->attrs->type ? $var->attrs->type : $var->type->body;
217 217
 					$buff .= sprintf('$widget_info->extra_var->%s = new stdClass;', $id);
218
-					if($type =='filebox')
218
+					if ($type == 'filebox')
219 219
 					{
220 220
 						$buff .= sprintf('$widget_info->extra_var->%s->filter = "%s";', $id, $var->type->attrs->filter);
221 221
 						$buff .= sprintf('$widget_info->extra_var->%s->allow_multiple = "%s";', $id, $var->type->attrs->allow_multiple);
@@ -225,23 +225,23 @@  discard block
 block discarded – undo
225 225
 					$buff .= sprintf('$widget_info->extra_var->%s->name = "%s";', $id, $name);
226 226
 					$buff .= sprintf('$widget_info->extra_var->%s->type = "%s";', $id, $type);
227 227
 					$buff .= sprintf('$widget_info->extra_var->%s->value = $vars->%s;', $id, $id);
228
-					$buff .= sprintf('$widget_info->extra_var->%s->description = "%s";', $id, str_replace('"','\"',$var->description->body));
228
+					$buff .= sprintf('$widget_info->extra_var->%s->description = "%s";', $id, str_replace('"', '\"', $var->description->body));
229 229
 
230 230
 					$options = $var->options;
231
-					if(!$options) continue;
231
+					if (!$options) continue;
232 232
 
233
-					if(!is_array($options)) $options = array($options);
233
+					if (!is_array($options)) $options = array($options);
234 234
 					$options_count = count($options);
235
-					for($j=0;$j<$options_count;$j++)
235
+					for ($j = 0; $j < $options_count; $j++)
236 236
 					{
237 237
 						$buff .= sprintf('$widget_info->extra_var->%s->options["%s"] = "%s";', $id, $options[$j]->value->body, $options[$j]->name->body);
238 238
 
239
-						if($options[$j]->attrs->default && $options[$j]->attrs->default=='true')
239
+						if ($options[$j]->attrs->default && $options[$j]->attrs->default == 'true')
240 240
 						{
241 241
 							$buff .= sprintf('$widget_info->extra_var->%s->default_options["%s"] = true;', $id, $options[$j]->value->body);
242 242
 						}
243 243
 
244
-						if($options[$j]->attrs->init && $options[$j]->attrs->init=='true')
244
+						if ($options[$j]->attrs->init && $options[$j]->attrs->init == 'true')
245 245
 						{
246 246
 							$buff .= sprintf('$widget_info->extra_var->%s->init_options["%s"] = true;', $id, $options[$j]->value->body);
247 247
 						}
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 		$buff = '<?php if(!defined("__XE__")) exit(); '.$buff.' ?>';
254 254
 		FileHandler::writeFile($cache_file, $buff);
255 255
 
256
-		if(file_exists($cache_file)) @include($cache_file);
256
+		if (file_exists($cache_file)) @include($cache_file);
257 257
 		return $widget_info;
258 258
 	}
259 259
 
@@ -264,13 +264,13 @@  discard block
 block discarded – undo
264 264
 	function getWidgetStyleInfo($widgetStyle)
265 265
 	{
266 266
 		$widgetStyle_path = $this->getWidgetStylePath($widgetStyle);
267
-		if(!$widgetStyle_path) return;
267
+		if (!$widgetStyle_path) return;
268 268
 		$xml_file = sprintf("%sskin.xml", $widgetStyle_path);
269
-		if(!file_exists($xml_file)) return;
269
+		if (!file_exists($xml_file)) return;
270 270
 		// If the problem by comparing the cache file and include the return variable $widgetStyle_info
271
-		$cache_file = sprintf(_XE_PATH_ . 'files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType());
271
+		$cache_file = sprintf(_XE_PATH_.'files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType());
272 272
 
273
-		if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file))
273
+		if (file_exists($cache_file) && filemtime($cache_file) > filemtime($xml_file))
274 274
 		{
275 275
 			@include($cache_file);
276 276
 			return $widgetStyle_info;
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 		$oXmlParser = new XmlParser();
280 280
 		$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
281 281
 		$xml_obj = $tmp_xml_obj->widgetstyle;
282
-		if(!$xml_obj) return;
282
+		if (!$xml_obj) return;
283 283
 
284 284
 		$buff = array();
285 285
 		$buff[] = '<?php if(!defined("__XE__")) exit();';
@@ -299,15 +299,15 @@  discard block
 block discarded – undo
299 299
 		$buff[] = sprintf('$widgetStyle_info->license_link = "%s";', $xml_obj->license->attrs->link);
300 300
 
301 301
 		// preview
302
-		if(!$xml_obj->preview->body) $xml_obj->preview->body = 'preview.jpg';
303
-		$preview_file = sprintf("%s%s", $widgetStyle_path,$xml_obj->preview->body);
304
-		if(file_exists($preview_file)) $buff[] = sprintf('$widgetStyle_info->preview = "%s";', $preview_file);
302
+		if (!$xml_obj->preview->body) $xml_obj->preview->body = 'preview.jpg';
303
+		$preview_file = sprintf("%s%s", $widgetStyle_path, $xml_obj->preview->body);
304
+		if (file_exists($preview_file)) $buff[] = sprintf('$widgetStyle_info->preview = "%s";', $preview_file);
305 305
 
306 306
 		// Author information
307
-		if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
307
+		if (!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
308 308
 		else $author_list = $xml_obj->author;
309 309
 
310
-		foreach($author_list as $idx => $author)
310
+		foreach ($author_list as $idx => $author)
311 311
 		{
312 312
 			$buff[] = sprintf('$widgetStyle_info->author[%d] = new stdClass();', $idx);
313 313
 			$buff[] = sprintf('$widgetStyle_info->author[%d]->name = "%s";', $idx, $author->name->body);
@@ -317,18 +317,18 @@  discard block
 block discarded – undo
317 317
 
318 318
 		// Extra vars (user defined variables to use in a template)
319 319
 		$extra_var_groups = $xml_obj->extra_vars->group;
320
-		if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
321
-		if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
320
+		if (!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
321
+		if (!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
322 322
 
323 323
 		$extra_var_count = 0;
324 324
 		$buff[] = sprintf('$widgetStyle_info->extra_var = new stdClass();', $extra_var_count);
325
-		foreach($extra_var_groups as $group)
325
+		foreach ($extra_var_groups as $group)
326 326
 		{
327 327
 			$extra_vars = (!is_array($group->var)) ? array($group->var) : $group->var;
328 328
 
329
-			if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name)
329
+			if ($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name)
330 330
 			{
331
-				foreach($extra_vars as $var)
331
+				foreach ($extra_vars as $var)
332 332
 				{
333 333
 					$extra_var_count++;
334 334
 					$id = ($var->attrs->id) ? $var->attrs->id : $var->attrs->name;
@@ -339,18 +339,18 @@  discard block
 block discarded – undo
339 339
 					$buff[] = sprintf('$widgetStyle_info->extra_var->%s->group = "%s";', $id, $group->title->body);
340 340
 					$buff[] = sprintf('$widgetStyle_info->extra_var->%s->name = "%s";', $id, $name);
341 341
 					$buff[] = sprintf('$widgetStyle_info->extra_var->%s->type = "%s";', $id, $type);
342
-					if($type =='filebox')
342
+					if ($type == 'filebox')
343 343
 					{
344 344
 						$buff[] = sprintf('$widgetStyle_info->extra_var->%s->filter = "%s";', $id, $var->attrs->filter);
345 345
 						$buff[] = sprintf('$widgetStyle_info->extra_var->%s->allow_multiple = "%s";', $id, $var->attrs->allow_multiple);
346 346
 					}
347 347
 					$buff[] = sprintf('$widgetStyle_info->extra_var->%s->value = $vars->%s;', $id, $id);
348
-					$buff[] = sprintf('$widgetStyle_info->extra_var->%s->description = "%s";', $id, str_replace('"','\"',$var->description->body));
348
+					$buff[] = sprintf('$widgetStyle_info->extra_var->%s->description = "%s";', $id, str_replace('"', '\"', $var->description->body));
349 349
 
350
-					if($var->options)
350
+					if ($var->options)
351 351
 					{
352 352
 						$var_options = (!is_array($var->options)) ? array($var->options) : $var->options;
353
-						foreach($var_options as $option_item)
353
+						foreach ($var_options as $option_item)
354 354
 						{
355 355
 							$buff[] = sprintf('$widgetStyle_info->extra_var->%s->options["%s"] = "%s";', $id, $option_item->value->body, $option_item->name->body);
356 356
 						}
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 
363 363
 		FileHandler::writeFile($cache_file, implode(PHP_EOL, $buff));
364 364
 
365
-		if(file_exists($cache_file)) @include($cache_file);
365
+		if (file_exists($cache_file)) @include($cache_file);
366 366
 
367 367
 		return $widgetStyle_info;
368 368
 	}
Please login to merge, or discard this patch.
modules/widget/widget.view.php 2 patches
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@  discard block
 block discarded – undo
21 21
 	function dispWidgetInfo()
22 22
 	{
23 23
 		// If people have skin widget widget output as a function of the skin More Details
24
-		if(Context::get('skin')) return $this->dispWidgetSkinInfo();
24
+		if(Context::get('skin')) {
25
+			return $this->dispWidgetSkinInfo();
26
+		}
25 27
 		// Wanted widget is selected information
26 28
 		$oWidgetModel = getModel('widget');
27 29
 		$widget_info = $oWidgetModel->getWidgetInfo(Context::get('selected_widget'));
@@ -62,7 +64,9 @@  discard block
 block discarded – undo
62 64
 
63 65
 		$widget_list = $oWidgetModel->getDownloadedWidgetList();
64 66
 		$selected_widget = Context::get('selected_widget');
65
-		if(!$selected_widget) $selected_widget = $widget_list[0]->widget;
67
+		if(!$selected_widget) {
68
+			$selected_widget = $widget_list[0]->widget;
69
+		}
66 70
 
67 71
 		$widget_info = $oWidgetModel->getWidgetInfo($selected_widget);
68 72
 		Context::set('widget_info', $widget_info);
@@ -89,8 +93,7 @@  discard block
 block discarded – undo
89 93
 			foreach($mid_list as $module_srl => $module) {
90 94
 				$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
91 95
 			}
92
-		}
93
-		else
96
+		} else
94 97
 		{
95 98
 			$module_categories[0] = new stdClass();
96 99
 			$module_categories[0]->list = $mid_list;
@@ -118,7 +121,9 @@  discard block
 block discarded – undo
118 121
 		$widget_list = $oWidgetModel->getDownloadedWidgetList();
119 122
 		Context::set('widget_list',$widget_list);
120 123
 		// When there is no widget is selected in the first widget
121
-		if(!Context::get('selected_widget')) Context::set('selected_widget',$widget_list[0]->widget);
124
+		if(!Context::get('selected_widget')) {
125
+			Context::set('selected_widget',$widget_list[0]->widget);
126
+		}
122 127
 
123 128
 		$this->dispWidgetGenerateCode();
124 129
 		$this->setLayoutFile('default_layout');
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	function dispWidgetInfo()
22 22
 	{
23 23
 		// If people have skin widget widget output as a function of the skin More Details
24
-		if(Context::get('skin')) return $this->dispWidgetSkinInfo();
24
+		if (Context::get('skin')) return $this->dispWidgetSkinInfo();
25 25
 		// Wanted widget is selected information
26 26
 		$oWidgetModel = getModel('widget');
27 27
 		$widget_info = $oWidgetModel->getWidgetInfo(Context::get('selected_widget'));
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 		$oModuleModel = getModel('module');
46 46
 		$skin_info = $oModuleModel->loadSkinInfo($path, $skin);
47 47
 
48
-		Context::set('skin_info',$skin_info);
48
+		Context::set('skin_info', $skin_info);
49 49
 		// Specifies the widget to pop up
50 50
 		$this->setLayoutFile('popup_layout');
51 51
 		// Set a template file
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 		$widget_list = $oWidgetModel->getDownloadedWidgetList();
64 64
 		$selected_widget = Context::get('selected_widget');
65
-		if(!$selected_widget) $selected_widget = $widget_list[0]->widget;
65
+		if (!$selected_widget) $selected_widget = $widget_list[0]->widget;
66 66
 
67 67
 		$widget_info = $oWidgetModel->getWidgetInfo($selected_widget);
68 68
 		Context::set('widget_info', $widget_info);
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
 		$group_list = $oMemberModel->getGroups($site_module_info->site_srl);
85 85
 		Context::set('group_list', $group_list);
86 86
 		// module_category and module combination
87
-		if($module_categories)
87
+		if ($module_categories)
88 88
 		{
89
-			foreach($mid_list as $module_srl => $module) {
89
+			foreach ($mid_list as $module_srl => $module) {
90 90
 				$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
91 91
 			}
92 92
 		}
@@ -96,10 +96,10 @@  discard block
 block discarded – undo
96 96
 			$module_categories[0]->list = $mid_list;
97 97
 		}
98 98
 
99
-		Context::set('mid_list',$module_categories);
99
+		Context::set('mid_list', $module_categories);
100 100
 		// Menu Get a list
101 101
 		$output = executeQueryArray('menu.getMenus');
102
-		Context::set('menu_list',$output->data);
102
+		Context::set('menu_list', $output->data);
103 103
 		// Wanted information on skin
104 104
 		$skin_list = $oModuleModel->getSkins($widget_info->path);
105 105
 		Context::set('skin_list', $skin_list);
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 	{
117 117
 		$oWidgetModel = getModel('widget');
118 118
 		$widget_list = $oWidgetModel->getDownloadedWidgetList();
119
-		Context::set('widget_list',$widget_list);
119
+		Context::set('widget_list', $widget_list);
120 120
 		// When there is no widget is selected in the first widget
121
-		if(!Context::get('selected_widget')) Context::set('selected_widget',$widget_list[0]->widget);
121
+		if (!Context::get('selected_widget')) Context::set('selected_widget', $widget_list[0]->widget);
122 122
 
123 123
 		$this->dispWidgetGenerateCode();
124 124
 		$this->setLayoutFile('default_layout');
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
 		// Widget-style list
134 134
 		$oWidgetModel = getModel('widget');
135 135
 		$widgetStyle_list = $oWidgetModel->getDownloadedWidgetStyleList();
136
-		Context::set('widgetStyle_list',$widgetStyle_list);
136
+		Context::set('widgetStyle_list', $widgetStyle_list);
137 137
 		// Selected list of widget styles
138 138
 		$widgetstyle = Context::get('widgetstyle');
139 139
 		$widgetstyle_info = $oWidgetModel->getWidgetStyleInfo($widgetstyle);
140
-		if($widgetstyle && $widgetstyle_info)
140
+		if ($widgetstyle && $widgetstyle_info)
141 141
 		{
142
-			Context::set('widgetstyle_info',$widgetstyle_info);
142
+			Context::set('widgetstyle_info', $widgetstyle_info);
143 143
 		}
144 144
 
145 145
 		$this->dispWidgetGenerateCode();
Please login to merge, or discard this patch.