+// Filter for marking extension as installed
+function FILTER_EXTENSION_MARK_INSTALLED ($filterData) {
+ // Mark it as installed
+ $GLOBALS['ext_is_installed'][$filterData['ext_name']] = true;
+}
+
+// Filter for generating mails links for 'pool' mails
+function FILTER_GENERATE_POOL_MAIL_LINKS ($filterData) {
+ // Is type 'mid'?
+ if ($filterData['type'] == 'mid') {
+ // Load template
+ $filterData['__output'] .= loadTemplate('admin_links_' . strtolower($filterData['mail_status']) . '_pool_mail', true, $filterData);
+ } // END - if
+
+ // Return data
+ return $filterData;
+}
+
+// Filter to activate exchange
+function FILTER_ACTIVATE_EXCHANGE () {
+ // Is the extension 'user' there?
+ if ((!isExtensionActive('user')) || (getActivateXchange() == '0')) {
+ // Silently abort here
+ return false;
+ } // END - if
+
+ // Check total amount of users
+ if (getTotalConfirmedUser() >= getActivateXchange()) {
+ // Activate System
+ addSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `locked`='N',`hidden`='N',`mem_only`='Y' WHERE `module`='order' LIMIT 1");
+ addSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y',`locked`='N' WHERE `what`='order' OR `what`='unconfirmed' LIMIT 2");
+
+ // Run SQLs
+ runFilterChain('run_sqls');
+
+ // Update configuration
+ updateConfiguration('activate_xchange' ,0);
+
+ // Rebuild cache
+ rebuildCache('modules', 'modules');
+ } // END - if
+}
+
+// Filter to handle configuration
+function FILTER_HANDLE_HOME_IN_INDEX_SETTING ($filterData) {
+ // Is ext-sql_patches up-to-date?
+ if ((isExtensionInstalledAndNewer('sql_patches', '0.8.3')) && (isDisplayHomeInIndexEnabled())) {
+ // Is 'search' as same as 'index_home'?
+ if ($filterData['search'] == getIndexHome()) {
+ // Then set 'content' to link to index.php
+ $filterData['content'] = $filterData['prefix'] . '<strong><a class="you_are_here" href="{%url=index.php' . $filterData['link_add'] . '%}">' . getTitleFromMenu($filterData['access_level'], $filterData['search'], $filterData['type'], $filterData['add']) . '</a></strong>';
+ } // END - if
+ } // END - if
+
+ // Return data
+ return $filterData;
+}
+
+// Filter to add history entry
+function FILTER_ADD_HISTORY_ENTRY ($filterData) {
+ // Add the entry
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_history` (`history_subject`,`history_userid`,`history_value`) VALUES ('%s',%s,'%s')",
+ $filterData,
+ __FUNCTION__, __LINE__);
+
+ // Remember insert id for other filters
+ $filterData['history_id'] = SQL_INSERTID();
+
+ // Return data
+ return $filterData;
+}
+