Completed
Push — master ( 5852b3...e99317 )
by Jacob
04:02
created
controller/blog/TagController.class.inc.php 1 patch
Braces   +19 added lines, -14 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@  discard block
 block discarded – undo
28 28
 		$tag = str_replace('-', ' ', $tag);
29 29
 		
30 30
 		$tag_result = TagCollector::getSingleTag($tag);
31
-		if($tag_result === false)
32
-			$this->eject();
31
+		if($tag_result === false) {
32
+					$this->eject();
33
+		}
33 34
 		
34 35
 		$this->tag = $tag_result;
35 36
 		
@@ -44,8 +45,7 @@  discard block
 block discarded – undo
44 45
 		{
45 46
 			$this->set_title(sprintf(self::$TITLE_MAIN, ucwords($this->tag->tag)));
46 47
 			$this->set_description(sprintf(self::$DESCRIPTION_MAIN, ucwords($this->tag->tag)));
47
-		}
48
-		else
48
+		} else
49 49
 		{
50 50
 			$this->set_title(sprintf(self::$TITLE_PAGINATED, ucwords($this->tag->tag), $this->page, $this->total_pages));
51 51
 			$this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages, ucwords($this->tag->tag)));
@@ -86,8 +86,9 @@  discard block
 block discarded – undo
86 86
 	protected function get_page_number()
87 87
 	{
88 88
 		$page = URLDecode::getPiece(3);
89
-		if(isset($page) && is_numeric($page))
90
-			return $page;
89
+		if(isset($page) && is_numeric($page)) {
90
+					return $page;
91
+		}
91 92
 		return 1;
92 93
 	}
93 94
 
@@ -106,25 +107,29 @@  discard block
 block discarded – undo
106 107
 
107 108
 	protected function get_list_next_link()
108 109
 	{
109
-		if($this->page == 1)
110
-			return;
111
-		if($this->page == 2)
112
-			return Content::instance('URLSafe', "/tag/{$this->tag->tag}/")->activate();
110
+		if($this->page == 1) {
111
+					return;
112
+		}
113
+		if($this->page == 2) {
114
+					return Content::instance('URLSafe', "/tag/{$this->tag->tag}/")->activate();
115
+		}
113 116
 		return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page - 1) . '/')->activate();
114 117
 	}
115 118
 
116 119
 	protected function get_list_prev_link()
117 120
 	{
118
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
119
-			return;
121
+		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
122
+					return;
123
+		}
120 124
 		return Content::instance('URLSafe', "/tag/{$this->tag->tag}/" . ($this->page + 1) . '/')->activate();
121 125
 	}
122 126
 
123 127
 	private $total_post_count;
124 128
 	protected function get_total_post_count()
125 129
 	{
126
-		if(!isset($this->total_post_count))
127
-			$this->total_post_count = PostCollector::getPostCountForTag($this->tag->id);
130
+		if(!isset($this->total_post_count)) {
131
+					$this->total_post_count = PostCollector::getPostCountForTag($this->tag->id);
132
+		}
128 133
 		return $this->total_post_count;
129 134
 	}
130 135
 
Please login to merge, or discard this patch.
controller/blog/DefaultPageController.class.inc.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
 		Loader::load('collector', 'image/PhotoCollector');
38 38
 		$photo_result = PhotoCollector::getRow($id);
39 39
 		
40
-		if($photo_result == null)
41
-			return;
40
+		if($photo_result == null) {
41
+					return;
42
+		}
42 43
 		
43 44
 		$name = $photo_result->name;
44 45
 		$category = $photo_result->category;
@@ -101,8 +102,9 @@  discard block
 block discarded – undo
101 102
 	{
102 103
 		$body = $post->body;
103 104
 		
104
-		if($trim)
105
-			$body = Content::instance('SmartTrim', $body)->activate(self::$LENGTH_OF_TRIMMED_POST);
105
+		if($trim) {
106
+					$body = Content::instance('SmartTrim', $body)->activate(self::$LENGTH_OF_TRIMMED_POST);
107
+		}
106 108
 		
107 109
 		$body = Content::instance('FixPhoto', $body)->activate(false, 'standard');
108 110
 		$body = Content::instance('MarkupCode', $body)->activate();
@@ -128,8 +130,9 @@  discard block
 block discarded – undo
128 130
 		$cloud_array = array();
129 131
 		foreach($tag_result as $tag)
130 132
 		{
131
-			if($tag->tag_count < self::$MINIMUM_TAG_COUNT)
132
-				continue;
133
+			if($tag->tag_count < self::$MINIMUM_TAG_COUNT) {
134
+							continue;
135
+			}
133 136
 			
134 137
 			$tag_object = new stdclass();
135 138
 			$tag_object->name = $tag->tag;
@@ -147,8 +150,9 @@  discard block
 block discarded – undo
147 150
 		
148 151
 		foreach($tag_result as $tag)
149 152
 		{
150
-			if($tag->tag_count > $maximum)
151
-				$maximum = $tag->tag_count;
153
+			if($tag->tag_count > $maximum) {
154
+							$maximum = $tag->tag_count;
155
+			}
152 156
 		}
153 157
 		return $maximum;
154 158
 	}
Please login to merge, or discard this patch.
controller/blog/HomeController.class.inc.php 1 patch
Braces   +25 added lines, -18 removed lines patch added patch discarded remove patch
@@ -32,15 +32,17 @@  discard block
 block discarded – undo
32 32
 	{
33 33
 		parent::set_head_data();
34 34
 		
35
-		if($this->page == 1)
36
-			$this->set_title(self::$TITLE_MAIN);
37
-		else
38
-			$this->set_title(sprintf(self::$TITLE_PAGINATED, $this->page, $this->total_pages));
35
+		if($this->page == 1) {
36
+					$this->set_title(self::$TITLE_MAIN);
37
+		} else {
38
+					$this->set_title(sprintf(self::$TITLE_PAGINATED, $this->page, $this->total_pages));
39
+		}
39 40
 		
40
-		if($this->page == 1)
41
-			$this->set_description(self::$DESCRIPTION_MAIN);
42
-		else
43
-			$this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages));
41
+		if($this->page == 1) {
42
+					$this->set_description(self::$DESCRIPTION_MAIN);
43
+		} else {
44
+					$this->set_description(sprintf(self::$DESCRIPTION_PAGINATED, $this->page, $this->total_pages));
45
+		}
44 46
 		
45 47
 		$this->set_keywords(self::$KEYWORD_ARRAY);
46 48
 	}
@@ -67,8 +69,9 @@  discard block
 block discarded – undo
67 69
 	protected function get_page_number()
68 70
 	{
69 71
 		$page = URLDecode::getPiece(1);
70
-		if(isset($page) && is_numeric($page))
71
-			return $page;
72
+		if(isset($page) && is_numeric($page)) {
73
+					return $page;
74
+		}
72 75
 		return 1;
73 76
 	}
74 77
 
@@ -87,25 +90,29 @@  discard block
 block discarded – undo
87 90
 
88 91
 	protected function get_list_next_link()
89 92
 	{
90
-		if($this->page == 1)
91
-			return;
92
-		if($this->page == 2)
93
-			return '/';
93
+		if($this->page == 1) {
94
+					return;
95
+		}
96
+		if($this->page == 2) {
97
+					return '/';
98
+		}
94 99
 		return '/' . ($this->page - 1) . '/';
95 100
 	}
96 101
 
97 102
 	protected function get_list_prev_link()
98 103
 	{
99
-		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count())
100
-			return;
104
+		if(($this->page * self::$POSTS_PER_PAGE) >= $this->get_total_post_count()) {
105
+					return;
106
+		}
101 107
 		return '/' . ($this->page + 1) . '/';
102 108
 	}
103 109
 
104 110
 	private $total_post_count;
105 111
 	protected function get_total_post_count()
106 112
 	{
107
-		if(!isset($this->total_post_count))
108
-			$this->total_post_count = PostCollector::getMainPostCount();
113
+		if(!isset($this->total_post_count)) {
114
+					$this->total_post_count = PostCollector::getMainPostCount();
115
+		}
109 116
 		return $this->total_post_count;
110 117
 	}
111 118
 
Please login to merge, or discard this patch.
controller/blog/DefaultListController.class.inc.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,9 @@
 block discarded – undo
60 60
 		{
61 61
 			$post_array[] = $this->format_post($post, true);
62 62
 		}
63
-		if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search')
64
-			$this->eject();
63
+		if(count($post_array) < 1 && URLDecode::getPiece(1) !== 'search') {
64
+					$this->eject();
65
+		}
65 66
 		return $post_array;
66 67
 	}
67 68
 
Please login to merge, or discard this patch.
controller/site/DefaultPageController.class.inc.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,14 +56,16 @@
 block discarded – undo
56 56
 	{
57 57
 		$current_uri = URLDecode::getPiece(1);
58 58
 		
59
-		if(!isset($current_uri))
60
-			return 'About';
59
+		if(!isset($current_uri)) {
60
+					return 'About';
61
+		}
61 62
 		
62 63
 		$menu = self::$MENU;
63 64
 		foreach($menu as $link)
64 65
 		{
65
-			if($link['uri'] == $current_uri)
66
-				return $link['name'];
66
+			if($link['uri'] == $current_uri) {
67
+							return $link['name'];
68
+			}
67 69
 		}
68 70
 		
69 71
 		return 'About';
Please login to merge, or discard this patch.
controller/site/ContactController.class.inc.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,15 +29,19 @@
 block discarded – undo
29 29
 
30 30
 	private function get_form_results()
31 31
 	{
32
-		if(!Request::hasPost())
33
-			return array();
32
+		if(!Request::hasPost()) {
33
+					return array();
34
+		}
34 35
 		
35
-		if(!Validate::checkRequest('post', 'name', 'string'))
36
-			$error_message['name'] = 'Please enter a value for your name.';
37
-		if(!Validate::checkRequest('post', 'email', 'string'))
38
-			$error_message['email'] = 'Please enter a valid email address.';
39
-		if(!Validate::checkRequest('post', 'message', 'string'))
40
-			$error_message['message'] = 'Please enter a message.';
36
+		if(!Validate::checkRequest('post', 'name', 'string')) {
37
+					$error_message['name'] = 'Please enter a value for your name.';
38
+		}
39
+		if(!Validate::checkRequest('post', 'email', 'string')) {
40
+					$error_message['email'] = 'Please enter a valid email address.';
41
+		}
42
+		if(!Validate::checkRequest('post', 'message', 'string')) {
43
+					$error_message['message'] = 'Please enter a message.';
44
+		}
41 45
 		
42 46
 		if(!empty($error_message))
43 47
 		{
Please login to merge, or discard this patch.
controller/portfolio/DefaultPageController.class.inc.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,10 +39,11 @@  discard block
 block discarded – undo
39 39
 				'name' => 'Contact',
40 40
 				'link' => Loader::getRootURL() . 'contact/'));
41 41
 		
42
-		if(!URLDecode::getPiece(1))
43
-			$active_page = 'About';
44
-		else
45
-			$active_page = ucfirst(URLDecode::getPiece(1));
42
+		if(!URLDecode::getPiece(1)) {
43
+					$active_page = 'About';
44
+		} else {
45
+					$active_page = ucfirst(URLDecode::getPiece(1));
46
+		}
46 47
 		
47 48
 		foreach($menu as $menu_item)
48 49
 		{
@@ -63,10 +64,11 @@  discard block
 block discarded – undo
63 64
 		{
64 65
 			$piece_obj = new stdclass();
65 66
 			$piece_obj->title = $piece->title;
66
-			if("{$piece->category}" == 1)
67
-				$piece_obj->url = Loader::getRootURL() . "web/{$piece->title_url}/";
68
-			else
69
-				$piece_obj->url = Loader::getRootURL() . "print/{$piece->title_url}/";
67
+			if("{$piece->category}" == 1) {
68
+							$piece_obj->url = Loader::getRootURL() . "web/{$piece->title_url}/";
69
+			} else {
70
+							$piece_obj->url = Loader::getRootURL() . "print/{$piece->title_url}/";
71
+			}
70 72
 			$piece_obj->image = "/{$piece->image}";
71 73
 			$piece_array[] = $piece_obj;
72 74
 		}
Please login to merge, or discard this patch.
controller/portfolio/ContactController.class.inc.php 1 patch
Braces   +13 added lines, -11 removed lines patch added patch discarded remove patch
@@ -28,24 +28,26 @@
 block discarded – undo
28 28
 
29 29
 	private function process_form_data()
30 30
 	{
31
-		if(!Request::hasPost())
32
-			return array();
31
+		if(!Request::hasPost()) {
32
+					return array();
33
+		}
33 34
 		
34
-		if(!Validate::checkRequest('post', 'name', 'string'))
35
-			$error_message['name'] = 'Please enter a value for your name.';
36
-		if(!Validate::checkRequest('post', 'email', 'string'))
37
-			$error_message['email'] = 'Please enter a valid email address.';
38
-		if(!Validate::checkRequest('post', 'message', 'string'))
39
-			$error_message['message'] = 'Please enter a message.';
35
+		if(!Validate::checkRequest('post', 'name', 'string')) {
36
+					$error_message['name'] = 'Please enter a value for your name.';
37
+		}
38
+		if(!Validate::checkRequest('post', 'email', 'string')) {
39
+					$error_message['email'] = 'Please enter a valid email address.';
40
+		}
41
+		if(!Validate::checkRequest('post', 'message', 'string')) {
42
+					$error_message['message'] = 'Please enter a message.';
43
+		}
40 44
 		
41 45
 		if(!empty($error_message))
42 46
 		{
43 47
 			return array(
44 48
 				'error_message' => $error_message,
45 49
 				'value' => Request::getPost());
46
-		}
47
-		
48
-		else
50
+		} else
49 51
 		{
50 52
             global $config;
51 53
 			$mail = new Mail();
Please login to merge, or discard this patch.
controller/portfolio/PieceController.class.inc.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,9 @@
 block discarded – undo
36 36
 		Loader::load('collector', 'portfolio/PortfolioCollector');
37 37
 		$portfolio_result = PortfolioCollector::getPieceByURI($this->title_url);
38 38
 		
39
-		if($portfolio_result === null)
40
-			$this->eject();
39
+		if($portfolio_result === null) {
40
+					$this->eject();
41
+		}
41 42
 		
42 43
 		$portfolio_image_result = PortfolioCollector::getImagesForPiece($portfolio_result->id, 2);
43 44
 		$image = new ImageOld("portfolio/{$portfolio_image_result[0]->name}");
Please login to merge, or discard this patch.