From ebb5d93c1d0234fff9cf3c46690904174b3fd15d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 27 Jan 2011 03:20:04 +0000 Subject: [PATCH] Fixes some HTML errors, shell scripts cleaned up --- .gitattributes | 6 + DOCS/TODOs.txt | 7 - DOCS/final-checker.sh | 12 +- DOCS/todo-builder.sh | 2 + DOCS/validator.sh | 6 +- inc/extensions/ext-sql_patches.php | 2 +- inc/libs/security_functions.php | 4 +- inc/modules/admin/what-list_bank_package.php | 4 +- inc/modules/admin/what-list_surfbar_urls.php | 54 +++---- inc/xml-functions.php | 44 ++++++ templates/de/html/admin/admin_list_beg.tpl | 2 +- templates/de/html/admin/admin_login_form.tpl | 2 +- templates/de/html/install/install_page3.tpl | 8 +- templates/xml/.htaccess | 1 + templates/xml/admin/.htaccess | 1 + .../admin/admin_edit_show_surfbar_urls.xml | 132 ++++++++++++++++++ templates/xml/admin_data_template.xml | 123 ++++++++++++++++ templates/xml/template.xml | 28 ++++ 18 files changed, 379 insertions(+), 59 deletions(-) create mode 100644 inc/xml-functions.php create mode 100644 templates/xml/.htaccess create mode 100644 templates/xml/admin/.htaccess create mode 100644 templates/xml/admin/admin_edit_show_surfbar_urls.xml create mode 100644 templates/xml/admin_data_template.xml create mode 100644 templates/xml/template.xml diff --git a/.gitattributes b/.gitattributes index 6f9071e46e..b952308b96 100644 --- a/.gitattributes +++ b/.gitattributes @@ -745,6 +745,7 @@ inc/weekly/.htaccess -text svneol=unset#text/plain inc/weekly/weekly_ -text svneol=unset#text/plain inc/weekly/weekly_surfbar.php -text svneol=unset#text/plain inc/wrapper-functions.php -text svneol=unset#text/plain +inc/xml-functions.php svneol=native#text/plain /index.php -text svneol=unset#text/plain /install.php -text svneol=unset#text/plain install/menu-de.sql -text @@ -1774,6 +1775,11 @@ templates/en/html/mailid/.htaccess -text svneol=unset#text/plain templates/en/html/member/.htaccess -text svneol=unset#text/plain templates/en/html/register_header.tpl -text svneol=unset#text/plain templates/en/html/welcome.tpl -text svneol=unset#text/plain +templates/xml/.htaccess svneol=native#text/plain +templates/xml/admin/.htaccess svneol=native#text/plain +templates/xml/admin/admin_edit_show_surfbar_urls.xml -text +templates/xml/admin_data_template.xml -text +templates/xml/template.xml -text theme/business/css/beg.css -text theme/business/css/doubler.css -text theme/business/css/general.css -text diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 17ef26b3f3..ac953e6ee4 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -275,17 +275,10 @@ PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/ PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/member/member_content_right.tpl, line: 5 in PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/member/member_welcome_footer.tpl, line: 1 in PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/member/member_footer.tpl, line: 6 in -PHP Warning: DOMDocument::loadHTMLFile(): Attribute class redefined in templates/de/html/install/install_page3.tpl, line: 21 in -PHP Warning: DOMDocument::loadHTMLFile(): Attribute class redefined in templates/de/html/install/install_page3.tpl, line: 27 in -PHP Warning: DOMDocument::loadHTMLFile(): Attribute class redefined in templates/de/html/install/install_page3.tpl, line: 33 in -PHP Warning: DOMDocument::loadHTMLFile(): Attribute class redefined in templates/de/html/install/install_page3.tpl, line: 39 in PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : div in templates/de/html/page_footer.tpl, line: 1 in /home PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/menu/menu_what_end.tpl, line: 1 in PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/menu/menu_what_end.tpl, line: 2 in -PHP Warning: DOMDocument::loadHTMLFile(): Attribute class redefined in templates/de/html/admin/admin_list_beg.tpl, line: 23 in -PHP Warning: DOMDocument::loadHTMLFile(): Attribute align redefined in templates/de/html/admin/admin_list_beg.tpl, line: 23 in PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_logout_sql_patches_remove.tpl, line: 10 in -PHP Warning: DOMDocument::loadHTMLFile(): Attribute class redefined in templates/de/html/admin/admin_login_form.tpl, line: 29 in PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : td in templates/de/html/admin/admin_main_footer.tpl, line: 1 in PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : tr in templates/de/html/admin/admin_main_footer.tpl, line: 2 in PHP Warning: DOMDocument::loadHTMLFile(): Unexpected end tag : table in templates/de/html/admin/admin_main_footer.tpl, line: 12 in diff --git a/DOCS/final-checker.sh b/DOCS/final-checker.sh index 93e39a701e..40526a7fc5 100755 --- a/DOCS/final-checker.sh +++ b/DOCS/final-checker.sh @@ -13,16 +13,20 @@ echo " - TODOs in PHP..." TODOS_PHP=`find -type f -name "*.php" -exec grep "@TODO" {} \; | grep "@" --count` echo " - TODOs in TPL..." TODOS_TPL=`find -type f -name "*.tpl" -exec grep "@TODO" {} \; | grep "@" --count` -echo " - DEPRECATED PHP..." +echo " - TODOs in XML..." +TODOS_XML=`find -type f -name "*.xml" -exec grep "@TODO" {} \; | grep "@" --count` +echo " - DEPRECATED in PHP..." DEPRECATED_PHP=`find -type f -name "*.php" -exec grep "@DEPRECATED" {} \; | grep "@" --count` -echo " - DEPRECATED TPL..." +echo " - DEPRECATED in TPL..." DEPRECATED_TPL=`find -type f -name "*.tpl" -exec grep "@DEPRECATED" {} \; | grep "@" --count` +echo " - DEPRECATED in XML..." +DEPRECATED_XML=`find -type f -name "*.xml" -exec grep "@DEPRECATED" {} \; | grep "@" --count` echo " - global statements..." GLOBALS=`find -type f -name "*.php" -exec grep -Hn "global " {} \; | grep -v "//" | grep -v "phpmailer" --count` echo "$0: Result..." echo "--------------------------------------" -echo " - Open TODOs: ${TODOS_PHP}/${TODOS_TPL}" -echo " - Open DEPRECATED: ${DEPRECATED_PHP}/${DEPRECATED_TPL}" +echo " - Open TODOs: ${TODOS_PHP}/${TODOS_TPL}/${TODOS_XML}" +echo " - Open DEPRECATED: ${DEPRECATED_PHP}/${DEPRECATED_TPL}/${DEPRECATED_XML}" echo " - global statements: ${GLOBALS}" echo "--------------------------------------" echo "$0: Thanks for waiting for the final release 0.2.1-FINAL! :-)" diff --git a/DOCS/todo-builder.sh b/DOCS/todo-builder.sh index f059853f7c..0b4b568bee 100755 --- a/DOCS/todo-builder.sh +++ b/DOCS/todo-builder.sh @@ -16,10 +16,12 @@ echo "### DO NOT EDIT THIS FILE. ###" >> ${TODO} echo "$0: Searching for @TODO ..." find -type f -name "*.php" -exec grep -Hin "@TODO" {} \; | sort >> ${TODO} find -type f -name "*.tpl" -exec grep -Hin "@TODO" {} \; | sort >> ${TODO} +find -type f -name "*.xml" -exec grep -Hin "@TODO" {} \; | sort >> ${TODO} echo "### ### DEPRECATION FOLLOWS: ### ###" >> ${TODO} echo "$0: Searching for @DEPRECATED ..." find -type f -name "*.php" -exec grep -Hin "@DEPRECATED" {} \; | sort >> ${TODO} find -type f -name "*.tpl" -exec grep -Hin "@DEPRECATED" {} \; | sort >> ${TODO} +find -type f -name "*.xml" -exec grep -Hin "@DEPRECATED" {} \; | sort >> ${TODO} echo "$0: Checking for template-warnings.log ..." LOG=`dirname $0`/template-warnings.log if test -e "${LOG}"; then diff --git a/DOCS/validator.sh b/DOCS/validator.sh index 6b6e8270bf..20aedf2a56 100755 --- a/DOCS/validator.sh +++ b/DOCS/validator.sh @@ -2,6 +2,8 @@ echo "$0: Validating all templates..." DUMMY=`find templates/de/html/ -type f -name *.tpl -exec php DOCS/tpl-validator.php {} \; 2>&1` -echo "${DUMMY}" | grep "Warning" | cut -d "/" -f 1-5 | grep -v "error parsing attribute name" > `dirname $0`/template-warnings.log +echo "${DUMMY}" | \ + grep "Warning" | \ + cut -d "/" -f 1-5 | \ + grep -v "error parsing attribute name" > `dirname $0`/template-warnings.log echo "$0: done." - diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 87e1c8c3ba..167b5655ce 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -566,7 +566,7 @@ PRIMARY KEY (`id`) addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_refdepths` CHANGE `percents` `percents` FLOAT(8,5) UNSIGNED NOT NULL DEFAULT 0.00000"); // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Prozentsätze können nun fünf Stelle hinter dem Komma sein."); + setExtensionUpdateNotes("Prozentsätze können nun fünf Stellen hinter dem Komma sein."); break; case '0.5.3': // SQL queries for v0.5.3 diff --git a/inc/libs/security_functions.php b/inc/libs/security_functions.php index faeccb51a6..2b41ab968c 100644 --- a/inc/libs/security_functions.php +++ b/inc/libs/security_functions.php @@ -36,7 +36,9 @@ ************************************************************************/ // Run only once this security check/replacement -if (defined('__SECURITY')) return; +if (defined('__SECURITY')) { + return; +} // END - if // Some security stuff... if (strpos($_SERVER['PHP_SELF'], basename(__FILE__)) !== false) { diff --git a/inc/modules/admin/what-list_bank_package.php b/inc/modules/admin/what-list_bank_package.php index 86fc276b8b..4c5b0c112e 100644 --- a/inc/modules/admin/what-list_bank_package.php +++ b/inc/modules/admin/what-list_bank_package.php @@ -108,7 +108,7 @@ if ((isPostRequestParameterSet('id')) && (is_array(postRequestParameter('id'))) ) ); $show = false; - } elseif (isPostRequestParameterSet('do_edit')) { + } elseif (isFormSent('do_edit')) { // Delete entries (with confirmation) adminEditEntriesConfirm( postRequestParameter('id'), @@ -118,7 +118,7 @@ if ((isPostRequestParameterSet('id')) && (is_array(postRequestParameter('id'))) array(), true ); - } elseif (isPostRequestParameterSet('delete')) { + } elseif (isFormSent('delete')) { // Delete entries (with confirmation) adminDeleteEntriesConfirm( postRequestParameter('id'), diff --git a/inc/modules/admin/what-list_surfbar_urls.php b/inc/modules/admin/what-list_surfbar_urls.php index 5204455333..d2163ad8f7 100644 --- a/inc/modules/admin/what-list_surfbar_urls.php +++ b/inc/modules/admin/what-list_surfbar_urls.php @@ -58,36 +58,11 @@ if ((countRequestPost() > 0) && ((!isPostRequestParameterSet('url_id')) || (!is_ // Edit or delete button hit? if (isFormSent('edit')) { // Show entries for editing - adminEditEntriesConfirm( - postRequestParameter('url_id'), - 'surfbar_urls', - array( - 'url_id', - 'url_userid', - 'url' - ), - array( - 'bigintval', - 'addMemberSelectionBox', - '' - ), - array( - '', - array( - false, - true, - true, - 'url_userid[]' - ), - '' - ), - false, - 'url_id', - 'url_userid', - 'url_userid' - ); + showEntriesByXmlCallback('admin_edit_show_surfbar_urls'); + + // Do not show the list of URLs after this template $show = false; -} elseif (isPostRequestParameterSet('do_edit')) { +} elseif (isFormSent('do_edit')) { // Change data of entries adminEditEntriesConfirm( postRequestParameter('url_id'), @@ -100,10 +75,10 @@ if (isFormSent('edit')) { 'url_userid', 'url_userid' ); -} elseif (isPostRequestParameterSet('delete')) { +} elseif (isFormSent('delete')) { // Show entries for deletion adminDeleteEntriesConfirm( - postRequestParameter('url_id'), + postRequestParameter('url_id'), 'surfbar_urls', array( 'url_id', @@ -128,8 +103,10 @@ if (isFormSent('edit')) { 'url_userid', 'url_userid' ); + + // Do not show the list of URLs after this template $show = false; -} elseif (isPostRequestParameterSet('do_delete')) { +} elseif (isFormSent('do_delete')) { // Remove entries from database adminDeleteEntriesConfirm( postRequestParameter('url_id'), @@ -171,8 +148,10 @@ if (isFormSent('edit')) { 'url_userid', 'url_userid' ); + + // Do not show the list of URLs after this template $show = false; -} elseif (isPostRequestParameterSet('do_lock')) { +} elseif (isFormSent('do_lock')) { // Un-/lock selected URLs. This does not work for pending URLs adminLockEntriesConfirm( postRequestParameter('url_id'), @@ -191,7 +170,7 @@ if (isFormSent('edit')) { 'url_userid', 'url_userid' ); -} elseif (isPostRequestParameterSet('undelete')) { +} elseif (isFormSent('undelete')) { // Undelete selected URLs. This does only work for deleted URLs... ;-) adminUndeleteEntriesConfirm( postRequestParameter('url_id'), @@ -223,7 +202,7 @@ if (isFormSent('edit')) { 'url_userid' ); $show = false; -} elseif (isPostRequestParameterSet('do_undelete')) { +} elseif (isFormSent('do_undelete')) { // Undelete selected URLs. This does only work for deleted URLs... ;-) adminUndeleteEntriesConfirm( postRequestParameter('url_id'), @@ -244,7 +223,10 @@ if (isFormSent('edit')) { } // Show entries? -if ($show === false) return false; +if ($show === false) { + // No, a form has already been show + return false; +} // END - if // List all URLs $result = SQL_QUERY("SELECT diff --git a/inc/xml-functions.php b/inc/xml-functions.php new file mode 100644 index 0000000000..94a9b6a0ed --- /dev/null +++ b/inc/xml-functions.php @@ -0,0 +1,44 @@ + diff --git a/templates/de/html/admin/admin_list_beg.tpl b/templates/de/html/admin/admin_list_beg.tpl index 8dc492893e..1fa9289d14 100644 --- a/templates/de/html/admin/admin_list_beg.tpl +++ b/templates/de/html/admin/admin_list_beg.tpl @@ -14,7 +14,7 @@ {--BEG_TOTAL--}: - {--LAST_ONLINE_SHORT--}: diff --git a/templates/de/html/admin/admin_login_form.tpl b/templates/de/html/admin/admin_login_form.tpl index 1d97c9a577..2852fcd788 100644 --- a/templates/de/html/admin/admin_login_form.tpl +++ b/templates/de/html/admin/admin_login_form.tpl @@ -26,7 +26,7 @@ - + $content[pass_message] diff --git a/templates/de/html/install/install_page3.tpl b/templates/de/html/install/install_page3.tpl index b0c4affbc6..42d7554ac4 100644 --- a/templates/de/html/install/install_page3.tpl +++ b/templates/de/html/install/install_page3.tpl @@ -14,25 +14,25 @@ {--INSTALLER_TEXT_SMTP_HOST--}: - {--INSTALLER_TEXT_SMTP_USER--}: - {--INSTALLER_TEXT_SMTP_PASS1--}: - {--INSTALLER_TEXT_SMTP_PASS2--}: - diff --git a/templates/xml/.htaccess b/templates/xml/.htaccess new file mode 100644 index 0000000000..3a42882788 --- /dev/null +++ b/templates/xml/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/templates/xml/admin/.htaccess b/templates/xml/admin/.htaccess new file mode 100644 index 0000000000..3a42882788 --- /dev/null +++ b/templates/xml/admin/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/templates/xml/admin/admin_edit_show_surfbar_urls.xml b/templates/xml/admin/admin_edit_show_surfbar_urls.xml new file mode 100644 index 0000000000..b4230ab3e7 --- /dev/null +++ b/templates/xml/admin/admin_edit_show_surfbar_urls.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/xml/admin_data_template.xml b/templates/xml/admin_data_template.xml new file mode 100644 index 0000000000..a1639cb580 --- /dev/null +++ b/templates/xml/admin_data_template.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/xml/template.xml b/templates/xml/template.xml new file mode 100644 index 0000000000..19f7c37e84 --- /dev/null +++ b/templates/xml/template.xml @@ -0,0 +1,28 @@ + + -- 2.39.2