Skip to content

Fix a lot of single issues and overhaul the language settings

onli requested to merge github/fork/stephanbrunker/master into master

Created by: stephanbrunker

  • admin/personal.inc.php: removed setting of $_SESSION: serendipity_lang (already set in serendipity_config.inc.php for all scenarios)
  • compat.inc.php: function detectLanguage returns now NULL if the detection failed, also doesn't change $serendipity['autolang'] anymore which remains 'en' as general fallback.
  • functions.entries.php:
    • function serendipity_printArchives() hooks now into hook_event::'frontend_fetchentries' to get multilingual data, also doesn't show months and years with zero entries.
    • function fetchEntryCategories, fetchEntryData and fetchCategories strips now data of multilingual tags
  • plugin_api.inc.php: added function find_plugin_id which returns an array of the ids of the installed instances of the given plugin this is used for checking the configuration of that plugin in other plugins
  • functions.config.inc.php: function serendipity_load_configuration sets the language back to 'autolang' (which is 'en') if the language loaded does not exist. Also sets the value $serendipity['default_lang'] to the default language of the blog.
  • functions.config.inc.php: removed the Cookie 'userDefLang' which is no longer needed
  • functions.config.inc.php: major rework of the functions serendipity_getSessionLanguage and serendipity_getPostAuthSessionLanguage. Those two functions should now process the user input via GET and POST, store it into SESSION and COOKIE, and if no such input is given, fallback to browser language negotiation and default language. More details in the comments to that functions. $serendipity['detected_lang'] is the language found from user input or browser negotiation.
  • functions.routing.inc.php: fix some lookups from $_GET to $serendipity['GET']
  • admin/plugins.inc.php: fix some lookups from $_GET to $serendipity['GET']
  • created a new event hook 'multilingual_strip_langs' to strip tagged translation of elements outside the sidebar (mostly categories in entry display)

event_entryproperties:

  • removed 'WHERE' keyword from fetchentries event hook, because that should be handled by the issuing SQL

event_nl2br:

  • just changed the indent to spaces for the piece of code i'd written in my last commit

event_spartacus:

  • fixed a call to a NULL value if the server cannot make a connection

plugin_categories:

  • stripped the translation tags from the links

plugin_recententries:

  • using the sql condition set aquired by event_hook::'frontend_fetchentries' to get the multilingual data set
  • $this->title (= title in backend) set to plugin name

plugin_superuser:

  • changed the link to /serendipity_admin.php

Merge request reports