From 4fe584c2e58ca2babe4141c1f4e8a595ec7a3ee9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 10 Mar 2009 23:55:36 +0000 Subject: [PATCH] Rewritten overview-inc.php, internal TODO closed --- .gitattributes | 1 + .gitignore | 1 - DOCS/TODOs.txt | 65 ++++++++++--------- DOCS/todo-builder.sh | 2 +- inc/modules/admin/admin-inc.php | 10 +-- inc/modules/admin/overview-inc.php | 9 +-- .../de/html/admin/admin_overview_footer.tpl | 13 +--- .../de/html/admin/admin_overview_header.tpl | 17 +---- .../de/html/admin/admin_overview_list.tpl | 15 ++--- .../de/html/admin/admin_overview_table.tpl | 30 +++++++++ 10 files changed, 85 insertions(+), 78 deletions(-) create mode 100644 templates/de/html/admin/admin_overview_table.tpl diff --git a/.gitattributes b/.gitattributes index 7bcf57b9fc..51f8117543 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1139,6 +1139,7 @@ templates/de/html/admin/admin_overview_list.tpl -text templates/de/html/admin/admin_overview_list_ext_rows.tpl -text templates/de/html/admin/admin_overview_list_rows.tpl -text templates/de/html/admin/admin_overview_row.tpl -text +templates/de/html/admin/admin_overview_table.tpl -text templates/de/html/admin/admin_overview_task.tpl -text templates/de/html/admin/admin_overview_task_extras.tpl -text templates/de/html/admin/admin_overview_task_rows.tpl -text diff --git a/.gitignore b/.gitignore index 9160c0a056..e14734f1e0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,3 @@ inc/.secret/dummy.php inc/cache/*.cache inc/cache/*.log inc/cache/.revision -inc/config.php diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 61cdc9fbd3..19370da966 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -4,24 +4,24 @@ ./inc/extensions/ext-sql_patches.php:755: // @TODO Rewrite this to a filter! ./inc/extensions/ext-sql_patches.php:793: // @TODO Can we remove this? setConfigEntry('verbose_sql' , "N"); ./inc/extensions/ext-sql_patches.php:95: /* @TODO SQL_ALTER_TABLE() should work now properly -./inc/extensions.php:317:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) ) -./inc/extensions.php:386: // @TODO Extension is loaded, what next? -./inc/functions.php:1241: // @TODO Rewrite this unnice code -./inc/functions.php:1302: // @TODO Remove this if() block if all is working fine -./inc/functions.php:1602: // @TODO This can be, somehow, rewritten -./inc/functions.php:2327:// @TODO Rewrite all language constants to this function. -./inc/functions.php:2574: $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO isn't it better to do $GLOBALS['cache_instance']->destroyCacheFile('revision')? -./inc/functions.php:2576: // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')? -./inc/functions.php:259: // @TODO Fine all templates which are using these direct variables and rewrite them. -./inc/functions.php:260: // @TODO After this step is done, this else-block is history -./inc/functions.php:2653: // @TODO What does this loop/regex do? Document it, please. -./inc/functions.php:2746: // @TODO Add a little more infos here -./inc/functions.php:2756: // @TODO This cannot be rewritten to mxchange_die(), try to find a solution for this. -./inc/functions.php:2861:// @TODO Implement $compress -./inc/functions.php:2868:// @TODO Implement $decompress -./inc/functions.php:2971: // @TODO We may want to switch over to UTF-8 here! -./inc/functions.php:2979:// @TODO Rewrite this function to use READ_FILE() and WRITE_FILE() -./inc/functions.php:475:// @TODO Rewrite this to an extension 'smtp' +./inc/extensions.php:324:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) ) +./inc/extensions.php:400: // @TODO Extension is loaded, what next? +./inc/functions.php:1229: // @TODO Rewrite this unnice code +./inc/functions.php:1290: // @TODO Remove this if() block if all is working fine +./inc/functions.php:1590: // @TODO This can be, somehow, rewritten +./inc/functions.php:2315:// @TODO Rewrite all language constants to this function. +./inc/functions.php:246: // @TODO Fine all templates which are using these direct variables and rewrite them. +./inc/functions.php:247: // @TODO After this step is done, this else-block is history +./inc/functions.php:2563: $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO isn't it better to do $GLOBALS['cache_instance']->destroyCacheFile('revision')? +./inc/functions.php:2565: // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')? +./inc/functions.php:2637: searchDirsRecursive($next_dir, $last_changed); // @TODO small change to API to $last_changed = searchDirsRecursive($next_dir, $time); +./inc/functions.php:2749: // @TODO Add a little more infos here +./inc/functions.php:2760: // @TODO This cannot be rewritten to mxchange_die(), try to find a solution for this. +./inc/functions.php:2865:// @TODO Implement $compress +./inc/functions.php:2872:// @TODO Implement $decompress +./inc/functions.php:2975: // @TODO We may want to switch over to UTF-8 here! +./inc/functions.php:2983:// @TODO Rewrite this function to use READ_FILE() and WRITE_FILE() +./inc/functions.php:462:// @TODO Rewrite this to an extension 'smtp' ./inc/language/de.php:1154:// @TODO Rewrite these two constants ./inc/language/de.php:1170:// @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. @@ -43,9 +43,9 @@ ./inc/libs/surfbar_functions.php:917: // @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:311: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', array('login' => $login, 'online' => $online)); -./inc/libs/user_functions.php:335: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('uid' => $uid, 'hash' => $hash, 'addon' => $ADDON)); -./inc/libs/user_functions.php:370: // @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_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? @@ -57,9 +57,8 @@ ./inc/modules/admin/overview-inc.php:268: // @TODO This may also be rewritten to include files ./inc/modules/admin/overview-inc.php:271: default: // @TODO Unknown support mode ./inc/modules/admin/overview-inc.php:389: // @TODO Rewrite this to one template and use $OUT = ... -./inc/modules/admin/overview-inc.php:419: // @TODO Rewritings: admin->assigned_admin,uid->userid,type->task_type_msg in template -./inc/modules/admin/overview-inc.php:431: // @TODO Rewrite this to $OUT .= ..., true, ... -./inc/modules/admin/overview-inc.php:435: // @TODO Rewrite this to $OUT .= ..., true, ... +./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/what-add_points.php:120: // @TODO Rewrite these both constants ./inc/modules/admin/what-add_points.php:54: // @TODO Rewrite this constant @@ -181,14 +180,22 @@ ./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:1516: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() -./inc/mysql-manager.php:1725: // @TODO Find a way for updating $_CONFIG here +./inc/mysql-manager.php:1523: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() +./inc/mysql-manager.php:1738: // @TODO Find a way for updating $_CONFIG here ./inc/mysql-manager.php:173: // @TODO Nothing helped??? -./inc/mysql-manager.php:1749: // @TODO Find a way for updating $_CONFIG here -./inc/mysql-manager.php:1833: // @TODO Rewrite this to $content = SQL_FETCHARRAY() -./inc/mysql-manager.php:2127: // @TODO This can be somehow rewritten +./inc/mysql-manager.php:1762: // @TODO Find a way for updating $_CONFIG here +./inc/mysql-manager.php:1846: // @TODO Rewrite this to $content = SQL_FETCHARRAY() +./inc/mysql-manager.php:2140: // @TODO This can be somehow rewritten ./inc/mysql-manager.php:617: // @TODO Why is this global??? #100 ./inc/mysql-manager.php:945: // @TODO Why does this lead into an endless loop but we still need it??? ./inc/mysql-manager.php:946: // @TODO Commented out LOAD_URL("admin.php"); ./mailid_top.php:211: // @TODO Rewrite these blocks to filter ./surfbar.php:65: // @TODO Display quick login form here or redirect as configured +### ### DEPRECATION FOLLOWS: ### ### +./inc/extensions/ext-sql_patches.php:587: // @DEPRECATED ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET gender=sex WHERE sex != 'M'"); +./inc/extensions/ext-sql_patches.php:588: // @DEPRECATED ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` DROP sex"); +./inc/functions.php:231: // @DEPRECATED Try to rewrite the if() condition +./inc/functions.php:2325: // @DEPRECATED Language array element found in BIG_LETTERS +./inc/functions.php:2328: // @DEPRECATED Deprecated constant found +./inc/functions.php:245: // @DEPRECATED +./inc/modules/admin/what-user_online.php:2:// @DEPRECATED diff --git a/DOCS/todo-builder.sh b/DOCS/todo-builder.sh index a005c9bbc7..cabf20a408 100644 --- a/DOCS/todo-builder.sh +++ b/DOCS/todo-builder.sh @@ -12,7 +12,7 @@ echo "$0: Generating TODOs.txt..." echo "### WARNING: THIS FILE IS AUTO-GENERATED BY $0 ###" > DOCS/TODOs.txt echo "### DO NOT EDIT THIS FILE. ###" >> DOCS/TODOs.txt find -type f -name "*.php" -exec grep -Hin "@TODO" {} \; | sort >> DOCS/TODOs.txt -echo "### ### DEPRECATION FOLLOWS: ### ###" >> docs/TODOs.txt +echo "### ### DEPRECATION FOLLOWS: ### ###" >> DOCS/TODOs.txt find -type f -name "*.php" -exec grep -Hin "@DEPRECATED" {} \; | sort >> DOCS/TODOs.txt echo "$0: Done." exit 0 diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index abb5ba51f1..7fbc40432c 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -357,7 +357,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) { } $OUT .= " -  · "; +
 · "; if (($menu == $act) && (empty($wht))) { $OUT .= ""; @@ -373,7 +373,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) { $OUT .= "]"; } - $OUT .= " + $OUT .= "
\n"; // Check for menu entries @@ -384,7 +384,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) { setAdminMenuHasEntries($menu, ((SQL_NUMROWS($result_what) > 0) && ($act == $menu))); // Do we have entries? - if (ifAdminMenuHasEntries($menu)) { + if ((ifAdminMenuHasEntries($menu)) && (SQL_NUMROWS($result_what) > 0)) { $GLOBALS['menu']['description'] = array(); $GLOBALS['menu']['title'] = array(); $SUB = true; $OUT .= " @@ -412,7 +412,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) { $GLOBALS['menu']['description'][$wht_sub] = $desc_what; $OUT .= " -  --> "; +
 --> "; if ($readable === true) { if ($wht == $wht_sub) { $OUT .= ""; @@ -434,7 +434,7 @@ function ADD_ADMIN_MENU ($act, $wht, $return=false) { } else { $OUT .= ""; } - $OUT .= " + $OUT .= "
\n"; } } diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index aff833a064..54f0fbf5b6 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -387,7 +387,6 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { // There are uncompleted jobs! // @TODO Rewrite this to one template and use $OUT = ... - LOAD_TEMPLATE("admin_overview_header"); $OUT = ""; $SW = 2; while ($content = SQL_FETCHARRAY($result_tasks)) { // Init infos @@ -428,12 +427,10 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { // Do we have extension task? if (($content['task_type'] == "EXTENSION") && (GET_EXT_VERSION($content['infos']) == "")) { // Load extension row template - // @TODO Rewrite this to $OUT .= ..., true, ... - LOAD_TEMPLATE("admin_overview_list_ext_rows", false, $content); + $OUT .= LOAD_TEMPLATE("admin_overview_list_ext_rows", true, $content); } else { // Load default row template - // @TODO Rewrite this to $OUT .= ..., true, ... - LOAD_TEMPLATE("admin_overview_list_rows", false, $content); + $OUT .= LOAD_TEMPLATE("admin_overview_list_rows", true, $content); } // Switch color @@ -444,7 +441,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) { SQL_FREERESULT($result_tasks); // Load footer template - LOAD_TEMPLATE("admin_overview_footer"); + LOAD_TEMPLATE("admin_overview_table", false, $OUT); } } // diff --git a/templates/de/html/admin/admin_overview_footer.tpl b/templates/de/html/admin/admin_overview_footer.tpl index ec0a4594ed..11f5d85d80 100644 --- a/templates/de/html/admin/admin_overview_footer.tpl +++ b/templates/de/html/admin/admin_overview_footer.tpl @@ -1,12 +1 @@ - - - - - - - - - - - - + diff --git a/templates/de/html/admin/admin_overview_header.tpl b/templates/de/html/admin/admin_overview_header.tpl index f203017174..11f5d85d80 100644 --- a/templates/de/html/admin/admin_overview_header.tpl +++ b/templates/de/html/admin/admin_overview_header.tpl @@ -1,16 +1 @@ -
- - - - - - - - - - - - - + diff --git a/templates/de/html/admin/admin_overview_list.tpl b/templates/de/html/admin/admin_overview_list.tpl index 4a6eb981d2..1d8ddd136a 100644 --- a/templates/de/html/admin/admin_overview_list.tpl +++ b/templates/de/html/admin/admin_overview_list.tpl @@ -1,9 +1,8 @@ -
-
{--ADMIN_TASK_SYSTEM_WELCOME--}
-
{--ID_SELECT--}{--ADMIN_ASSIGNED_ADMIN--}{--ADMIN_REGISTER_EXTENSION--}{--ADMIN_TASK_INFOS--}{--ADMIN_MEMBER_UID--}{--ADMIN_TASK_TYPE--}{--ADMIN_TASK_CREATED--}
- - - - {!__TASK_ROWS!} +
{--ADMIN_SELECTED_TASKS_ASSIGN--}:
+ + + +{!__TASK_ROWS!}
+ {--ADMIN_SELECTED_TASKS_ASSIGN--}: +
diff --git a/templates/de/html/admin/admin_overview_table.tpl b/templates/de/html/admin/admin_overview_table.tpl new file mode 100644 index 0000000000..40cf1641d8 --- /dev/null +++ b/templates/de/html/admin/admin_overview_table.tpl @@ -0,0 +1,30 @@ +
+ + + + + + + + + + + + + + +$content + + + +
+
{--ADMIN_TASK_SYSTEM_WELCOME--}
+
{--ID_SELECT--}{--ADMIN_ASSIGNED_ADMIN--}{--ADMIN_REGISTER_EXTENSION--}{--ADMIN_TASK_INFOS--}{--ADMIN_MEMBER_UID--}{--ADMIN_TASK_TYPE--}{--ADMIN_TASK_CREATED--}
+ +
-- 2.39.5