Completed
Push — master ( 83b49e...84b670 )
by Nazar
04:49
created

Controller::index()   B

Complexity

Conditions 5
Paths 5

Size

Total Lines 36
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 28
nc 5
nop 1
dl 0
loc 36
rs 8.439
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A Controller::browse_pages() 0 12 2
1
<?php
2
/**
3
 * @package   Static Pages
4
 * @category  modules
5
 * @author    Nazar Mokrynskyi <[email protected]>
6
 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
 * @license   MIT License, see license.txt
8
 */
9
namespace cs\modules\Static_pages\admin;
10
use
11
	h,
12
	cs\Language\Prefix,
13
	cs\Page,
14
	cs\modules\Static_pages\Categories;
15
16
class Controller {
17
	/**
18
	 * @return string
19
	 */
20
	public static function browse_categories () {
21
		return h::cs_static_pages_admin_categories_list();
22
	}
23
	/**
24
	 * @param \cs\Request $Request
25
	 *
26
	 * @return string
27
	 */
28
	public static function browse_pages ($Request) {
29
		$L        = new Prefix('static_pages_');
30
		$category = $Request->route_ids(0);
31
		Page::instance()->title(
32
			$category ? Categories::instance()->get($category)['title'] : $L->root_category
33
		);
34
		return h::cs_static_pages_admin_pages_list(
35
			[
36
				'category' => $category
37
			]
38
		);
39
	}
40
}
41