@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | public function display(array $properties) |
27 | 27 | { |
28 | - if (!$this->hasPermission('Onlineblock::', $properties['bid'].'::', ACCESS_READ)) { |
|
28 | + if (!$this->hasPermission('Onlineblock::', $properties['bid'] . '::', ACCESS_READ)) { |
|
29 | 29 | return ''; |
30 | 30 | } |
31 | 31 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | { |
22 | 22 | public function display(array $properties) |
23 | 23 | { |
24 | - if ($this->hasPermission('Loginblock::', $properties['title'].'::', ACCESS_READ)) { |
|
24 | + if ($this->hasPermission('Loginblock::', $properties['title'] . '::', ACCESS_READ)) { |
|
25 | 25 | if (!$this->get('zikula_users_module.current_user')->isLoggedIn()) { |
26 | 26 | $request = $this->get('request_stack')->getCurrentRequest(); |
27 | 27 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | if ($form->get('download')->isClicked()) { |
47 | 47 | $data = $form->getData(); |
48 | 48 | $response = new StreamedResponse(); |
49 | - $response->setCallback(function () use ($data) { |
|
49 | + $response->setCallback(function() use ($data) { |
|
50 | 50 | $fields = ['uid', 'uname', 'activated', 'email', 'user_regdate', 'lastlogin', 'groups']; |
51 | 51 | foreach ($fields as $k => $field) { |
52 | 52 | if (isset($data[$field]) && !$data[$field]) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | UsersConstant::MODVAR_LOGIN_DISPLAY_APPROVAL_STATUS |
118 | 118 | ]; |
119 | 119 | foreach ($modvarsToConvertToBool as $modvarToConvert) { |
120 | - $this->setVar($modvarToConvert, (bool) $this->getVar($modvarToConvert)); |
|
120 | + $this->setVar($modvarToConvert, (bool)$this->getVar($modvarToConvert)); |
|
121 | 121 | } |
122 | 122 | $this->schemaTool->update(['Zikula\UsersModule\Entity\UserEntity']); |
123 | 123 | $this->delVar('login_redirect'); |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $value = in_array($migratedModVarName, [ |
291 | 291 | ZAuthConstant::MODVAR_EMAIL_VERIFICATION_REQUIRED, |
292 | 292 | ZAuthConstant::MODVAR_PASSWORD_STRENGTH_METER_ENABLED |
293 | - ]) ? (bool) $value : $value; |
|
293 | + ]) ? (bool)$value : $value; |
|
294 | 294 | $this->container->get('zikula_extensions_module.api.variable')->set('ZikulaZAuthModule', $migratedModVarName, $value); |
295 | 295 | } |
296 | 296 | } |
@@ -175,7 +175,7 @@ |
||
175 | 175 | |
176 | 176 | // add body with formatting |
177 | 177 | $bodyFormat = 'text/plain'; |
178 | - if (!empty($altBody) || ((bool) $html) || $this->dataValues['html']) { |
|
178 | + if (!empty($altBody) || ((bool)$html) || $this->dataValues['html']) { |
|
179 | 179 | $bodyFormat = 'text/html'; |
180 | 180 | } |
181 | 181 | if (isset($body)) { |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $qb->from('ZikulaUsersModule:UserEntity', 'u'); |
109 | 109 | $qb->andWhere($qb->expr()->eq('tbl.user', 'u.uid')); |
110 | 110 | $qb->andWhere($qb->expr()->eq('tbl.user', ':uid')) |
111 | - ->setParameter('uid', $uid); |
|
111 | + ->setParameter('uid', $uid); |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $i = 1; |
118 | 118 | foreach ($filters as $w_key => $w_value) { |
119 | 119 | $qb->andWhere($qb->expr()->eq('tbl.' . $w_key, '?' . $i)) |
120 | - ->setParameter($i, $w_value); |
|
120 | + ->setParameter($i, $w_value); |
|
121 | 121 | $i++; |
122 | 122 | } |
123 | 123 | } |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | |
145 | 145 | if ($fieldName == 'uid') { |
146 | 146 | $qb->select('DISTINCT(u.' . $fieldName . ')') |
147 | - ->from('ZikulaUsersModule:UserEntity', 'u') |
|
148 | - ->where($qb->expr()->eq('tbl.user', 'u.uid')) |
|
149 | - ->addOrderBy('u.uname', 'ASC'); |
|
147 | + ->from('ZikulaUsersModule:UserEntity', 'u') |
|
148 | + ->where($qb->expr()->eq('tbl.user', 'u.uid')) |
|
149 | + ->addOrderBy('u.uname', 'ASC'); |
|
150 | 150 | } else { |
151 | 151 | $qb->select('DISTINCT(tbl.' . $fieldName . ')') |
152 | - ->addOrderBy('tbl.' . $fieldName, 'ASC'); |
|
152 | + ->addOrderBy('tbl.' . $fieldName, 'ASC'); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | $query = $qb->getQuery(); |
@@ -391,7 +391,7 @@ |
||
391 | 391 | |
392 | 392 | $mpath = ModUtil::getModuleRelativePath($modinfo['name']); |
393 | 393 | if ($mpath) { |
394 | - $path = $mpath.'/Resources/public/css'; |
|
394 | + $path = $mpath . '/Resources/public/css'; |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | if ((isset($path) && is_dir($dir = $path)) |
@@ -49,40 +49,40 @@ |
||
49 | 49 | |
50 | 50 | function get_load_files_code() { |
51 | 51 | $code = ( '<link rel="stylesheet" type="text/css" media="all" href="' . |
52 | - $this->calendar_lib_path . $this->calendar_theme_file . |
|
53 | - '" />' . NEWLINE ); |
|
52 | + $this->calendar_lib_path . $this->calendar_theme_file . |
|
53 | + '" />' . NEWLINE ); |
|
54 | 54 | $code .= ( '<script type="text/javascript" src="' . |
55 | - $this->calendar_lib_path . $this->calendar_file . |
|
56 | - '"></script>' . NEWLINE ); |
|
55 | + $this->calendar_lib_path . $this->calendar_file . |
|
56 | + '"></script>' . NEWLINE ); |
|
57 | 57 | $code .= ( '<script type="text/javascript" src="' . |
58 | - $this->calendar_lib_path . $this->calendar_lang_file . |
|
59 | - '"></script>' . NEWLINE ); |
|
58 | + $this->calendar_lib_path . $this->calendar_lang_file . |
|
59 | + '"></script>' . NEWLINE ); |
|
60 | 60 | $code .= ( '<script type="text/javascript" src="' . |
61 | - $this->calendar_lib_path . $this->calendar_setup_file . |
|
62 | - '"></script>' ); |
|
61 | + $this->calendar_lib_path . $this->calendar_setup_file . |
|
62 | + '"></script>' ); |
|
63 | 63 | return $code; |
64 | 64 | } |
65 | 65 | |
66 | 66 | function _make_calendar($other_options = array()) { |
67 | 67 | $js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options)); |
68 | 68 | $code = ( '<script type="text/javascript">Calendar.setup({' . |
69 | - $js_options . |
|
70 | - '});</script>' ); |
|
69 | + $js_options . |
|
70 | + '});</script>' ); |
|
71 | 71 | return $code; |
72 | 72 | } |
73 | 73 | |
74 | 74 | function make_input_field($cal_options = array(), $field_attributes = array()) { |
75 | 75 | $id = $this->_gen_id(); |
76 | 76 | $attrstr = $this->_make_html_attr(array_merge($field_attributes, |
77 | - array('id' => $this->_field_id($id), |
|
77 | + array('id' => $this->_field_id($id), |
|
78 | 78 | 'type' => 'text'))); |
79 | 79 | echo '<input ' . $attrstr .'/>'; |
80 | 80 | echo '<a href="#" id="'. $this->_trigger_id($id) . '">' . |
81 | 81 | '<img align="middle" border="0" src="' . $this->calendar_lib_path . 'img.gif" alt="" /></a>'; |
82 | 82 | |
83 | 83 | $options = array_merge($cal_options, |
84 | - array('inputField' => $this->_field_id($id), |
|
85 | - 'button' => $this->_trigger_id($id))); |
|
84 | + array('inputField' => $this->_field_id($id), |
|
85 | + 'button' => $this->_trigger_id($id))); |
|
86 | 86 | echo $this->_make_calendar($options); |
87 | 87 | } |
88 | 88 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->calendar_setup_file = 'calendar-setup.js'; |
34 | 34 | } |
35 | 35 | $this->calendar_lang_file = 'lang/calendar-' . $lang . '.js'; |
36 | - $this->calendar_theme_file = $theme.'.css'; |
|
36 | + $this->calendar_theme_file = $theme . '.css'; |
|
37 | 37 | $this->calendar_lib_path = preg_replace('/\/+$/', '/', $calendar_lib_path); |
38 | 38 | $this->calendar_options = array('ifFormat' => '%Y/%m/%d', |
39 | 39 | 'daFormat' => '%Y/%m/%d'); |
@@ -48,26 +48,26 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | function get_load_files_code() { |
51 | - $code = ( '<link rel="stylesheet" type="text/css" media="all" href="' . |
|
51 | + $code = ('<link rel="stylesheet" type="text/css" media="all" href="' . |
|
52 | 52 | $this->calendar_lib_path . $this->calendar_theme_file . |
53 | - '" />' . NEWLINE ); |
|
54 | - $code .= ( '<script type="text/javascript" src="' . |
|
53 | + '" />' . NEWLINE); |
|
54 | + $code .= ('<script type="text/javascript" src="' . |
|
55 | 55 | $this->calendar_lib_path . $this->calendar_file . |
56 | - '"></script>' . NEWLINE ); |
|
57 | - $code .= ( '<script type="text/javascript" src="' . |
|
56 | + '"></script>' . NEWLINE); |
|
57 | + $code .= ('<script type="text/javascript" src="' . |
|
58 | 58 | $this->calendar_lib_path . $this->calendar_lang_file . |
59 | - '"></script>' . NEWLINE ); |
|
60 | - $code .= ( '<script type="text/javascript" src="' . |
|
59 | + '"></script>' . NEWLINE); |
|
60 | + $code .= ('<script type="text/javascript" src="' . |
|
61 | 61 | $this->calendar_lib_path . $this->calendar_setup_file . |
62 | - '"></script>' ); |
|
62 | + '"></script>'); |
|
63 | 63 | return $code; |
64 | 64 | } |
65 | 65 | |
66 | 66 | function _make_calendar($other_options = array()) { |
67 | 67 | $js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options)); |
68 | - $code = ( '<script type="text/javascript">Calendar.setup({' . |
|
68 | + $code = ('<script type="text/javascript">Calendar.setup({' . |
|
69 | 69 | $js_options . |
70 | - '});</script>' ); |
|
70 | + '});</script>'); |
|
71 | 71 | return $code; |
72 | 72 | } |
73 | 73 | |
@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | $attrstr = $this->_make_html_attr(array_merge($field_attributes, |
77 | 77 | array('id' => $this->_field_id($id), |
78 | 78 | 'type' => 'text'))); |
79 | - echo '<input ' . $attrstr .'/>'; |
|
80 | - echo '<a href="#" id="'. $this->_trigger_id($id) . '">' . |
|
79 | + echo '<input ' . $attrstr . '/>'; |
|
80 | + echo '<a href="#" id="' . $this->_trigger_id($id) . '">' . |
|
81 | 81 | '<img align="middle" border="0" src="' . $this->calendar_lib_path . 'img.gif" alt="" /></a>'; |
82 | 82 | |
83 | 83 | $options = array_merge($cal_options, |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | if (is_bool($val)) |
100 | 100 | $val = $val ? 'true' : 'false'; |
101 | 101 | else if (!is_numeric($val)) |
102 | - $val = '"'.$val.'"'; |
|
102 | + $val = '"' . $val . '"'; |
|
103 | 103 | if ($jstr) $jstr .= ','; |
104 | 104 | $jstr .= '"' . $key . '":' . $val; |
105 | 105 | } |
@@ -12,7 +12,8 @@ discard block |
||
12 | 12 | |
13 | 13 | define('NEWLINE', "\n"); |
14 | 14 | |
15 | -class DHTML_Calendar { |
|
15 | +class DHTML_Calendar |
|
16 | +{ |
|
16 | 17 | var $calendar_lib_path; |
17 | 18 | |
18 | 19 | var $calendar_file; |
@@ -24,7 +25,8 @@ discard block |
||
24 | 25 | function DHTML_Calendar($calendar_lib_path = '/calendar/', |
25 | 26 | $lang = 'en', |
26 | 27 | $theme = 'calendar-win2k-1', |
27 | - $stripped = true) { |
|
28 | + $stripped = true) |
|
29 | + { |
|
28 | 30 | if ($stripped) { |
29 | 31 | $this->calendar_file = 'calendar_stripped.js'; |
30 | 32 | $this->calendar_setup_file = 'calendar-setup_stripped.js'; |
@@ -39,15 +41,18 @@ discard block |
||
39 | 41 | 'daFormat' => '%Y/%m/%d'); |
40 | 42 | } |
41 | 43 | |
42 | - function set_option($name, $value) { |
|
44 | + function set_option($name, $value) |
|
45 | + { |
|
43 | 46 | $this->calendar_options[$name] = $value; |
44 | 47 | } |
45 | 48 | |
46 | - function load_files() { |
|
49 | + function load_files() |
|
50 | + { |
|
47 | 51 | echo $this->get_load_files_code(); |
48 | 52 | } |
49 | 53 | |
50 | - function get_load_files_code() { |
|
54 | + function get_load_files_code() |
|
55 | + { |
|
51 | 56 | $code = ( '<link rel="stylesheet" type="text/css" media="all" href="' . |
52 | 57 | $this->calendar_lib_path . $this->calendar_theme_file . |
53 | 58 | '" />' . NEWLINE ); |
@@ -63,7 +68,8 @@ discard block |
||
63 | 68 | return $code; |
64 | 69 | } |
65 | 70 | |
66 | - function _make_calendar($other_options = array()) { |
|
71 | + function _make_calendar($other_options = array()) |
|
72 | + { |
|
67 | 73 | $js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options)); |
68 | 74 | $code = ( '<script type="text/javascript">Calendar.setup({' . |
69 | 75 | $js_options . |
@@ -71,7 +77,8 @@ discard block |
||
71 | 77 | return $code; |
72 | 78 | } |
73 | 79 | |
74 | - function make_input_field($cal_options = array(), $field_attributes = array()) { |
|
80 | + function make_input_field($cal_options = array(), $field_attributes = array()) |
|
81 | + { |
|
75 | 82 | $id = $this->_gen_id(); |
76 | 83 | $attrstr = $this->_make_html_attr(array_merge($field_attributes, |
77 | 84 | array('id' => $this->_field_id($id), |
@@ -88,25 +95,36 @@ discard block |
||
88 | 95 | |
89 | 96 | /// PRIVATE SECTION |
90 | 97 | |
91 | - function _field_id($id) { return 'f-calendar-field-' . $id; } |
|
92 | - function _trigger_id($id) { return 'f-calendar-trigger-' . $id; } |
|
93 | - function _gen_id() { static $id = 0; return ++$id; } |
|
94 | - |
|
95 | - function _make_js_hash($array) { |
|
98 | + function _field_id($id) |
|
99 | + { |
|
100 | +return 'f-calendar-field-' . $id; } |
|
101 | + function _trigger_id($id) |
|
102 | + { |
|
103 | +return 'f-calendar-trigger-' . $id; } |
|
104 | + function _gen_id() |
|
105 | + { |
|
106 | +static $id = 0; return ++$id; } |
|
107 | + |
|
108 | + function _make_js_hash($array) |
|
109 | + { |
|
96 | 110 | $jstr = ''; |
97 | 111 | reset($array); |
98 | 112 | while (list($key, $val) = each($array)) { |
99 | - if (is_bool($val)) |
|
100 | - $val = $val ? 'true' : 'false'; |
|
101 | - else if (!is_numeric($val)) |
|
102 | - $val = '"'.$val.'"'; |
|
103 | - if ($jstr) $jstr .= ','; |
|
113 | + if (is_bool($val)) { |
|
114 | + $val = $val ? 'true' : 'false'; |
|
115 | + } else if (!is_numeric($val)) { |
|
116 | + $val = '"'.$val.'"'; |
|
117 | + } |
|
118 | + if ($jstr) { |
|
119 | + $jstr .= ','; |
|
120 | + } |
|
104 | 121 | $jstr .= '"' . $key . '":' . $val; |
105 | 122 | } |
106 | 123 | return $jstr; |
107 | 124 | } |
108 | 125 | |
109 | - function _make_html_attr($array) { |
|
126 | + function _make_html_attr($array) |
|
127 | + { |
|
110 | 128 | $attrstr = ''; |
111 | 129 | reset($array); |
112 | 130 | while (list($key, $val) = each($array)) { |
@@ -208,7 +208,7 @@ |
||
208 | 208 | if (!$fp) { |
209 | 209 | return false; |
210 | 210 | } else { |
211 | - $out = "GET $path_query? HTTP/1.1\r\n"; |
|
211 | + $out = "get $path_query? HTTP/1.1\r\n"; |
|
212 | 212 | $out .= "User-Agent: $userAgent\r\n"; |
213 | 213 | $out .= "Referer: $ref\r\n"; |
214 | 214 | $out .= "Host: $urlArray[host]\r\n"; |