From b16d1f640a44da05b1f018be13e8d0b803a74aeb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 6 Jun 2009 18:33:21 +0000 Subject: [PATCH] Functions renamed to new naming convetion, TODOs.txt updated --- DOCS/TODOs.txt | 112 +++++++++++++++++--------------- inc/extensions.php | 2 +- inc/extensions/ext-active.php | 4 +- inc/extensions/ext-admins.php | 4 +- inc/extensions/ext-cache.php | 40 ++++++------ inc/extensions/ext-online.php | 4 +- inc/extensions/ext-rallye.php | 4 +- inc/extensions/ext-removeip.php | 4 +- inc/filters.php | 45 ++++++------- inc/load_extensions.php | 8 +-- 10 files changed, 114 insertions(+), 113 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index eb4caf6032..5a52272b18 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -1,34 +1,33 @@ ### WARNING: THIS FILE IS AUTO-GENERATED BY DOCS/todo-builder.sh ### ### DO NOT EDIT THIS FILE. ### -./beg.php:196: // @TODO Opps, what is missing here??? -./inc/extensions/ext-sql_patches.php:705: // @TODO Rewrite this to a filter! -./inc/extensions/ext-sql_patches.php:743: // @TODO Can we remove this? setConfigEntry('verbose_sql' , 'N'); -./inc/extensions/ext-sql_patches.php:93: /* @TODO SQL_ALTER_TABLE() should work now properly -./inc/extensions/ext-surfbar.php:237: // @TODO Set some constants we need??? +./beg.php:193: // @TODO Opps, what is missing here??? +./inc/config-functions.php:182: // @TODO Make this all better... :-/ +./inc/config-functions.php:207: // @TODO Rewrite these all to config entries, if somehow possible +./inc/extensions/ext-sql_patches.php:705: // @TODO Rewrite this to a filter! +./inc/extensions/ext-sql_patches.php:743: // @TODO Can we remove this? setConfigEntry('verbose_sql' , 'N'); +./inc/extensions/ext-sql_patches.php:93: /* @TODO SQL_ALTER_TABLE() should work now properly +./inc/extensions/ext-surfbar.php:237: // @TODO Set some constants we need??? ./inc/extensions.php:343:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) ) ./inc/extensions.php:419: // @TODO Extension is loaded, what next? -./inc/functions.php:1277: // @TODO Rewrite this unnice code -./inc/functions.php:1338: // @TODO Remove this if() block if all is working fine -./inc/functions.php:1638: // @TODO This can be, somehow, rewritten -./inc/functions.php:1991: // @TODO eregi() should be rewritten here -./inc/functions.php:2367:// @TODO Rewrite all language constants to this function. -./inc/functions.php:248: // @TODO Fine all templates which are using these direct variables and rewrite them. -./inc/functions.php:249: // @TODO After this step is done, this else-block is history -./inc/functions.php:2614: $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO isn't it better to do $GLOBALS['cache_instance']->destroyCacheFile('revision')? -./inc/functions.php:2616: // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')? -./inc/functions.php:2677:// @TODO Please describe this function -./inc/functions.php:2689: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time); -./inc/functions.php:2801: // @TODO Add a little more infos here -./inc/functions.php:2812: // @TODO This cannot be rewritten to app_die(), try to find a solution for this. -./inc/functions.php:2909:// @TODO Implement $compress -./inc/functions.php:2916:// @TODO Implement $decompress -./inc/functions.php:3027:// @TODO Rewrite this function to use readFromFile() and writeToFile() -./inc/functions.php:464:// @TODO Rewrite this to an extension 'smtp' +./inc/functions.php:1221: // @TODO Rewrite this unnice code +./inc/functions.php:1282: // @TODO Remove this if() block if all is working fine +./inc/functions.php:1582: // @TODO This can be, somehow, rewritten +./inc/functions.php:2451: $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO isn't it better to do $GLOBALS['cache_instance']->destroyCacheFile('revision')? +./inc/functions.php:2453: // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')? +./inc/functions.php:247: // @TODO Fine all templates which are using these direct variables and rewrite them. +./inc/functions.php:248: // @TODO After this step is done, this else-block is history +./inc/functions.php:2514:// @TODO Please describe this function +./inc/functions.php:2526: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time); +./inc/functions.php:2609: // @TODO Add a little more infos here +./inc/functions.php:2620: // @TODO This cannot be rewritten to app_die(), try to find a solution for this. +./inc/functions.php:2797:// @TODO Rewrite this function to use readFromFile() and writeToFile() +./inc/functions.php:463:// @TODO Rewrite this to an extension 'smtp' ./inc/language/de.php:1156:// @TODO Rewrite these two constants ./inc/language/de.php:1172:// @TODO Rewrite these five constants ./inc/language/de.php:756:// @TODO The template 'admin_extensions_installed' is using this. But the template is no longer used. ./inc/language/de.php:855:// @TODO Are these constants still used? ./inc/language/de.php:866:// @TODO Are these constants longer used? +./inc/language-functions.php:45:// @TODO Rewrite all language constants to this function. ./inc/language/holiday_de.php:49:// @TODO Rewrite these two constants to one ./inc/language/rallye_de.php:110:// @TODO Rewrite following two lines to one ./inc/language/refback_de.php:46:// @TODO Rewrite these constants to one @@ -42,14 +41,15 @@ ./inc/libs/rallye_functions.php:697: // @TODO Rewrite this to our API function ./inc/libs/register_functions.php:53: // @TODO Rewrite these constants ./inc/libs/register_functions.php:62: // @TODO Rewrite these constants, too -./inc/libs/surfbar_functions.php:1469: // @TODO This can be somehow rewritten -./inc/libs/surfbar_functions.php:942: // @TODO Invalid salt should be refused +./inc/libs/surfbar_functions.php:1475: // @TODO This can be somehow rewritten +./inc/libs/surfbar_functions.php:948: // @TODO Invalid salt should be refused ./inc/libs/task_functions.php:261: // @TODO These can be rewritten to filter ./inc/libs/task_functions.php:53:// @TODO Move all extension-dependent queries into filters -./inc/libs/user_functions.php:317: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content); -./inc/libs/user_functions.php:342: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); -./inc/libs/user_functions.php:377: // @TODO Can this query be merged with above query? +./inc/libs/user_functions.php:317: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content); +./inc/libs/user_functions.php:342: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON)); +./inc/libs/user_functions.php:377: // @TODO Can this query be merged with above query? ./inc/libs/yoomedia_functions.php:65: $response = YOOMEDIA_QUERY_API("out_textmail.php", true); // @TODO Ask Yoo!Media for test script +./inc/load_config.php:77: // @TODO Rewrite them to avoid this else block ./inc/load_extensions.php:13: * @TODO Rewrite this whole file to load_cache-extensions.php * ./inc/mails/birthday_mails.php:85: // @TODO 4 is hard-coded here, should we move it out in config? ./inc/modules/admin/admin-inc.php:343: // @TODO Rewrite this to $content = SQL_FETCHARRAY() @@ -58,11 +58,11 @@ ./inc/modules/admin/admin-inc.php:530: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY(). Please look some lines above for the dynamic query ./inc/modules/admin/overview-inc.php:143: // @TODO Rewrite this to a filter ./inc/modules/admin/overview-inc.php:230: // @TODO Rewrite this to something with include files -./inc/modules/admin/overview-inc.php:269: // @TODO This may also be rewritten to include files -./inc/modules/admin/overview-inc.php:272: default: // @TODO Unknown support mode +./inc/modules/admin/overview-inc.php:269: // @TODO This may also be rewritten to include files +./inc/modules/admin/overview-inc.php:272: default: // @TODO Unknown support mode ./inc/modules/admin/overview-inc.php:418: // @TODO Rewritings: admin->assigned_admin,uid->userid,type->task_type_msg in template ./inc/modules/admin.php:257: // @TODO Rewrite all these constants -./inc/modules/admin.php:94: // @TODO Why is this set to 'done'? +./inc/modules/admin.php:94: // @TODO Why is this set to 'done'? ./inc/modules/admin/what-add_points.php:120: // @TODO Rewrite these both constants ./inc/modules/admin/what-add_points.php:54: // @TODO Rewrite this constant ./inc/modules/admin/what-admin_add.php:120: // @TODO This can be somehow rewritten to a function @@ -94,7 +94,7 @@ ./inc/modules/admin/what-edit_emails.php:60: // @TODO More constants to rewrite ./inc/modules/admin/what-edit_emails.php:95: // @TODO Rewritings: subj->subject in template ./inc/modules/admin/what-extensions.php:154: // @TODO Rewrite this constant -./inc/modules/admin/what-extensions.php:333: // @TODO Rewrite this to a filter +./inc/modules/admin/what-extensions.php:333: // @TODO Rewrite this to a filter ./inc/modules/admin/what-guest_add.php:122: // @TODO This can be somehow rewritten to a function ./inc/modules/admin/what-guest_add.php:77: // @TODO This can be somehow rewritten to a function ./inc/modules/admin/what-guestedit.php:284: // @TODO Rewrite this constant @@ -157,9 +157,9 @@ ./inc/modules/guest/what-sponsor_reg.php:284: // @TODO Swap this HTML code to templates ./inc/modules/guest/what-sponsor_reg.php:298: // @TODO Rewrite this constant ./inc/modules/guest/what-sponsor_reg.php:304: // @TODO Rewrite these constants -./inc/modules/guest/what-stats.php:110: // @TODO This can be somehow rewritten -./inc/modules/guest/what-stats.php:123: // @TODO Rewrite all these constants -./inc/modules/guest/what-stats.php:192: // @TODO Rewrite this to one template and $OUT .= .... +./inc/modules/guest/what-stats.php:110: // @TODO This can be somehow rewritten +./inc/modules/guest/what-stats.php:123: // @TODO Rewrite all these constants +./inc/modules/guest/what-stats.php:192: // @TODO Rewrite this to one template and $OUT .= .... ./inc/modules/guest/what-top10.php:107:// @TODO Rewrite this constant ./inc/modules/guest/what-top10.php:145: // @TODO Rewritings: nick->nickname,uid->userid in template ./inc/modules/guest/what-top10.php:177:// @TODO Rewrite this constant @@ -170,8 +170,9 @@ ./inc/modules/guest/what-wernis_portal.php:85:// @TODO Can this be removed? $rdf->clear_cache(); ./inc/modules/member/what-bonus.php:55: // @TODO Rewrite this to a filter ./inc/modules/member/what-categories.php:112: // @TODO Rewrite this to use $OUT .= ... +./inc/modules/member/what-mydata.php:53:// @TODO Try to rewrite this constant ./inc/modules/member/what-order.php:411: // @TODO Rewrite this to a filter -./inc/modules/member/what-order.php:506: // @TODO Rewrite this old lost code to a template +./inc/modules/member/what-order.php:506: // @TODO Rewrite this old lost code to a template ./inc/modules/member/what-payout.php:132: // @TODO Rewritings: acc->target_account,bank->target_bank in templates ./inc/modules/member/what-payout.php:148: // @TODO Rewrite this constant ./inc/modules/member/what-payout.php:182: // @TODO Rewrite these constants @@ -179,29 +180,32 @@ ./inc/modules/member/what-payout.php:235: // @TODO Rewrite this to a filter ./inc/modules/member/what-points.php:54:// @TODO Should we rewrite this to a filter? ./inc/modules/member/what-reflinks.php:105: // @TODO Rewritings: alt->alternate,cnt->counter,cks->clicks,uid->userid in template -./inc/modules/member/what-transfer.php:116: // @TODO Rewrite all these constants to array elements -./inc/modules/member/what-transfer.php:247: // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries -./inc/modules/member/what-transfer.php:309: // @TODO Rewrite these constants -./inc/modules/member/what-transfer.php:317: // @TODO Rewrite these constants -./inc/modules/member/what-transfer.php:329: // @TODO This should be somehow rewritten to $content = SQL_FETCHARRAY(), see switch() block above for SQL queries -./inc/modules/member/what-transfer.php:364: // @TODO Rewrite these constants -./inc/modules/member/what-transfer.php:451: // @TODO Rewrite all these constants +./inc/modules/member/what-transfer.php:116: // @TODO Rewrite all these constants to array elements +./inc/modules/member/what-transfer.php:247: // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries +./inc/modules/member/what-transfer.php:309: // @TODO Rewrite these constants +./inc/modules/member/what-transfer.php:317: // @TODO Rewrite these constants +./inc/modules/member/what-transfer.php:329: // @TODO This should be somehow rewritten to $content = SQL_FETCHARRAY(), see switch() block above for SQL queries +./inc/modules/member/what-transfer.php:364: // @TODO Rewrite these constants +./inc/modules/member/what-transfer.php:451: // @TODO Rewrite all these constants ./inc/modules/member/what-unconfirmed.php:134: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() ./inc/mysql-manager.php:1549: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() -./inc/mysql-manager.php:1592: // @TODO Rewrite this to a filter -./inc/mysql-manager.php:1768: // @TODO Find a way for updating $_CONFIG here -./inc/mysql-manager.php:1792: // @TODO Find a way for updating $_CONFIG here -./inc/mysql-manager.php:1815:// @TODO Can this be rewritten to a filter? -./inc/mysql-manager.php:1877: // @TODO Rewrite this to $content = SQL_FETCHARRAY() +./inc/mysql-manager.php:1592: // @TODO Rewrite this to a filter +./inc/mysql-manager.php:1770: // @TODO Find a way for updating $_CONFIG here +./inc/mysql-manager.php:1794: // @TODO Find a way for updating $_CONFIG here +./inc/mysql-manager.php:1817:// @TODO Can this be rewritten to a filter? +./inc/mysql-manager.php:1879: // @TODO Rewrite this to $content = SQL_FETCHARRAY() ./inc/mysql-manager.php:199: // @TODO Nothing helped??? -./inc/mysql-manager.php:2171: // @TODO This can be somehow rewritten +./inc/mysql-manager.php:2173: // @TODO This can be somehow rewritten ./inc/mysql-manager.php:513: // @TODO Why is this global??? #100 ./inc/mysql-manager.php:947: // @TODO Why does this lead into an endless loop but we still need it??? -./inc/mysql-manager.php:948: // @TODO Commented out LOAD_URL('admin.php'); -./mailid_top.php:208: // @TODO Rewrite these blocks to filter +./inc/mysql-manager.php:948: // @TODO Commented out redirectToUrl('admin.php'); +./inc/wrapper-functions.php:146:// @TODO Implement $compress +./inc/wrapper-functions.php:153:// @TODO Implement $decompress +./inc/wrapper-functions.php:379:// @TODO Do some more sanity check here +./mailid_top.php:208: // @TODO Rewrite these blocks to filter ./surfbar.php:65: // @TODO Display quick login form here or redirect as configured ### ### DEPRECATION FOLLOWS: ### ### -./inc/functions.php:233: // @DEPRECATED Try to rewrite the if() condition -./inc/functions.php:2377: // @DEPRECATED Language array element found in BIG_LETTERS -./inc/functions.php:2380: // @DEPRECATED Deprecated constant found -./inc/functions.php:247: // @DEPRECATED +./inc/functions.php:232: // @DEPRECATED Try to rewrite the if() condition +./inc/functions.php:246: // @DEPRECATED +./inc/language-functions.php:55: // @DEPRECATED Language array element found in BIG_LETTERS +./inc/language-functions.php:58: // @DEPRECATED Deprecated constant found diff --git a/inc/extensions.php b/inc/extensions.php index 09fbc8c9c0..b0b7df1291 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -328,7 +328,7 @@ function REGISTER_EXTENSION ($ext_name, $task_id, $dry_run = false, $logout = tr redirectToUrl('modules.php?module=admin&logout=1&' . $EXT_LOAD_MODE . '=sql_patches'); } else { // Add temporary filter - REGISTER_FILTER('shutdown', 'REDIRECT_TO_LOGOUT_SQL_PATCHES', true, true); + registerFilter('shutdown', 'REDIRECT_TO_LOGOUT_SQL_PATCHES', true, true); $GLOBALS['ext_load_mode'] = $EXT_LOAD_MODE; } } // END - if diff --git a/inc/extensions/ext-active.php b/inc/extensions/ext-active.php index 79d213b6e6..7bfd72efe3 100644 --- a/inc/extensions/ext-active.php +++ b/inc/extensions/ext-active.php @@ -61,7 +61,7 @@ switch ($EXT_LOAD_MODE) ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_active'"); // Unregister filter - UNREGISTER_FILTER('online_extra_links', 'ADD_LINK_ACTIVE_LIST', true, $dry_run); + unregisterFilter('online_extra_links', 'ADD_LINK_ACTIVE_LIST', true, $dry_run); break; case 'activate': // Do stuff when admin activates this extension @@ -125,7 +125,7 @@ switch ($EXT_LOAD_MODE) EXT_ADD_UPDATE_DEPENDS('online'); // Register filter - REGISTER_FILTER('online_extra_links', 'ADD_LINK_ACTIVE_LIST', false, true, $dry_run); + registerFilter('online_extra_links', 'ADD_LINK_ACTIVE_LIST', false, true, $dry_run); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Filter für den "Wer ist Online" Block hinzugefügt und ist von online abhängig."); diff --git a/inc/extensions/ext-admins.php b/inc/extensions/ext-admins.php index c698c25af7..ebb2bc1c34 100644 --- a/inc/extensions/ext-admins.php +++ b/inc/extensions/ext-admins.php @@ -65,7 +65,7 @@ switch ($EXT_LOAD_MODE) ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_admins` DROP default_acl"); // Remove filters - UNREGISTER_FILTER('sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', true, $dry_run); + unregisterFilter('sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', true, $dry_run); break; case 'activate': // Do stuff when admin activates this extension @@ -290,7 +290,7 @@ PRIMARY KEY (id) EXT_ADD_UPDATE_DEPENDS('sql_patches'); // Add filters - REGISTER_FILTER('sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', false, true, $dry_run); + registerFilter('sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', false, true, $dry_run); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Filter hinzugefügt und ist von sql_patches abhängig."); diff --git a/inc/extensions/ext-cache.php b/inc/extensions/ext-cache.php index 9391294cc5..2d9c2de386 100644 --- a/inc/extensions/ext-cache.php +++ b/inc/extensions/ext-cache.php @@ -64,16 +64,16 @@ switch ($EXT_LOAD_MODE) ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what` IN('config_cache','cache_stats')"); // Unregister all filters - UNREGISTER_FILTER('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', true, $dry_run); - UNREGISTER_FILTER('post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', true, $dry_run); - UNREGISTER_FILTER('post_extension_installed', 'CACHE_PURGE_ADMIN_MENU', true, $dry_run); - UNREGISTER_FILTER('post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', true, $dry_run); - UNREGISTER_FILTER('post_extension_run_sql', 'CACHE_PURGE_ADMIN_MENU', true, $dry_run); - UNREGISTER_FILTER('post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, $dry_run); - UNREGISTER_FILTER('post_admin_edited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, $dry_run); - UNREGISTER_FILTER('post_admin_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, $dry_run); - UNREGISTER_FILTER('post_admin_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, $dry_run); - UNREGISTER_FILTER('extension_remove', 'CACHE_DESTROY_ALL', true, $dry_run); + unregisterFilter('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', true, $dry_run); + unregisterFilter('post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', true, $dry_run); + unregisterFilter('post_extension_installed', 'CACHE_PURGE_ADMIN_MENU', true, $dry_run); + unregisterFilter('post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', true, $dry_run); + unregisterFilter('post_extension_run_sql', 'CACHE_PURGE_ADMIN_MENU', true, $dry_run); + unregisterFilter('post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, $dry_run); + unregisterFilter('post_admin_edited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, $dry_run); + unregisterFilter('post_admin_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, $dry_run); + unregisterFilter('post_admin_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', true, $dry_run); + unregisterFilter('extension_remove', 'CACHE_DESTROY_ALL', true, $dry_run); break; case 'activate': // Do stuff when admin activates this extension @@ -216,14 +216,14 @@ switch ($EXT_LOAD_MODE) case '0.2.1': // SQL queries for v0.2.1 // Register the new filter - REGISTER_FILTER('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, $dry_run); - REGISTER_FILTER('post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, $dry_run); - REGISTER_FILTER('post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, $dry_run); - REGISTER_FILTER('post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, $dry_run); - REGISTER_FILTER('post_admin_edited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, $dry_run); - REGISTER_FILTER('post_admin_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, $dry_run); - REGISTER_FILTER('post_admin_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, $dry_run); - REGISTER_FILTER('extension_remove', 'CACHE_DESTROY_ALL', false, true, $dry_run); + registerFilter('extension_update', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, $dry_run); + registerFilter('post_extension_installed', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, $dry_run); + registerFilter('post_extension_run_sql', 'CACHE_DESTROY_ON_EXT_CHANGE', false, true, $dry_run); + registerFilter('post_admin_added', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, $dry_run); + registerFilter('post_admin_edited', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, $dry_run); + registerFilter('post_admin_deleted', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, $dry_run); + registerFilter('post_admin_reset_pass', 'CACHE_DESTROY_ON_ADMIN_CHANGE', false, true, $dry_run); + registerFilter('extension_remove', 'CACHE_DESTROY_ALL', false, true, $dry_run); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Filter für Erweiterungsmanagement hinzugefügt."); @@ -231,8 +231,8 @@ switch ($EXT_LOAD_MODE) case '0.2.2': // SQL queries for v0.2.2 // Register the new filter - REGISTER_FILTER('post_extension_installed', 'CACHE_PURGE_ADMIN_MENU', false, true, $dry_run); - REGISTER_FILTER('post_extension_run_sql', 'CACHE_PURGE_ADMIN_MENU', false, true, $dry_run); + registerFilter('post_extension_installed', 'CACHE_PURGE_ADMIN_MENU', false, true, $dry_run); + registerFilter('post_extension_run_sql', 'CACHE_PURGE_ADMIN_MENU', false, true, $dry_run); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Weitere Filter hinzugefügt."); diff --git a/inc/extensions/ext-online.php b/inc/extensions/ext-online.php index de64a56dc3..4e4d696d0a 100644 --- a/inc/extensions/ext-online.php +++ b/inc/extensions/ext-online.php @@ -80,7 +80,7 @@ KEY `admin_member` (`is_admin`,`is_member`) ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='online'"); // Unregister filter - UNREGISTER_FILTER('init', 'UPDATE_ONLINE_LIST', true, $dry_run); + unregisterFilter('init', 'UPDATE_ONLINE_LIST', true, $dry_run); break; case 'activate': // Do stuff when admin activates this extension @@ -120,7 +120,7 @@ KEY `admin_member` (`is_admin`,`is_member`) ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('online',NULL,'Jetzt Online','2','Y','N')"); // Register filter - REGISTER_FILTER('init', 'UPDATE_ONLINE_LIST', false, true, $dry_run); + registerFilter('init', 'UPDATE_ONLINE_LIST', false, true, $dry_run); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Hinzufügen des Menüpunktes "Jetzt Online" wird nun von dieser Erweiterung erledigt. Filter hinzugefügt."); diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index ad8df4d644..e4e2963dd8 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -114,7 +114,7 @@ PRIMARY KEY(id) ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `what`='rallyes'"); // Unregister filter - UNREGISTER_FILTER('extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', true, $dry_run); + unregisterFilter('extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', true, $dry_run); break; case 'activate': // Do stuff when admin activates this extension @@ -313,7 +313,7 @@ Zudem sollten Sie mindestens folgende Templates (in templates/".getLangu EXT_ADD_UPDATE_DEPENDS('sql_patches'); // Register filter - REGISTER_FILTER('extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', false, true, $dry_run); + registerFilter('extra_autopurge', 'RALLYE_EXTRA_AUTOPURGE', false, true, $dry_run); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Filter hinzugefügt und ist von sql_patches abhängig."); diff --git a/inc/extensions/ext-removeip.php b/inc/extensions/ext-removeip.php index 0c3b40c165..8114d0d415 100644 --- a/inc/extensions/ext-removeip.php +++ b/inc/extensions/ext-removeip.php @@ -69,7 +69,7 @@ switch ($EXT_LOAD_MODE) ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_removeip'"); // Remove filters - UNREGISTER_FILTER('post_youhere_line', 'ADD_ANONYMITY_NOTICE', true, $dry_run); + unregisterFilter('post_youhere_line', 'ADD_ANONYMITY_NOTICE', true, $dry_run); break; case 'activate': // Do stuff when admin activates this extension @@ -88,7 +88,7 @@ switch ($EXT_LOAD_MODE) EXT_ADD_UPDATE_DEPENDS('sql_patches'); // Add filters - REGISTER_FILTER('post_youhere_line', 'ADD_ANONYMITY_NOTICE', false, true, $dry_run); + registerFilter('post_youhere_line', 'ADD_ANONYMITY_NOTICE', false, true, $dry_run); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Filter hinzugefügt und ist von sql_patches abhängig."); diff --git a/inc/filters.php b/inc/filters.php index 4c22772bb1..6f213c8b65 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -43,7 +43,7 @@ if (!defined('__SECURITY')) { } // Init "generic filter system" -function INIT_FILTER_SYSTEM () { +function initFilterSystem () { // Is the filter already initialized? if ((isset($GLOBALS['filters']['chains'])) && (is_array($GLOBALS['filters']['chains']))) { // Then abort here @@ -53,12 +53,9 @@ function INIT_FILTER_SYSTEM () { // Init the filter system (just some ideas) $GLOBALS['filters']['chains'] = array( - // Filters for pre-init phase - 'preinit' => array(), - // Filters for post-init phase - 'postinit' => array(), - // Filters for shutdown phase - 'shutdown' => array() + 'preinit' => array(), // Filters for pre-init phase + 'postinit' => array(), // Filters for post-init phase + 'shutdown' => array() // Filters for shutdown phase ); // Init loaded filters and counter @@ -106,39 +103,39 @@ ORDER BY `filter_id` ASC", __FUNCTION__, __LINE__); } // END - if // Init filters - REGISTER_FILTER('init', 'UPDATE_LOGIN_DATA'); - REGISTER_FILTER('init', 'INIT_RANDOMIZER'); + registerFilter('init', 'UPDATE_LOGIN_DATA'); + registerFilter('init', 'INIT_RANDOMIZER'); // Login failures handler - REGISTER_FILTER('post_youhere_line', 'CALL_HANDLER_LOGIN_FAILTURES'); + registerFilter('post_youhere_line', 'CALL_HANDLER_LOGIN_FAILTURES'); // Filters for pre-extension-registration - REGISTER_FILTER('pre_extension_installed', 'RUN_SQLS'); + registerFilter('pre_extension_installed', 'RUN_SQLS'); // Filters for post-extension-registration - REGISTER_FILTER('post_extension_installed', 'AUTO_ACTIVATE_EXTENSION'); - REGISTER_FILTER('post_extension_installed', 'SOLVE_TASK'); - REGISTER_FILTER('post_extension_installed', 'loadIncludeLUDES'); - REGISTER_FILTER('post_extension_installed', 'REMOVE_UPDATES'); + registerFilter('post_extension_installed', 'AUTO_ACTIVATE_EXTENSION'); + registerFilter('post_extension_installed', 'SOLVE_TASK'); + registerFilter('post_extension_installed', 'loadIncludeLUDES'); + registerFilter('post_extension_installed', 'REMOVE_UPDATES'); // Solving tasks - REGISTER_FILTER('solve_task', 'SOLVE_TASK'); + registerFilter('solve_task', 'SOLVE_TASK'); // Loading includes in general - REGISTER_FILTER('load_includes', 'loadIncludeLUDES'); + registerFilter('load_includes', 'loadIncludeLUDES'); // Run SQLs - REGISTER_FILTER('run_sqls', 'RUN_SQLS'); + registerFilter('run_sqls', 'RUN_SQLS'); // Admin ACL check - REGISTER_FILTER('check_admin_acl', 'CHECK_ADMIN_ACL'); + registerFilter('check_admin_acl', 'CHECK_ADMIN_ACL'); // Register shutdown filters - REGISTER_FILTER('shutdown', 'FLUSH_FILTERS'); + registerFilter('shutdown', 'FLUSH_FILTERS'); } // "Registers" a new filter function -function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $force = false, $dry_run = false) { +function registerFilter ($filterName, $filterFunction, $silentAbort = true, $force = false, $dry_run = false) { // Extend the filter function name $filterFunction = sprintf("FILTER_%s", strtoupper($filterFunction)); @@ -169,7 +166,7 @@ function REGISTER_FILTER ($filterName, $filterFunction, $silentAbort = true, $fo } // "Unregisters" a filter from the given chain -function UNREGISTER_FILTER ($filterName, $filterFunction, $force = false, $dry_run = false) { +function unregisterFilter ($filterName, $filterFunction, $force = false, $dry_run = false) { // Extend the filter function name only if not loaded from database if (!isset($GLOBALS['filters']['loaded'][$filterName][$filterFunction])) { $filterFunction = sprintf("FILTER_%s", strtoupper($filterFunction)); @@ -217,7 +214,7 @@ function runFilterChain ($filterName, $data = null, $silentAbort = true) { // Is this filter there? if (!function_exists($filterFunction)) { // Unregister it - UNREGISTER_FILTER($filterName, $filterFunction); + unregisterFilter($filterName, $filterFunction); // Skip this entry continue; @@ -344,7 +341,7 @@ function FILTER_CALL_HANDLER_LOGIN_FAILTURES ($data) { // Filter for redirecting to logout if sql_patches has been installed function FILTER_REDIRECT_TO_LOGOUT_SQL_PATCHES () { // Remove this filter - UNREGISTER_FILTER('shutdown', __FUNCTION__); + unregisterFilter('shutdown', __FUNCTION__); // Is the element set? if (isset($GLOBALS['ext_load_mode'])) { diff --git a/inc/load_extensions.php b/inc/load_extensions.php index baeff4c573..96b15450cd 100644 --- a/inc/load_extensions.php +++ b/inc/load_extensions.php @@ -55,7 +55,7 @@ $GLOBALS['cache_array'] = array(); // Skip loading extensions if ((!isInstalled()) || (isInstalling())) { // Init filter system here - INIT_FILTER_SYSTEM(); + initFilterSystem(); // Skip loading return; @@ -185,7 +185,7 @@ if ($GLOBALS['cache_mode'] == 'load') { } // END - foreach // Init filter system - INIT_FILTER_SYSTEM(); + initFilterSystem(); // Load more cache files (like admins) loadIncludeOnce('inc/load_cache.php'); @@ -275,7 +275,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cache_mode'] == 'init') && ( } // END - while // Init filter system - INIT_FILTER_SYSTEM(); + initFilterSystem(); if ($GLOBALS['cache_mode'] == 'init') { // Close cache file @@ -289,7 +289,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($GLOBALS['cache_mode'] == 'init') && ( SQL_FREERESULT($res_ext_crt); } elseif (!EXT_IS_ACTIVE('cache')) { // Init filter system even when there are no extensions installed. #16 - INIT_FILTER_SYSTEM(); + initFilterSystem(); } // Run the filter -- 2.39.5