forked from rchavik/Kinspir
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp_helper.php
38 lines (37 loc) · 941 Bytes
/
app_helper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* Chaw : source code and project management
*
* @copyright Copyright 2009, Garrett J. Woodworth ([email protected])
* @license GNU AFFERO GENERAL PUBLIC LICENSE v3 (http://opensource.org/licenses/agpl-v3.html)
*
*/
/**
* undocumented class
*
* @package default
*/
class AppHelper extends Helper {
/**
* undocumented function
*
* @param string $url
* @param string $full
* @return void
*/
function url($url = null, $full = false) {
if (is_array($url)) {
if (!empty($this->params['project'])) {
$url = array_merge(array('project' => $this->params['project']), $url);
}
if (!empty($this->params['fork'])) {
$url = array_merge(array('fork' => $this->params['fork']), $url);
}
if (!empty($this->params['project']) && empty($this->params['fork'])) {
$url = array_merge(array('username' => $this->params['username']), $url);
}
}
return Router::url($url, $full);
}
}
?>