Commit graph

17 commits

Author SHA1 Message Date
Sam
6f15e14392
chore: fix styleci (#3588)
Co-authored-by: Sam <samerton@users.noreply.github.com>
2025-03-29 10:50:03 +00:00
Sam
db647d9b4e
Add Smarty and Twig template engines (#3452)
* Add Smarty and Twig template engines

* Update composer.json

* Convert Widgets class to template engine and PHPStan fixes

* Fix widget initialisation

* Fix panel widget initialisation

* chore: remove debug return

* feat: convert 403/404 pages to new template system and general tidy

* chore: style fixes

* feat: update latest pages to new template engine

* feat: template base should not be nullable in onPageLoad

* feat: set template base directory upon initialisation and allow custom smarty security directories

* chore: fix style
2025-02-24 18:44:29 +00:00
tadhgboyle
0c80570609
Enable StyleCI (#3475)
* Create StyleCI config file

* Disable `phpdoc_separation`

* Apply fixes from StyleCI (#3476)

Co-authored-by: StyleCI Bot <bot@styleci.io>

* style: styleci fixes

---------

Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Sam <samerton@users.noreply.github.com>
2024-03-09 11:19:55 +00:00
PadowYT2
f01f8b3dbe Resolve conversation & from #2757 2022-05-27 11:54:24 +03:00
Tadhg Boyle
d3ce574a85
Remove a lot of queries (StaffCP < 20, Frontend 10-15 less) (#2684)
Co-authored-by: samerton <samerton@users.noreply.github.com>
2022-04-23 20:02:00 +01:00
Tadhg Boyle
2c21149a1e
Use i18n for translations (#2658)
* Dependency updates

* Start i18n conversion

* Switch to ellipsis character

* Add Dutch language json

* Remove Dutch PHP language files + fix variables

* Further variable fixes

* WIP i18n Language class conversion

* Convert Cookie Consent module to new language format

* Further progress including timeago translations

* Misc

* Replace {x}

* Replace more {x} usage

* {{time}}

this took way too long

* replace last {x}

* Remove comments

So searching for {x} produces relevant results

* forgot to save

* move to onPageLoad

* Accept both string and int

* types in doc

* Remove unused (broken?) function

* Don't convert to string first

* Last arg doesn't seem to be used anywhere

* Time `{x}` replacements

* Email `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* misc `{x}` replacements

* remove comments (makes searching for "{x}" nicer)

* misc `{x}` replacements

* JS `{x}` replacements

* Cleanup language initialization

* Change language constant + add pluralForm support

* Misc language update things

* Add script to find unused terms

* Check all quote types

* Remove most english translations from non-english languages

* Also match with more args

* Missed some apparently

* Missed some (more) apparently

* Misc work

* Add script to convert *all* language files to json

* Fix language codes

* Remove a lot of unused terms

* Remove a lot more unused terms

* Convert everything to JSON, delete old files, get installer working with new system

* Fix general configuration language dropdown + email messages

* Fix page load time, fix language term `set` method

* Fix discord integration command

* Misc

* Misc

* Uncomment RTL definition

* Misc

* Convert links

* Convert links

* Convert links

* Convert links

* Misc work (bolding, fixes, etc)

* Style fix

* Fix variable

* Fix #2668

* Fix old page load timers

* Fix installer group sync injector error

* Convert integration language terms

* Fix more integration language things

* Re-add upgrade script language things

* Resolve PR comments

* Remove unnecessary date()

* Resolve some PR issues

* Fix endpoint

* Style

* Fix Semantic -> Fomantic

* Fix Semantic -> Fomantic

* Return locale short code, not language id/name

Only the short code is interesting to the API, return short code in user info endpoint just like in the website info endpoint.

Also renamed to locale because it's language + region

* Revert "warn people to not translate old language files"

This reverts commit 690b77afff.

* Fix query when there are no filters

* Update 200-pr12.php

* Update footer.php

* insert time into string using placeholder

* Fix getDisplayname case

* Clean username

* PR suggestions

* Include newly created language in converted languages (migration)

* PR suggestions

* PR suggestions

* Update init.php

* Fix default language

Co-authored-by: samerton <samerton@users.noreply.github.com>
Co-authored-by: Robin <robinslot@hotmail.nl>
Co-authored-by: Robin <robin+git@rkslot.nl>
Co-authored-by: Partydragen <adrian_kili@outlook.com>
2022-04-23 14:27:10 +01:00
Tadhg
e0133a5cd5 Get PHP-CS to pass! 2021-12-07 22:14:12 -08:00
Tadhg
65b00b9486 replace define() with const where applicable 2021-11-02 21:28:04 -07:00
Tadhg
6d1bb0ecbb Replace double quotes with single quotes where applicable 2021-10-30 16:25:44 -07:00
Tadhg
a9c678e4d4 convert all array(...) syntax to [...] 2021-10-29 22:00:05 -07:00
Tadhg
1d8779a063 fix typo 2021-10-19 16:56:12 -07:00
Tadhg
c7a8f2c0e5 add required $template variable to Module::loadPage 2021-10-19 16:51:29 -07:00
Robin
36d4994312 rename $mod_nav to $staffcp_nav, move groups to be near users
because groups are closely related to users
2021-10-08 21:13:33 +02:00
Derkades
6d22c03863 Style fixes 2020-11-03 20:27:17 +01:00
Tadhg
f62b0b0216 Add Widget setting for being on Left or Right 2020-09-11 22:45:46 -07:00
Tadhg Boyle
0560fd907b
Discord Integration! Sync your roles between your NamelessMC site and your Discord Guild. (#1764)
* Initial commit, big additions. Linking/verifying discord id is complete

* Update admin.php

* Better validation errors + language updating

* Apply role change on user edit page - still some things to flush out though

* flush out some edge cases

* Add role in discord upon account validation & more

* Add api endpoint (need to test) & a lot of TODOs

* fix announcements a bit on Default template

* define bot url for easier move to self-hosting

* Add discord->website (adding) sync & lots of the TODOs

* Add discord role removal api endpoint

* Add logging od discord role add/remove & fix log table

* Add api_url to discord request for extra security & add todo's for error handling

* More API error handling for discord bot

* Add boilerplate error handling if bot throws error

* Add error messages for all discord linking

* If they have a role on the site, give it to them when they verify their id

* Resolve Sam's review

* Add info msgs so people know where to get discord IDs

* Add all language translations and update NMC version strings
2020-07-25 21:00:41 -07:00
samerton
fae0da2c83 Add 403 page 2020-01-04 16:36:52 +00:00