spaces, quotes extra braces

This commit is contained in:
Isaac Connor 2019-09-25 10:13:32 -04:00
parent 80710e6551
commit afd10e49d6
1 changed files with 189 additions and 191 deletions

View File

@ -196,7 +196,7 @@ function collectData() {
ajaxError('Unrecognised action or insufficient permissions'); ajaxError('Unrecognised action or insufficient permissions');
if ( !empty($entitySpec['func']) ) { if ( !empty($entitySpec['func']) ) {
$data = eval( 'return( '.$entitySpec['func']." );" ); $data = eval('return('.$entitySpec['func'].');');
} else { } else {
$data = array(); $data = array();
$postFuncs = array(); $postFuncs = array();
@ -249,10 +249,10 @@ function collectData() {
$groupSql[] = $elementData['group']; $groupSql[] = $elementData['group'];
} }
} }
} } # end foreach element
if ( count($fieldSql) ) { if ( count($fieldSql) ) {
$sql = 'select '.join( ', ', $fieldSql ).' from '.$entitySpec['table']; $sql = 'SELECT '.join(', ', $fieldSql).' FROM '.$entitySpec['table'];
if ( $joinSql ) if ( $joinSql )
$sql .= ' '.join(' ', array_unique($joinSql)); $sql .= ' '.join(' ', array_unique($joinSql));
if ( $id && !empty($entitySpec['selector']) ) { if ( $id && !empty($entitySpec['selector']) ) {
@ -335,8 +335,7 @@ if ( !isset($_REQUEST['layout']) ) {
switch( $_REQUEST['layout'] ) { switch( $_REQUEST['layout'] ) {
case 'xml NOT CURRENTLY SUPPORTED' : case 'xml NOT CURRENTLY SUPPORTED' :
{ header('Content-type: application/xml');
header("Content-type: application/xml" );
echo('<?xml version="1.0" encoding="iso-8859-1"?>'."\n"); echo('<?xml version="1.0" encoding="iso-8859-1"?>'."\n");
echo '<'.strtolower($_REQUEST['entity']).">\n"; echo '<'.strtolower($_REQUEST['entity']).">\n";
foreach ( $data as $key=>$value ) { foreach ( $data as $key=>$value ) {
@ -345,7 +344,6 @@ switch( $_REQUEST['layout'] ) {
} }
echo '</'.strtolower($_REQUEST['entity']).">\n"; echo '</'.strtolower($_REQUEST['entity']).">\n";
break; break;
}
case 'json' : case 'json' :
{ {
$response = array( strtolower(validJsStr($_REQUEST['entity'])) => $data ); $response = array( strtolower(validJsStr($_REQUEST['entity'])) => $data );
@ -355,11 +353,11 @@ switch( $_REQUEST['layout'] ) {
break; break;
} }
case 'text' : case 'text' :
{
header('Content-type: text/plain' ); header('Content-type: text/plain' );
echo join( ' ', array_values( $data ) ); echo join( ' ', array_values( $data ) );
break; break;
} default:
ZM\Error('Unsupported layout: '. $_REQUEST['layout']);
} }
function getFrameImage() { function getFrameImage() {