@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -$userid = (int)$value; |
|
2 | +$userid = (int) $value; |
|
3 | 3 | if (!isset($modx->filter->cache['ui'][$userid])) { |
4 | 4 | if ($userid < 0) { |
5 | 5 | $user = $modx->getWebUserInfo(abs($userid)); |
@@ -13,12 +13,12 @@ |
||
13 | 13 | |
14 | 14 | $out = false; |
15 | 15 | $class = 'DBAPI'; |
16 | -if (! class_exists($class)) { |
|
17 | - include_once MODX_MANAGER_PATH . 'includes/extenders/dbapi.' . $database_type . '.class.inc.php'; |
|
16 | +if (!class_exists($class)) { |
|
17 | + include_once MODX_MANAGER_PATH.'includes/extenders/dbapi.'.$database_type.'.class.inc.php'; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | if (class_exists($class)) { |
21 | - $this->db= new $class; |
|
21 | + $this->db = new $class; |
|
22 | 22 | $out = true; |
23 | 23 | } |
24 | 24 |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * Message Quit Template |
4 | 4 | * |
5 | 5 | */ |
6 | -if ((! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { |
|
6 | +if ((!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE != "true") { |
|
7 | 7 | die("<b>INCLUDE ACCESS ERROR</b><br /><br />Direct access to this file prohibited."); |
8 | 8 | } |
9 | 9 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | <a href='javascript:copyToClip();' style='color:#821517;font-size: 9px; text-decoration: none'>[Copy SQL to ClipBoard]</a><textarea id='holdtext' style='display:none;'></textarea></td></tr>"; |
38 | 38 | } |
39 | 39 | |
40 | -if ($text!='') { |
|
40 | +if ($text != '') { |
|
41 | 41 | $errortype = array( |
42 | 42 | E_ERROR => "Error", |
43 | 43 | E_WARNING => "Warning", |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $parsedMessageString .= "</tr>"; |
60 | 60 | |
61 | 61 | $parsedMessageString .= "<tr><td valign='top'> Error type/ Nr.: </td>"; |
62 | - $parsedMessageString .= "<td colspan='2'>" . $errortype[$nr] . " - $nr</b></td><td> </td>"; |
|
62 | + $parsedMessageString .= "<td colspan='2'>".$errortype[$nr]." - $nr</b></td><td> </td>"; |
|
63 | 63 | $parsedMessageString .= "</tr>"; |
64 | 64 | |
65 | 65 | $parsedMessageString .= "<tr><td> File: </td>"; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $parsedMessageString .= "<tr><td> Line: </td>"; |
70 | 70 | $parsedMessageString .= "<td colspan='2'>$line</td><td> </td>"; |
71 | 71 | $parsedMessageString .= "</tr>"; |
72 | - if ($source!='') { |
|
72 | + if ($source != '') { |
|
73 | 73 | $parsedMessageString .= "<tr><td valign='top'> Line $line source: </td>"; |
74 | 74 | $parsedMessageString .= "<td colspan='2'>$source</td><td> </td>"; |
75 | 75 | $parsedMessageString .= "</tr>"; |
@@ -33,22 +33,22 @@ discard block |
||
33 | 33 | |
34 | 34 | case "text": // handler for regular text boxes |
35 | 35 | case "rawtext": // non-htmlentity converted text boxes |
36 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" />'; |
|
36 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" />'; |
|
37 | 37 | break; |
38 | 38 | case "email": // handles email input fields |
39 | - $field_html .= '<input type="email" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%"/>'; |
|
39 | + $field_html .= '<input type="email" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%"/>'; |
|
40 | 40 | break; |
41 | 41 | case "number": // handles the input of numbers |
42 | - $field_html .= '<input type="number" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>'; |
|
42 | + $field_html .= '<input type="number" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>'; |
|
43 | 43 | break; |
44 | 44 | case "textareamini": // handler for textarea mini boxes |
45 | - $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">' . $modx->htmlspecialchars($field_value) . '</textarea>'; |
|
45 | + $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">'.$modx->htmlspecialchars($field_value).'</textarea>'; |
|
46 | 46 | break; |
47 | 47 | case "textarea": // handler for textarea boxes |
48 | 48 | case "rawtextarea": // non-htmlentity convertex textarea boxes |
49 | 49 | case "htmlarea": // handler for textarea boxes (deprecated) |
50 | 50 | case "richtext": // handler for textarea boxes |
51 | - $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">' . $modx->htmlspecialchars($field_value) . '</textarea>'; |
|
51 | + $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">'.$modx->htmlspecialchars($field_value).'</textarea>'; |
|
52 | 52 | break; |
53 | 53 | case "date": |
54 | 54 | $field_id = str_replace(array( |
@@ -58,44 +58,44 @@ discard block |
||
58 | 58 | if ($field_value == '') { |
59 | 59 | $field_value = 0; |
60 | 60 | } |
61 | - $field_html .= '<input id="tv' . $field_id . '" name="tv' . $field_id . '" class="DatePicker" type="text" value="' . ($field_value == 0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;" />'; |
|
62 | - $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].value=\'\';document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="' . $_style["actions_calendar_delete"] . '"></i></a>'; |
|
61 | + $field_html .= '<input id="tv'.$field_id.'" name="tv'.$field_id.'" class="DatePicker" type="text" value="'.($field_value == 0 || !isset($field_value) ? "" : $field_value).'" onblur="documentDirty=true;" />'; |
|
62 | + $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].value=\'\';document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="'.$_style["actions_calendar_delete"].'"></i></a>'; |
|
63 | 63 | |
64 | 64 | break; |
65 | 65 | case "dropdown": // handler for select boxes |
66 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" size="1" onchange="documentDirty=true;">'; |
|
66 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" size="1" onchange="documentDirty=true;">'; |
|
67 | 67 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
68 | 68 | while (list($item, $itemvalue) = each($index_list)) { |
69 | 69 | list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); |
70 | 70 | if (strlen($itemvalue) == 0) { |
71 | 71 | $itemvalue = $item; |
72 | 72 | } |
73 | - $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>'; |
|
73 | + $field_html .= '<option value="'.$modx->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($item).'</option>'; |
|
74 | 74 | } |
75 | 75 | $field_html .= "</select>"; |
76 | 76 | break; |
77 | 77 | case "listbox": // handler for select boxes |
78 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" onchange="documentDirty=true;" size="8">'; |
|
78 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" onchange="documentDirty=true;" size="8">'; |
|
79 | 79 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
80 | 80 | while (list($item, $itemvalue) = each($index_list)) { |
81 | 81 | list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); |
82 | 82 | if (strlen($itemvalue) == 0) { |
83 | 83 | $itemvalue = $item; |
84 | 84 | } |
85 | - $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>'; |
|
85 | + $field_html .= '<option value="'.$modx->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($item).'</option>'; |
|
86 | 86 | } |
87 | 87 | $field_html .= "</select>"; |
88 | 88 | break; |
89 | 89 | case "listbox-multiple": // handler for select boxes where you can choose multiple items |
90 | 90 | $field_value = explode("||", $field_value); |
91 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '[]" multiple="multiple" onchange="documentDirty=true;" size="8">'; |
|
91 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'[]" multiple="multiple" onchange="documentDirty=true;" size="8">'; |
|
92 | 92 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', $tvsArray)); |
93 | 93 | while (list($item, $itemvalue) = each($index_list)) { |
94 | 94 | list($item, $itemvalue) = (is_array($itemvalue)) ? $itemvalue : explode("==", $itemvalue); |
95 | 95 | if (strlen($itemvalue) == 0) { |
96 | 96 | $itemvalue = $item; |
97 | 97 | } |
98 | - $field_html .= '<option value="' . $modx->htmlspecialchars($itemvalue) . '"' . (in_array($itemvalue, $field_value) ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($item) . '</option>'; |
|
98 | + $field_html .= '<option value="'.$modx->htmlspecialchars($itemvalue).'"'.(in_array($itemvalue, $field_value) ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($item).'</option>'; |
|
99 | 99 | } |
100 | 100 | $field_html .= "</select>"; |
101 | 101 | break; |
@@ -107,17 +107,17 @@ discard block |
||
107 | 107 | 'ftp://' => 'ftp://', |
108 | 108 | 'mailto:' => 'mailto:' |
109 | 109 | ); |
110 | - $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv' . $field_id . '_prefix" name="tv' . $field_id . '_prefix" onchange="documentDirty=true;">'; |
|
110 | + $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv'.$field_id.'_prefix" name="tv'.$field_id.'_prefix" onchange="documentDirty=true;">'; |
|
111 | 111 | foreach ($urls as $k => $v) { |
112 | 112 | if (strpos($field_value, $v) === false) { |
113 | - $field_html .= '<option value="' . $v . '">' . $k . '</option>'; |
|
113 | + $field_html .= '<option value="'.$v.'">'.$k.'</option>'; |
|
114 | 114 | } else { |
115 | 115 | $field_value = str_replace($v, '', $field_value); |
116 | - $field_html .= '<option value="' . $v . '" selected="selected">' . $k . '</option>'; |
|
116 | + $field_html .= '<option value="'.$v.'" selected="selected">'.$k.'</option>'; |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | $field_html .= '</select></td><td>'; |
120 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" width="100" ' . $field_style . ' onchange="documentDirty=true;" /></td></tr></table>'; |
|
120 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" width="100" '.$field_style.' onchange="documentDirty=true;" /></td></tr></table>'; |
|
121 | 121 | break; |
122 | 122 | case 'checkbox': // handles check boxes |
123 | 123 | $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | if (strlen($itemvalue) == 0) { |
158 | 158 | $itemvalue = $item; |
159 | 159 | } |
160 | - $field_html .= '<input type="radio" value="' . $modx->htmlspecialchars($itemvalue) . '" id="tv_' . $i . '" name="tv' . $field_id . '" ' . ($itemvalue == $field_value ? 'checked="checked"' : '') . ' onchange="documentDirty=true;" /><label for="tv_' . $i . '" class="radio">' . $item . '</label><br />'; |
|
160 | + $field_html .= '<input type="radio" value="'.$modx->htmlspecialchars($itemvalue).'" id="tv_'.$i.'" name="tv'.$field_id.'" '.($itemvalue == $field_value ? 'checked="checked"' : '').' onchange="documentDirty=true;" /><label for="tv_'.$i.'" class="radio">'.$item.'</label><br />'; |
|
161 | 161 | $i++; |
162 | 162 | } |
163 | 163 | break; |
@@ -187,13 +187,13 @@ discard block |
||
187 | 187 | lastImageCtrl = ctrl; |
188 | 188 | var w = screen.width * 0.5; |
189 | 189 | var h = screen.height * 0.5; |
190 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
190 | + OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
191 | 191 | } |
192 | 192 | function BrowseFileServer(ctrl) { |
193 | 193 | lastFileCtrl = ctrl; |
194 | 194 | var w = screen.width * 0.5; |
195 | 195 | var h = screen.height * 0.5; |
196 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
196 | + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
197 | 197 | } |
198 | 198 | function SetUrlChange(el) { |
199 | 199 | if ('createEvent' in document) { |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | </script>"; |
228 | 228 | $ResourceManagerLoaded = true; |
229 | 229 | } |
230 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseServer(\'tv' . $field_id . '\')" />'; |
|
230 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseServer(\'tv'.$field_id.'\')" />'; |
|
231 | 231 | break; |
232 | 232 | case "file": // handles the input of file uploads |
233 | 233 | /* Modified by Timon for use with resource browser */ |
@@ -257,13 +257,13 @@ discard block |
||
257 | 257 | lastImageCtrl = ctrl; |
258 | 258 | var w = screen.width * 0.5; |
259 | 259 | var h = screen.height * 0.5; |
260 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
260 | + OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
261 | 261 | } |
262 | 262 | function BrowseFileServer(ctrl) { |
263 | 263 | lastFileCtrl = ctrl; |
264 | 264 | var w = screen.width * 0.5; |
265 | 265 | var h = screen.height * 0.5; |
266 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
266 | + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
267 | 267 | } |
268 | 268 | function SetUrlChange(el) { |
269 | 269 | if ('createEvent' in document) { |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | </script>"; |
298 | 298 | $ResourceManagerLoaded = true; |
299 | 299 | } |
300 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseFileServer(\'tv' . $field_id . '\')" />'; |
|
300 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseFileServer(\'tv'.$field_id.'\')" />'; |
|
301 | 301 | |
302 | 302 | break; |
303 | 303 | |
@@ -305,16 +305,16 @@ discard block |
||
305 | 305 | $custom_output = ''; |
306 | 306 | /* If we are loading a file */ |
307 | 307 | if (substr($field_elements, 0, 5) == "@FILE") { |
308 | - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); |
|
308 | + $file_name = MODX_BASE_PATH.trim(substr($field_elements, 6)); |
|
309 | 309 | if (!file_exists($file_name)) { |
310 | - $custom_output = $file_name . ' does not exist'; |
|
310 | + $custom_output = $file_name.' does not exist'; |
|
311 | 311 | } else { |
312 | 312 | $custom_output = file_get_contents($file_name); |
313 | 313 | } |
314 | 314 | } elseif (substr($field_elements, 0, 8) == '@INCLUDE') { |
315 | - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); |
|
315 | + $file_name = MODX_BASE_PATH.trim(substr($field_elements, 9)); |
|
316 | 316 | if (!file_exists($file_name)) { |
317 | - $custom_output = $file_name . ' does not exist'; |
|
317 | + $custom_output = $file_name.' does not exist'; |
|
318 | 318 | } else { |
319 | 319 | ob_start(); |
320 | 320 | include $file_name; |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | $chunk_name = trim(substr($field_elements, 7)); |
326 | 326 | $chunk_body = $modx->getChunk($chunk_name); |
327 | 327 | if ($chunk_body == false) { |
328 | - $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; |
|
328 | + $custom_output = $_lang['chunk_no_exist'].'('.$_lang['htmlsnippet_name'].':'.$chunk_name.')'; |
|
329 | 329 | } else { |
330 | 330 | $custom_output = $chunk_body; |
331 | 331 | } |
@@ -350,15 +350,15 @@ discard block |
||
350 | 350 | break; |
351 | 351 | |
352 | 352 | default: // the default handler -- for errors, mostly |
353 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->htmlspecialchars($field_value) . '" ' . $field_style . ' onchange="documentDirty=true;" />'; |
|
353 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->htmlspecialchars($field_value).'" '.$field_style.' onchange="documentDirty=true;" />'; |
|
354 | 354 | |
355 | 355 | } // end switch statement |
356 | 356 | } else { |
357 | 357 | $custom = explode(":", $field_type); |
358 | 358 | $custom_output = ''; |
359 | - $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; |
|
359 | + $file_name = MODX_BASE_PATH.'assets/tvs/'.$custom['1'].'/'.$custom['1'].'.customtv.php'; |
|
360 | 360 | if (!file_exists($file_name)) { |
361 | - $custom_output = $file_name . ' does not exist'; |
|
361 | + $custom_output = $file_name.' does not exist'; |
|
362 | 362 | } else { |
363 | 363 | ob_start(); |
364 | 364 | include $file_name; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $o = ''; |
22 | 22 | |
23 | 23 | // process any TV commands in value |
24 | - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
|
24 | + $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier; |
|
25 | 25 | $value = ProcessTVCommand($value, $name, $docid); |
26 | 26 | |
27 | 27 | $params = array(); |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | $attr['align'] = $params['align']; |
61 | 61 | } |
62 | 62 | foreach ($attr as $k => $v) { |
63 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
63 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
64 | 64 | } |
65 | - $attributes .= ' ' . $params['attrib']; |
|
65 | + $attributes .= ' '.$params['attrib']; |
|
66 | 66 | |
67 | 67 | // Output the image with attributes |
68 | - $o .= '<img' . rtrim($attributes) . ' />'; |
|
68 | + $o .= '<img'.rtrim($attributes).' />'; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | break; |
@@ -131,12 +131,12 @@ discard block |
||
131 | 131 | 'target' => $params['target'], |
132 | 132 | ); |
133 | 133 | foreach ($attr as $k => $v) { |
134 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
134 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
135 | 135 | } |
136 | - $attributes .= ' ' . $params['attrib']; // add extra |
|
136 | + $attributes .= ' '.$params['attrib']; // add extra |
|
137 | 137 | |
138 | 138 | // Output the link |
139 | - $o .= '<a' . rtrim($attributes) . '>' . ($params['text'] ? $modx->htmlspecialchars($params['text']) : $name) . '</a>'; |
|
139 | + $o .= '<a'.rtrim($attributes).'>'.($params['text'] ? $modx->htmlspecialchars($params['text']) : $name).'</a>'; |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | break; |
@@ -162,12 +162,12 @@ discard block |
||
162 | 162 | 'style' => $params['style'], |
163 | 163 | ); |
164 | 164 | foreach ($attr as $k => $v) { |
165 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
165 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
166 | 166 | } |
167 | - $attributes .= ' ' . $params['attrib']; // add extra |
|
167 | + $attributes .= ' '.$params['attrib']; // add extra |
|
168 | 168 | |
169 | 169 | // Output the HTML Tag |
170 | - $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . '</' . $tagname . '>'; |
|
170 | + $o .= '<'.$tagname.rtrim($attributes).'>'.$tagvalue.'</'.$tagname.'>'; |
|
171 | 171 | } |
172 | 172 | break; |
173 | 173 | |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $w = $params['w'] ? $params['w'] : '100%'; |
177 | 177 | $h = $params['h'] ? $params['h'] : '400px'; |
178 | 178 | $richtexteditor = $params['edt'] ? $params['edt'] : ""; |
179 | - $o = '<div class="MODX_RichTextWidget"><textarea id="' . $id . '" name="' . $id . '" style="width:' . $w . '; height:' . $h . ';">'; |
|
179 | + $o = '<div class="MODX_RichTextWidget"><textarea id="'.$id.'" name="'.$id.'" style="width:'.$w.'; height:'.$h.';">'; |
|
180 | 180 | $o .= $modx->htmlspecialchars($value); |
181 | 181 | $o .= '</textarea></div>'; |
182 | 182 | $replace_richtext = array($id); |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | case "viewport": |
205 | 205 | $value = parseInput($value); |
206 | - $id = '_' . time(); |
|
206 | + $id = '_'.time(); |
|
207 | 207 | if (!$params['vpid']) { |
208 | 208 | $params['vpid'] = $id; |
209 | 209 | } |
@@ -217,37 +217,37 @@ discard block |
||
217 | 217 | $h = "100%"; |
218 | 218 | } |
219 | 219 | if ($params['asize'] == 'Yes' || ($params['awidth'] == 'Yes' && $params['aheight'] == 'Yes')) { |
220 | - $autoMode = "3"; //both |
|
220 | + $autoMode = "3"; //both |
|
221 | 221 | } elseif ($params['awidth'] == 'Yes') { |
222 | 222 | $autoMode = "1"; //width only |
223 | 223 | } elseif ($params['aheight'] == 'Yes') { |
224 | - $autoMode = "2"; //height only |
|
224 | + $autoMode = "2"; //height only |
|
225 | 225 | } |
226 | 226 | |
227 | - $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( |
|
227 | + $modx->regClientStartupScript(MODX_MANAGER_URL."media/script/bin/viewport.js", array( |
|
228 | 228 | 'name' => 'viewport', |
229 | 229 | 'version' => '0', |
230 | 230 | 'plaintext' => false |
231 | 231 | )); |
232 | - $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; |
|
232 | + $o = $sTag." id='".$params['vpid']."' name='".$params['vpid']."' "; |
|
233 | 233 | if ($params['class']) { |
234 | - $o .= " class='" . $params['class'] . "' "; |
|
234 | + $o .= " class='".$params['class']."' "; |
|
235 | 235 | } |
236 | 236 | if ($params['style']) { |
237 | - $o .= " style='" . $params['style'] . "' "; |
|
237 | + $o .= " style='".$params['style']."' "; |
|
238 | 238 | } |
239 | 239 | if ($params['attrib']) { |
240 | - $o .= $params['attrib'] . " "; |
|
240 | + $o .= $params['attrib']." "; |
|
241 | 241 | } |
242 | - $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; |
|
243 | - $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; |
|
244 | - $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; |
|
242 | + $o .= "scrolling='".($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto"))."' "; |
|
243 | + $o .= "src='".$value."' frameborder='".$params['borsize']."' "; |
|
244 | + $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'".$params['vpid']."\\',".$autoMode.")',100);\" width='".$w."' height='".$h."' "; |
|
245 | 245 | $o .= ">"; |
246 | 246 | $o .= $eTag; |
247 | 247 | break; |
248 | 248 | |
249 | 249 | case "datagrid": |
250 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
250 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
251 | 251 | $grd = new DataGrid('', $value); |
252 | 252 | |
253 | 253 | $grd->noRecordMsg = $params['egmsg']; |
@@ -294,16 +294,16 @@ discard block |
||
294 | 294 | $o = ''; |
295 | 295 | /* If we are loading a file */ |
296 | 296 | if (substr($params['output'], 0, 5) == "@FILE") { |
297 | - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); |
|
297 | + $file_name = MODX_BASE_PATH.trim(substr($params['output'], 6)); |
|
298 | 298 | if (!file_exists($file_name)) { |
299 | - $widget_output = $file_name . ' does not exist'; |
|
299 | + $widget_output = $file_name.' does not exist'; |
|
300 | 300 | } else { |
301 | 301 | $widget_output = file_get_contents($file_name); |
302 | 302 | } |
303 | 303 | } elseif (substr($params['output'], 0, 8) == '@INCLUDE') { |
304 | - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); |
|
304 | + $file_name = MODX_BASE_PATH.trim(substr($params['output'], 9)); |
|
305 | 305 | if (!file_exists($file_name)) { |
306 | - $widget_output = $file_name . ' does not exist'; |
|
306 | + $widget_output = $file_name.' does not exist'; |
|
307 | 307 | } else { |
308 | 308 | /* The included file needs to set $widget_output. Can be string, array, object */ |
309 | 309 | include $file_name; |
@@ -20,37 +20,37 @@ discard block |
||
20 | 20 | $body_class = ''; |
21 | 21 | $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness'); |
22 | 22 | if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { |
23 | - $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; |
|
23 | + $body_class .= ' '.$theme_modes[$_COOKIE['MODX_themeMode']]; |
|
24 | 24 | } elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) { |
25 | - $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']]; |
|
25 | + $body_class .= ' '.$theme_modes[$modx->config['manager_theme_mode']]; |
|
26 | 26 | } |
27 | 27 | |
28 | -$css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime; |
|
28 | +$css = 'media/style/'.$modx->config['manager_theme'].'/style.css?v='.$lastInstallTime; |
|
29 | 29 | |
30 | 30 | if ($modx->config['manager_theme'] == 'default') { |
31 | - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') |
|
32 | - && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
33 | - require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
|
31 | + if (!file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css') |
|
32 | + && is_writable(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css')) { |
|
33 | + require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php'; |
|
34 | 34 | $minifier = new Formatter\CSSMinify(); |
35 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
36 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
37 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css'); |
|
38 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css'); |
|
39 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css'); |
|
40 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css'); |
|
41 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css'); |
|
42 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css'); |
|
43 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css'); |
|
44 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css'); |
|
45 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'); |
|
35 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
36 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
37 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css'); |
|
38 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css'); |
|
39 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css'); |
|
40 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css'); |
|
41 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css'); |
|
42 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css'); |
|
43 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css'); |
|
44 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css'); |
|
45 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css'); |
|
46 | 46 | $css = $minifier->minify(); |
47 | 47 | file_put_contents( |
48 | - MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', |
|
48 | + MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css', |
|
49 | 49 | $css |
50 | 50 | ); |
51 | 51 | } |
52 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
53 | - $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
|
52 | + if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) { |
|
53 | + $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime; |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | <meta http-equiv="X-UA-Compatible" content="IE=edge"/> |
66 | 66 | <link rel="stylesheet" type="text/css" href="<?= $css ?>"/> |
67 | 67 | <script type="text/javascript" src="media/script/tabpane.js"></script> |
68 | - <?= sprintf('<script type="text/javascript" src="%s"></script>' . "\n", $modx->config['mgr_jquery_path']) ?> |
|
68 | + <?= sprintf('<script type="text/javascript" src="%s"></script>'."\n", $modx->config['mgr_jquery_path']) ?> |
|
69 | 69 | <?php if ($modx->config['show_picker'] != "0") { |
70 | 70 | ?> |
71 | 71 | <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/color.switcher.js" |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } ?> |
83 | 83 | |
84 | 84 | <!-- OnManagerMainFrameHeaderHTMLBlock --> |
85 | - <?= $onManagerMainFrameHeaderHTMLBlock . "\n" ?> |
|
85 | + <?= $onManagerMainFrameHeaderHTMLBlock."\n" ?> |
|
86 | 86 | |
87 | 87 | <script type="text/javascript"> |
88 | 88 | if (!evo) { |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | <script> |
113 | 113 | <?php |
114 | 114 | if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
115 | - echo 'doRefresh(' . $_REQUEST['r'] . ");\n"; |
|
115 | + echo 'doRefresh('.$_REQUEST['r'].");\n"; |
|
116 | 116 | } |
117 | 117 | ?> |
118 | 118 | </script> |
@@ -36,16 +36,16 @@ discard block |
||
36 | 36 | $action = "", |
37 | 37 | $itemid = "", |
38 | 38 | $itemname = "" |
39 | - ) { |
|
39 | + ){ |
|
40 | 40 | $modx = evolutionCMS(); |
41 | 41 | $this->entry['msg'] = $msg; // writes testmessage to the object |
42 | - $this->entry['action'] = empty($action) ? $modx->manager->action : $action; // writes the action to the object |
|
42 | + $this->entry['action'] = empty($action) ? $modx->manager->action : $action; // writes the action to the object |
|
43 | 43 | |
44 | 44 | // User Credentials |
45 | 45 | $this->entry['internalKey'] = $internalKey == "" ? $modx->getLoginUserID() : $internalKey; |
46 | 46 | $this->entry['username'] = $username == "" ? $modx->getLoginUserName() : $username; |
47 | 47 | |
48 | - $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int)$_REQUEST['id'] : $itemid; // writes the id to the object |
|
48 | + $this->entry['itemId'] = (empty($itemid) && isset($_REQUEST['id'])) ? (int) $_REQUEST['id'] : $itemid; // writes the id to the object |
|
49 | 49 | if ($this->entry['itemId'] == 0) { |
50 | 50 | $this->entry['itemId'] = "-"; |
51 | 51 | } // to stop items having id 0 |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | |
97 | 97 | $insert_id = $modx->db->insert($fields, $tbl_manager_log); |
98 | 98 | if (!$insert_id) { |
99 | - $modx->messageQuit("Logging error: couldn't save log to table! Error code: " . $modx->db->getLastError()); |
|
99 | + $modx->messageQuit("Logging error: couldn't save log to table! Error code: ".$modx->db->getLastError()); |
|
100 | 100 | } else { |
101 | - $limit = (isset($modx->config['manager_log_limit'])) ? (int)$modx->config['manager_log_limit'] : 3000; |
|
102 | - $trim = (isset($modx->config['manager_log_trim'])) ? (int)$modx->config['manager_log_trim'] : 100; |
|
101 | + $limit = (isset($modx->config['manager_log_limit'])) ? (int) $modx->config['manager_log_limit'] : 3000; |
|
102 | + $trim = (isset($modx->config['manager_log_trim'])) ? (int) $modx->config['manager_log_trim'] : 100; |
|
103 | 103 | if (($insert_id % $trim) === 0) { |
104 | 104 | $modx->rotate_log('manager_log', $limit, $trim); |
105 | 105 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | private function getUserIP() |
110 | 110 | { |
111 | 111 | if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER) && !empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { |
112 | - if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')>0) { |
|
112 | + if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') > 0) { |
|
113 | 113 | $addr = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); |
114 | 114 | return trim($addr[0]); |
115 | 115 | } else { |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | 6 | // show debug information |
7 | -if (isset($enable_debug) && $enable_debug==true) { |
|
7 | +if (isset($enable_debug) && $enable_debug == true) { |
|
8 | 8 | ?> |
9 | 9 | <script language="javascript"> |
10 | 10 | //document.onload = removeDebug(); |
@@ -53,11 +53,11 @@ discard block |
||
53 | 53 | public $im_height = 0; |
54 | 54 | public $im; |
55 | 55 | |
56 | - public function __construct($w=200, $h=80) |
|
56 | + public function __construct($w = 200, $h = 80) |
|
57 | 57 | { |
58 | 58 | /* create session to set word for verification */ |
59 | 59 | $this->set_veriword(); |
60 | - $this->dir_font = dirname(__FILE__) . '/' . $this->dir_font; |
|
60 | + $this->dir_font = dirname(__FILE__).'/'.$this->dir_font; |
|
61 | 61 | $this->im_width = $w; |
62 | 62 | $this->im_height = $h; |
63 | 63 | } |
@@ -82,12 +82,12 @@ discard block |
||
82 | 82 | { |
83 | 83 | $modx = evolutionCMS(); |
84 | 84 | // set default words |
85 | - $words="MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote"; |
|
85 | + $words = "MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote"; |
|
86 | 86 | $words = $modx->config['captcha_words'] ? $modx->config['captcha_words'] : $words; |
87 | 87 | $arr_words = array_filter(array_map('trim', explode(',', $words))); |
88 | 88 | |
89 | 89 | /* pick one randomly for text verification */ |
90 | - return (string) $arr_words[array_rand($arr_words)] . rand(10, 999); |
|
90 | + return (string) $arr_words[array_rand($arr_words)].rand(10, 999); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | public function draw_text() |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $fontstmp = array(); |
97 | 97 | while (false !== ($file = $dir->read())) { |
98 | 98 | if (substr($file, -4) == '.ttf') { |
99 | - $fontstmp[] = $this->dir_font . $file; |
|
99 | + $fontstmp[] = $this->dir_font.$file; |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | $dir->close(); |
@@ -108,20 +108,20 @@ discard block |
||
108 | 108 | $text_size = 30; |
109 | 109 | /* calculate text width and height */ |
110 | 110 | $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); |
111 | - $text_width = $box[2]-$box[0]; //text width |
|
112 | - $text_height= $box[5]-$box[3]; //text height |
|
111 | + $text_width = $box[2] - $box[0]; //text width |
|
112 | + $text_height = $box[5] - $box[3]; //text height |
|
113 | 113 | |
114 | 114 | /* adjust text size */ |
115 | - $text_size = round((20 * $this->im_width)/$text_width); |
|
115 | + $text_size = round((20 * $this->im_width) / $text_width); |
|
116 | 116 | |
117 | 117 | /* recalculate text width and height */ |
118 | 118 | $box = imagettfbbox($text_size, $text_angle, $text_font, $this->word); |
119 | - $text_width = $box[2]-$box[0]; //text width |
|
120 | - $text_height= $box[5]-$box[3]; //text height |
|
119 | + $text_width = $box[2] - $box[0]; //text width |
|
120 | + $text_height = $box[5] - $box[3]; //text height |
|
121 | 121 | |
122 | 122 | /* calculate center position of text */ |
123 | - $text_x = ($this->im_width - $text_width)/2; |
|
124 | - $text_y = ($this->im_height - $text_height)/2; |
|
123 | + $text_x = ($this->im_width - $text_width) / 2; |
|
124 | + $text_y = ($this->im_height - $text_height) / 2; |
|
125 | 125 | |
126 | 126 | /* create canvas for text drawing */ |
127 | 127 | $im_text = imagecreate($this->im_width, $this->im_height); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | { |
151 | 151 | |
152 | 152 | /* pick one background image randomly from image directory */ |
153 | - $img_file = $this->dir_noise . "noise" . rand(1, 4) . ".jpg"; |
|
153 | + $img_file = $this->dir_noise."noise".rand(1, 4).".jpg"; |
|
154 | 154 | |
155 | 155 | /* create "noise" background image from your image stock*/ |
156 | 156 | $noise_img = @imagecreatefromjpeg($img_file); |