63 Commits

Author SHA1 Message Date
Le Philousophe 93d3aa56a1 WEB: Handle null cases
Sometimes variables may be null. Handle the cases when passing to
functions expecting something non-null.
2025-08-24 12:32:47 +02:00
Le Philousophe 710b95a5f4 WEB: Better error handling
When PHP functions fail they often return false instead of the expected
object type.
CHeck for this value and fail properly.
2025-08-24 12:32:47 +02:00
Le Philousophe cc9fa80181 WEB: Add typing 2025-08-24 12:32:47 +02:00
Le Philousophe d7c3bd0528 WEB: Various small fixes
These are either cosmetic or spotted by PHPStan
2025-08-24 12:32:47 +02:00
Le Philousophe d8ff9c3c75 WEB: Remove useless check
The function is expected to take an array or a string.
Array is checked above so what remains is a string.
Any other use is an error that should be reported (strlen will fail).
2025-08-24 12:32:46 +02:00
Le Philousophe 649ade2977 WEB: Make index a void function
It's used with Smarty::display which is void so there is never anything
to return and the return value was never checked.
Propagate this change everywhere.
2025-08-24 12:32:46 +02:00
Le Philousophe ee085bcdba WEB: Rework links localization
The new algorithm is more robust and avoids adding the localization path
fragment to unrelated ScummVM websites.
It also fixes URLs to keep the user on the same website it visited (www
vs without www).
2025-08-09 17:39:22 +02:00
Le Philousophe 832f769fe3 WEB: Add a description and a descriptive title for OpenGraph 2024-09-14 13:27:42 +02:00
Le Philousophe a08bd53973 WEB: Remove leading / in page URLs 2024-09-14 13:27:42 +02:00
Le Philousophe 7a6a3e7edd WEB: Upgrade for recent PHP and future Smarty v5 2024-09-14 13:14:49 +02:00
Mataniko 8780993416 WEB: Convert most most pages to use the ORM objects 2020-12-31 04:49:44 -05:00
Mataniko 02a48194c6 WEB: Really fix translation links 2020-12-29 21:11:49 -05:00
Mataniko aa19570df5 WEB: Fix links to translations when page starts with lang code 2020-12-29 20:47:49 -05:00
Mataniko 9590d5797e WEB: Revert release modifier regex 2020-11-24 14:51:10 -05:00
Mataniko b71677c47c WEB: Fix tools and legacy downloads 2020-11-24 14:51:10 -05:00
Mataniko f34caa9203 WEB: add a "release" modifier 2020-11-24 14:51:10 -05:00
mataniko 49b934db46 WEB: Redirect downloads to Fastly 2020-11-08 09:27:33 -05:00
Mataniko 0a394a6260 WEB: Adjust references to non-localized data 2020-10-10 01:34:06 -04:00
Mataniko cd420b7bce WEB: Define custom themes 2020-10-08 19:35:06 -04:00
Mataniko bcf45949d0 JANITORIAL: Code lint 2020-09-29 16:08:34 -04:00
Mataniko 35039fedb3 WEB: Update news and feed templates to use canonical language URLs 2020-09-29 16:08:34 -04:00
Mataniko cae79c85e3 L10N: Add new smarty modifier function to add lang url path 2020-09-29 16:08:34 -04:00
Mataniko e483873d57 WEB: Remove the lang cookie and leverage the url path instead 2020-09-29 16:08:34 -04:00
Mataniko db6cb726e8 WEB: Add a new SimpleModel class
The SimpleModel is used to to read simple data models from YAML that require no further processing

This allows us to delete several models that re-use the same code.
2020-09-27 22:08:07 -04:00
Mataniko 4471b291a1 WEB: Convert all models to not be static objects
This is a first step towards moving to a dependency injection model.
2020-09-27 22:08:07 -04:00
mataniko ed146dd3ab WEB: Add BiDi support for RTL languages 2020-09-01 00:10:54 -04:00
mataniko 2da6d8f010 WEB: Fix formatting and analysis errors 2020-09-01 00:10:54 -04:00
mataniko 819a958ccd WEB: Update Localization feature
Now L10N will automatically handle new locales and time formats added via Weblate.
2020-09-01 00:10:54 -04:00
Thierry Crozat b85b1249ab WEB: Fix parsing of some language
With the intorduction of the pt_BR language, the URL was no longer
parsed correctly as the language regexp was too restrictive.
2020-08-03 22:59:12 +01:00
Matan Bareket f48d95e174 WEB: Lint PHP files 2019-05-08 23:28:05 -04:00
Matan Bareket ec67ddce8a WEB: Move public files to /public_html 2019-04-27 01:53:43 -04:00
Matan Bareket b9df12da28 WEB: Revert 9d98a59 2019-01-23 05:28:31 -05:00
Matan Bareket 9d98a5991e WEB: Disable Smarty caching 2019-01-23 05:21:02 -05:00
Matan Bareket 07f704f814 WEB: Remove unused Smarty parameters and update syntax 2019-01-22 19:49:58 -05:00
Matan Bareket 56fc8e6d4f WEB: Remove unused constant 2019-01-22 19:49:58 -05:00
Matan Bareket 573416873c WEB: Remove Smarty global 2019-01-22 19:49:58 -05:00
Matan Bareket 2d07e63028 WEB: Remove unused code in Controller 2019-01-22 19:49:58 -05:00
Matan Bareket 2eff11cbb3 WEB: Clean up most PSR2 style warnings 2019-01-22 19:49:58 -05:00
Matan Bareket df825b7878 WEB: Fix phpstan static errors 2019-01-22 19:49:58 -05:00
Matan Bareket 85328f2997 WEB: Use PSR-4 autoloading 2019-01-22 19:49:58 -05:00
Matan Bareket cfbeebb8dc WEB: Add namespaces to all PHP files 2019-01-22 19:49:58 -05:00
Matan Bareket 851bb41bb7 WEB: Auto-fix to PSR-2 standard 2019-01-22 19:49:58 -05:00
Matan Bareket a15b8f4dca I18N: Automatically generate ini files and sanitize HTML 2018-11-05 13:45:03 -05:00
Matan Bareket 0ce6ab24c0 WEB: Fix date_localized on windows 2018-08-27 00:08:59 -04:00
Matan Bareket f0be08f8dc WEB: update templates includes to use the new folder structure 2018-07-26 07:17:40 -04:00
Matan Bareket ab1ded4bba WEB: Upgrade to Smarty 3 2018-07-26 07:17:40 -04:00
Colin Snover a5de04c699 WEB: Deduplicate allowed languages list 2016-04-24 13:47:53 +00:00
Adrian Astley 5c27ce3e0e WEB: Fix language switching
As mentioned in f3c2203e2f,
the language switching was always 1 behind. As in, the
language would be the last language you selected.

The first problem is that some of the smarty config variables
were being set after the call to _smarty->config_load(). Since
the smarty instance is cached, it was using the last set of variables.

I don't know why the production web site isn't throwing errors. My
personal set up wouldn't load until I could set _smarty->compile_dir
the first time. Perhaps the language update was done on the fly, so
smarty was still cached.

The next potential problem is persistence with $_SESSION.
The session is never initialized with session_start(). However,
the production php.ini may have session auto start enabled.
2016-01-21 12:43:43 -06:00
Eugene Sandulenko 14713d363a WEB: Made news dates translatable 2016-01-17 01:34:09 +01:00
Eugene Sandulenko 628ee9c980 WEB: Do not process Russian characters 2016-01-16 23:43:58 +01:00