]> git.mxchange.org Git - mailer.git/commitdiff
New function getMenuModeFromModule() introduced:
authorRoland Häder <roland@mxchange.org>
Sun, 25 Nov 2012 20:18:24 +0000 (20:18 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 25 Nov 2012 20:18:24 +0000 (20:18 +0000)
- Introduced getMenuModeFromModule() which determines the "menu mode" from
  given module. This value can also be used for template names
- Old template removed (listed.tp)
- TODOs.txt updated

.gitattributes
DOCS/TODOs.txt
inc/filters.php
inc/functions.php
inc/module-functions.php
inc/template-functions.php
templates/de/html/admin/admin_metadata.tpl [new file with mode: 0644]
templates/de/html/guest/guest_metadata.tpl [new file with mode: 0644]
templates/de/html/listed.tp [deleted file]
templates/de/html/metadata.tpl

index d6c907e9aafeb5f0f4f9a85bfa0c8dc9a4925b04..51d3c4e59dc451a0253a925b4f1a45e8e38018e2 100644 (file)
@@ -1569,6 +1569,7 @@ templates/de/html/admin/admin_menu_hints.tpl svneol=native#text/plain
 templates/de/html/admin/admin_menu_hints_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_menu_overview_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_menu_status_row.tpl svneol=native#text/plain
+templates/de/html/admin/admin_metadata.tpl svneol=native#text/plain
 templates/de/html/admin/admin_mini_online.tpl svneol=native#text/plain
 templates/de/html/admin/admin_mods_footer_edit.tpl svneol=native#text/plain
 templates/de/html/admin/admin_mods_footer_list.tpl svneol=native#text/plain
@@ -1800,6 +1801,7 @@ templates/de/html/guest/guest_menu_content.tpl svneol=native#text/plain
 templates/de/html/guest/guest_menu_row.tpl svneol=native#text/plain
 templates/de/html/guest/guest_menu_td.tpl svneol=native#text/plain
 templates/de/html/guest/guest_menu_title.tpl svneol=native#text/plain
+templates/de/html/guest/guest_metadata.tpl svneol=native#text/plain
 templates/de/html/guest/guest_nickname_login.tpl svneol=native#text/plain
 templates/de/html/guest/guest_paidlinks_register.tpl svneol=native#text/plain
 templates/de/html/guest/guest_paidlinks_register_header.tpl svneol=native#text/plain
@@ -1873,7 +1875,6 @@ templates/de/html/js/js_surfbar_member_edit.tpl svneol=native#text/plain
 templates/de/html/js/js_surfbar_stopped.tpl svneol=native#text/plain
 templates/de/html/js/js_uberwach.tpl svneol=native#text/plain
 templates/de/html/lead_code.tpl svneol=native#text/plain
-templates/de/html/listed.tp -text
 templates/de/html/loader.tpl svneol=native#text/plain
 templates/de/html/login_failed_js.tpl svneol=native#text/plain
 templates/de/html/login_failures.tpl svneol=native#text/plain
index a00ba0561457b3873571e7c9176ad0f94f5a7173..ba1aef8f21d88eacff0a690d22b3fb6900ac5a92 100644 (file)
 ./inc/filter/cache_filter.php:94:              // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
 ./inc/filter/forced_filter.php:73:             // @TODO This part is unfinished
 ./inc/filters.php:1320:                // @TODO No banner found, output some default banner
-./inc/functions.php:1102:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
-./inc/functions.php:1188:                      // @TODO Are these convertions still required?
-./inc/functions.php:1209:// @TODO Rewrite this function to use readFromFile() and writeToFile()
-./inc/functions.php:1814:      // @TODO Find a way to cache this
-./inc/functions.php:1919:      // @TODO This is still very static, rewrite it somehow
-./inc/functions.php:2123:      // @TODO Rename column data_type to e.g. mail_status
-./inc/functions.php:2473:// @TODO cacheFiles is not yet supported
+./inc/functions.php:1104:                      // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
+./inc/functions.php:1190:                      // @TODO Are these convertions still required?
+./inc/functions.php:1211:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:1816:      // @TODO Find a way to cache this
+./inc/functions.php:1921:      // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2125:      // @TODO Rename column data_type to e.g. mail_status
+./inc/functions.php:2475:// @TODO cacheFiles is not yet supported
 ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
 ./inc/header.php:66:// @TODO Find a way to not use direct module comparison
 ./inc/install-functions.php:402:       // @TODO Comparing with DEFAULT_MAIN_TITLE doesn't work
 ./inc/modules/admin/what-holiday_list.php:46:// @TODO Unused at the moment
 ./inc/modules/admin/what-list_admins_acls.php:126:     // @TODO Rewrite this to filter 'run_sqls'
 ./inc/modules/admin/what-list_autopurge.php:47:// @TODO Rewrite those lines to filter
-./inc/modules/admin/what-list_bonus.php:137:           // @TODO Can't this be moved into our expression language?
+./inc/modules/admin/what-list_bonus.php:136:           // @TODO Can't this be moved into our expression language?
 ./inc/modules/admin/what-list_links.php:96:                                    // @TODO Rewrite this to includes/filter
 ./inc/modules/admin/what-list_mods.php:55:                     // @TODO This can be moved into mysql-function.php, see checkModulePermissions() function
 ./inc/modules/admin/what-list_rallye_prices.php:222:                   // @TODO Rewrite these two constants
 ./inc/template-functions.php:1145:                     // @TODO Deprecate this thing
 ./inc/template-functions.php:1252:     // @TODO This can be easily moved out after the merge from EL branch to this is complete
 ./inc/template-functions.php:1301:             // @TODO Add a little more infos here
-./inc/template-functions.php:1676:// @TODO Lame description for this function
-./inc/template-functions.php:1698:                     // @TODO Move this in a filter
+./inc/template-functions.php:1667:// @TODO Lame description for this function
+./inc/template-functions.php:1689:                     // @TODO Move this in a filter
 ./inc/template-functions.php:200:       * @TODO On some pages this is buggy
-./inc/template-functions.php:2313:     // @TODO Is this needed for e.g. $GLOBALS['template_content'] ? $this->setRawTemplateData($compactedContent);
+./inc/template-functions.php:2323:     // @TODO Is this needed for e.g. $GLOBALS['template_content'] ? $this->setRawTemplateData($compactedContent);
 ./inc/template-functions.php:288:      // @TODO Remove these sanity checks if all is fine
 ./inc/template-functions.php:625:// @TODO $simple/$constants are deprecated
 ./inc/template-functions.php:723:                      // @TODO $userid is deprecated and should be removed from loadEmailTemplate() and replaced with $content[userid] in all templates
-./inc/wrapper-functions.php:3008:      // @TODO Find a way to not use direct module comparison
+./inc/wrapper-functions.php:3020:      // @TODO Find a way to not use direct module comparison
 ./inc/wrapper-functions.php:512:// @TODO Do some more sanity check here
 ./inc/xml-functions.php:240:   // @TODO Handle characters
 ./mailid.php:102:              // @TODO Rewrite this to a filter
 ./templates/de/html/guest/guest_paidlinks_register_header.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/guest/guest_paidlinks_register.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/install/install_header.tpl:1:<!-- @DEPRECATED //-->
+./templates/de/html/metadata.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/theme_one.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/theme_select_box.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/theme_select_form.tpl:1:<!-- @DEPRECATED //-->
index ceaaa50cec874ae0fafc5710fd24bab3a4552b4a..bd804baf9be9f455810726a2c7f3f0d45af85797 100644 (file)
@@ -1094,12 +1094,12 @@ function FILTER_LOAD_PAGE_HEADER () {
        $GLOBALS['__page_header'] = loadTemplate('page_header', TRUE);
 
        // Include meta data in 'guest' module
-       if ((isModuleSet()) && (getModule() == 'index')) {
+       if (isModuleSet()) {
                // Load meta data template
-               $GLOBALS['__page_header'] .= loadTemplate('metadata', TRUE);
+               $GLOBALS['__page_header'] .= loadTemplate(getMenuModeFromModule() . '_metadata', TRUE);
 
                // Add meta description to header
-               if ((isInstalled()) && (isAdminRegistered()) && (SQL_IS_LINK_UP())) {
+               if ((isInstalled()) && (isAdminRegistered()) && (SQL_IS_LINK_UP()) && (getModule() == 'index')) {
                        // Add meta description not in admin and login module and when the script is installed
                        generateMetaDescriptionCode();
                } // END - if
index 4ff81b5d8d5438be596a373f85e29f0965b47cbe..1935e2a8ccedda9cacd01492dec25e57fe0f4df6 100644 (file)
@@ -1828,7 +1828,6 @@ function mapModuleToTable ($moduleName) {
                case 'login': // ... and 'login' the member's menu
                        $moduleName = 'member';
                        break;
-
                // Anything else will not be mapped, silently.
        } // END - switch
 
index 9c9fafac9dcfacfedf6df4fc7cb9def38b36384e..cf0ea0d049c190ed50e747df9ee77ab5d1edbac9 100644 (file)
@@ -525,5 +525,32 @@ function doIncludeModule () {
        loadIncludeOnce('inc/footer.php');
 }
 
+// "Getter" for menu mode from given module
+function getMenuModeFromModule () {
+       // Is cache set?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Default is NULL
+               $GLOBALS[__FUNCTION__] = NULL;
+
+               // Determine it hard-coded
+               if (getModule() == 'login') {
+                       // Is member area
+                       $GLOBALS[__FUNCTION__] = 'member';
+               } elseif (getModule() == 'index') {
+                       // Is guest area
+                       $GLOBALS[__FUNCTION__] = 'guest';
+               } elseif (getModule() == 'admin') {
+                       // Is admin area
+                       $GLOBALS[__FUNCTION__] = 'admin';
+               } else {
+                       // Get it from filter
+                       $GLOBALS[__FUNCTION__] = runFilterChain('determine_menu_mode');
+               }
+       } // END - if
+
+       // Return it
+       return $GLOBALS[__FUNCTION__];
+}
+
 // [EOF]
 ?>
index e2cb87becc01362a6d44a03faa6667fd7b545dac..a4c4d6f0a9f114da1630cba0dfb5805466aeea63 100644 (file)
@@ -1549,17 +1549,8 @@ function determinePageTitle () {
                        $pageTitle .= ' {%config,trim=title_middle%} {DQUOTE} . getModuleTitle(getModule()) . {DQUOTE}';
                } // END - if
 
-               // Add title from what file
-               $menuMode = '';
-               if (getModule() == 'login') {
-                       $menuMode = 'member';
-               } elseif (getModule() == 'index') {
-                       $menuMode = 'guest';
-               } elseif (getModule() == 'admin') {
-                       $menuMode = 'admin';
-               } elseif (getModule() == 'sponsor') {
-                       $menuMode = 'sponsor';
-               }
+               // Get menu mode from module
+               $menuMode = getMenuModeFromModule();
 
                // Add middle part (always in admin area!)
                if ((!empty($menuMode)) && ((isWhatTitleEnabled()) || ($menuMode == 'admin'))) {
diff --git a/templates/de/html/admin/admin_metadata.tpl b/templates/de/html/admin/admin_metadata.tpl
new file mode 100644 (file)
index 0000000..fddd968
--- /dev/null
@@ -0,0 +1 @@
+<meta name="robots" content="noindex, nofollow, noarchive, nosnippet" />
\ No newline at end of file
diff --git a/templates/de/html/guest/guest_metadata.tpl b/templates/de/html/guest/guest_metadata.tpl
new file mode 100644 (file)
index 0000000..a7eb109
--- /dev/null
@@ -0,0 +1,4 @@
+<meta name="author" content="Roland H&auml;der" />
+<meta name="publisher" content="Ihr Name nochmal" />
+<meta name="keywords" content="{?POINTS?}, mailtausch, mailversand, kostenlos, kostenloser, mailexchange, werbemail, werbemailversand, exchange, werbepunkte, punkte, auktion, auktionen, umsonst, sms kostenlos, produkte, produktproben, gewinn, gewinnspiel, gratis sms, promotion, besucher, werbung, linkliste, geldverdienen, verdienen, traffic, hits" />
+<meta name="robots" content="index,follow" />
diff --git a/templates/de/html/listed.tp b/templates/de/html/listed.tp
deleted file mode 100644 (file)
index e69de29..0000000
index a7eb109c89ced7eeee9f84407051144b8d0de9c3..11f5d85d80b1ca4d16cf4c19e14af24e5ec2a60f 100644 (file)
@@ -1,4 +1 @@
-<meta name="author" content="Roland H&auml;der" />
-<meta name="publisher" content="Ihr Name nochmal" />
-<meta name="keywords" content="{?POINTS?}, mailtausch, mailversand, kostenlos, kostenloser, mailexchange, werbemail, werbemailversand, exchange, werbepunkte, punkte, auktion, auktionen, umsonst, sms kostenlos, produkte, produktproben, gewinn, gewinnspiel, gratis sms, promotion, besucher, werbung, linkliste, geldverdienen, verdienen, traffic, hits" />
-<meta name="robots" content="index,follow" />
+<!-- @DEPRECATED //-->