@@ -26,7 +26,7 @@ |
||
26 | 26 | * @return void |
27 | 27 | * @throws |
28 | 28 | */ |
29 | - function HTML_QuickForm_email($elementName=null, $elementLabel=null, $attributes=null) |
|
29 | + function HTML_QuickForm_email($elementName = null, $elementLabel = null, $attributes = null) |
|
30 | 30 | { |
31 | 31 | parent::__construct($elementName, $elementLabel, $attributes); |
32 | 32 | $this->setType('email'); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | } elseif ('..' == $pathAry[$i] && $i > 1 && '..' != $pathAry[$i - 1]) { |
72 | - if ($i < count($pathAry) -1) { |
|
72 | + if ($i < count($pathAry) - 1) { |
|
73 | 73 | array_splice($pathAry, $i - 1, 2); |
74 | 74 | $i--; |
75 | 75 | } else { |
@@ -98,28 +98,28 @@ discard block |
||
98 | 98 | function _resolveRelativeURL($url) |
99 | 99 | { |
100 | 100 | $https = !empty($_SERVER['HTTPS']) && ('off' != strtolower($_SERVER['HTTPS'])); |
101 | - $scheme = ($https? 'https:': 'http:'); |
|
101 | + $scheme = ($https ? 'https:' : 'http:'); |
|
102 | 102 | if ('//' == substr($url, 0, 2)) { |
103 | - return $scheme . $url; |
|
103 | + return $scheme.$url; |
|
104 | 104 | |
105 | 105 | } else { |
106 | - $host = $scheme . '//' . $_SERVER['SERVER_NAME'] . |
|
106 | + $host = $scheme.'//'.$_SERVER['SERVER_NAME']. |
|
107 | 107 | (($https && 443 == $_SERVER['SERVER_PORT'] || |
108 | - !$https && 80 == $_SERVER['SERVER_PORT'])? '': ':' . $_SERVER['SERVER_PORT']); |
|
108 | + !$https && 80 == $_SERVER['SERVER_PORT']) ? '' : ':'.$_SERVER['SERVER_PORT']); |
|
109 | 109 | if ('' == $url) { |
110 | - return $host . $_SERVER['REQUEST_URI']; |
|
110 | + return $host.$_SERVER['REQUEST_URI']; |
|
111 | 111 | |
112 | 112 | } elseif ('/' == $url[0]) { |
113 | - return $host . $url; |
|
113 | + return $host.$url; |
|
114 | 114 | |
115 | 115 | } else { |
116 | 116 | list($basePath, $baseQuery) = $this->_splitUri($_SERVER['REQUEST_URI']); |
117 | 117 | list($actPath, $actQuery) = $this->_splitUri($url); |
118 | 118 | if ('' == $actPath) { |
119 | - return $host . $basePath . $actQuery; |
|
119 | + return $host.$basePath.$actQuery; |
|
120 | 120 | } else { |
121 | - $path = substr($basePath, 0, strrpos($basePath, '/') + 1) . $actPath; |
|
122 | - return $host . $this->_normalizePath($path) . $actQuery; |
|
121 | + $path = substr($basePath, 0, strrpos($basePath, '/') + 1).$actPath; |
|
122 | + return $host.$this->_normalizePath($path).$actQuery; |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | if (!$page->controller->isValid($pageName)) { |
137 | 137 | $pageName = $page->controller->findInvalid(); |
138 | 138 | } |
139 | - $current =& $page->controller->getPage($pageName); |
|
139 | + $current = & $page->controller->getPage($pageName); |
|
140 | 140 | |
141 | 141 | } else { |
142 | - $current =& $page; |
|
142 | + $current = & $page; |
|
143 | 143 | } |
144 | 144 | // generate the URL for the page 'display' event and redirect to it |
145 | 145 | $action = $current->getAttribute('action'); |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | if (!preg_match('!^https?://!i', $action)) { |
148 | 148 | $action = $this->_resolveRelativeURL($action); |
149 | 149 | } |
150 | - $url = $action . (false === strpos($action, '?')? '?': '&') . |
|
151 | - $current->getButtonName('display') . '=true' . |
|
152 | - ((!defined('SID') || '' == SID || ini_get('session.use_only_cookies'))? '': '&' . SID); |
|
153 | - header('Location: ' . $url); |
|
150 | + $url = $action.(false === strpos($action, '?') ? '?' : '&'). |
|
151 | + $current->getButtonName('display').'=true'. |
|
152 | + ((!defined('SID') || '' == SID || ini_get('session.use_only_cookies')) ? '' : '&'.SID); |
|
153 | + header('Location: '.$url); |
|
154 | 154 | exit; |
155 | 155 | } |
156 | 156 | } |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | { |
36 | 36 | // save the form values and validation status to the session |
37 | 37 | $page->isFormBuilt() or $page->buildForm(); |
38 | - $pageName = $page->getAttribute('id'); |
|
39 | - $data =& $page->controller->container(); |
|
38 | + $pageName = $page->getAttribute('id'); |
|
39 | + $data = & $page->controller->container(); |
|
40 | 40 | $data['values'][$pageName] = $page->exportValues(); |
41 | 41 | if (!$page->controller->isModal()) { |
42 | 42 | if (PEAR::isError($valid = $page->validate())) { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | return $page->handle('jump'); |
54 | 54 | // |
55 | 55 | } else { |
56 | - $prev =& $page->controller->getPage($prevName); |
|
56 | + $prev = & $page->controller->getPage($prevName); |
|
57 | 57 | // Modified by Chamilo team, 16-MAR-2010. |
58 | 58 | //$prev->handle('jump'); |
59 | 59 | return $prev->handle('jump'); |
@@ -45,13 +45,13 @@ |
||
45 | 45 | // If the controller is "modal" we should not allow direct access to a page |
46 | 46 | // unless all previous pages are valid (see also bug #2323) |
47 | 47 | if ($page->controller->isModal() && !$page->controller->isValid($page->getAttribute('id'))) { |
48 | - $target =& $page->controller->getPage($page->controller->findInvalid()); |
|
48 | + $target = & $page->controller->getPage($page->controller->findInvalid()); |
|
49 | 49 | // Modified by Chamilo team, 16-MAR-2010. |
50 | 50 | //$target->handle('jump'); |
51 | 51 | return $target->handle('jump'); |
52 | 52 | // |
53 | 53 | } |
54 | - $data =& $page->controller->container(); |
|
54 | + $data = & $page->controller->container(); |
|
55 | 55 | if (!empty($data['values'][$pageName])) { |
56 | 56 | $page->loadValues($data['values'][$pageName]); |
57 | 57 | $validate = false === $data['valid'][$pageName]; |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | { |
36 | 36 | // save the form values and validation status to the session |
37 | 37 | $page->isFormBuilt() or $page->buildForm(); |
38 | - $pageName = $page->getAttribute('id'); |
|
39 | - $data =& $page->controller->container(); |
|
38 | + $pageName = $page->getAttribute('id'); |
|
39 | + $data = & $page->controller->container(); |
|
40 | 40 | $data['values'][$pageName] = $page->exportValues(); |
41 | 41 | if (PEAR::isError($valid = $page->validate())) { |
42 | 42 | return $valid; |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | } |
50 | 50 | // More pages? |
51 | 51 | if (null !== ($nextName = $page->controller->getNextName($pageName))) { |
52 | - $next =& $page->controller->getPage($nextName); |
|
52 | + $next = & $page->controller->getPage($nextName); |
|
53 | 53 | // Modified by Chamilo team, 16-MAR-2010. |
54 | 54 | //$next->handle('jump'); |
55 | 55 | return $next->handle('jump'); |
56 | 56 | // |
57 | 57 | // Consider this a 'finish' button, if there is no explicit one |
58 | - } elseif($page->controller->isModal()) { |
|
58 | + } elseif ($page->controller->isModal()) { |
|
59 | 59 | if ($page->controller->isValid()) { |
60 | 60 | // Modified by Chamilo team, 16-MAR-2010. |
61 | 61 | //$page->handle('process'); |
@@ -38,15 +38,15 @@ |
||
38 | 38 | { |
39 | 39 | // save the form values and validation status to the session |
40 | 40 | $page->isFormBuilt() or $page->buildForm(); |
41 | - $pageName = $page->getAttribute('id'); |
|
42 | - $data =& $page->controller->container(); |
|
41 | + $pageName = $page->getAttribute('id'); |
|
42 | + $data = & $page->controller->container(); |
|
43 | 43 | $data['values'][$pageName] = $page->exportValues(); |
44 | 44 | if (PEAR::isError($valid = $page->validate())) { |
45 | 45 | return $valid; |
46 | 46 | } |
47 | 47 | $data['valid'][$pageName] = $valid; |
48 | 48 | |
49 | - $target =& $page->controller->getPage($actionName); |
|
49 | + $target = & $page->controller->getPage($actionName); |
|
50 | 50 | if (PEAR::isError($target)) { |
51 | 51 | return $target; |
52 | 52 | } else { |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | { |
36 | 36 | // save the form values and validation status to the session |
37 | 37 | $page->isFormBuilt() or $page->buildForm(); |
38 | - $pageName = $page->getAttribute('id'); |
|
39 | - $data =& $page->controller->container(); |
|
38 | + $pageName = $page->getAttribute('id'); |
|
39 | + $data = & $page->controller->container(); |
|
40 | 40 | $data['values'][$pageName] = $page->exportValues(); |
41 | 41 | if (PEAR::isError($valid = $page->validate())) { |
42 | 42 | return $valid; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | // Some other page is invalid, redirect to it |
61 | 61 | } else { |
62 | - $target =& $page->controller->getPage($page->controller->findInvalid()); |
|
62 | + $target = & $page->controller->getPage($page->controller->findInvalid()); |
|
63 | 63 | // Modified by Chamilo team, 16-MAR-2010. |
64 | 64 | //$target->handle('jump'); |
65 | 65 | return $target->handle('jump'); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * @access public |
16 | 16 | * @return void |
17 | 17 | */ |
18 | - public function __construct($elementName=null, $value=null, $attributes=null) |
|
18 | + public function __construct($elementName = null, $value = null, $attributes = null) |
|
19 | 19 | { |
20 | 20 | parent::__construct($elementName, null, $attributes); |
21 | 21 | $this->setValue($value); |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | function toHtml() |
117 | 117 | { |
118 | 118 | // prevent problems with grouped elements |
119 | - $arrayName = str_replace(array('[', ']'), array('__', ''), $this->getName()) . '_values'; |
|
119 | + $arrayName = str_replace(array('[', ']'), array('__', ''), $this->getName()).'_values'; |
|
120 | 120 | |
121 | 121 | $this->updateAttributes(array( |
122 | - 'onkeypress' => 'return autocomplete(this, event, ' . $arrayName . ');' |
|
122 | + 'onkeypress' => 'return autocomplete(this, event, '.$arrayName.');' |
|
123 | 123 | )); |
124 | 124 | if ($this->_flagFrozen) { |
125 | 125 | $js = ''; |
@@ -239,13 +239,13 @@ discard block |
||
239 | 239 | ); |
240 | 240 | |
241 | 241 | $js .= $this->_js; |
242 | - $js .= 'var ' . $arrayName . " = new Array();\n"; |
|
242 | + $js .= 'var '.$arrayName." = new Array();\n"; |
|
243 | 243 | for ($i = 0; $i < count($this->_options); $i++) { |
244 | - $js .= $arrayName . '[' . $i . "] = '" . strtr($this->_options[$i], $jsEscape) . "';\n"; |
|
244 | + $js .= $arrayName.'['.$i."] = '".strtr($this->_options[$i], $jsEscape)."';\n"; |
|
245 | 245 | } |
246 | 246 | $js .= "//]]>\n</script>"; |
247 | 247 | } |
248 | - return $js . parent::toHtml(); |
|
248 | + return $js.parent::toHtml(); |
|
249 | 249 | }// end func toHtml |
250 | 250 | |
251 | 251 | // }}} |