@@ -22,7 +22,8 @@ discard block |
||
| 22 | 22 | NOTE: http://www.w3.org/TR/NOTE-datetime |
| 23 | 23 | \*======================================================================*/ |
| 24 | 24 | |
| 25 | -function parse_w3cdtf ( $date_str ) { |
|
| 25 | +function parse_w3cdtf ( $date_str ) |
|
| 26 | +{ |
|
| 26 | 27 | |
| 27 | 28 | # regex to match wc3dtf |
| 28 | 29 | $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/"; |
@@ -37,8 +38,7 @@ discard block |
||
| 37 | 38 | $offset = 0; |
| 38 | 39 | if ( $match[10] == 'Z' ) { |
| 39 | 40 | # zulu time, aka GMT |
| 40 | - } |
|
| 41 | - else { |
|
| 41 | + } else { |
|
| 42 | 42 | list( $tz_mod, $tz_hour, $tz_min ) = |
| 43 | 43 | array( $match[8], $match[9], $match[10]); |
| 44 | 44 | |
@@ -58,8 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | $epoch = $epoch + $offset; |
| 60 | 60 | return $epoch; |
| 61 | - } |
|
| 62 | - else { |
|
| 61 | + } else { |
|
| 63 | 62 | return -1; |
| 64 | 63 | } |
| 65 | 64 | } |
@@ -22,35 +22,35 @@ |
||
| 22 | 22 | NOTE: http://www.w3.org/TR/NOTE-datetime |
| 23 | 23 | \*======================================================================*/ |
| 24 | 24 | |
| 25 | -function parse_w3cdtf ( $date_str ) { |
|
| 25 | +function parse_w3cdtf($date_str){ |
|
| 26 | 26 | |
| 27 | 27 | # regex to match wc3dtf |
| 28 | 28 | $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/"; |
| 29 | 29 | |
| 30 | - if ( preg_match( $pat, $date_str, $match ) ) { |
|
| 31 | - list( $year, $month, $day, $hours, $minutes, $seconds) = |
|
| 32 | - array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]); |
|
| 30 | + if (preg_match($pat, $date_str, $match)) { |
|
| 31 | + list($year, $month, $day, $hours, $minutes, $seconds) = |
|
| 32 | + array($match[1], $match[2], $match[3], $match[4], $match[5], $match[6]); |
|
| 33 | 33 | |
| 34 | 34 | # calc epoch for current date assuming GMT |
| 35 | - $epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year); |
|
| 35 | + $epoch = gmmktime($hours, $minutes, $seconds, $month, $day, $year); |
|
| 36 | 36 | |
| 37 | 37 | $offset = 0; |
| 38 | - if ( $match[10] == 'Z' ) { |
|
| 38 | + if ($match[10] == 'Z') { |
|
| 39 | 39 | # zulu time, aka GMT |
| 40 | 40 | } |
| 41 | 41 | else { |
| 42 | - list( $tz_mod, $tz_hour, $tz_min ) = |
|
| 43 | - array( $match[8], $match[9], $match[10]); |
|
| 42 | + list($tz_mod, $tz_hour, $tz_min) = |
|
| 43 | + array($match[8], $match[9], $match[10]); |
|
| 44 | 44 | |
| 45 | 45 | # zero out the variables |
| 46 | - if ( ! $tz_hour ) { $tz_hour = 0; } |
|
| 47 | - if ( ! $tz_min ) { $tz_min = 0; } |
|
| 46 | + if (!$tz_hour) { $tz_hour = 0; } |
|
| 47 | + if (!$tz_min) { $tz_min = 0; } |
|
| 48 | 48 | |
| 49 | - $offset_secs = (($tz_hour*60)+$tz_min)*60; |
|
| 49 | + $offset_secs = (($tz_hour * 60) + $tz_min) * 60; |
|
| 50 | 50 | |
| 51 | 51 | # is timezone ahead of GMT? then subtract offset |
| 52 | 52 | # |
| 53 | - if ( $tz_mod == '+' ) { |
|
| 53 | + if ($tz_mod == '+') { |
|
| 54 | 54 | $offset_secs = $offset_secs * -1; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$c = &$settings; |
|
| 3 | +$c = &$settings; |
|
| 4 | 4 | |
| 5 | 5 | $c['site_name'] = 'My MODX Site'; |
| 6 | 6 | $c['site_start'] = 1; |
@@ -65,21 +65,37 @@ |
||
| 65 | 65 | $_['macintosh'] = 'Western European (Mac) - macintosh'; |
| 66 | 66 | $_['Windows-1252'] = 'Western European (Windows) - Windows-1252'; |
| 67 | 67 | |
| 68 | -if($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
| 69 | -elseif($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
| 70 | -elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
| 71 | -elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
| 72 | -elseif($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
| 73 | -elseif($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
| 74 | -elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
| 75 | -elseif($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
| 76 | -elseif($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
| 77 | -elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
| 78 | -elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
| 79 | -elseif($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
| 80 | -elseif($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
| 81 | -elseif($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
| 82 | -elseif($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
| 68 | +if($modx_charset == 'euc-jp') { |
|
| 69 | + $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
| 70 | +} elseif($modx_charset == 'shift_jis') { |
|
| 71 | + $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
| 72 | +} elseif($modx_charset == 'iso-2022-jp') { |
|
| 73 | + $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
| 74 | +} elseif($modx_charset == 'csISO2022JP') { |
|
| 75 | + $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
| 76 | +} elseif($modx_charset == 'EUC-CN') { |
|
| 77 | + $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
| 78 | +} elseif($modx_charset == 'hz-gb-2312') { |
|
| 79 | + $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
| 80 | +} elseif($modx_charset == 'x-mac-chinesesimp') { |
|
| 81 | + $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
| 82 | +} elseif($modx_charset == 'x-Chinese-CNS') { |
|
| 83 | + $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
| 84 | +} elseif($modx_charset == 'x-Chinese-Eten') { |
|
| 85 | + $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
| 86 | +} elseif($modx_charset == 'x-mac-chinesetrad') { |
|
| 87 | + $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
| 88 | +} elseif($modx_charset == 'ks_c_5601-1987') { |
|
| 89 | + $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
| 90 | +} elseif($modx_charset == 'euc-kr') { |
|
| 91 | + $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
| 92 | +} elseif($modx_charset == 'iso-2022-kr') { |
|
| 93 | + $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
| 94 | +} elseif($modx_charset == 'Johab') { |
|
| 95 | + $_['Johab'] = 'Korean (Johab) - Johab'; |
|
| 96 | +} elseif($modx_charset == 'x-mac-korean') { |
|
| 97 | + $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
| 98 | +} |
|
| 83 | 99 | |
| 84 | 100 | $tpl = '<option value="%s" %s>%s</option>'; |
| 85 | 101 | $options = array(); |
@@ -65,26 +65,26 @@ |
||
| 65 | 65 | $_['macintosh'] = 'Western European (Mac) - macintosh'; |
| 66 | 66 | $_['Windows-1252'] = 'Western European (Windows) - Windows-1252'; |
| 67 | 67 | |
| 68 | -if($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
| 69 | -elseif($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
| 70 | -elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
| 71 | -elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
| 72 | -elseif($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
| 73 | -elseif($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
| 74 | -elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
| 75 | -elseif($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
| 76 | -elseif($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
| 77 | -elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
| 78 | -elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
| 79 | -elseif($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
| 80 | -elseif($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
| 81 | -elseif($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
| 82 | -elseif($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
| 68 | +if ($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
| 69 | +elseif ($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
| 70 | +elseif ($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
| 71 | +elseif ($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
| 72 | +elseif ($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
| 73 | +elseif ($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
| 74 | +elseif ($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
| 75 | +elseif ($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
| 76 | +elseif ($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
| 77 | +elseif ($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
| 78 | +elseif ($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
| 79 | +elseif ($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
| 80 | +elseif ($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
| 81 | +elseif ($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
| 82 | +elseif ($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
| 83 | 83 | |
| 84 | 84 | $tpl = '<option value="%s" %s>%s</option>'; |
| 85 | 85 | $options = array(); |
| 86 | -foreach($_ as $value=>$label) { |
|
| 87 | - $selected = $value===$modx_charset ? 'selected' : ''; |
|
| 86 | +foreach ($_ as $value=>$label) { |
|
| 87 | + $selected = $value === $modx_charset ? 'selected' : ''; |
|
| 88 | 88 | $options[] = sprintf($tpl, $value, $selected, $label); |
| 89 | 89 | } |
| 90 | 90 | echo implode("\n", $options); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $modx->setPlaceholder($rvKey, $rvValue); |
| 56 | 56 | } |
| 57 | 57 | $param = $modx->mergePlaceholderContent($param); |
| 58 | - $rs = $modx->db->query("SELECT $param;"); |
|
| 58 | + $rs = $modx->db->query("select $param;"); |
|
| 59 | 59 | $output = $rs; |
| 60 | 60 | break; |
| 61 | 61 | |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | * |
| 164 | 164 | * @param string $param |
| 165 | 165 | * @param array $tvsArray |
| 166 | - * @return mixed |
|
| 166 | + * @return string |
|
| 167 | 167 | */ |
| 168 | 168 | function parseTvValues($param, $tvsArray) |
| 169 | 169 | { |
@@ -131,8 +131,8 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | function ProcessFile($file) { |
| 133 | 133 | // get the file |
| 134 | - $buffer = @file_get_contents($file); |
|
| 135 | - if ($buffer === false) $buffer = " Could not retrieve document '$file'."; |
|
| 134 | + $buffer = @file_get_contents($file); |
|
| 135 | + if ($buffer === false) $buffer = " Could not retrieve document '$file'."; |
|
| 136 | 136 | return $buffer; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -168,20 +168,20 @@ discard block |
||
| 168 | 168 | function parseTvValues($param, $tvsArray) |
| 169 | 169 | { |
| 170 | 170 | $modx = evolutionCMS(); |
| 171 | - $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; |
|
| 172 | - if (strpos($param, '[*') !== false) { |
|
| 173 | - $matches = $modx->getTagsFromContent($param, '[*', '*]'); |
|
| 174 | - foreach ($matches[0] as $i=>$match) { |
|
| 175 | - if(isset($tvsArray[ $matches[1][$i] ])) { |
|
| 176 | - if(is_array($tvsArray[ $matches[1][$i] ])) { |
|
| 177 | - $value = $tvsArray[$matches[1][$i]]['value']; |
|
| 178 | - $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; |
|
| 179 | - } else { |
|
| 180 | - $value = $tvsArray[ $matches[1][$i] ]; |
|
| 181 | - } |
|
| 182 | - $param = str_replace($match, $value, $param); |
|
| 183 | - } |
|
| 184 | - } |
|
| 185 | - } |
|
| 186 | - return $param; |
|
| 171 | + $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; |
|
| 172 | + if (strpos($param, '[*') !== false) { |
|
| 173 | + $matches = $modx->getTagsFromContent($param, '[*', '*]'); |
|
| 174 | + foreach ($matches[0] as $i=>$match) { |
|
| 175 | + if(isset($tvsArray[ $matches[1][$i] ])) { |
|
| 176 | + if(is_array($tvsArray[ $matches[1][$i] ])) { |
|
| 177 | + $value = $tvsArray[$matches[1][$i]]['value']; |
|
| 178 | + $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; |
|
| 179 | + } else { |
|
| 180 | + $value = $tvsArray[ $matches[1][$i] ]; |
|
| 181 | + } |
|
| 182 | + $param = str_replace($match, $value, $param); |
|
| 183 | + } |
|
| 184 | + } |
|
| 185 | + } |
|
| 186 | + return $param; |
|
| 187 | 187 | } |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | * Created by Raymond Irving Feb, 2005 |
| 5 | 5 | */ |
| 6 | 6 | global $BINDINGS; // Array of supported bindings. must be upper case |
| 7 | -$BINDINGS = array ( |
|
| 7 | +$BINDINGS = array( |
|
| 8 | 8 | 'FILE', |
| 9 | 9 | 'CHUNK', |
| 10 | 10 | 'DOCUMENT', |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | * @param array $tvsArray |
| 23 | 23 | * @return string |
| 24 | 24 | */ |
| 25 | -function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) { |
|
| 25 | +function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array()){ |
|
| 26 | 26 | $modx = evolutionCMS(); |
| 27 | - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
|
| 27 | + $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier; |
|
| 28 | 28 | $nvalue = trim($value); |
| 29 | 29 | if (substr($nvalue, 0, 1) != '@') |
| 30 | 30 | return $value; |
| 31 | - elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { |
|
| 31 | + elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings'] != 1 && $src === 'docform') { |
|
| 32 | 32 | return '@Bindings is disabled.'; |
| 33 | 33 | } |
| 34 | 34 | else { |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | break; |
| 55 | 55 | |
| 56 | 56 | case "SELECT" : // selects a record from the cms database |
| 57 | - $rt = array (); |
|
| 58 | - $replacementVars = array ( |
|
| 57 | + $rt = array(); |
|
| 58 | + $replacementVars = array( |
|
| 59 | 59 | 'DBASE' => $modx->db->config['dbase'], |
| 60 | 60 | 'PREFIX' => $modx->db->config['table_prefix'] |
| 61 | 61 | ); |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | break; |
| 97 | 97 | |
| 98 | 98 | case 'DIRECTORY' : |
| 99 | - $files = array (); |
|
| 100 | - $path = $modx->config['base_path'] . $param; |
|
| 99 | + $files = array(); |
|
| 100 | + $path = $modx->config['base_path'].$param; |
|
| 101 | 101 | if (substr($path, -1, 1) != '/') { |
| 102 | 102 | $path .= '/'; |
| 103 | 103 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * @param $file |
| 130 | 130 | * @return string |
| 131 | 131 | */ |
| 132 | -function ProcessFile($file) { |
|
| 132 | +function ProcessFile($file){ |
|
| 133 | 133 | // get the file |
| 134 | 134 | $buffer = @file_get_contents($file); |
| 135 | 135 | if ($buffer === false) $buffer = " Could not retrieve document '$file'."; |
@@ -146,12 +146,12 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | global $BINDINGS; |
| 148 | 148 | $binding_array = array(); |
| 149 | - foreach($BINDINGS as $cmd) |
|
| 149 | + foreach ($BINDINGS as $cmd) |
|
| 150 | 150 | { |
| 151 | - if(strpos($binding_string,'@'.$cmd)===0) |
|
| 151 | + if (strpos($binding_string, '@'.$cmd) === 0) |
|
| 152 | 152 | { |
| 153 | - $code = substr($binding_string,strlen($cmd)+1); |
|
| 154 | - $binding_array = array($cmd,trim($code)); |
|
| 153 | + $code = substr($binding_string, strlen($cmd) + 1); |
|
| 154 | + $binding_array = array($cmd, trim($code)); |
|
| 155 | 155 | break; |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -172,12 +172,12 @@ discard block |
||
| 172 | 172 | if (strpos($param, '[*') !== false) { |
| 173 | 173 | $matches = $modx->getTagsFromContent($param, '[*', '*]'); |
| 174 | 174 | foreach ($matches[0] as $i=>$match) { |
| 175 | - if(isset($tvsArray[ $matches[1][$i] ])) { |
|
| 176 | - if(is_array($tvsArray[ $matches[1][$i] ])) { |
|
| 175 | + if (isset($tvsArray[$matches[1][$i]])) { |
|
| 176 | + if (is_array($tvsArray[$matches[1][$i]])) { |
|
| 177 | 177 | $value = $tvsArray[$matches[1][$i]]['value']; |
| 178 | 178 | $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; |
| 179 | 179 | } else { |
| 180 | - $value = $tvsArray[ $matches[1][$i] ]; |
|
| 180 | + $value = $tvsArray[$matches[1][$i]]; |
|
| 181 | 181 | } |
| 182 | 182 | $param = str_replace($match, $value, $param); |
| 183 | 183 | } |
@@ -22,16 +22,16 @@ discard block |
||
| 22 | 22 | * @param array $tvsArray |
| 23 | 23 | * @return string |
| 24 | 24 | */ |
| 25 | -function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) { |
|
| 25 | +function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) |
|
| 26 | +{ |
|
| 26 | 27 | $modx = evolutionCMS(); |
| 27 | 28 | $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
| 28 | 29 | $nvalue = trim($value); |
| 29 | - if (substr($nvalue, 0, 1) != '@') |
|
| 30 | - return $value; |
|
| 31 | - elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { |
|
| 30 | + if (substr($nvalue, 0, 1) != '@') { |
|
| 31 | + return $value; |
|
| 32 | + } elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { |
|
| 32 | 33 | return '@Bindings is disabled.'; |
| 33 | - } |
|
| 34 | - else { |
|
| 34 | + } else { |
|
| 35 | 35 | list ($cmd, $param) = ParseCommand($nvalue); |
| 36 | 36 | $cmd = trim($cmd); |
| 37 | 37 | $param = parseTvValues($param, $tvsArray); |
@@ -47,10 +47,11 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | case "DOCUMENT" : // retrieve a document and process it's content |
| 49 | 49 | $rs = $modx->getDocument($param); |
| 50 | - if (is_array($rs)) |
|
| 51 | - $output = $rs['content']; |
|
| 52 | - else |
|
| 53 | - $output = "Unable to locate document $param"; |
|
| 50 | + if (is_array($rs)) { |
|
| 51 | + $output = $rs['content']; |
|
| 52 | + } else { |
|
| 53 | + $output = "Unable to locate document $param"; |
|
| 54 | + } |
|
| 54 | 55 | break; |
| 55 | 56 | |
| 56 | 57 | case "SELECT" : // selects a record from the cms database |
@@ -80,8 +81,10 @@ discard block |
||
| 80 | 81 | |
| 81 | 82 | // Grab document regardless of publish status |
| 82 | 83 | $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published'); |
| 83 | - if ($doc['parent'] != 0 && !$doc['published']) |
|
| 84 | - continue; // hide unpublished docs if we're not at the top |
|
| 84 | + if ($doc['parent'] != 0 && !$doc['published']) { |
|
| 85 | + continue; |
|
| 86 | + } |
|
| 87 | + // hide unpublished docs if we're not at the top |
|
| 85 | 88 | |
| 86 | 89 | $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published']); |
| 87 | 90 | |
@@ -129,10 +132,13 @@ discard block |
||
| 129 | 132 | * @param $file |
| 130 | 133 | * @return string |
| 131 | 134 | */ |
| 132 | -function ProcessFile($file) { |
|
| 135 | +function ProcessFile($file) |
|
| 136 | +{ |
|
| 133 | 137 | // get the file |
| 134 | 138 | $buffer = @file_get_contents($file); |
| 135 | - if ($buffer === false) $buffer = " Could not retrieve document '$file'."; |
|
| 139 | + if ($buffer === false) { |
|
| 140 | + $buffer = " Could not retrieve document '$file'."; |
|
| 141 | + } |
|
| 136 | 142 | return $buffer; |
| 137 | 143 | } |
| 138 | 144 | |
@@ -146,10 +152,8 @@ discard block |
||
| 146 | 152 | { |
| 147 | 153 | global $BINDINGS; |
| 148 | 154 | $binding_array = array(); |
| 149 | - foreach($BINDINGS as $cmd) |
|
| 150 | - { |
|
| 151 | - if(strpos($binding_string,'@'.$cmd)===0) |
|
| 152 | - { |
|
| 155 | + foreach($BINDINGS as $cmd) { |
|
| 156 | + if(strpos($binding_string,'@'.$cmd)===0) { |
|
| 153 | 157 | $code = substr($binding_string,strlen($cmd)+1); |
| 154 | 158 | $binding_array = array($cmd,trim($code)); |
| 155 | 159 | break; |
@@ -1,30 +1,30 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | - /** |
|
| 4 | - * System Alert Message Queue Display file |
|
| 5 | - * Written By Raymond Irving, April, 2005 |
|
| 6 | - * |
|
| 7 | - * Used to display system alert messages inside the browser |
|
| 8 | - * |
|
| 9 | - */ |
|
| 3 | + /** |
|
| 4 | + * System Alert Message Queue Display file |
|
| 5 | + * Written By Raymond Irving, April, 2005 |
|
| 6 | + * |
|
| 7 | + * Used to display system alert messages inside the browser |
|
| 8 | + * |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | - require_once(dirname(__FILE__).'/protect.inc.php'); |
|
| 11 | + require_once(dirname(__FILE__).'/protect.inc.php'); |
|
| 12 | 12 | |
| 13 | - $sysMsgs = ""; |
|
| 14 | - $limit = count($SystemAlertMsgQueque); |
|
| 15 | - for($i=0;$i<$limit;$i++) { |
|
| 16 | - $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>"; |
|
| 17 | - } |
|
| 18 | - // reset message queque |
|
| 19 | - unset($_SESSION['SystemAlertMsgQueque']); |
|
| 20 | - $_SESSION['SystemAlertMsgQueque'] = array(); |
|
| 21 | - $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
|
| 13 | + $sysMsgs = ""; |
|
| 14 | + $limit = count($SystemAlertMsgQueque); |
|
| 15 | + for($i=0;$i<$limit;$i++) { |
|
| 16 | + $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>"; |
|
| 17 | + } |
|
| 18 | + // reset message queque |
|
| 19 | + unset($_SESSION['SystemAlertMsgQueque']); |
|
| 20 | + $_SESSION['SystemAlertMsgQueque'] = array(); |
|
| 21 | + $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
|
| 22 | 22 | |
| 23 | - if($sysMsgs!="") { |
|
| 23 | + if($sysMsgs!="") { |
|
| 24 | 24 | ?> |
| 25 | 25 | |
| 26 | 26 | <?php // fetch the styles |
| 27 | - echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />'; |
|
| 27 | + echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />'; |
|
| 28 | 28 | ?> |
| 29 | 29 | <script type="text/javascript"> |
| 30 | 30 | // <![CDATA[ |
@@ -42,5 +42,5 @@ discard block |
||
| 42 | 42 | // ]]> |
| 43 | 43 | </script> |
| 44 | 44 | <?php |
| 45 | - } |
|
| 45 | + } |
|
| 46 | 46 | ?> |
| 47 | 47 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | $sysMsgs = ""; |
| 14 | 14 | $limit = count($SystemAlertMsgQueque); |
| 15 | - for($i=0;$i<$limit;$i++) { |
|
| 15 | + for ($i = 0; $i < $limit; $i++) { |
|
| 16 | 16 | $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>"; |
| 17 | 17 | } |
| 18 | 18 | // reset message queque |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $_SESSION['SystemAlertMsgQueque'] = array(); |
| 21 | 21 | $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
| 22 | 22 | |
| 23 | - if($sysMsgs!="") { |
|
| 23 | + if ($sysMsgs != "") { |
|
| 24 | 24 | ?> |
| 25 | 25 | |
| 26 | 26 | <?php // fetch the styles |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | var sysAlert = new Element('div').setProperties({ |
| 33 | 33 | 'class': 'sysAlert' |
| 34 | 34 | }); |
| 35 | - sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs);?>'; |
|
| 35 | + sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs); ?>'; |
|
| 36 | 36 | var boxHtml = new MooPrompt('<?php echo $_lang['sys_alert']; ?>', sysAlert, { |
| 37 | 37 | buttons: 1, |
| 38 | 38 | button1: 'Ok', |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | } |
| 89 | 89 | </script> |
| 90 | 90 | |
| 91 | -JS; |
|
| 91 | +js; |
|
| 92 | 92 | $modx->regClientScript($script); |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -5,14 +5,14 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | // PROCESSOR FIRST |
| 7 | 7 | if($_SESSION['mgrRole'] == 1) { |
| 8 | - if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) { |
|
| 9 | - $current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']); |
|
| 10 | - if(!empty($current)) { |
|
| 11 | - $modx->manager->setSystemChecksum($current); |
|
| 12 | - $modx->clearCache('full'); |
|
| 13 | - $modx->config['sys_files_checksum'] = $current; |
|
| 14 | - }; |
|
| 15 | - } |
|
| 8 | + if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) { |
|
| 9 | + $current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']); |
|
| 10 | + if(!empty($current)) { |
|
| 11 | + $modx->manager->setSystemChecksum($current); |
|
| 12 | + $modx->clearCache('full'); |
|
| 13 | + $modx->config['sys_files_checksum'] = $current; |
|
| 14 | + }; |
|
| 15 | + } |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | // NOW CHECK CONFIG |
@@ -20,15 +20,15 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | $sysfiles_check = $modx->manager->checkSystemChecksum(); |
| 22 | 22 | if ($sysfiles_check!=='0'){ |
| 23 | - $warningspresent = 1; |
|
| 24 | - $warnings[] = array($_lang['configcheck_sysfiles_mod']); |
|
| 23 | + $warningspresent = 1; |
|
| 24 | + $warnings[] = array($_lang['configcheck_sysfiles_mod']); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | if (is_writable("includes/config.inc.php")){ |
| 28 | 28 | // Warn if world writable |
| 29 | 29 | if(@fileperms('includes/config.inc.php') & 0x0002) { |
| 30 | - $warningspresent = 1; |
|
| 31 | - $warnings[] = array($_lang['configcheck_configinc']); |
|
| 30 | + $warningspresent = 1; |
|
| 31 | + $warnings[] = array($_lang['configcheck_configinc']); |
|
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | |
@@ -179,10 +179,10 @@ discard block |
||
| 179 | 179 | break; |
| 180 | 180 | case $_lang['configcheck_sysfiles_mod']: |
| 181 | 181 | $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"]; |
| 182 | - $warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>'; |
|
| 183 | - if($modx->hasPermission('settings')) { |
|
| 184 | - $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>'; |
|
| 185 | - } |
|
| 182 | + $warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>'; |
|
| 183 | + if($modx->hasPermission('settings')) { |
|
| 184 | + $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>'; |
|
| 185 | + } |
|
| 186 | 186 | if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']); |
| 187 | 187 | break; |
| 188 | 188 | case $_lang['configcheck_lang_difference'] : |
@@ -1,13 +1,13 @@ discard block |
||
| 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 | // PROCESSOR FIRST |
| 7 | -if($_SESSION['mgrRole'] == 1) { |
|
| 8 | - if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) { |
|
| 7 | +if ($_SESSION['mgrRole'] == 1) { |
|
| 8 | + if ($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) { |
|
| 9 | 9 | $current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']); |
| 10 | - if(!empty($current)) { |
|
| 10 | + if (!empty($current)) { |
|
| 11 | 11 | $modx->manager->setSystemChecksum($current); |
| 12 | 12 | $modx->clearCache('full'); |
| 13 | 13 | $modx->config['sys_files_checksum'] = $current; |
@@ -19,14 +19,14 @@ discard block |
||
| 19 | 19 | $warningspresent = 0; |
| 20 | 20 | |
| 21 | 21 | $sysfiles_check = $modx->manager->checkSystemChecksum(); |
| 22 | -if ($sysfiles_check!=='0'){ |
|
| 22 | +if ($sysfiles_check !== '0') { |
|
| 23 | 23 | $warningspresent = 1; |
| 24 | 24 | $warnings[] = array($_lang['configcheck_sysfiles_mod']); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | -if (is_writable("includes/config.inc.php")){ |
|
| 27 | +if (is_writable("includes/config.inc.php")) { |
|
| 28 | 28 | // Warn if world writable |
| 29 | - if(@fileperms('includes/config.inc.php') & 0x0002) { |
|
| 29 | + if (@fileperms('includes/config.inc.php') & 0x0002) { |
|
| 30 | 30 | $warningspresent = 1; |
| 31 | 31 | $warnings[] = array($_lang['configcheck_configinc']); |
| 32 | 32 | } |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | $warnings[] = array($_lang['configcheck_php_gdzip']); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | -if(!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') { |
|
| 46 | - if(isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') { |
|
| 45 | +if (!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') { |
|
| 46 | + if (isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') { |
|
| 47 | 47 | if ($modx->db->getValue($modx->db->select('COUNT(setting_value)', $modx->getFullTableName('system_settings'), "setting_name='validate_referer' AND setting_value='0'"))) { |
| 48 | 48 | $warningspresent = 1; |
| 49 | 49 | $warnings[] = array($_lang['configcheck_validate_referer']); |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // check for Template Switcher plugin |
| 55 | -if(!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') { |
|
| 56 | - if(isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') { |
|
| 55 | +if (!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') { |
|
| 56 | + if (isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') { |
|
| 57 | 57 | $rs = $modx->db->select('name, disabled', $modx->getFullTableName('site_plugins'), "name IN ('TemplateSwitcher', 'Template Switcher', 'templateswitcher', 'template_switcher', 'template switcher') OR plugincode LIKE '%TemplateSwitcher%'"); |
| 58 | 58 | $row = $modx->db->getRow($rs); |
| 59 | - if($row && $row['disabled'] == 0) { |
|
| 59 | + if ($row && $row['disabled'] == 0) { |
|
| 60 | 60 | $warningspresent = 1; |
| 61 | 61 | $warnings[] = array($_lang['configcheck_templateswitcher_present']); |
| 62 | 62 | $tplName = $row['name']; |
@@ -120,36 +120,36 @@ discard block |
||
| 120 | 120 | /** |
| 121 | 121 | * @return bool |
| 122 | 122 | */ |
| 123 | - function checkSiteCache() { |
|
| 123 | + function checkSiteCache(){ |
|
| 124 | 124 | $modx = evolutionCMS(); |
| 125 | - $checked= true; |
|
| 126 | - if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) { |
|
| 127 | - $checked= @include_once ($modx->config['base_path'] . 'assets/cache/siteCache.idx.php'); |
|
| 125 | + $checked = true; |
|
| 126 | + if (file_exists($modx->config['base_path'].'assets/cache/siteCache.idx.php')) { |
|
| 127 | + $checked = @include_once ($modx->config['base_path'].'assets/cache/siteCache.idx.php'); |
|
| 128 | 128 | } |
| 129 | 129 | return $checked; |
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | -if (!is_writable(MODX_BASE_PATH . "assets/cache/")) { |
|
| 133 | +if (!is_writable(MODX_BASE_PATH."assets/cache/")) { |
|
| 134 | 134 | $warningspresent = 1; |
| 135 | 135 | $warnings[] = array($_lang['configcheck_cache']); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if (!checkSiteCache()) { |
| 139 | 139 | $warningspresent = 1; |
| 140 | - $warnings[]= array($lang['configcheck_sitecache_integrity']); |
|
| 140 | + $warnings[] = array($lang['configcheck_sitecache_integrity']); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | -if (!is_writable(MODX_BASE_PATH . "assets/images/")) { |
|
| 143 | +if (!is_writable(MODX_BASE_PATH."assets/images/")) { |
|
| 144 | 144 | $warningspresent = 1; |
| 145 | 145 | $warnings[] = array($_lang['configcheck_images']); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | -if(strpos($modx->config['rb_base_dir'],MODX_BASE_PATH)!==0) { |
|
| 148 | +if (strpos($modx->config['rb_base_dir'], MODX_BASE_PATH) !== 0) { |
|
| 149 | 149 | $warningspresent = 1; |
| 150 | 150 | $warnings[] = array($_lang['configcheck_rb_base_dir']); |
| 151 | 151 | } |
| 152 | -if(strpos($modx->config['filemanager_path'],MODX_BASE_PATH)!==0) { |
|
| 152 | +if (strpos($modx->config['filemanager_path'], MODX_BASE_PATH) !== 0) { |
|
| 153 | 153 | $warningspresent = 1; |
| 154 | 154 | $warnings[] = array($_lang['configcheck_filemanager_path']); |
| 155 | 155 | } |
@@ -157,36 +157,36 @@ discard block |
||
| 157 | 157 | // clear file info cache |
| 158 | 158 | clearstatcache(); |
| 159 | 159 | |
| 160 | -if ($warningspresent==1) { |
|
| 160 | +if ($warningspresent == 1) { |
|
| 161 | 161 | |
| 162 | -if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3'; |
|
| 162 | +if (!isset($modx->config['send_errormail'])) $modx->config['send_errormail'] = '3'; |
|
| 163 | 163 | $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>"; |
| 164 | 164 | |
| 165 | -for ($i=0;$i<count($warnings);$i++) { |
|
| 165 | +for ($i = 0; $i < count($warnings); $i++) { |
|
| 166 | 166 | switch ($warnings[$i][0]) { |
| 167 | 167 | case $_lang['configcheck_configinc']; |
| 168 | 168 | $warnings[$i][1] = $_lang['configcheck_configinc_msg']; |
| 169 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']); |
|
| 169 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_configinc']); |
|
| 170 | 170 | break; |
| 171 | 171 | case $_lang['configcheck_installer'] : |
| 172 | 172 | $warnings[$i][1] = $_lang['configcheck_installer_msg']; |
| 173 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']); |
|
| 173 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_installer']); |
|
| 174 | 174 | break; |
| 175 | 175 | case $_lang['configcheck_cache'] : |
| 176 | 176 | $warnings[$i][1] = $_lang['configcheck_cache_msg']; |
| 177 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']); |
|
| 177 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_cache']); |
|
| 178 | 178 | break; |
| 179 | 179 | case $_lang['configcheck_images'] : |
| 180 | 180 | $warnings[$i][1] = $_lang['configcheck_images_msg']; |
| 181 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']); |
|
| 181 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_images']); |
|
| 182 | 182 | break; |
| 183 | 183 | case $_lang['configcheck_sysfiles_mod']: |
| 184 | 184 | $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"]; |
| 185 | - $warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>'; |
|
| 186 | - if($modx->hasPermission('settings')) { |
|
| 187 | - $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>'; |
|
| 185 | + $warnings[$i][2] = '<ul><li>'.implode('</li><li>', $sysfiles_check).'</li></ul>'; |
|
| 186 | + if ($modx->hasPermission('settings')) { |
|
| 187 | + $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\''.$_lang["reset_sysfiles_checksum_alert"].'\')">'.$_lang["reset_sysfiles_checksum_button"].'</a></li></ul>'; |
|
| 188 | 188 | } |
| 189 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']); |
|
| 189 | + if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1]." ".implode(', ', $sysfiles_check), $_lang['configcheck_sysfiles_mod']); |
|
| 190 | 190 | break; |
| 191 | 191 | case $_lang['configcheck_lang_difference'] : |
| 192 | 192 | $warnings[$i][1] = $_lang['configcheck_lang_difference_msg']; |
@@ -208,18 +208,18 @@ discard block |
||
| 208 | 208 | break; |
| 209 | 209 | case $_lang['configcheck_validate_referer'] : |
| 210 | 210 | $msg = $_lang['configcheck_validate_referer_msg']; |
| 211 | - $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'validate_referer'); |
|
| 211 | + $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'validate_referer'); |
|
| 212 | 212 | $warnings[$i][1] = "<span id=\"validate_referer_warning_wrapper\">{$msg}</span>\n"; |
| 213 | 213 | break; |
| 214 | 214 | case $_lang['configcheck_templateswitcher_present'] : |
| 215 | 215 | $msg = $_lang["configcheck_templateswitcher_present_msg"]; |
| 216 | - if(isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') { |
|
| 217 | - $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_disable"]; |
|
| 216 | + if (isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') { |
|
| 217 | + $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_disable"]; |
|
| 218 | 218 | } |
| 219 | - if(isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') { |
|
| 220 | - $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_delete"]; |
|
| 219 | + if (isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') { |
|
| 220 | + $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_delete"]; |
|
| 221 | 221 | } |
| 222 | - $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present'); |
|
| 222 | + $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present'); |
|
| 223 | 223 | $warnings[$i][1] = "<span id=\"templateswitcher_present_warning_wrapper\">{$msg}</span>\n"; |
| 224 | 224 | break; |
| 225 | 225 | case $_lang['configcheck_rb_base_dir'] : |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $warnings[$i][1] = $_lang['configcheck_default_msg']; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | - $admin_warning = $_SESSION['mgrRole']!=1 ? $_lang['configcheck_admin'] : "" ; |
|
| 235 | + $admin_warning = $_SESSION['mgrRole'] != 1 ? $_lang['configcheck_admin'] : ""; |
|
| 236 | 236 | $config_check_results .= " |
| 237 | 237 | <fieldset> |
| 238 | 238 | <p><strong>".$_lang['configcheck_warning']."</strong> '".$warnings[$i][0]."'</p> |
@@ -241,11 +241,11 @@ discard block |
||
| 241 | 241 | ".(isset($warnings[$i][2]) ? '<div style="padding-left:1em">'.$warnings[$i][2].'</div>' : '')." |
| 242 | 242 | </fieldset> |
| 243 | 243 | "; |
| 244 | - if ($i!=count($warnings)-1) { |
|
| 244 | + if ($i != count($warnings) - 1) { |
|
| 245 | 245 | $config_check_results .= "<br />"; |
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | - $_SESSION["mgrConfigCheck"]=true; |
|
| 248 | + $_SESSION["mgrConfigCheck"] = true; |
|
| 249 | 249 | } else { |
| 250 | 250 | $config_check_results = $_lang['configcheck_ok']; |
| 251 | 251 | } |
@@ -19,12 +19,12 @@ discard block |
||
| 19 | 19 | $warningspresent = 0; |
| 20 | 20 | |
| 21 | 21 | $sysfiles_check = $modx->manager->checkSystemChecksum(); |
| 22 | -if ($sysfiles_check!=='0'){ |
|
| 22 | +if ($sysfiles_check!=='0') { |
|
| 23 | 23 | $warningspresent = 1; |
| 24 | 24 | $warnings[] = array($_lang['configcheck_sysfiles_mod']); |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | -if (is_writable("includes/config.inc.php")){ |
|
| 27 | +if (is_writable("includes/config.inc.php")) { |
|
| 28 | 28 | // Warn if world writable |
| 29 | 29 | if(@fileperms('includes/config.inc.php') & 0x0002) { |
| 30 | 30 | $warningspresent = 1; |
@@ -120,7 +120,8 @@ discard block |
||
| 120 | 120 | /** |
| 121 | 121 | * @return bool |
| 122 | 122 | */ |
| 123 | - function checkSiteCache() { |
|
| 123 | + function checkSiteCache() |
|
| 124 | + { |
|
| 124 | 125 | $modx = evolutionCMS(); |
| 125 | 126 | $checked= true; |
| 126 | 127 | if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) { |
@@ -159,26 +160,36 @@ discard block |
||
| 159 | 160 | |
| 160 | 161 | if ($warningspresent==1) { |
| 161 | 162 | |
| 162 | -if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3'; |
|
| 163 | +if(!isset($modx->config['send_errormail'])) { |
|
| 164 | + $modx->config['send_errormail']='3'; |
|
| 165 | +} |
|
| 163 | 166 | $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>"; |
| 164 | 167 | |
| 165 | 168 | for ($i=0;$i<count($warnings);$i++) { |
| 166 | 169 | switch ($warnings[$i][0]) { |
| 167 | 170 | case $_lang['configcheck_configinc']; |
| 168 | 171 | $warnings[$i][1] = $_lang['configcheck_configinc_msg']; |
| 169 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']); |
|
| 172 | + if(!$_SESSION["mgrConfigCheck"]) { |
|
| 173 | + $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']); |
|
| 174 | + } |
|
| 170 | 175 | break; |
| 171 | 176 | case $_lang['configcheck_installer'] : |
| 172 | 177 | $warnings[$i][1] = $_lang['configcheck_installer_msg']; |
| 173 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']); |
|
| 178 | + if(!$_SESSION["mgrConfigCheck"]) { |
|
| 179 | + $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']); |
|
| 180 | + } |
|
| 174 | 181 | break; |
| 175 | 182 | case $_lang['configcheck_cache'] : |
| 176 | 183 | $warnings[$i][1] = $_lang['configcheck_cache_msg']; |
| 177 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']); |
|
| 184 | + if(!$_SESSION["mgrConfigCheck"]) { |
|
| 185 | + $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']); |
|
| 186 | + } |
|
| 178 | 187 | break; |
| 179 | 188 | case $_lang['configcheck_images'] : |
| 180 | 189 | $warnings[$i][1] = $_lang['configcheck_images_msg']; |
| 181 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']); |
|
| 190 | + if(!$_SESSION["mgrConfigCheck"]) { |
|
| 191 | + $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']); |
|
| 192 | + } |
|
| 182 | 193 | break; |
| 183 | 194 | case $_lang['configcheck_sysfiles_mod']: |
| 184 | 195 | $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"]; |
@@ -186,7 +197,9 @@ discard block |
||
| 186 | 197 | if($modx->hasPermission('settings')) { |
| 187 | 198 | $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>'; |
| 188 | 199 | } |
| 189 | - if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']); |
|
| 200 | + if(!$_SESSION["mgrConfigCheck"]) { |
|
| 201 | + $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']); |
|
| 202 | + } |
|
| 190 | 203 | break; |
| 191 | 204 | case $_lang['configcheck_lang_difference'] : |
| 192 | 205 | $warnings[$i][1] = $_lang['configcheck_lang_difference_msg']; |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | |
| 4 | 4 | // show debug information |
| 5 | 5 | if(isset($enable_debug) && $enable_debug==true) { |
| 6 | - ?> |
|
| 6 | + ?> |
|
| 7 | 7 | <script language="javascript"> |
| 8 | 8 | //document.onload = removeDebug(); |
| 9 | 9 | |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | </style> |
| 35 | 35 | <?php |
| 36 | - $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); |
|
| 37 | - ?> |
|
| 36 | + $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); |
|
| 37 | + ?> |
|
| 38 | 38 | <div class='debug' id='debug' name='debug' onClick="removeDebugDiv();"> |
| 39 | 39 | <table border="0" cellspacing="0" cellpadding="0"> |
| 40 | 40 | <tr> |
@@ -1,10 +1,10 @@ discard block |
||
| 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(); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | </style> |
| 37 | 37 | <?php |
| 38 | - $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); |
|
| 38 | + $mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart); |
|
| 39 | 39 | ?> |
| 40 | 40 | <div class='debug' id='debug' name='debug' onClick="removeDebugDiv();"> |
| 41 | 41 | <table border="0" cellspacing="0" cellpadding="0"> |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | </tr> |
| 45 | 45 | <tr> |
| 46 | 46 | <td width="70">Time taken</td> |
| 47 | - <td width="80"><?php echo printf ("%6.5f s", $totaltime); ?></td> |
|
| 47 | + <td width="80"><?php echo printf("%6.5f s", $totaltime); ?></td> |
|
| 48 | 48 | </tr> |
| 49 | 49 | </table> |
| 50 | 50 | </div> |
@@ -69,4 +69,4 @@ |
||
| 69 | 69 | cm.style.visibility = 'hidden'; |
| 70 | 70 | } |
| 71 | 71 | </script> |
| 72 | -BLOCK; |
|
| 72 | +block; |
|
@@ -4,71 +4,71 @@ |
||
| 4 | 4 | $ContextMenuCnt = 0; |
| 5 | 5 | |
| 6 | 6 | class ContextMenu { |
| 7 | - public $id; |
|
| 7 | + public $id; |
|
| 8 | 8 | /** |
| 9 | 9 | * @var string |
| 10 | 10 | */ |
| 11 | - public $html = ''; |
|
| 11 | + public $html = ''; |
|
| 12 | 12 | /** |
| 13 | 13 | * @var bool |
| 14 | 14 | */ |
| 15 | - public $visible = false; |
|
| 15 | + public $visible = false; |
|
| 16 | 16 | /** |
| 17 | 17 | * @var int |
| 18 | 18 | */ |
| 19 | - public $width = 120; |
|
| 19 | + public $width = 120; |
|
| 20 | 20 | |
| 21 | 21 | public function __construct($id = '', $width = 120, $visible = false) { |
| 22 | - global $ContextMenuCnt; |
|
| 23 | - $ContextMenuCnt++; |
|
| 24 | - $this->html = ""; |
|
| 25 | - $this->visible = $visible ? $visible : false; |
|
| 26 | - $this->width = is_numeric($width) ? (int)$width : 120; |
|
| 27 | - $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id |
|
| 28 | - } |
|
| 22 | + global $ContextMenuCnt; |
|
| 23 | + $ContextMenuCnt++; |
|
| 24 | + $this->html = ""; |
|
| 25 | + $this->visible = $visible ? $visible : false; |
|
| 26 | + $this->width = is_numeric($width) ? (int)$width : 120; |
|
| 27 | + $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id |
|
| 28 | + } |
|
| 29 | 29 | |
| 30 | 30 | public function addItem($text, $action = "", $img = "", $disabled = 0) { |
| 31 | - global $base_url, $_style; |
|
| 31 | + global $base_url, $_style; |
|
| 32 | 32 | if($disabled) { |
| 33 | 33 | return; |
| 34 | 34 | } |
| 35 | - if(!$img) { |
|
| 36 | - $img = $base_url . $_style['tx']; |
|
| 37 | - } |
|
| 38 | - if(substr($action, 0, 3) == "js:") { |
|
| 39 | - $action = substr($action, 3); |
|
| 40 | - } else if(substr($action, 0, 3) == "hl:") { |
|
| 41 | - $action = "window.location.href='" . substr($action, 3) . "'"; |
|
| 42 | - } else { |
|
| 43 | - $action = "window.location.href='" . $action . "'"; |
|
| 44 | - } |
|
| 45 | - $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\""; |
|
| 46 | - $this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>"; |
|
| 35 | + if(!$img) { |
|
| 36 | + $img = $base_url . $_style['tx']; |
|
| 37 | + } |
|
| 38 | + if(substr($action, 0, 3) == "js:") { |
|
| 39 | + $action = substr($action, 3); |
|
| 40 | + } else if(substr($action, 0, 3) == "hl:") { |
|
| 41 | + $action = "window.location.href='" . substr($action, 3) . "'"; |
|
| 42 | + } else { |
|
| 43 | + $action = "window.location.href='" . $action . "'"; |
|
| 44 | + } |
|
| 45 | + $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\""; |
|
| 46 | + $this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>"; |
|
| 47 | 47 | if(substr($img, 0, 5) == 'fa fa') { |
| 48 | 48 | $img = '<i class="' . $img . '"></i>'; |
| 49 | 49 | } else if(substr($img, 0, 1) != '<') { |
| 50 | 50 | $img = '<img src="' . $img . '" />'; |
| 51 | 51 | } |
| 52 | - $this->html .= $img . ' ' . $text . '</div>'; |
|
| 53 | - } |
|
| 52 | + $this->html .= $img . ' ' . $text . '</div>'; |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | 55 | public function addSeparator() { |
| 56 | - $this->html .= " |
|
| 56 | + $this->html .= " |
|
| 57 | 57 | <div class='cntxMnuSeparator'></div> |
| 58 | 58 | "; |
| 59 | - } |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | 61 | public function render() { |
| 62 | - global $ContextMenuScript; |
|
| 62 | + global $ContextMenuScript; |
|
| 63 | 63 | |
| 64 | - $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>"; |
|
| 65 | - $ContextMenuScript = ""; // reset css |
|
| 66 | - return $html; |
|
| 67 | - } |
|
| 64 | + $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>"; |
|
| 65 | + $ContextMenuScript = ""; // reset css |
|
| 66 | + return $html; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | 69 | public function getClientScriptObject() { |
| 70 | - return "getCntxMenu('" . $this->id . "')"; |
|
| 71 | - } |
|
| 70 | + return "getCntxMenu('" . $this->id . "')"; |
|
| 71 | + } |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | $ContextMenuScript = <<<BLOCK |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | global $ContextMenuCnt; |
| 4 | 4 | $ContextMenuCnt = 0; |
| 5 | 5 | |
| 6 | -class ContextMenu { |
|
| 6 | +class ContextMenu{ |
|
| 7 | 7 | public $id; |
| 8 | 8 | /** |
| 9 | 9 | * @var string |
@@ -18,56 +18,56 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public $width = 120; |
| 20 | 20 | |
| 21 | - public function __construct($id = '', $width = 120, $visible = false) { |
|
| 21 | + public function __construct($id = '', $width = 120, $visible = false){ |
|
| 22 | 22 | global $ContextMenuCnt; |
| 23 | 23 | $ContextMenuCnt++; |
| 24 | 24 | $this->html = ""; |
| 25 | 25 | $this->visible = $visible ? $visible : false; |
| 26 | - $this->width = is_numeric($width) ? (int)$width : 120; |
|
| 27 | - $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id |
|
| 26 | + $this->width = is_numeric($width) ? (int) $width : 120; |
|
| 27 | + $this->id = $id ? $id : "cntxMnu".$ContextMenuCnt; // set id |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function addItem($text, $action = "", $img = "", $disabled = 0) { |
|
| 30 | + public function addItem($text, $action = "", $img = "", $disabled = 0){ |
|
| 31 | 31 | global $base_url, $_style; |
| 32 | - if($disabled) { |
|
| 32 | + if ($disabled) { |
|
| 33 | 33 | return; |
| 34 | 34 | } |
| 35 | - if(!$img) { |
|
| 36 | - $img = $base_url . $_style['tx']; |
|
| 35 | + if (!$img) { |
|
| 36 | + $img = $base_url.$_style['tx']; |
|
| 37 | 37 | } |
| 38 | - if(substr($action, 0, 3) == "js:") { |
|
| 38 | + if (substr($action, 0, 3) == "js:") { |
|
| 39 | 39 | $action = substr($action, 3); |
| 40 | - } else if(substr($action, 0, 3) == "hl:") { |
|
| 41 | - $action = "window.location.href='" . substr($action, 3) . "'"; |
|
| 40 | + } else if (substr($action, 0, 3) == "hl:") { |
|
| 41 | + $action = "window.location.href='".substr($action, 3)."'"; |
|
| 42 | 42 | } else { |
| 43 | - $action = "window.location.href='" . $action . "'"; |
|
| 43 | + $action = "window.location.href='".$action."'"; |
|
| 44 | 44 | } |
| 45 | - $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\""; |
|
| 46 | - $this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>"; |
|
| 47 | - if(substr($img, 0, 5) == 'fa fa') { |
|
| 48 | - $img = '<i class="' . $img . '"></i>'; |
|
| 49 | - } else if(substr($img, 0, 1) != '<') { |
|
| 50 | - $img = '<img src="' . $img . '" />'; |
|
| 45 | + $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('".$this->id."');\""; |
|
| 46 | + $this->html .= "<div class='".($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem")."' $action>"; |
|
| 47 | + if (substr($img, 0, 5) == 'fa fa') { |
|
| 48 | + $img = '<i class="'.$img.'"></i>'; |
|
| 49 | + } else if (substr($img, 0, 1) != '<') { |
|
| 50 | + $img = '<img src="'.$img.'" />'; |
|
| 51 | 51 | } |
| 52 | - $this->html .= $img . ' ' . $text . '</div>'; |
|
| 52 | + $this->html .= $img.' '.$text.'</div>'; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function addSeparator() { |
|
| 55 | + public function addSeparator(){ |
|
| 56 | 56 | $this->html .= " |
| 57 | 57 | <div class='cntxMnuSeparator'></div> |
| 58 | 58 | "; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - public function render() { |
|
| 61 | + public function render(){ |
|
| 62 | 62 | global $ContextMenuScript; |
| 63 | 63 | |
| 64 | - $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>"; |
|
| 64 | + $html = $ContextMenuScript."<div id='".$this->id."' class='contextMenu' style='width:".$this->width."px; visibility:".($this->visible ? 'visible' : 'hidden')."'>".$this->html."</div>"; |
|
| 65 | 65 | $ContextMenuScript = ""; // reset css |
| 66 | 66 | return $html; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - public function getClientScriptObject() { |
|
| 70 | - return "getCntxMenu('" . $this->id . "')"; |
|
| 69 | + public function getClientScriptObject(){ |
|
| 70 | + return "getCntxMenu('".$this->id."')"; |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
@@ -3,7 +3,8 @@ discard block |
||
| 3 | 3 | global $ContextMenuCnt; |
| 4 | 4 | $ContextMenuCnt = 0; |
| 5 | 5 | |
| 6 | -class ContextMenu { |
|
| 6 | +class ContextMenu |
|
| 7 | +{ |
|
| 7 | 8 | public $id; |
| 8 | 9 | /** |
| 9 | 10 | * @var string |
@@ -18,7 +19,8 @@ discard block |
||
| 18 | 19 | */ |
| 19 | 20 | public $width = 120; |
| 20 | 21 | |
| 21 | - public function __construct($id = '', $width = 120, $visible = false) { |
|
| 22 | + public function __construct($id = '', $width = 120, $visible = false) |
|
| 23 | + { |
|
| 22 | 24 | global $ContextMenuCnt; |
| 23 | 25 | $ContextMenuCnt++; |
| 24 | 26 | $this->html = ""; |
@@ -27,7 +29,8 @@ discard block |
||
| 27 | 29 | $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id |
| 28 | 30 | } |
| 29 | 31 | |
| 30 | - public function addItem($text, $action = "", $img = "", $disabled = 0) { |
|
| 32 | + public function addItem($text, $action = "", $img = "", $disabled = 0) |
|
| 33 | + { |
|
| 31 | 34 | global $base_url, $_style; |
| 32 | 35 | if($disabled) { |
| 33 | 36 | return; |
@@ -52,13 +55,15 @@ discard block |
||
| 52 | 55 | $this->html .= $img . ' ' . $text . '</div>'; |
| 53 | 56 | } |
| 54 | 57 | |
| 55 | - public function addSeparator() { |
|
| 58 | + public function addSeparator() |
|
| 59 | + { |
|
| 56 | 60 | $this->html .= " |
| 57 | 61 | <div class='cntxMnuSeparator'></div> |
| 58 | 62 | "; |
| 59 | 63 | } |
| 60 | 64 | |
| 61 | - public function render() { |
|
| 65 | + public function render() |
|
| 66 | + { |
|
| 62 | 67 | global $ContextMenuScript; |
| 63 | 68 | |
| 64 | 69 | $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>"; |
@@ -66,7 +71,8 @@ discard block |
||
| 66 | 71 | return $html; |
| 67 | 72 | } |
| 68 | 73 | |
| 69 | - public function getClientScriptObject() { |
|
| 74 | + public function getClientScriptObject() |
|
| 75 | + { |
|
| 70 | 76 | return "getCntxMenu('" . $this->id . "')"; |
| 71 | 77 | } |
| 72 | 78 | } |
@@ -128,10 +128,10 @@ |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | return base64_encode( |
| 131 | - 'user=' . |
|
| 132 | - $this->oauthUserEmail . |
|
| 133 | - "\001auth=Bearer " . |
|
| 134 | - $this->oauthToken . |
|
| 131 | + 'user='. |
|
| 132 | + $this->oauthUserEmail. |
|
| 133 | + "\001auth=Bearer ". |
|
| 134 | + $this->oauthToken. |
|
| 135 | 135 | "\001\001" |
| 136 | 136 | ); |
| 137 | 137 | } |