Completed
Push — master ( b0071f...70260c )
by Jacob
03:06
created
controller/blog/HomeController.class.inc.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 	{
50 50
 		if($this->page == 1)
51 51
 		{
52
-        global $container;
53
-        $repository = new Jacobemerick\Web\Domain\Blog\Introduction\MysqlIntroductionRepository($container['db_connection_locator']);
54
-        $introduction_result = $repository->findByType('home');
52
+		global $container;
53
+		$repository = new Jacobemerick\Web\Domain\Blog\Introduction\MysqlIntroductionRepository($container['db_connection_locator']);
54
+		$introduction_result = $repository->findByType('home');
55 55
 			
56 56
 			$introduction = array();
57 57
 			$introduction['title'] = $introduction_result['title'];
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 
76 76
 	protected function get_list_results()
77 77
 	{
78
-        global $container;
79
-        $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
80
-        return $repository->getActivePosts(self::$POSTS_PER_PAGE, $this->offset);
78
+		global $container;
79
+		$repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
80
+		return $repository->getActivePosts(self::$POSTS_PER_PAGE, $this->offset);
81 81
 	}
82 82
 
83 83
 	protected function get_list_description()
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 	private $total_post_count;
108 108
 	protected function get_total_post_count()
109 109
 	{
110
-      if(!isset($this->total_post_count)) {
111
-          global $container;
112
-          $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
113
-          $this->total_post_count = $repository->getActivePostsCount();
114
-      }
110
+	  if(!isset($this->total_post_count)) {
111
+		  global $container;
112
+		  $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
113
+		  $this->total_post_count = $repository->getActivePostsCount();
114
+	  }
115 115
 
116 116
 		return $this->total_post_count;
117 117
 	}
Please login to merge, or discard this patch.
controller/blog/TagController.class.inc.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
 		$tag = URLDecode::getPiece(2);
27 27
 		$tag = str_replace('-', ' ', $tag);
28 28
 
29
-        global $container;
30
-        $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
31
-        $tag_result = $repository->findTagByTitle($tag);
29
+		global $container;
30
+		$repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
31
+		$tag_result = $repository->findTagByTitle($tag);
32 32
 
33 33
 		if($tag_result === false)
34 34
 			$this->eject();
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
 		
65 65
 		if($this->page == 1)
66 66
 		{
67
-        global $container;
68
-        $repository = new Jacobemerick\Web\Domain\Blog\Introduction\MysqlIntroductionRepository($container['db_connection_locator']);
69
-        $introduction_result = $repository->findByType('tag', $this->tag['tag']);
67
+		global $container;
68
+		$repository = new Jacobemerick\Web\Domain\Blog\Introduction\MysqlIntroductionRepository($container['db_connection_locator']);
69
+		$introduction_result = $repository->findByType('tag', $this->tag['tag']);
70 70
 			
71 71
 			if($introduction_result !== false)
72 72
 			{
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 
97 97
 	protected function get_list_results()
98 98
 	{
99
-        global $container;
100
-        $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
101
-        return $repository->getActivePostsByTag($this->tag['id'], self::$POSTS_PER_PAGE, $this->offset);
99
+		global $container;
100
+		$repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
101
+		return $repository->getActivePostsByTag($this->tag['id'], self::$POSTS_PER_PAGE, $this->offset);
102 102
 	}
103 103
 
104 104
 	protected function get_list_description()
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
 	protected function get_total_post_count()
130 130
 	{
131 131
 		if(!isset($this->total_post_count)) {
132
-        global $container;
133
-        $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
134
-        $this->total_post_count = $repository->getActivePostsCountByTag($this->tag['id']);
135
-    }
132
+		global $container;
133
+		$repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
134
+		$this->total_post_count = $repository->getActivePostsCountByTag($this->tag['id']);
135
+	}
136 136
 
137 137
 		return $this->total_post_count;
138 138
 	}
Please login to merge, or discard this patch.
controller/blog/CategoryController.class.inc.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -115,9 +115,9 @@  discard block
 block discarded – undo
115 115
 	{
116 116
 		if($this->page == 1)
117 117
 		{
118
-        global $container;
119
-        $repository = new Jacobemerick\Web\Domain\Blog\Introduction\MysqlIntroductionRepository($container['db_connection_locator']);
120
-        $introduction_result = $repository->findByType('category', $this->category->link);
118
+		global $container;
119
+		$repository = new Jacobemerick\Web\Domain\Blog\Introduction\MysqlIntroductionRepository($container['db_connection_locator']);
120
+		$introduction_result = $repository->findByType('category', $this->category->link);
121 121
 			
122 122
 			$introduction = array();
123 123
 			$introduction['title'] = $introduction_result['title'];
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 
142 142
 	protected function get_list_results()
143 143
 	{
144
-        global $container;
145
-        $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
146
-        return $repository->getActivePostsByCategory($this->category->link, self::$POSTS_PER_PAGE, $this->offset);
144
+		global $container;
145
+		$repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
146
+		return $repository->getActivePostsByCategory($this->category->link, self::$POSTS_PER_PAGE, $this->offset);
147 147
 	}
148 148
 
149 149
 	protected function get_list_description()
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
 	protected function get_total_post_count()
175 175
 	{
176 176
 		if(!isset($this->total_post_count)) {
177
-        global $container;
178
-        $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
179
-        $this->total_post_count = $repository->getActivePostsCountByCategory($this->category->link);
180
-    }
177
+		global $container;
178
+		$repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
179
+		$this->total_post_count = $repository->getActivePostsCountByCategory($this->category->link);
180
+	}
181 181
 		return $this->total_post_count;
182 182
 	}
183 183
 
Please login to merge, or discard this patch.
controller/blog/AboutController.class.inc.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@
 block discarded – undo
33 33
 
34 34
 	protected function get_introduction()
35 35
 	{
36
-        global $container;
37
-        $repository = new Jacobemerick\Web\Domain\Blog\Introduction\MysqlIntroductionRepository($container['db_connection_locator']);
38
-        $introduction_result = $repository->findByType('about');
36
+		global $container;
37
+		$repository = new Jacobemerick\Web\Domain\Blog\Introduction\MysqlIntroductionRepository($container['db_connection_locator']);
38
+		$introduction_result = $repository->findByType('about');
39 39
 		
40 40
 		if($introduction_result !== null)
41 41
 		{
Please login to merge, or discard this patch.
controller/blog/SearchController.class.inc.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	{
35 35
 		$query = URLDecode::getPiece(2);
36 36
 		$query = urldecode($query);
37
-        $query = str_replace('-', ' ', $query);
37
+		$query = str_replace('-', ' ', $query);
38 38
 		
39 39
 		$this->query = $query;
40 40
 		
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 	{
88 88
 		if(!isset($this->search_result))
89 89
 		{
90
-        global $container;
91
-        $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
92
-        $posts = $repository->getActivePosts();
90
+		global $container;
91
+		$repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
92
+		$posts = $repository->getActivePosts();
93 93
 			
94 94
 			$this->search_result = Search::instance()
95 95
 				->setQuery($this->query)
Please login to merge, or discard this patch.
controller/blog/DefaultPageController.class.inc.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 
19 19
 	protected function set_head_data()
20 20
 	{
21
-    $this->set_head('rss_link', [
22
-      'title' => 'Jacob Emerick Blog Feed',
23
-      'url' => '/rss.xml'
24
-    ]);
25
-    $this->set_head('rss_comment_link', [
26
-      'title' => 'Jacob Emerick Blog Comment Feed',
27
-      'url' => '/rss-comments.xml'
28
-    ]);
21
+	$this->set_head('rss_link', [
22
+	  'title' => 'Jacob Emerick Blog Feed',
23
+	  'url' => '/rss.xml'
24
+	]);
25
+	$this->set_head('rss_comment_link', [
26
+	  'title' => 'Jacob Emerick Blog Comment Feed',
27
+	  'url' => '/rss-comments.xml'
28
+	]);
29 29
 		
30 30
 		$this->add_css('normalize');
31 31
 		$this->add_css('blog');
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
 
88 88
 	final private function get_tags_for_post($post)
89 89
 	{
90
-        global $container;
91
-        $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
92
-        $tag_result = $repository->getTagsForPost($post['id']);
90
+		global $container;
91
+		$repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
92
+		$tag_result = $repository->getTagsForPost($post['id']);
93 93
 
94
-        $tag_array = array();
94
+		$tag_array = array();
95 95
 		foreach($tag_result as $tag)
96 96
 		{
97 97
 			$tag_object = new stdclass();
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
 
126 126
 	final private function get_tag_cloud()
127 127
 	{
128
-        global $container;
129
-        $repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
130
-        $tag_result = $repository->getTagCloud();
128
+		global $container;
129
+		$repository = new Jacobemerick\Web\Domain\Blog\Tag\MysqlTagRepository($container['db_connection_locator']);
130
+		$tag_result = $repository->getTagCloud();
131 131
 		
132 132
 		$maximum_tag_count = $this->get_maximum_tag_count($tag_result);
133 133
 		
Please login to merge, or discard this patch.
src/Domain/Blog/Post/MysqlPostRepository.php 1 patch
Indentation   +134 added lines, -134 removed lines patch added patch discarded remove patch
@@ -7,163 +7,163 @@  discard block
 block discarded – undo
7 7
 class MysqlPostRepository implements PostRepositoryInterface
8 8
 {
9 9
 
10
-    /** @var  Aura\Sql\ConnectionLocator */
11
-    protected $connections;
12
-
13
-    /**
14
-     * @param Aura\Sql\ConnectionLocator $connections
15
-     */
16
-    public function __construct(ConnectionLocator $connections)
17
-    {
18
-        $this->connections = $connections;
19
-    }
20
-
21
-    /**
22
-     * @param string $path
23
-     *
24
-     * @return array|false
25
-     */
26
-    public function findPostByPath($path)
27
-    {
28
-        $query = "
10
+	/** @var  Aura\Sql\ConnectionLocator */
11
+	protected $connections;
12
+
13
+	/**
14
+	 * @param Aura\Sql\ConnectionLocator $connections
15
+	 */
16
+	public function __construct(ConnectionLocator $connections)
17
+	{
18
+		$this->connections = $connections;
19
+	}
20
+
21
+	/**
22
+	 * @param string $path
23
+	 *
24
+	 * @return array|false
25
+	 */
26
+	public function findPostByPath($path)
27
+	{
28
+		$query = "
29 29
             SELECT `id`, `title`, `path`, `date`, `body`, `category`
30 30
             FROM `jpemeric_blog`.`post`
31 31
             WHERE `path` = :path AND `display` = :is_active
32 32
             LIMIT 1";
33
-        $bindings = [
34
-            'path'      => $path,
35
-            'is_active' => 1,
36
-        ];
37
-
38
-        return $this
39
-            ->connections
40
-            ->getRead()
41
-            ->fetchOne($query, $bindings);
42
-    }
43
-
44
-    public function getActivePosts($limit = null, $offset = 0)
45
-    {
46
-        $query = "
33
+		$bindings = [
34
+			'path'      => $path,
35
+			'is_active' => 1,
36
+		];
37
+
38
+		return $this
39
+			->connections
40
+			->getRead()
41
+			->fetchOne($query, $bindings);
42
+	}
43
+
44
+	public function getActivePosts($limit = null, $offset = 0)
45
+	{
46
+		$query = "
47 47
             SELECT `id`, `title`, `path`, `date`, `body`, `category`
48 48
             FROM `jpemeric_blog`.`post`
49 49
             WHERE `display` = :is_active
50 50
             ORDER BY `date` DESC";
51
-        if ($limit != null) {
52
-            $query .= "
51
+		if ($limit != null) {
52
+			$query .= "
53 53
             LIMIT {$offset}, {$limit}";
54
-        }
54
+		}
55 55
 
56
-        $bindings = [
57
-            'is_active' => 1,
58
-        ];
56
+		$bindings = [
57
+			'is_active' => 1,
58
+		];
59 59
 
60
-        return $this
61
-            ->connections
62
-            ->getRead()
63
-            ->fetchAll($query, $bindings);
64
-    }
60
+		return $this
61
+			->connections
62
+			->getRead()
63
+			->fetchAll($query, $bindings);
64
+	}
65 65
 
66
-    public function getActivePostsCount()
67
-    {
68
-        $query = "
66
+	public function getActivePostsCount()
67
+	{
68
+		$query = "
69 69
             SELECT COUNT(1) AS `count`
70 70
             FROM `jpemeric_blog`.`post`
71 71
             WHERE `display` = :is_active";
72
-        $bindings = [
73
-            'is_active' => 1,
74
-        ];
75
-
76
-        return $this
77
-            ->connections
78
-            ->getRead()
79
-            ->fetchValue($query, $bindings);
80
-    }
81
-
82
-    public function getActivePostsByTag($tag, $limit = null, $offset = 0)
83
-    {
84
-        $query = "
72
+		$bindings = [
73
+			'is_active' => 1,
74
+		];
75
+
76
+		return $this
77
+			->connections
78
+			->getRead()
79
+			->fetchValue($query, $bindings);
80
+	}
81
+
82
+	public function getActivePostsByTag($tag, $limit = null, $offset = 0)
83
+	{
84
+		$query = "
85 85
             SELECT `id`, `title`, `path`, `date`, `body`, `category`
86 86
             FROM `jpemeric_blog`.`post`
87 87
             INNER JOIN `jpemeric_blog`.`ptlink` ON `ptlink`.`post_id` = `post`.`id` AND
88 88
                                                    `ptlink`.`tag_id` = :tag_id
89 89
             WHERE `display` = :is_active";
90
-        if ($limit != null) {
91
-            $query .= "
90
+		if ($limit != null) {
91
+			$query .= "
92 92
             LIMIT {$offset}, {$limit}";
93
-        }
94
-
95
-        $bindings = [
96
-            'tag_id'    => $tag,
97
-            'is_active' => 1,
98
-        ];
99
-
100
-        return $this
101
-            ->connections
102
-            ->getRead()
103
-            ->fetchAll($query, $bindings);
104
-    }
105
-
106
-    public function getActivePostsCountByTag($tag)
107
-    {
108
-        $query = "
93
+		}
94
+
95
+		$bindings = [
96
+			'tag_id'    => $tag,
97
+			'is_active' => 1,
98
+		];
99
+
100
+		return $this
101
+			->connections
102
+			->getRead()
103
+			->fetchAll($query, $bindings);
104
+	}
105
+
106
+	public function getActivePostsCountByTag($tag)
107
+	{
108
+		$query = "
109 109
             SELECT COUNT(1) AS `count`
110 110
             FROM `jpemeric_blog`.`post`
111 111
             INNER JOIN `jpemeric_blog`.`ptlink` ON `ptlink`.`post_id` = `post`.`id` AND
112 112
                                                    `ptlink`.`tag_id` = :tag_id
113 113
             WHERE `display` = :is_active";
114
-        $bindings = [
115
-            'tag_id'    => $tag,
116
-            'is_active' => 1,
117
-        ];
118
-
119
-        return $this
120
-            ->connections
121
-            ->getRead()
122
-            ->fetchValue($query, $bindings);
123
-    }
124
-
125
-    public function getActivePostsByCategory($category, $limit = null, $offset = 0)
126
-    {
127
-        $query = "
114
+		$bindings = [
115
+			'tag_id'    => $tag,
116
+			'is_active' => 1,
117
+		];
118
+
119
+		return $this
120
+			->connections
121
+			->getRead()
122
+			->fetchValue($query, $bindings);
123
+	}
124
+
125
+	public function getActivePostsByCategory($category, $limit = null, $offset = 0)
126
+	{
127
+		$query = "
128 128
             SELECT `id`, `title`, `path`, `date`, `body`, `category`
129 129
             FROM `jpemeric_blog`.`post`
130 130
             WHERE `category` = :category AND `display` = :is_active";
131
-        if ($limit != null) {
132
-            $query .= "
131
+		if ($limit != null) {
132
+			$query .= "
133 133
             LIMIT {$offset}, {$limit}";
134
-        }
135
-
136
-        $bindings = [
137
-            'category'  => $category,
138
-            'is_active' => 1,
139
-        ];
140
-
141
-        return $this
142
-            ->connections
143
-            ->getRead()
144
-            ->fetchAll($query, $bindings);
145
-    }
146
-
147
-    public function getActivePostsCountByCategory($category)
148
-    {
149
-        $query = "
134
+		}
135
+
136
+		$bindings = [
137
+			'category'  => $category,
138
+			'is_active' => 1,
139
+		];
140
+
141
+		return $this
142
+			->connections
143
+			->getRead()
144
+			->fetchAll($query, $bindings);
145
+	}
146
+
147
+	public function getActivePostsCountByCategory($category)
148
+	{
149
+		$query = "
150 150
             SELECT COUNT(1) AS `count`
151 151
             FROM `jpemeric_blog`.`post`
152 152
             WHERE `category` = :category AND `display` = :is_active";
153
-        $bindings = [
154
-            'category'  => $category,
155
-            'is_active' => 1,
156
-        ];
157
-
158
-        return $this
159
-            ->connections
160
-            ->getRead()
161
-            ->fetchValue($query, $bindings);
162
-    }
163
-
164
-    public function getActivePostsByRelatedTags($post, $limit = 4)
165
-    {
166
-        $query = "
153
+		$bindings = [
154
+			'category'  => $category,
155
+			'is_active' => 1,
156
+		];
157
+
158
+		return $this
159
+			->connections
160
+			->getRead()
161
+			->fetchValue($query, $bindings);
162
+	}
163
+
164
+	public function getActivePostsByRelatedTags($post, $limit = 4)
165
+	{
166
+		$query = "
167 167
             SELECT `id`, `title`, `path`, `date`, `body`, `category`, COUNT(1) AS `count`
168 168
             FROM `jpemeric_blog`.`post`
169 169
             INNER JOIN `jpemeric_blog`.`ptlink` ON `ptlink`.`post_id` = `post`.`id` AND
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
             GROUP BY `id`
184 184
             ORDER BY `count` DESC
185 185
             LIMIT {$limit}";
186
-        $bindings = [
187
-            'post'      => $post,
188
-            'is_active' => 1,
189
-        ];
190
-
191
-        return $this
192
-            ->connections
193
-            ->getRead()
194
-            ->fetchAll($query, $bindings);
195
-    }
186
+		$bindings = [
187
+			'post'      => $post,
188
+			'is_active' => 1,
189
+		];
190
+
191
+		return $this
192
+			->connections
193
+			->getRead()
194
+			->fetchAll($query, $bindings);
195
+	}
196 196
 }
Please login to merge, or discard this patch.
src/Domain/Blog/Post/PostRepositoryInterface.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@
 block discarded – undo
4 4
 
5 5
 interface PostRepositoryInterface
6 6
 {
7
-    public function findPostByPath($path);
8
-    public function getActivePosts($limit = null, $offset= 0);
9
-    public function getActivePostsCount();
10
-    public function getActivePostsByTag($tag, $limit = null, $offset = 0);
11
-    public function getActivePostsCountByTag($tag);
12
-    public function getActivePostsByCategory($category, $limit = null, $offset = 0);
13
-    public function getActivePostsCountByCategory($category);
14
-    public function getActivePostsByRelatedTags($post, $limit = 4);
7
+	public function findPostByPath($path);
8
+	public function getActivePosts($limit = null, $offset= 0);
9
+	public function getActivePostsCount();
10
+	public function getActivePostsByTag($tag, $limit = null, $offset = 0);
11
+	public function getActivePostsCountByTag($tag);
12
+	public function getActivePostsByCategory($category, $limit = null, $offset = 0);
13
+	public function getActivePostsCountByCategory($category);
14
+	public function getActivePostsByRelatedTags($post, $limit = 4);
15 15
 }
Please login to merge, or discard this patch.
utility/content/FixInternalLinkContent.class.inc.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 		switch($type)
33 33
 		{
34 34
 			case 'blog' :
35
-        global $container;
36
-        $repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
37
-        $post = $repository->findPostByPath($uri);
35
+		global $container;
36
+		$repository = new Jacobemerick\Web\Domain\Blog\Post\MysqlPostRepository($container['db_connection_locator']);
37
+		$post = $repository->findPostByPath($uri);
38 38
 
39 39
 				if($post === NULL)
40 40
 					return;
@@ -73,38 +73,38 @@  discard block
 block discarded – undo
73 73
 				
74 74
 				break;
75 75
 			case 'falls' :
76
-                $pieces = explode('/', $uri);
77
-                if (count($pieces) == 1) {
78
-                    Loader::load('collector', 'waterfall/WatercourseCollector');
79
-                    list ($watercourse_alias) = $pieces;
80
-                    $watercourse = WatercourseCollector::getByAlias($watercourse_alias);
76
+				$pieces = explode('/', $uri);
77
+				if (count($pieces) == 1) {
78
+					Loader::load('collector', 'waterfall/WatercourseCollector');
79
+					list ($watercourse_alias) = $pieces;
80
+					$watercourse = WatercourseCollector::getByAlias($watercourse_alias);
81 81
                     
82
-                    if ($watercourse == null) {
83
-                        return;
84
-                    }
82
+					if ($watercourse == null) {
83
+						return;
84
+					}
85 85
                     
86
-                    $link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
87
-                    $link .= "{$watercourse->alias}/";
86
+					$link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
87
+					$link .= "{$watercourse->alias}/";
88 88
                     
89
-                    if ($anchor == '') {
90
-                        $anchor = $watercourse->name;
91
-                    }
92
-                } else if (count($pieces) == 2) {
93
-                    Loader::load('collector', 'waterfall/WaterfallCollector');
94
-                    list ($watercourse_alias, $waterfall_alias) = $pieces;
95
-                    $waterfall = WaterfallCollector::getByAlias($watercourse_alias, $waterfall_alias);
89
+					if ($anchor == '') {
90
+						$anchor = $watercourse->name;
91
+					}
92
+				} else if (count($pieces) == 2) {
93
+					Loader::load('collector', 'waterfall/WaterfallCollector');
94
+					list ($watercourse_alias, $waterfall_alias) = $pieces;
95
+					$waterfall = WaterfallCollector::getByAlias($watercourse_alias, $waterfall_alias);
96 96
                     
97
-                    if ($waterfall == null) {
98
-                        return;
99
-                    }
97
+					if ($waterfall == null) {
98
+						return;
99
+					}
100 100
                     
101
-                    $link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
102
-                    $link .= "{$waterfall->watercourse_alias}/{$waterfall->alias}/";
101
+					$link .= ($is_absolute) ? Loader::getRootURL('waterfalls') : '/';
102
+					$link .= "{$waterfall->watercourse_alias}/{$waterfall->alias}/";
103 103
                     
104
-                    if ($anchor == '') {
105
-                        $anchor = $waterfall->name;
106
-                    }
107
-                }
104
+					if ($anchor == '') {
105
+						$anchor = $waterfall->name;
106
+					}
107
+				}
108 108
 				break;
109 109
 			default :
110 110
 				break;
Please login to merge, or discard this patch.