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/editor/components/emoticon/emoticon.class.php 2 patches
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@  discard block
 block discarded – undo
28 28
 	function getEmoticonList()
29 29
 	{
30 30
 		$emoticon = Context::get('emoticon');
31
-		if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) return new Object(-1,'msg_invalid_request');
31
+		if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) {
32
+			return new Object(-1,'msg_invalid_request');
33
+		}
32 34
 
33 35
 		$list = $this->getEmoticons($emoticon);
34 36
 
@@ -46,11 +48,17 @@  discard block
 block discarded – undo
46 48
 		$oDir = dir($emoticon_path);
47 49
 		while($file = $oDir->read())
48 50
 		{
49
-			if(substr($file,0,1)=='.') continue;
50
-			if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file));
51
+			if(substr($file,0,1)=='.') {
52
+				continue;
53
+			}
54
+			if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) {
55
+				$output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file));
56
+			}
51 57
 		}
52 58
 		$oDir->close();
53
-		if(count($output)) asort($output);
59
+		if(count($output)) {
60
+			asort($output);
61
+		}
54 62
 		return $output;
55 63
 	}
56 64
 
@@ -66,7 +74,9 @@  discard block
 block discarded – undo
66 74
 		{
67 75
 			foreach($emoticon_dirs as $emoticon)
68 76
 			{
69
-				if(preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) $emoticon_list[] = $emoticon;
77
+				if(preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) {
78
+					$emoticon_list[] = $emoticon;
79
+				}
70 80
 			}
71 81
 		}
72 82
 		Context::set('emoticon_list', $emoticon_list);
@@ -96,7 +106,9 @@  discard block
 block discarded – undo
96 106
 		}
97 107
 
98 108
 		$src = str_replace(array('&','"'), array('&','&qout;'), $src);
99
-		if(!$alt) $alt = $src;
109
+		if(!$alt) {
110
+			$alt = $src;
111
+		}
100 112
 
101 113
 		$attr_output = array();
102 114
 		$attr_output = array("src=\"".$src."\"");
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	{
20 20
 		$this->editor_sequence = $editor_sequence;
21 21
 		$this->component_path = $component_path;
22
-		$this->emoticon_path = sprintf('%s%s/images',preg_replace('/^\.\//i','',$this->component_path),'tpl','images');
22
+		$this->emoticon_path = sprintf('%s%s/images', preg_replace('/^\.\//i', '', $this->component_path), 'tpl', 'images');
23 23
 	}
24 24
 
25 25
 	/**
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 	function getEmoticonList()
29 29
 	{
30 30
 		$emoticon = Context::get('emoticon');
31
-		if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) return new Object(-1,'msg_invalid_request');
31
+		if (!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) return new Object(-1, 'msg_invalid_request');
32 32
 
33 33
 		$list = $this->getEmoticons($emoticon);
34 34
 
35
-		$this->add('emoticons', implode("\n",$list));
35
+		$this->add('emoticons', implode("\n", $list));
36 36
 	}
37 37
 
38 38
 	/**
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
 		$output = array();
45 45
 
46 46
 		$oDir = dir($emoticon_path);
47
-		while($file = $oDir->read())
47
+		while ($file = $oDir->read())
48 48
 		{
49
-			if(substr($file,0,1)=='.') continue;
50
-			if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file));
49
+			if (substr($file, 0, 1) == '.') continue;
50
+			if (preg_match('/\.(jpg|jpeg|gif|png)$/i', $file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path, '', $file));
51 51
 		}
52 52
 		$oDir->close();
53
-		if(count($output)) asort($output);
53
+		if (count($output)) asort($output);
54 54
 		return $output;
55 55
 	}
56 56
 
@@ -62,11 +62,11 @@  discard block
 block discarded – undo
62 62
 		// Bringing a list of emoticons directory
63 63
 		$emoticon_dirs = FileHandler::readDir($this->emoticon_path);
64 64
 		$emoticon_list = array();
65
-		if($emoticon_dirs)
65
+		if ($emoticon_dirs)
66 66
 		{
67
-			foreach($emoticon_dirs as $emoticon)
67
+			foreach ($emoticon_dirs as $emoticon)
68 68
 			{
69
-				if(preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) $emoticon_list[] = $emoticon;
69
+				if (preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) $emoticon_list[] = $emoticon;
70 70
 			}
71 71
 		}
72 72
 		Context::set('emoticon_list', $emoticon_list);
@@ -89,24 +89,24 @@  discard block
 block discarded – undo
89 89
 		$src = $xml_obj->attrs->src;
90 90
 		$alt = $xml_obj->attrs->alt;
91 91
 
92
-		if(!$alt)
92
+		if (!$alt)
93 93
 		{
94
-			$tmp_arr = explode('/',$src);
94
+			$tmp_arr = explode('/', $src);
95 95
 			$alt = array_pop($tmp_arr);
96 96
 		}
97 97
 
98
-		$src = str_replace(array('&','"'), array('&','&qout;'), $src);
99
-		if(!$alt) $alt = $src;
98
+		$src = str_replace(array('&', '"'), array('&', '&qout;'), $src);
99
+		if (!$alt) $alt = $src;
100 100
 
101 101
 		$attr_output = array();
102 102
 		$attr_output = array("src=\"".$src."\"");
103 103
 
104
-		if($alt)
104
+		if ($alt)
105 105
 		{
106 106
 			$attr_output[] = "alt=\"".$alt."\"";
107 107
 		}
108 108
 
109
-		$code = sprintf("<img %s style=\"border:0px\" />", implode(" ",$attr_output));
109
+		$code = sprintf("<img %s style=\"border:0px\" />", implode(" ", $attr_output));
110 110
 
111 111
 		return $code;
112 112
 	}
Please login to merge, or discard this patch.
modules/editor/components/image_gallery/image_gallery.class.php 2 patches
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,15 +75,20 @@
 block discarded – undo
75 75
 		// HTML gallery output, the output settings via the template for the conversion to generate the html code should
76 76
 		preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
77 77
 		$gallery_info->width = trim($matches[3][0]);
78
-		if(!$gallery_info->width) $gallery_info->width = 400;
78
+		if(!$gallery_info->width) {
79
+			$gallery_info->width = 400;
80
+		}
79 81
 
80 82
 		Context::set('gallery_info', $gallery_info);
81 83
 
82 84
 		$tpl_path = $this->component_path.'tpl';
83 85
 		Context::set("tpl_path", $tpl_path);
84 86
 
85
-		if($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html';
86
-		else $tpl_file = 'slide_gallery.html';
87
+		if($gallery_info->gallery_style == "list") {
88
+			$tpl_file = 'list_gallery.html';
89
+		} else {
90
+			$tpl_file = 'slide_gallery.html';
91
+		}
87 92
 
88 93
 		$oTemplate = &TemplateHandler::getInstance();
89 94
 		return $oTemplate->compile($tpl_path, $tpl_file);
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -45,14 +45,14 @@  discard block
 block discarded – undo
45 45
 	{
46 46
 		$gallery_info = new stdClass();
47 47
 		$gallery_info->srl = rand(111111, 999999);
48
-		$gallery_info->border_thickness = (int)$xml_obj->attrs->border_thickness;
48
+		$gallery_info->border_thickness = (int) $xml_obj->attrs->border_thickness;
49 49
 		$gallery_info->gallery_style = $xml_obj->attrs->gallery_style;
50 50
 		$color_preg = "/^([a-fA-F0-9]{6})/";
51
-		$gallery_info->border_color = preg_replace($color_preg,"#$1",$xml_obj->attrs->border_color);
52
-		$gallery_info->bg_color = preg_replace($color_preg,"#$1",$xml_obj->attrs->bg_color);
51
+		$gallery_info->border_color = preg_replace($color_preg, "#$1", $xml_obj->attrs->border_color);
52
+		$gallery_info->bg_color = preg_replace($color_preg, "#$1", $xml_obj->attrs->bg_color);
53 53
 		$gallery_info->gallery_align = $xml_obj->attrs->gallery_align;
54 54
 
55
-		if(!in_array($gallery_info->gallery_align, array('left', 'center', 'right'))) {
55
+		if (!in_array($gallery_info->gallery_align, array('left', 'center', 'right'))) {
56 56
 			$gallery_info->gallery_align = 'center';
57 57
 		}
58 58
 
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
 		$gallery_info->images_list = preg_grep("/^[a-z0-9\/]+\.(gif|jpe?g|png)+$/", $images_list);
63 63
 
64 64
 		// If you set the output to output the XML code generated a list of the image
65
-		if(Context::getResponseMethod() == 'XMLRPC')
65
+		if (Context::getResponseMethod() == 'XMLRPC')
66 66
 		{
67 67
 			$output = array();
68
-			for($i=0;$i<count($gallery_info->images_list);$i++)
68
+			for ($i = 0; $i < count($gallery_info->images_list); $i++)
69 69
 			{
70 70
 				$output[] = sprintf('<img src="%s" alt="" />', $gallery_info->images_list[$i]);
71 71
 			}
@@ -73,16 +73,16 @@  discard block
 block discarded – undo
73 73
 			return implode('<br />', $output);
74 74
 		}
75 75
 		// HTML gallery output, the output settings via the template for the conversion to generate the html code should
76
-		preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
76
+		preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i', $xml_obj->attrs->style, $matches);
77 77
 		$gallery_info->width = trim($matches[3][0]);
78
-		if(!$gallery_info->width) $gallery_info->width = 400;
78
+		if (!$gallery_info->width) $gallery_info->width = 400;
79 79
 
80 80
 		Context::set('gallery_info', $gallery_info);
81 81
 
82 82
 		$tpl_path = $this->component_path.'tpl';
83 83
 		Context::set("tpl_path", $tpl_path);
84 84
 
85
-		if($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html';
85
+		if ($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html';
86 86
 		else $tpl_file = 'slide_gallery.html';
87 87
 
88 88
 		$oTemplate = &TemplateHandler::getInstance();
Please login to merge, or discard this patch.
modules/editor/components/image_link/image_link.class.php 2 patches
Braces   +30 added lines, -12 removed lines patch added patch discarded remove patch
@@ -60,14 +60,19 @@  discard block
 block discarded – undo
60 60
 
61 61
 		// Image containing the address to the address conversion request uri (rss output, etc. purposes)
62 62
 		$temp_src = explode('/', $src);
63
-		if(substr($src, 0,2)=='./') $src = Context::getRequestUri().substr($src, 2);
64
-		else if(substr($src , 0, 1)=='/')
63
+		if(substr($src, 0,2)=='./') {
64
+			$src = Context::getRequestUri().substr($src, 2);
65
+		} else if(substr($src , 0, 1)=='/')
65 66
 		{
66
-			if($_SERVER['HTTPS']=='on') $http_src = 'https://';
67
-			else $http_src = 'http://';
67
+			if($_SERVER['HTTPS']=='on') {
68
+				$http_src = 'https://';
69
+			} else {
70
+				$http_src = 'http://';
71
+			}
68 72
 			$src = $http_src.$_SERVER['HTTP_HOST'].$src;
73
+		} else if(!strpos($temp_src[0],':') && $src) {
74
+			$src = Context::getRequestUri().$src;
69 75
 		}
70
-		else if(!strpos($temp_src[0],':') && $src) $src = Context::getRequestUri().$src;
71 76
 
72 77
 		$attr_output = array();
73 78
 		$attr_output = array("src=\"".$src."\"");
@@ -81,17 +86,27 @@  discard block
 block discarded – undo
81 86
 		{
82 87
 			$style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';';
83 88
 			$style = str_replace(';;',';',$style);
84
-			if($style == ';') $style = '';
89
+			if($style == ';') {
90
+				$style = '';
91
+			}
85 92
 			$style .= ' margin:'.$margin.'px;';
86 93
 		}
87
-		if($align) $attr_output[] = "align=\"".$align."\"";
88
-		if($width) $attr_output[] = 'width="'.$width.'"';
89
-		if($height) $attr_output[] = 'height="'.$height.'"';
94
+		if($align) {
95
+			$attr_output[] = "align=\"".$align."\"";
96
+		}
97
+		if($width) {
98
+			$attr_output[] = 'width="'.$width.'"';
99
+		}
100
+		if($height) {
101
+			$attr_output[] = 'height="'.$height.'"';
102
+		}
90 103
 		if($border)
91 104
 		{
92 105
 			$style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';';
93 106
 			$style = str_replace(';;',';',$style);
94
-			if($style == ';') $style = '';
107
+			if($style == ';') {
108
+				$style = '';
109
+			}
95 110
 			$style .= ' border-style: solid; border-width:'.$border.'px;';
96 111
 		}
97 112
 
@@ -99,8 +114,11 @@  discard block
 block discarded – undo
99 114
 
100 115
 		if($link_url)
101 116
 		{
102
-			if($open_window =='Y') $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code);
103
-			else $code = sprintf('<a href="%s" >%s</a>', $link_url, $code);
117
+			if($open_window =='Y') {
118
+				$code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code);
119
+			} else {
120
+				$code = sprintf('<a href="%s" >%s</a>', $link_url, $code);
121
+			}
104 122
 		}
105 123
 		return $code;
106 124
 	}
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -49,57 +49,57 @@
 block discarded – undo
49 49
 		$align = $xml_obj->attrs->align;
50 50
 		$alt = $xml_obj->attrs->alt;
51 51
 		$title = $xml_obj->attrs->title;
52
-		$border = (int)$xml_obj->attrs->border;
52
+		$border = (int) $xml_obj->attrs->border;
53 53
 		$link_url = $xml_obj->attrs->link_url;
54 54
 		$open_window = $xml_obj->attrs->open_window;
55 55
 		$style = $xml_obj->attrs->style;
56
-		$margin = (int)$xml_obj->attrs->margin;
56
+		$margin = (int) $xml_obj->attrs->margin;
57 57
 
58
-		$src = str_replace(array('&','"'), array('&amp;','&qout;'), $src);
58
+		$src = str_replace(array('&', '"'), array('&amp;', '&qout;'), $src);
59 59
 		$src = str_replace('&amp;amp;', '&amp;', $src);
60 60
 
61 61
 		// Image containing the address to the address conversion request uri (rss output, etc. purposes)
62 62
 		$temp_src = explode('/', $src);
63
-		if(substr($src, 0,2)=='./') $src = Context::getRequestUri().substr($src, 2);
64
-		else if(substr($src , 0, 1)=='/')
63
+		if (substr($src, 0, 2) == './') $src = Context::getRequestUri().substr($src, 2);
64
+		else if (substr($src, 0, 1) == '/')
65 65
 		{
66
-			if($_SERVER['HTTPS']=='on') $http_src = 'https://';
66
+			if ($_SERVER['HTTPS'] == 'on') $http_src = 'https://';
67 67
 			else $http_src = 'http://';
68 68
 			$src = $http_src.$_SERVER['HTTP_HOST'].$src;
69 69
 		}
70
-		else if(!strpos($temp_src[0],':') && $src) $src = Context::getRequestUri().$src;
70
+		else if (!strpos($temp_src[0], ':') && $src) $src = Context::getRequestUri().$src;
71 71
 
72 72
 		$attr_output = array();
73 73
 		$attr_output = array("src=\"".$src."\"");
74 74
 		$attr_output[] = "alt=\"".$alt."\"";
75 75
 
76
-		if($title)
76
+		if ($title)
77 77
 		{
78 78
 			$attr_output[] = "title=\"".$title."\"";
79 79
 		}
80
-		if($margin)
80
+		if ($margin)
81 81
 		{
82
-			$style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';';
83
-			$style = str_replace(';;',';',$style);
84
-			if($style == ';') $style = '';
82
+			$style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i', '', $style)).';';
83
+			$style = str_replace(';;', ';', $style);
84
+			if ($style == ';') $style = '';
85 85
 			$style .= ' margin:'.$margin.'px;';
86 86
 		}
87
-		if($align) $attr_output[] = "align=\"".$align."\"";
88
-		if($width) $attr_output[] = 'width="'.$width.'"';
89
-		if($height) $attr_output[] = 'height="'.$height.'"';
90
-		if($border)
87
+		if ($align) $attr_output[] = "align=\"".$align."\"";
88
+		if ($width) $attr_output[] = 'width="'.$width.'"';
89
+		if ($height) $attr_output[] = 'height="'.$height.'"';
90
+		if ($border)
91 91
 		{
92
-			$style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';';
93
-			$style = str_replace(';;',';',$style);
94
-			if($style == ';') $style = '';
92
+			$style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i', '', $style)).';';
93
+			$style = str_replace(';;', ';', $style);
94
+			if ($style == ';') $style = '';
95 95
 			$style .= ' border-style: solid; border-width:'.$border.'px;';
96 96
 		}
97 97
 
98
-		$code = sprintf("<img %s style=\"%s\" />", implode(' ',$attr_output), $style);
98
+		$code = sprintf("<img %s style=\"%s\" />", implode(' ', $attr_output), $style);
99 99
 
100
-		if($link_url)
100
+		if ($link_url)
101 101
 		{
102
-			if($open_window =='Y') $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code);
102
+			if ($open_window == 'Y') $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code);
103 103
 			else $code = sprintf('<a href="%s" >%s</a>', $link_url, $code);
104 104
 		}
105 105
 		return $code;
Please login to merge, or discard this patch.
modules/editor/components/poll_maker/poll_maker.class.php 2 patches
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,11 +47,15 @@
 block discarded – undo
47 47
 	{
48 48
 		$poll_srl = $xml_obj->attrs->poll_srl;
49 49
 		$skin = $xml_obj->attrs->skin;
50
-		if(!$skin) $skin = 'default';
50
+		if(!$skin) {
51
+			$skin = 'default';
52
+		}
51 53
 
52 54
 		preg_match('/width([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
53 55
 		$width = $matches[2];
54
-		if(!$width) $width = 400;
56
+		if(!$width) {
57
+			$width = 400;
58
+		}
55 59
 		$style = sprintf('width:%dpx', $width);
56 60
 		// poll model object creation to come get it return html
57 61
 		$oPollModel = getModel('poll');
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	{
28 28
 		// Wanted Skins survey
29 29
 		$oModuleModel = getModel('module');
30
-		$skin_list = $oModuleModel->getSkins(_XE_PATH_ . 'modules/poll/');
30
+		$skin_list = $oModuleModel->getSkins(_XE_PATH_.'modules/poll/');
31 31
 		Context::set('skin_list', $skin_list);
32 32
 		// Pre-compiled source code to compile template return to
33 33
 		$tpl_path = $this->component_path.'tpl';
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 	{
48 48
 		$poll_srl = $xml_obj->attrs->poll_srl;
49 49
 		$skin = $xml_obj->attrs->skin;
50
-		if(!$skin) $skin = 'default';
50
+		if (!$skin) $skin = 'default';
51 51
 
52
-		preg_match('/width([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
52
+		preg_match('/width([^[:digit:]]+)([0-9]+)/i', $xml_obj->attrs->style, $matches);
53 53
 		$width = $matches[2];
54
-		if(!$width) $width = 400;
54
+		if (!$width) $width = 400;
55 55
 		$style = sprintf('width:%dpx', $width);
56 56
 		// poll model object creation to come get it return html
57 57
 		$oPollModel = getModel('poll');
Please login to merge, or discard this patch.
modules/editor/editor.admin.controller.php 2 patches
Braces   +56 added lines, -26 removed lines patch added patch discarded remove patch
@@ -23,8 +23,12 @@  discard block
 block discarded – undo
23 23
 		$enables = Context::get('enables');
24 24
 		$component_names = Context::get('component_names');
25 25
 
26
-		if(!is_array($component_names)) $component_names = array();
27
-		if(!is_array($enables)) $enables = array();
26
+		if(!is_array($component_names)) {
27
+			$component_names = array();
28
+		}
29
+		if(!is_array($enables)) {
30
+			$enables = array();
31
+		}
28 32
 
29 33
 		$unables = array_diff($component_names, $enables);
30 34
 		$componentList = array();
@@ -39,10 +43,14 @@  discard block
 block discarded – undo
39 43
 		}
40 44
 
41 45
 		$output = $this->editorListOrder($component_names,$site_module_info->site_srl);
42
-		if(!$output->toBool()) return new Object();
46
+		if(!$output->toBool()) {
47
+			return new Object();
48
+		}
43 49
 
44 50
 		$output = $this->editorCheckUse($componentList,$site_module_info->site_srl);
45
-		if(!$output->toBool()) return new Object();
51
+		if(!$output->toBool()) {
52
+			return new Object();
53
+		}
46 54
 
47 55
 		$oEditorController = getController('editor');
48 56
 		$oEditorController->removeCache($site_module_info->site_srl);
@@ -64,13 +72,14 @@  discard block
 block discarded – undo
64 72
 			if($site_srl == 0)
65 73
 			{
66 74
 				$output = executeQuery('editor.updateComponent', $args);
67
-			}
68
-			else
75
+			} else
69 76
 			{
70 77
 				$output = executeQuery('editor.updateSiteComponent', $args);
71 78
 			}
72 79
 		}
73
-		if(!$output->toBool()) return new Object();
80
+		if(!$output->toBool()) {
81
+			return new Object();
82
+		}
74 83
 
75 84
 		unset($componentList);
76 85
 		return $output;
@@ -93,13 +102,14 @@  discard block
 block discarded – undo
93 102
 				if($site_srl == 0)
94 103
 				{
95 104
 					$output = executeQuery('editor.updateComponent', $args);
96
-				}
97
-				else
105
+				} else
98 106
 				{
99 107
 					$output = executeQuery('editor.updateSiteComponent', $args);
100 108
 				}
101 109
 
102
-				if(!$output->toBool()) return new Object();
110
+				if(!$output->toBool()) {
111
+					return new Object();
112
+				}
103 113
 				$list_order_num++;
104 114
 			}
105 115
 		}
@@ -126,9 +136,14 @@  discard block
 block discarded – undo
126 136
 		$args->extra_vars = serialize($extra_vars);
127 137
 		$args->site_srl = (int)$site_module_info->site_srl;
128 138
 
129
-		if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
130
-		else $output = executeQuery('editor.updateSiteComponent', $args);
131
-		if(!$output->toBool()) return $output;
139
+		if(!$args->site_srl) {
140
+			$output = executeQuery('editor.updateComponent', $args);
141
+		} else {
142
+			$output = executeQuery('editor.updateSiteComponent', $args);
143
+		}
144
+		if(!$output->toBool()) {
145
+			return $output;
146
+		}
132 147
 
133 148
 		$oEditorController = getController('editor');
134 149
 		$oEditorController->removeCache($args->site_srl);
@@ -145,13 +160,17 @@  discard block
 block discarded – undo
145 160
 		$oModuleController = getController('module');
146 161
 		$configVars = Context::getRequestVars();
147 162
 
148
-		if($configVars->font_defined != 'Y') $config->font_defined = $configVars->font_defined = 'N';
149
-		else $config->font_defined = 'Y';
163
+		if($configVars->font_defined != 'Y') {
164
+			$config->font_defined = $configVars->font_defined = 'N';
165
+		} else {
166
+			$config->font_defined = 'Y';
167
+		}
150 168
 
151
-		if($config->font_defined == 'Y')
152
-			$config->content_font = $configVars->content_font_defined;
153
-		else
154
-			$config->content_font = $configVars->content_font;
169
+		if($config->font_defined == 'Y') {
170
+					$config->content_font = $configVars->content_font_defined;
171
+		} else {
172
+					$config->content_font = $configVars->content_font;
173
+		}
155 174
 
156 175
 		$config->editor_skin = $configVars->editor_skin;
157 176
 		$config->editor_height = $configVars->editor_height;
@@ -172,21 +191,32 @@  discard block
 block discarded – undo
172 191
 	 */
173 192
 	function insertComponent($component_name, $enabled = false, $site_srl = 0)
174 193
 	{
175
-		if($enabled) $enabled = 'Y';
176
-		else $enabled = 'N';
194
+		if($enabled) {
195
+			$enabled = 'Y';
196
+		} else {
197
+			$enabled = 'N';
198
+		}
177 199
 
178 200
 		$args = new stdClass;
179 201
 		$args->component_name = $component_name;
180 202
 		$args->enabled = $enabled;
181 203
 		$args->site_srl = $site_srl;
182 204
 		// Check if the component exists
183
-		if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args);
184
-		else $output = executeQuery('editor.isSiteComponentInserted', $args);
185
-		if($output->data->count) return new Object(-1, 'msg_component_is_not_founded');
205
+		if(!$site_srl) {
206
+			$output = executeQuery('editor.isComponentInserted', $args);
207
+		} else {
208
+			$output = executeQuery('editor.isSiteComponentInserted', $args);
209
+		}
210
+		if($output->data->count) {
211
+			return new Object(-1, 'msg_component_is_not_founded');
212
+		}
186 213
 		// Inert a component
187 214
 		$args->list_order = getNextSequence();
188
-		if(!$site_srl) $output = executeQuery('editor.insertComponent', $args);
189
-		else $output = executeQuery('editor.insertSiteComponent', $args);
215
+		if(!$site_srl) {
216
+			$output = executeQuery('editor.insertComponent', $args);
217
+		} else {
218
+			$output = executeQuery('editor.insertSiteComponent', $args);
219
+		}
190 220
 
191 221
 		$oEditorController = getController('editor');
192 222
 		$oEditorController->removeCache($site_srl);
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -23,26 +23,26 @@  discard block
 block discarded – undo
23 23
 		$enables = Context::get('enables');
24 24
 		$component_names = Context::get('component_names');
25 25
 
26
-		if(!is_array($component_names)) $component_names = array();
27
-		if(!is_array($enables)) $enables = array();
26
+		if (!is_array($component_names)) $component_names = array();
27
+		if (!is_array($enables)) $enables = array();
28 28
 
29 29
 		$unables = array_diff($component_names, $enables);
30 30
 		$componentList = array();
31 31
 
32
-		foreach($enables as $component_name)
32
+		foreach ($enables as $component_name)
33 33
 		{
34 34
 			$componentList[$component_name] = 'Y';
35 35
 		}
36
-		foreach($unables as $component_name)
36
+		foreach ($unables as $component_name)
37 37
 		{
38 38
 			$componentList[$component_name] = 'N';
39 39
 		}
40 40
 
41
-		$output = $this->editorListOrder($component_names,$site_module_info->site_srl);
42
-		if(!$output->toBool()) return new Object();
41
+		$output = $this->editorListOrder($component_names, $site_module_info->site_srl);
42
+		if (!$output->toBool()) return new Object();
43 43
 
44
-		$output = $this->editorCheckUse($componentList,$site_module_info->site_srl);
45
-		if(!$output->toBool()) return new Object();
44
+		$output = $this->editorCheckUse($componentList, $site_module_info->site_srl);
45
+		if (!$output->toBool()) return new Object();
46 46
 
47 47
 		$oEditorController = getController('editor');
48 48
 		$oEditorController->removeCache($site_module_info->site_srl);
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 		$args = new stdClass();
58 58
 		$args->site_srl = $site_srl;
59 59
 
60
-		foreach($componentList as $componentName => $value)
60
+		foreach ($componentList as $componentName => $value)
61 61
 		{
62 62
 			$args->component_name = $componentName;
63 63
 			$args->enabled = $value;
64
-			if($site_srl == 0)
64
+			if ($site_srl == 0)
65 65
 			{
66 66
 				$output = executeQuery('editor.updateComponent', $args);
67 67
 			}
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 				$output = executeQuery('editor.updateSiteComponent', $args);
71 71
 			}
72 72
 		}
73
-		if(!$output->toBool()) return new Object();
73
+		if (!$output->toBool()) return new Object();
74 74
 
75 75
 		unset($componentList);
76 76
 		return $output;
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
 		$args = new stdClass();
85 85
 		$args->site_srl = $site_srl;
86 86
 		$list_order_num = '30';
87
-		if(is_array($component_names))
87
+		if (is_array($component_names))
88 88
 		{
89
-			foreach($component_names as $name)
89
+			foreach ($component_names as $name)
90 90
 			{
91 91
 				$args->list_order = $list_order_num;
92 92
 				$args->component_name = $name;
93
-				if($site_srl == 0)
93
+				if ($site_srl == 0)
94 94
 				{
95 95
 					$output = executeQuery('editor.updateComponent', $args);
96 96
 				}
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 					$output = executeQuery('editor.updateSiteComponent', $args);
100 100
 				}
101 101
 
102
-				if(!$output->toBool()) return new Object();
102
+				if (!$output->toBool()) return new Object();
103 103
 				$list_order_num++;
104 104
 			}
105 105
 		}
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
 		$args = new stdClass;
125 125
 		$args->component_name = $component_name;
126 126
 		$args->extra_vars = serialize($extra_vars);
127
-		$args->site_srl = (int)$site_module_info->site_srl;
127
+		$args->site_srl = (int) $site_module_info->site_srl;
128 128
 
129
-		if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
129
+		if (!$args->site_srl) $output = executeQuery('editor.updateComponent', $args);
130 130
 		else $output = executeQuery('editor.updateSiteComponent', $args);
131
-		if(!$output->toBool()) return $output;
131
+		if (!$output->toBool()) return $output;
132 132
 
133 133
 		$oEditorController = getController('editor');
134 134
 		$oEditorController->removeCache($args->site_srl);
@@ -146,10 +146,10 @@  discard block
 block discarded – undo
146 146
 		$configVars = Context::getRequestVars();
147 147
 		
148 148
 		$config = new stdClass;
149
-		if($configVars->font_defined != 'Y') $config->font_defined = $configVars->font_defined = 'N';
149
+		if ($configVars->font_defined != 'Y') $config->font_defined = $configVars->font_defined = 'N';
150 150
 		else $config->font_defined = 'Y';
151 151
 
152
-		if($config->font_defined == 'Y')
152
+		if ($config->font_defined == 'Y')
153 153
 			$config->content_font = $configVars->content_font_defined;
154 154
 		else
155 155
 			$config->content_font = $configVars->content_font;
@@ -160,11 +160,11 @@  discard block
 block discarded – undo
160 160
 		$config->comment_editor_height = $configVars->comment_editor_height;
161 161
 		$config->content_style = $configVars->content_style;
162 162
 
163
-		$config->content_font_size= $configVars->content_font_size.'px';
164
-		$config->sel_editor_colorset= $configVars->sel_editor_colorset;
165
-		$config->sel_comment_editor_colorset= $configVars->sel_comment_editor_colorset;
163
+		$config->content_font_size = $configVars->content_font_size.'px';
164
+		$config->sel_editor_colorset = $configVars->sel_editor_colorset;
165
+		$config->sel_comment_editor_colorset = $configVars->sel_comment_editor_colorset;
166 166
 
167
-		$oModuleController->insertModuleConfig('editor',$config);
167
+		$oModuleController->insertModuleConfig('editor', $config);
168 168
 		$this->setRedirectUrl(Context::get('error_return_url'));
169 169
 	}
170 170
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 */
174 174
 	function insertComponent($component_name, $enabled = false, $site_srl = 0)
175 175
 	{
176
-		if($enabled) $enabled = 'Y';
176
+		if ($enabled) $enabled = 'Y';
177 177
 		else $enabled = 'N';
178 178
 
179 179
 		$args = new stdClass;
@@ -181,12 +181,12 @@  discard block
 block discarded – undo
181 181
 		$args->enabled = $enabled;
182 182
 		$args->site_srl = $site_srl;
183 183
 		// Check if the component exists
184
-		if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args);
184
+		if (!$site_srl) $output = executeQuery('editor.isComponentInserted', $args);
185 185
 		else $output = executeQuery('editor.isSiteComponentInserted', $args);
186
-		if($output->data->count) return new Object(-1, 'msg_component_is_not_founded');
186
+		if ($output->data->count) return new Object(-1, 'msg_component_is_not_founded');
187 187
 		// Inert a component
188 188
 		$args->list_order = getNextSequence();
189
-		if(!$site_srl) $output = executeQuery('editor.insertComponent', $args);
189
+		if (!$site_srl) $output = executeQuery('editor.insertComponent', $args);
190 190
 		else $output = executeQuery('editor.insertSiteComponent', $args);
191 191
 
192 192
 		$oEditorController = getController('editor');
Please login to merge, or discard this patch.
modules/editor/editor.admin.view.php 2 patches
Braces   +34 added lines, -13 removed lines patch added patch discarded remove patch
@@ -35,12 +35,24 @@  discard block
 block discarded – undo
35 35
 		}
36 36
 
37 37
 		//editor_config init
38
-		if(!$editor_config->editor_height) $editor_config->editor_height = 300;
39
-		if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 100;
40
-		if(!$editor_config->editor_skin) $editor_config->editor_skin = 'ckeditor';
41
-		if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'ckeditor';
42
-		if(!$editor_config->sel_editor_colorset) $editor_config->sel_editor_colorset= 'moono';
43
-		if(!$editor_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset= 'moono';
38
+		if(!$editor_config->editor_height) {
39
+			$editor_config->editor_height = 300;
40
+		}
41
+		if(!$editor_config->comment_editor_height) {
42
+			$editor_config->comment_editor_height = 100;
43
+		}
44
+		if(!$editor_config->editor_skin) {
45
+			$editor_config->editor_skin = 'ckeditor';
46
+		}
47
+		if(!$editor_config->comment_editor_skin) {
48
+			$editor_config->comment_editor_skin = 'ckeditor';
49
+		}
50
+		if(!$editor_config->sel_editor_colorset) {
51
+			$editor_config->sel_editor_colorset= 'moono';
52
+		}
53
+		if(!$editor_config->sel_comment_editor_colorset) {
54
+			$editor_config->sel_comment_editor_colorset= 'moono';
55
+		}
44 56
 
45 57
 		$component_list = $oEditorModel->getComponentList(false, $site_srl, true);
46 58
 		$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
@@ -65,14 +77,20 @@  discard block
 block discarded – undo
65 77
 			$xml_info->path = './modules/editor/components/'.$xml_info->component_name;
66 78
 			$xml_info->delete_url = $oAutoinstallModel->getRemoveUrlByPath($xml_info->path);
67 79
 			$xml_info->package_srl = $oAutoinstallModel->getPackageSrlByPath($xml_info->path);
68
-			if($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0;
80
+			if($xml_info->package_srl) {
81
+				$targetpackages[$xml_info->package_srl] = 0;
82
+			}
69 83
 		}
70 84
 
71
-		if(is_array($targetpackages))	$packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
85
+		if(is_array($targetpackages)) {
86
+			$packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
87
+		}
72 88
 
73 89
 		foreach($component_list as $component_name => $xml_info)
74 90
 		{
75
-			if($packages[$xml_info->package_srl])	$xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
91
+			if($packages[$xml_info->package_srl]) {
92
+				$xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
93
+			}
76 94
 		}
77 95
 		$editor_config_default = array( "editor_height" => "300", "comment_editor_height" => "100","content_font_size"=>"13");
78 96
 
@@ -162,13 +180,16 @@  discard block
 block discarded – undo
162 180
 			// Get a list of module category
163 181
 			$module_categories = $oModuleModel->getModuleCategories();
164 182
 
165
-			if(!is_array($mid_list)) $mid_list = array($mid_list);
183
+			if(!is_array($mid_list)) {
184
+				$mid_list = array($mid_list);
185
+			}
166 186
 			foreach($mid_list as $module_srl => $module)
167 187
 			{
168
-				if($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; 
188
+				if($module) {
189
+					$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
190
+				}
169 191
 			}
170
-		}
171
-		else
192
+		} else
172 193
 		{
173 194
 			$module_categories[0]->list = $mid_list;
174 195
 		}
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -22,59 +22,59 @@  discard block
 block discarded – undo
22 22
 	{
23 23
 		$component_count = 0;
24 24
 		$site_module_info = Context::get('site_module_info');
25
-		$site_srl = (int)$site_module_info->site_srl;
25
+		$site_srl = (int) $site_module_info->site_srl;
26 26
 
27 27
 		// Get a type of component
28 28
 		$oEditorModel = getModel('editor');
29 29
 		$oModuleModel = getModel('module');
30 30
 		$editor_config = $oModuleModel->getModuleConfig('editor');
31 31
 
32
-		if(!$editor_config)
32
+		if (!$editor_config)
33 33
 		{
34 34
 			$editor_config = new stdClass();
35 35
 		}
36 36
 
37 37
 		//editor_config init
38
-		if(!$editor_config->editor_height) $editor_config->editor_height = 300;
39
-		if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 100;
40
-		if(!$editor_config->editor_skin) $editor_config->editor_skin = 'ckeditor';
41
-		if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'ckeditor';
42
-		if(!$editor_config->sel_editor_colorset) $editor_config->sel_editor_colorset= 'moono';
43
-		if(!$editor_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset= 'moono';
38
+		if (!$editor_config->editor_height) $editor_config->editor_height = 300;
39
+		if (!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 100;
40
+		if (!$editor_config->editor_skin) $editor_config->editor_skin = 'ckeditor';
41
+		if (!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'ckeditor';
42
+		if (!$editor_config->sel_editor_colorset) $editor_config->sel_editor_colorset = 'moono';
43
+		if (!$editor_config->sel_comment_editor_colorset) $editor_config->sel_comment_editor_colorset = 'moono';
44 44
 
45 45
 		$component_list = $oEditorModel->getComponentList(false, $site_srl, true);
46 46
 		$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
47 47
 
48
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin);
48
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->editor_skin);
49 49
 
50 50
 		$contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles');
51 51
 		$content_style_list = array();
52
-		for($i=0,$c=count($contents);$i<$c;$i++)
52
+		for ($i = 0, $c = count($contents); $i < $c; $i++)
53 53
 		{
54 54
 			$style = $contents[$i];
55
-			$info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles');
55
+			$info = $oModuleModel->loadSkinInfo($this->module_path, $style, 'styles');
56 56
 			$content_style_list[$style] = new stdClass();
57 57
 			$content_style_list[$style]->title = $info->title;
58 58
 		}
59 59
 
60 60
 		// Get install info, update info, count
61 61
 		$oAutoinstallModel = getModel('autoinstall');
62
-		foreach($component_list as $component_name => $xml_info)
62
+		foreach ($component_list as $component_name => $xml_info)
63 63
 		{
64 64
 			$component_count++;
65 65
 			$xml_info->path = './modules/editor/components/'.$xml_info->component_name;
66 66
 			$xml_info->delete_url = $oAutoinstallModel->getRemoveUrlByPath($xml_info->path);
67 67
 			$xml_info->package_srl = $oAutoinstallModel->getPackageSrlByPath($xml_info->path);
68
-			if($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0;
68
+			if ($xml_info->package_srl) $targetpackages[$xml_info->package_srl] = 0;
69 69
 		}
70 70
 
71
-		if(is_array($targetpackages))	$packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
71
+		if (is_array($targetpackages))	$packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
72 72
 
73
-		foreach($component_list as $component_name => $xml_info)
73
+		foreach ($component_list as $component_name => $xml_info)
74 74
 		{
75
-			if($packages[$xml_info->package_srl])	$xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
75
+			if ($packages[$xml_info->package_srl])	$xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
76 76
 		}
77
-		$editor_config_default = array( "editor_height" => "300", "comment_editor_height" => "100","content_font_size"=>"13");
77
+		$editor_config_default = array("editor_height" => "300", "comment_editor_height" => "100", "content_font_size"=>"13");
78 78
 
79 79
 		//editor preview
80 80
 		$config = $oEditorModel->getEditorConfig();
@@ -138,12 +138,12 @@  discard block
 block discarded – undo
138 138
 	function dispEditorAdminSetupComponent()
139 139
 	{
140 140
 		$site_module_info = Context::get('site_module_info');
141
-		$site_srl = (int)$site_module_info->site_srl;
141
+		$site_srl = (int) $site_module_info->site_srl;
142 142
 
143 143
 		$component_name = Context::get('component_name');
144 144
 		// Get information of the editor component
145 145
 		$oEditorModel = getModel('editor');
146
-		$component = $oEditorModel->getComponent($component_name,$site_srl);
146
+		$component = $oEditorModel->getComponent($component_name, $site_srl);
147 147
 		Context::set('component', $component);
148 148
 		// Get a group list to set a group
149 149
 		$oMemberModel = getModel('member');
@@ -152,20 +152,20 @@  discard block
 block discarded – undo
152 152
 		// Get a mid list
153 153
 		$oModuleModel = getModel('module');
154 154
 
155
-		$args =new stdClass();
155
+		$args = new stdClass();
156 156
 		$args->site_srl = $site_srl;
157 157
 		$columnList = array('module_srl', 'mid', 'module_category_srl', 'browser_title');
158 158
 		$mid_list = $oModuleModel->getMidList($args, $columnList);
159 159
 		// Combination of module_category and module
160
-		if(!$args->site_srl)
160
+		if (!$args->site_srl)
161 161
 		{
162 162
 			// Get a list of module category
163 163
 			$module_categories = $oModuleModel->getModuleCategories();
164 164
 
165
-			if(!is_array($mid_list)) $mid_list = array($mid_list);
166
-			foreach($mid_list as $module_srl => $module)
165
+			if (!is_array($mid_list)) $mid_list = array($mid_list);
166
+			foreach ($mid_list as $module_srl => $module)
167 167
 			{
168
-				if($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; 
168
+				if ($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; 
169 169
 			}
170 170
 		}
171 171
 		else
@@ -173,13 +173,13 @@  discard block
 block discarded – undo
173 173
 			$module_categories[0]->list = $mid_list;
174 174
 		}
175 175
 
176
-		Context::set('mid_list',$module_categories);
176
+		Context::set('mid_list', $module_categories);
177 177
 
178 178
 		//Security
179 179
 		$security = new Security();
180 180
 		$security->encodeHTML('group_list..title');
181 181
 		$security->encodeHTML('component...');
182
-		$security->encodeHTML('mid_list..title','mid_list..list..browser_title');
182
+		$security->encodeHTML('mid_list..title', 'mid_list..list..browser_title');
183 183
 
184 184
 		$this->setTemplatePath($this->module_path.'tpl');
185 185
 		$this->setTemplateFile('setup_component');
Please login to merge, or discard this patch.
modules/editor/editor.class.php 2 patches
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
 		$oModuleController = getController('module');
17 17
 		// Add the default editor component
18 18
 		$oEditorController = getAdminController('editor');
19
-		$oEditorController->insertComponent('colorpicker_text',true);
20
-		$oEditorController->insertComponent('colorpicker_bg',true);
21
-		$oEditorController->insertComponent('emoticon',true);
22
-		$oEditorController->insertComponent('url_link',true);
23
-		$oEditorController->insertComponent('image_link',true);
24
-		$oEditorController->insertComponent('multimedia_link',true);
25
-		$oEditorController->insertComponent('quotation',true);
26
-		$oEditorController->insertComponent('table_maker',true);
27
-		$oEditorController->insertComponent('poll_maker',true);
28
-		$oEditorController->insertComponent('image_gallery',true);
19
+		$oEditorController->insertComponent('colorpicker_text', true);
20
+		$oEditorController->insertComponent('colorpicker_bg', true);
21
+		$oEditorController->insertComponent('emoticon', true);
22
+		$oEditorController->insertComponent('url_link', true);
23
+		$oEditorController->insertComponent('image_link', true);
24
+		$oEditorController->insertComponent('multimedia_link', true);
25
+		$oEditorController->insertComponent('quotation', true);
26
+		$oEditorController->insertComponent('table_maker', true);
27
+		$oEditorController->insertComponent('poll_maker', true);
28
+		$oEditorController->insertComponent('image_gallery', true);
29 29
 		// Create a directory to use in the editor module
30 30
 		FileHandler::makeDir('./files/cache/editor');
31 31
 		// 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
@@ -48,21 +48,21 @@  discard block
 block discarded – undo
48 48
 
49 49
 		$oDB = &DB::getInstance();
50 50
 		// 2009. 06. 15 Save module_srl when auto-saving
51
-		if(!$oDB->isColumnExists("editor_autosave","module_srl")) return true;
52
-		if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) return true;
51
+		if (!$oDB->isColumnExists("editor_autosave", "module_srl")) return true;
52
+		if (!$oDB->isIndexExists("editor_autosave", "idx_module_srl")) return true;
53 53
 
54 54
 		// 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
55
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true;
56
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true;
55
+		if (!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true;
56
+		if (!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true;
57 57
 		// 2007. 10. 23 Add an editor trigger on the module addition setup
58
-		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) return true;
58
+		if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) return true;
59 59
 		// 2009. 04. 14 Add a trigger from compiled codes of the editor component
60
-		if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) return true;
60
+		if (!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) return true;
61 61
 		// 2009. 06. 19 Remove unused trigger
62
-		if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true;
62
+		if ($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true;
63 63
 
64 64
 		// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
65
-		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true;
65
+		if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true;
66 66
 
67 67
 		return false;
68 68
 	}
@@ -77,29 +77,29 @@  discard block
 block discarded – undo
77 77
 
78 78
 		$oDB = &DB::getInstance();
79 79
 		// Save module_srl when auto-saving 15/06/2009
80
-		if(!$oDB->isColumnExists("editor_autosave","module_srl")) 
81
-			$oDB->addColumn("editor_autosave","module_srl","number",11);
80
+		if (!$oDB->isColumnExists("editor_autosave", "module_srl")) 
81
+			$oDB->addColumn("editor_autosave", "module_srl", "number", 11);
82 82
 
83 83
 		// create an index on module_srl
84
-		if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) $oDB->addIndex("editor_autosave","idx_module_srl", "module_srl");
84
+		if (!$oDB->isIndexExists("editor_autosave", "idx_module_srl")) $oDB->addIndex("editor_autosave", "idx_module_srl", "module_srl");
85 85
 
86 86
 		// 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
87
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) 
87
+		if (!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) 
88 88
 			$oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
89
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) 
89
+		if (!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) 
90 90
 			$oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
91 91
 		// 2007. 10. Add an editor trigger on the module addition setup
92
-		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) 
92
+		if (!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) 
93 93
 			$oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
94 94
 		// 2009. 04. 14 Add a trigger from compiled codes of the editor component
95
-		if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) 
95
+		if (!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) 
96 96
 			$oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
97 97
 		// 2009. 06. 19 Remove unused trigger
98
-		if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) 
98
+		if ($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) 
99 99
 			$oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before');
100 100
 
101 101
 		// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
102
-		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after'))
102
+		if (!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after'))
103 103
 		{
104 104
 			$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after');
105 105
 		}
Please login to merge, or discard this patch.
Braces   +45 added lines, -21 removed lines patch added patch discarded remove patch
@@ -48,21 +48,37 @@  discard block
 block discarded – undo
48 48
 
49 49
 		$oDB = &DB::getInstance();
50 50
 		// 2009. 06. 15 Save module_srl when auto-saving
51
-		if(!$oDB->isColumnExists("editor_autosave","module_srl")) return true;
52
-		if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) return true;
51
+		if(!$oDB->isColumnExists("editor_autosave","module_srl")) {
52
+			return true;
53
+		}
54
+		if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) {
55
+			return true;
56
+		}
53 57
 
54 58
 		// 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
55
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true;
56
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true;
59
+		if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) {
60
+			return true;
61
+		}
62
+		if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) {
63
+			return true;
64
+		}
57 65
 		// 2007. 10. 23 Add an editor trigger on the module addition setup
58
-		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) return true;
66
+		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) {
67
+			return true;
68
+		}
59 69
 		// 2009. 04. 14 Add a trigger from compiled codes of the editor component
60
-		if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) return true;
70
+		if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) {
71
+			return true;
72
+		}
61 73
 		// 2009. 06. 19 Remove unused trigger
62
-		if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true;
74
+		if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) {
75
+			return true;
76
+		}
63 77
 
64 78
 		// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
65
-		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true;
79
+		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) {
80
+			return true;
81
+		}
66 82
 
67 83
 		return false;
68 84
 	}
@@ -77,26 +93,34 @@  discard block
 block discarded – undo
77 93
 
78 94
 		$oDB = &DB::getInstance();
79 95
 		// Save module_srl when auto-saving 15/06/2009
80
-		if(!$oDB->isColumnExists("editor_autosave","module_srl")) 
81
-			$oDB->addColumn("editor_autosave","module_srl","number",11);
96
+		if(!$oDB->isColumnExists("editor_autosave","module_srl")) {
97
+					$oDB->addColumn("editor_autosave","module_srl","number",11);
98
+		}
82 99
 
83 100
 		// create an index on module_srl
84
-		if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) $oDB->addIndex("editor_autosave","idx_module_srl", "module_srl");
101
+		if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) {
102
+			$oDB->addIndex("editor_autosave","idx_module_srl", "module_srl");
103
+		}
85 104
 
86 105
 		// 2007. 10. 17 Add a trigger to delete automatically saved document whenever the document(insert or update) is modified
87
-		if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) 
88
-			$oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
89
-		if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) 
90
-			$oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
106
+		if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) {
107
+					$oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
108
+		}
109
+		if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) {
110
+					$oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after');
111
+		}
91 112
 		// 2007. 10. Add an editor trigger on the module addition setup
92
-		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) 
93
-			$oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
113
+		if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) {
114
+					$oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before');
115
+		}
94 116
 		// 2009. 04. 14 Add a trigger from compiled codes of the editor component
95
-		if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) 
96
-			$oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
117
+		if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) {
118
+					$oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before');
119
+		}
97 120
 		// 2009. 06. 19 Remove unused trigger
98
-		if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) 
99
-			$oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before');
121
+		if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) {
122
+					$oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before');
123
+		}
100 124
 
101 125
 		// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied 
102 126
 		if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after'))
Please login to merge, or discard this patch.
modules/editor/editor.view.php 2 patches
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@  discard block
 block discarded – undo
36 36
 			Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component));
37 37
 			$this->setTemplatePath($this->module_path.'tpl');
38 38
 			$this->setTemplateFile('component_not_founded');
39
-		}
40
-		else
39
+		} else
41 40
 		{
42 41
 			// Get the result after executing a method to display popup url of the component
43 42
 			$popup_content = $oComponent->getPopupContent();
@@ -82,7 +81,9 @@  discard block
 block discarded – undo
82 81
 			// Get information of the current module
83 82
 			$current_module_info = Context::get('current_module_info');
84 83
 			$current_module_srl = $current_module_info->module_srl;
85
-			if(!$current_module_srl) return new Object();
84
+			if(!$current_module_srl) {
85
+				return new Object();
86
+			}
86 87
 		}
87 88
 		// Get editors settings
88 89
 		$oEditorModel = getModel('editor');
@@ -172,8 +173,7 @@  discard block
 block discarded – undo
172 173
 			$option_com->content_style = $config->comment_content_style;
173 174
 			$option_com->colorset = $config->sel_comment_editor_colorset;
174 175
 			$editor = $oEditorModel->getEditor(0, $option_com);
175
-		}
176
-		else
176
+		} else
177 177
 		{
178 178
 			$option = new stdClass();
179 179
 			$option->allow_fileupload = false;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 		$component = Context::get('component');
28 28
 
29 29
 		$site_module_info = Context::get('site_module_info');
30
-		$site_srl = (int)$site_module_info->site_srl;
30
+		$site_srl = (int) $site_module_info->site_srl;
31 31
 		// Get compoenet object
32 32
 		$oEditorModel = getModel('editor');
33 33
 		$oComponent = &$oEditorModel->getComponentObject($component, $editor_sequence, $site_srl);
34
-		if(!$oComponent->toBool())
34
+		if (!$oComponent->toBool())
35 35
 		{
36 36
 			Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component));
37 37
 			$this->setTemplatePath($this->module_path.'tpl');
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 		$component_name = Context::get('component_name');
59 59
 
60 60
 		$site_module_info = Context::get('site_module_info');
61
-		$site_srl = (int)$site_module_info->site_srl;
61
+		$site_srl = (int) $site_module_info->site_srl;
62 62
 
63 63
 		$oEditorModel = getModel('editor');
64 64
 		$component = $oEditorModel->getComponent($component_name, $site_srl);
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
 		$current_module_srl = Context::get('module_srl');
78 78
 		$current_module_srls = Context::get('module_srls');
79 79
 
80
-		if(!$current_module_srl && !$current_module_srls)
80
+		if (!$current_module_srl && !$current_module_srls)
81 81
 		{
82 82
 			// Get information of the current module
83 83
 			$current_module_info = Context::get('current_module_info');
84 84
 			$current_module_srl = $current_module_info->module_srl;
85
-			if(!$current_module_srl) return new Object();
85
+			if (!$current_module_srl) return new Object();
86 86
 		}
87 87
 		// Get editors settings
88 88
 		$oEditorModel = getModel('editor');
@@ -95,17 +95,17 @@  discard block
 block discarded – undo
95 95
 		$editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins');
96 96
 		Context::set('editor_skin_list', $editor_skin_list);
97 97
 
98
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin);
98
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->editor_skin);
99 99
 		Context::set('editor_colorset_list', $skin_info->colorset);
100
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->comment_editor_skin);
100
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->comment_editor_skin);
101 101
 		Context::set('editor_comment_colorset_list', $skin_info->colorset);
102 102
 
103 103
 		$contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles');
104 104
 		$content_style_list = array();
105
-		for($i=0,$c=count($contents);$i<$c;$i++)
105
+		for ($i = 0, $c = count($contents); $i < $c; $i++)
106 106
 		{
107 107
 			$style = $contents[$i];
108
-			$info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles');
108
+			$info = $oModuleModel->loadSkinInfo($this->module_path, $style, 'styles');
109 109
 			$content_style_list[$style] = new stdClass();
110 110
 			$content_style_list[$style]->title = $info->title;
111 111
 		}			
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 	{
143 143
 		$skin = Context::get('skin');
144 144
 		$oModuleModel = getModel('module');
145
-		$skin_info = $oModuleModel->loadSkinInfo($this->module_path,$skin);
145
+		$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
146 146
 		$colorset = $skin_info->colorset;
147 147
 		Context::set('colorset', $colorset);
148 148
 	}
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
 		$mode = Context::get('mode');
156 156
 
157
-		if($mode != 'main')
157
+		if ($mode != 'main')
158 158
 		{
159 159
 			$option_com = new stdClass();
160 160
 			$option_com->allow_fileupload = false;
Please login to merge, or discard this patch.
modules/file/file.admin.view.php 2 patches
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -64,16 +64,13 @@  discard block
 block discarded – undo
64 64
 					if($document_list[$target_srl])
65 65
 					{
66 66
 						$file->upload_target_type = 'doc';
67
-					}
68
-					else if($comment_list[$target_srl])
67
+					} else if($comment_list[$target_srl])
69 68
 					{
70 69
 						$file->upload_target_type = 'com';
71
-					}
72
-					else if($module_list[$target_srl])
70
+					} else if($module_list[$target_srl])
73 71
 					{
74 72
 						$file->upload_target_type = 'mod';
75
-					}
76
-					else
73
+					} else
77 74
 					{
78 75
 						// document
79 76
 						$document = $oDocumentModel->getDocument($target_srl);
@@ -115,15 +112,21 @@  discard block
 block discarded – undo
115 112
 					// Check if data is already obtained
116 113
 					for($i = 0; $i < $com_srls_count; ++$i)
117 114
 					{
118
-						if($comment_list[$com_srls[$i]]) delete($com_srls[$i]);
115
+						if($comment_list[$com_srls[$i]]) {
116
+							delete($com_srls[$i]);
117
+						}
119 118
 					}
120 119
 					for($i = 0; $i < $doc_srls_count; ++$i)
121 120
 					{
122
-						if($document_list[$doc_srls[$i]]) delete($doc_srls[$i]);
121
+						if($document_list[$doc_srls[$i]]) {
122
+							delete($doc_srls[$i]);
123
+						}
123 124
 					}
124 125
 					for($i = 0; $i < $mod_srls_count; ++$i)
125 126
 					{
126
-						if($module_list[$mod_srls[$i]]) delete($mod_srls[$i]);
127
+						if($module_list[$mod_srls[$i]]) {
128
+							delete($mod_srls[$i]);
129
+						}
127 130
 					}
128 131
 				}
129 132
 
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 				, 'source_filename', 'isvalid', 'file_size', 'download_count', 'files.regdate', 'ipaddress', 'member.member_srl', 'member.nick_name', 'uploaded_filename');
37 37
 		$output = $oFileAdminModel->getFileList($args, $columnList);
38 38
 		// Get the document for looping a list
39
-		if($output->data)
39
+		if ($output->data)
40 40
 		{
41 41
 			$oCommentModel = getModel('comment');
42 42
 			$oDocumentModel = getModel('document');
@@ -45,31 +45,31 @@  discard block
 block discarded – undo
45 45
 			$file_list = array();
46 46
 			$document_list = array();
47 47
 			$comment_list = array();
48
-			$module_list= array();
48
+			$module_list = array();
49 49
 
50 50
 			$doc_srls = array();
51 51
 			$com_srls = array();
52
-			$mod_srls= array();
52
+			$mod_srls = array();
53 53
 
54
-			foreach($output->data as $file)
54
+			foreach ($output->data as $file)
55 55
 			{
56 56
 				$file_srl = $file->file_srl;
57 57
 				$target_srl = $file->upload_target_srl;
58 58
 				$file_update_args = new stdClass();
59 59
 				$file_update_args->file_srl = $file_srl;
60 60
 				// Find and update if upload_target_type doesn't exist
61
-				if(!$file->upload_target_type)
61
+				if (!$file->upload_target_type)
62 62
 				{
63 63
 					// Pass if upload_target_type is already found 
64
-					if($document_list[$target_srl])
64
+					if ($document_list[$target_srl])
65 65
 					{
66 66
 						$file->upload_target_type = 'doc';
67 67
 					}
68
-					else if($comment_list[$target_srl])
68
+					else if ($comment_list[$target_srl])
69 69
 					{
70 70
 						$file->upload_target_type = 'com';
71 71
 					}
72
-					else if($module_list[$target_srl])
72
+					else if ($module_list[$target_srl])
73 73
 					{
74 74
 						$file->upload_target_type = 'mod';
75 75
 					}
@@ -77,17 +77,17 @@  discard block
 block discarded – undo
77 77
 					{
78 78
 						// document
79 79
 						$document = $oDocumentModel->getDocument($target_srl);
80
-						if($document->isExists())
80
+						if ($document->isExists())
81 81
 						{
82 82
 							$file->upload_target_type = 'doc';
83 83
 							$file_update_args->upload_target_type = $file->upload_target_type;
84 84
 							$document_list[$target_srl] = $document;
85 85
 						}
86 86
 						// comment
87
-						if(!$file->upload_target_type)
87
+						if (!$file->upload_target_type)
88 88
 						{
89 89
 							$comment = $oCommentModel->getComment($target_srl);
90
-							if($comment->isExists())
90
+							if ($comment->isExists())
91 91
 							{
92 92
 								$file->upload_target_type = 'com';
93 93
 								$file->target_document_srl = $comment->document_srl;
@@ -97,39 +97,39 @@  discard block
 block discarded – undo
97 97
 							}
98 98
 						}
99 99
 						// module (for a page)
100
-						if(!$file->upload_target_type)
100
+						if (!$file->upload_target_type)
101 101
 						{
102 102
 							$module = $oModuleModel->getModulesInfo($target_srl);
103
-							if($module)
103
+							if ($module)
104 104
 							{
105 105
 								$file->upload_target_type = 'mod';
106 106
 								$file_update_args->upload_target_type = $file->upload_target_type;
107 107
 								$module_list[$module->comment_srl] = $module;
108 108
 							}
109 109
 						}
110
-						if($file_update_args->upload_target_type)
110
+						if ($file_update_args->upload_target_type)
111 111
 						{
112 112
 							executeQuery('file.updateFileTargetType', $file_update_args);
113 113
 						}
114 114
 					}
115 115
 					// Check if data is already obtained
116
-					for($i = 0; $i < $com_srls_count; ++$i)
116
+					for ($i = 0; $i < $com_srls_count; ++$i)
117 117
 					{
118
-						if($comment_list[$com_srls[$i]]) delete($com_srls[$i]);
118
+						if ($comment_list[$com_srls[$i]]) delete($com_srls[$i]);
119 119
 					}
120
-					for($i = 0; $i < $doc_srls_count; ++$i)
120
+					for ($i = 0; $i < $doc_srls_count; ++$i)
121 121
 					{
122
-						if($document_list[$doc_srls[$i]]) delete($doc_srls[$i]);
122
+						if ($document_list[$doc_srls[$i]]) delete($doc_srls[$i]);
123 123
 					}
124
-					for($i = 0; $i < $mod_srls_count; ++$i)
124
+					for ($i = 0; $i < $mod_srls_count; ++$i)
125 125
 					{
126
-						if($module_list[$mod_srls[$i]]) delete($mod_srls[$i]);
126
+						if ($module_list[$mod_srls[$i]]) delete($mod_srls[$i]);
127 127
 					}
128 128
 				}
129 129
 
130
-				if($file->upload_target_type)
130
+				if ($file->upload_target_type)
131 131
 				{
132
-					if(!in_array($file->upload_target_srl, ${$file->upload_target_type.'_srls'}))
132
+					if (!in_array($file->upload_target_srl, ${$file->upload_target_type.'_srls'}))
133 133
 					{
134 134
 						${$file->upload_target_type.'_srls'}[] = $target_srl;
135 135
 					}
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
 			$mod_srls = array_unique($mod_srls);
145 145
 			// Comment list
146 146
 			$com_srls_count = count($com_srls);
147
-			if($com_srls_count)
147
+			if ($com_srls_count)
148 148
 			{
149 149
 				$comment_output = $oCommentModel->getComments($com_srls);
150
-				foreach($comment_output as $comment)
150
+				foreach ($comment_output as $comment)
151 151
 				{
152 152
 					$comment_list[$comment->comment_srl] = $comment;
153 153
 					$doc_srls[] = $comment->document_srl;
@@ -155,12 +155,12 @@  discard block
 block discarded – undo
155 155
 			}
156 156
 			// Document list
157 157
 			$doc_srls_count = count($doc_srls);
158
-			if($doc_srls_count)
158
+			if ($doc_srls_count)
159 159
 			{
160 160
 				$document_output = $oDocumentModel->getDocuments($doc_srls);
161
-				if(is_array($document_output))
161
+				if (is_array($document_output))
162 162
 				{
163
-					foreach($document_output as $document)
163
+					foreach ($document_output as $document)
164 164
 					{
165 165
 						$document_list[$document->document_srl] = $document;
166 166
 					}
@@ -168,22 +168,22 @@  discard block
 block discarded – undo
168 168
 			}
169 169
 			// Module List
170 170
 			$mod_srls_count = count($mod_srls);
171
-			if($mod_srls_count)
171
+			if ($mod_srls_count)
172 172
 			{
173 173
 				$columnList = array('module_srl', 'mid', 'browser_title');
174 174
 				$module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList);
175
-				if($module_output && is_array($module_output))
175
+				if ($module_output && is_array($module_output))
176 176
 				{
177
-					foreach($module_output as $module)
177
+					foreach ($module_output as $module)
178 178
 					{
179 179
 						$module_list[$module->module_srl] = $module;
180 180
 					}
181 181
 				}
182 182
 			}
183 183
 
184
-			foreach($file_list as $srl => $file)
184
+			foreach ($file_list as $srl => $file)
185 185
 			{
186
-				if($file->upload_target_type == 'com')
186
+				if ($file->upload_target_type == 'com')
187 187
 				{
188 188
 					$file_list[$srl]->target_document_srl = $comment_list[$file->upload_target_srl]->document_srl;
189 189
 				}
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	{
217 217
 		$oFileModel = getModel('file');
218 218
 		$config = $oFileModel->getFileConfig();
219
-		Context::set('config',$config);
219
+		Context::set('config', $config);
220 220
 		$iniPostMaxSize = FileHandler::returnbytes(ini_get('post_max_size'));
221 221
 		$iniUploadMaxSize = FileHandler::returnbytes(ini_get('upload_max_filesize'));
222 222
 		$iniMinSize = min($iniPostMaxSize, $iniUploadMaxSize);
Please login to merge, or discard this patch.