// Filter for auto-activation of a extension
function FILTER_AUTO_ACTIVATE_EXTENSION ($data) {
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ext_name=' . $data['ext_name'] . ',isExtensionAlwaysActive()=' . intval(isExtensionAlwaysActive()));
+
// Is this extension always activated?
if (isExtensionAlwaysActive()) {
// Then activate the extension
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "ext_name={$data['ext_name']}<br />");
doActivateExtension($data['ext_name']);
} // END - if
// Filter for running SQL commands
function FILTER_RUN_SQLS ($data) {
// Debug message
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "- Entered!");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '- Entered!');
// Is the array there?
if ((isSqlsValid()) && ((!isset($data['dry_run'])) || ($data['dry_run'] == false))) {
// Run SQL commands
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "- Found ".countSqls()." queries to run.");
- foreach (getSqls() as $sqls) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '- Found ' . countSqls() . ' queries to run.');
+ foreach (getSqls() as $mode=>$sqls) {
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'mode=' . $mode . ',count()=' . count($sqls));
+
// New cache format...
foreach ($sqls as $sql) {
// Trim spaces away
SQL_ALTER_TABLE($sql, __FUNCTION__, __LINE__, $data['enable_codes']);
} else {
// Run regular SQL command
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Running regular query: ' . $sql . ',enable_codes=' . intval($data['enable_codes']);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Running regular query: ' . $sql . ',enable_codes=' . intval($data['enable_codes']));
SQL_QUERY($sql, __FUNCTION__, __LINE__, $data['enable_codes']);
}
} // END - if
} // END - if
// Debug message
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "- Left!");
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '- Left!');
}
// Filter for updating/validating login data
} // END - if
// Construct call-back function name for the command
- $commandFunction = 'doExpression' . ucfirst(strtolower($cmd));
+ $commandFunction = 'doExpression' . capitalizeUnderscoreString($cmd);
// Is this function there?
if (function_exists($commandFunction)) {
$code = call_user_func($commandFunction, $data);
} else {
// Unsupported command detected
- debug_report_bug(__FUNCTION__, __LINE__, 'Command=' . $cmd . ', callback=' . $callback . ', extra=' . $extraFunction . ' is unsupported.');
+ logDebugMessage(__FUNCTION__, __LINE__, 'Command=' . $cmd . ', callback=' . $callback . ', extra=' . $extraFunction . ' is unsupported.');
}
} // END - foreach
} // END - if
// Filter for loading page header, this should be ran first!
function FILTER_LOAD_PAGE_HEADER () {
- // Determine the page title
- $content['header_title'] = determinePageTitle();
-
// Output page header code
- $GLOBALS['page_header'] = loadTemplate('page_header', true, $content);
+ $GLOBALS['page_header'] = loadTemplate('page_header', true);
// Include meta data in 'guest' module
if (getModule() == 'index') {
} // END - if
}
+// Filter for setting CURRENT_DATE, this is required after initialization of extensions
+function FILTER_SET_CURRENT_DATE () {
+ // Set current date
+ setConfigEntry('CURRENT_DATE', generateDateTime(time(), '3'));
+
+ // Timestamp for yesterday, today ... all at 00:00 am
+ setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getConfig('ONE_DAY')));
+ setConfigEntry('START_TDAY', makeTime(0, 0, 0, time()));
+}
+
// [EOF]
?>