if (trim($attributes['NAME']) == '') {
// Numerical index
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!');
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][] = $attributes['VALUE'];
+ if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey])) {
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey] = array();
+ } // END - if
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey])] = $attributes['VALUE'];
} elseif (!empty($key)) {
// Use from $key
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - KEY! (key=' . $attributes[$key] . ')');
// Add the entry
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',ALIAS[' . gettype($attributes['ALIAS']) . ']=' . $attributes['ALIAS'] . ',FUNCTION[' . gettype($attributes['FUNCTION']) . ']=' . $attributes['FUNCTION'] . ' - FUNCTION! (VALUE=' . $attributes['VALUE'] . ')');
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $array;
+ if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) {
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array();
+ } // END - if
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array;
} elseif ((isset($attributes['CONDITION'])) && (isset($attributes['LOOK-FOR']))) {
// CONDITION/LOOK-FOR detected
// Init array
);
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',CONDITION[' . gettype($attributes['CONDITION']) . ']=' . $attributes['CONDITION'] . ',LOOK-FOR[' . gettype($attributes['LOOK-FOR']) . ']=' . $attributes['LOOK-FOR'] . ' - CONDITION! (VALUE=' . $attributes['VALUE'] . ')');
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $array;
+ if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) {
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array();
+ } // END - if
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array;
} elseif ((isset($attributes['CONDITION'])) && (isset($attributes['NAME']))) {
// CONDITION/NAME detected
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',CONDITION[' . gettype($attributes['CONDITION']) . ']=' . $attributes['CONDITION'] . ',NAME[' . gettype($attributes['NAME']) . ']=' . $attributes['NAME'] . ' - CONDITION!');
} elseif (isset($attributes['COLUMN'])) {
// COLUMN/VALUE detected
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ',COLUMN[' . gettype($attributes['COLUMN']) . ']=' . $attributes['COLUMN'] . ' - COLUMN!');
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']][] = $attributes['VALUE'];
+ if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])) {
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']] = array();
+ } // END - if
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])] = $attributes['VALUE'];
} elseif ((!isset($attributes['NAME'])) || (trim($attributes['NAME']) == '')) {
// Numerical index
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!');
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][] = $attributes['VALUE'];
+ if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) {
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array();
+ } // END - if
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $attributes['VALUE'];
} elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['NAME']])) {
// Already created
reportBug(__FUNCTION__, __LINE__, 'NAME=' . $attributes['NAME'] . ' already addded to ' . $element . ' attributes=<pre>' . print_r($attributes, TRUE) . '</pre>');
// Then log it
/* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',extraValues=' . $extraValues[$key] . ',key=' . $key . ',id=' . $id . ',entries[' . gettype($entries) . ']=' . $entries . ' - AFTER!');
} // END - if
+ } elseif ((!empty($filterFunctions[$search])) && (!empty($extraValues[$search]))) {
+ // Debug mode enabled?
+ if (isDebugModeEnabled()) {
+ // Then log it
+ /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',search=' . $search . ',entries[' . gettype($entries) . ']=' . $entries . ' - BEFORE!');
+ } // END - if
+
+ // Handle extra values
+ $entries = handleExtraValues($filterFunctions[$search], $entries, $extraValues[$search]);
+
+ // Debug mode enabled?
+ if (isDebugModeEnabled()) {
+ // Then log it
+ /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'search=' . $search . ',filterFunctions=' . $filterFunctions[$search] . ',key=' . $key . ',search=' . $search . ',entries[' . gettype($entries) . ']=' . $entries . ' - AFTER!');
+ } // END - if
+
+ // Make sure entries is not bool, then something went wrong
+ assert(!is_bool($entries));
} elseif (!empty($filterFunctions[$search])) {
// Debug mode enabled?
if (isDebugModeEnabled()) {
while ($content = SQL_FETCHARRAY($result)) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . intval($userid) . '/' . $content['userid']);
$OUT .= '<option value="' . bigintval($content['userid']) . '"';
- if (bigintval($userid) === bigintval($content['userid'])) {
+ if (bigintval($userid, FALSE, FALSE) === bigintval($content['userid'])) {
$OUT .= ' selected="selected"';
} // END - if
$OUT .= '>' . $content['surname'] . ' ' . $content['family'] . ' (' . bigintval($content['userid']) . ')</option>';
// Filter all data
foreach ($row as $key => $value) {
// Search index
- $idx = searchXmlArray($key, $columns, 'column');
+ $idx = searchXmlArray($key, $columns, 'column');
+
+ // Default name is NULL
+ $name = NULL;
+
+ // Is the name there?
+ if (isset($columns[$idx]['name'])) {
+ // Then use it
+ $name = $columns[$idx]['name'];
+ } // END - if
// Skip any missing entries
if ($idx === FALSE) {
// Try to handle call-back functions and/or extra values
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'idx=' . $idx . ',row[' . $key . ']=' . $row[$key]);
- $row[$key] = doHandleExtraValues($filterFunctions, $extraValues, $idx, $row[$key], $userIdColumn, $key);
+ //if ($key == 'forced_campaign_created') die($idx.'=<pre>'.print_r($columns,true).'</pre><pre>'.print_r($extraValues,true).'</pre>');
+ $row[$key] = doHandleExtraValues($filterFunctions, $extraValues, $idx, $row[$key], $userIdColumn, ((!is_null($name)) ? $name : $key));
} // END - foreach
// Then list it
assert(isset($columnArray[$childKey]));
// Now is it what we are looking for?
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'value=' . $value . ',key=' . $key . ',childKey=' . $childKey . ',columnArray=' . $columnArray[$childKey]);
if ($columnArray[$childKey] === $value) {
// Remember this match
$return = $key;
//-->
<database-column-list-entry name="" type="string" table="" value="id" alias="" function="" />
<database-column-list-entry name="" type="string" table="" value="userid" alias="" function="" />
- <database-column-list-entry name="subid_added" type="string" table="" value="subid_added" alias="subid_added" function="UNIX_TIMESTAMP" />
+ <database-column-list-entry name="added_list" type="string" table="" value="subid_added" alias="subid_added" function="UNIX_TIMESTAMP" />
<database-column-list-entry name="" type="string" table="" value="subid" alias="" function="" />
</database-column-list>
<!--
A call-back function list entry
//-->
<callback-function-list-entry name="" type="string" value="bigintval" />
- <callback-function-list-entry name="subid_added" type="string" value="generateDateTime" />
+ <callback-function-list-entry name="added_list" type="string" value="generateDateTime" />
</callback-function-list>
<!--
Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
numerical column names?
//-->
<database-column-list-entry name="" type="string" table="" value="id" alias="" function="" />
- <database-column-list-entry name="subid_added" type="string" table="" value="subid_added" alias="subid_added" function="UNIX_TIMESTAMP" />
+ <database-column-list-entry name="added_list" type="string" table="" value="subid_added" alias="subid_added" function="UNIX_TIMESTAMP" />
<database-column-list-entry name="" type="string" table="" value="subid" alias="" function="" />
</database-column-list>
<!--
A call-back function list entry
//-->
<callback-function-list-entry name="" type="string" value="bigintval" />
- <callback-function-list-entry name="subid_added" type="string" value="generateDateTime" />
+ <callback-function-list-entry name="added_list" type="string" value="generateDateTime" />
</callback-function-list>
<!--
Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array