Commit Graph

63 Commits

Author SHA1 Message Date
Franz Liedke
c41e58531a
Deprecate remaining non-namespaced events
These will be replaced by etenders soon.
2018-01-03 09:42:11 +01:00
Daniël Klabbers
f65e4dcba3
merges 5.5 and master into next-back 2017-12-14 01:00:16 +01:00
Franz Liedke
914b94b62d
Remove user bio feature (#1214)
The feature is very limited in scope, and we hope for community
extensions to take over this feature and make it much better.
2017-11-02 01:12:49 +01:00
Toby Zerner
2dbcfe02d8 Consolidate avatar uploading, allow avatarUrl to be used when updating user 2017-10-07 17:39:27 +10:30
Franz Liedke
4aad7c1040
Cleanup code, typehints and class references 2017-10-03 18:54:07 +02:00
Franz Liedke
69b517ea79
Get rid of Server classes for Admin, API and Forum
The various middleware can be registered in the service provider,
and the rest of the logic can all go through one single front
controller (index.php in flarum/flarum, and Flarum\Http\Server in
flarum/core).

This will also simplify the necessary server setup, as only one
rewrite rule remains.
2017-10-03 18:54:07 +02:00
Franz Liedke
b4c7f8ca89
Move event to Flarum\User namespace 2017-10-03 18:54:07 +02:00
Franz Liedke
3ece3ca976
Move events to Flarum\Api namespace 2017-10-03 18:54:07 +02:00
Franz Liedke
f824dcfb53
Move more event classes to appropriate namespaces 2017-10-03 18:54:06 +02:00
Franz Liedke
78f3681fc1
Fix namespace orderings
(Thanks, StyleCI!)
2017-10-03 18:54:06 +02:00
Franz Liedke
95dc7e71f4
Fix namespaces 2017-10-03 18:52:50 +02:00
Franz Liedke
b38ade986d
Extract Flarum\Notification namespace 2017-10-03 18:49:53 +02:00
Franz Liedke
c22219ec20
Extract Flarum\Group namespace 2017-10-03 18:49:53 +02:00
Franz Liedke
11bf3e34b7
Extract Flarum\Search namespace 2017-10-03 18:49:53 +02:00
Franz Liedke
4fb38d6458
Extract new Flarum\Discussion namespace 2017-10-03 18:49:52 +02:00
Franz Liedke
66abd7ecfd
Extract new Flarum\Post namespace 2017-10-03 18:47:23 +02:00
Franz Liedke
9abc63aaac
Move events to Flarum\Extension\Event namespace 2017-10-03 18:47:23 +02:00
Franz Liedke
6cd6a7d260
Move events to Flarum\Formatter\Event namespace 2017-10-03 18:47:23 +02:00
Franz Liedke
6c9ff72efb
Finalize Flarum\Foundation namespace 2017-10-03 18:47:23 +02:00
Franz Liedke
33e3d757c3
Flatten Flarum\Http namespace 2017-10-03 18:47:23 +02:00
Franz Liedke
551e76f296
Move events to Flarum\Settings\Event namespace 2017-10-03 18:47:23 +02:00
Franz Liedke
564ea8ff73
Extract new Flarum\User namespace 2017-10-03 18:47:23 +02:00
Franz Liedke
fda8c597f4
Flarum\Frontend: Rename ConfigureWebApp event to Rendering 2017-10-03 18:45:41 +02:00
Franz Liedke
0be13d50bd
Create new Flarum\Frontend namespace
It replaces the old Http\WebApp namespace and swallows other namespaces
and files, such as Flarum\Asset.
2017-10-03 18:45:40 +02:00
Franz Liedke
5127514d35
Restructure Flarum\Admin namespace 2017-10-03 18:45:38 +02:00
Toby Zerner
eb72307a54 User display names (#1246)
* Introduce user display names

It is not uncommon for forums to be intergrated with sites where users
don't have a unique "handle" - they might just have their first name,
or a full name, which is not guaranteed to be unique.

This commit introduces the concept of "display names" for users. By
default display names are the same as usernames, but extensions may
override this and set them to something different. The important thing
is that all code should use `display_name` whenever intending to output
a human-readable name - `username` is reserved for cases where you want
to output a unique identifier (which may or may not be human-friendly).

The new "GetDisplayName" API is probably sub-optimal, but I didn't worry
too much because we can come up with something better in `next-back`.

ref #557

* Apply fixes from StyleCI

[ci skip] [skip ci]
2017-09-20 16:42:18 +09:30
Daniël Klabbers
04c4806f6f making posts and discussions private (#1153)
* flagrow/byobu#11 making posts and discussions private

* tested migrations and tested setting is_private on discussion and post manually

* added phpdoc for Post and Discussion and added the casting for these attributes

* satisfying styleci

* fixes for review

* added new private discussion event and included it in the access policy

* added new private post event and included it in the access policy
2017-05-27 14:19:15 +09:30
Daniël Klabbers
cd70819fd5
fixed issues with $extension visibility and typehinting 2017-02-11 21:14:44 +01:00
Franz Liedke
9349ed13fc
Make event attributes public
Without this, reading the extension information would not be
possible for the validator.
2017-02-03 20:23:24 +01:00
Franz Liedke
91ace15f6d Merge pull request #1032 from dav-is/patch-1
Prevent deletion of default/all locale(s)
2017-02-03 20:21:19 +01:00
Toby Zerner
1031826a3d Apply fixes from StyleCI
[ci skip] [skip ci]
2016-11-29 05:03:53 +00:00
Toby Zerner
b9918e6c40 Add missing parameter 2016-11-07 18:22:20 +10:30
Toby Zerner
b3e1a023c2 Add event to allow custom user password validation 2016-11-07 18:03:49 +10:30
Davis
1192867c4f StyleCl 2016-09-12 22:28:03 -05:00
Davis
ea12bbaf48 StyleCL 2016-09-12 22:24:57 -05:00
Davis
58f9c22375 Create ExtensionWillBeEnabled.php 2016-09-12 17:07:00 -05:00
Davis
939a1e9ca8 Forgot the extension :/ 2016-09-12 17:05:41 -05:00
Davis
736f22a31a Create ExtensionWillBeDisabled 2016-09-12 16:57:24 -05:00
Toby Zerner
df247925d4 Fix locale JS files not being added; add (temporary?) API to add locale CSS files
fixes flarum/core#970
2016-09-03 22:22:36 +09:30
Toby Zerner
4bd05ee561 Fix up some references to old classes 2016-05-29 16:01:58 +09:30
Toby Zerner
c3dfa3560a Allow extensions to add default model attributes
Extensions can add default column values in their migrations, but Eloquent doesn't know about this when it first saves a model to the database.

This is useful in flarum-ext-approval where the default value for is_approved on the posts table is true.
2016-05-28 09:37:43 +09:30
Toby Zerner
40a78d302e Fix permission logic priorities
This helps to fix a bug in flarum-ext-tags where a user could not rename or edit the tags of their own discussion if it was in a restricted tag. This was due to the order of GetPermission event listeners – the logic that determines that a user *can't* perform an action because of a restrictive tag was running before (and thus instead of) the logic that determines that a user *can* edit their own stuff.

The solution is to change the "catch-all" methods on Policies to "after" instead of "before" – that is, they will run only if the per-ability methods return null.

We also simplify the GetPermission event by passing the model as a sole "argument", as I can't imagine any cases where we'll need more than one argument.
2016-05-28 09:35:08 +09:30
Toby Zerner
9bfb797fdc Refactor the web app bootstrapping code
- All custom JS variables are now preloaded into the `app.data` object, rather than directly on the `app` object. This means that admin settings are available in `app.data.settings` rather than `app.settings`, etc.
- Cleaner route handler generation
- Renamed ConfigureClientView to ConfigureWebApp, though the former still exists and is deprecated
- Partial fix for #881 (strips ?nojs=1 from URL if possible, so that refreshing will attempt to load JS version again)
2016-05-26 19:04:24 +09:30
Toby Zerner
e11401b551 Fix some random docblocks 2016-04-08 13:52:50 +09:30
Franz Liedke
594a2ba8cc More indentation cleanup 2016-02-26 13:10:32 +09:00
Toby Zerner
a6cf10f854 Applied fixes from StyleCI 2016-02-25 22:09:39 -05:00
Daniel Klabbers
191589e2b1 Implemented extensions as an object, usable by backend and frontend. 2016-02-10 15:13:51 +01:00
Daniel Klabbers
31be2f8f86 reordering and removing unused imports 2016-02-10 11:00:37 +01:00
Toby Zerner
2018e424ec Refactor ListPostsController, make filtering extensible
It became apparent in https://github.com/flarum/core/issues/319#issuecomment-170558573 that there was no way for extensions to add filter parameters to the /api/posts endpoint (e.g. /api/posts?filter[mentioned]=1). Simply adding an event to modify the `$where` array severely limits how much can be done with the query. This commit refactors the controller so that filters are applied directly to the query Builder, and exposes the Builder in a new `ConfigurePostsQuery` event.
2016-01-31 17:06:38 +10:30
Toby Zerner
8506d095db Use correct directory in loadLanguagePackFrom API 2016-01-12 18:35:37 +10:30