mirror of
https://github.com/flarum/framework.git
synced 2025-01-21 12:08:47 +08:00
Revert "run the convert.sh script by CDK2020 to replace namespaces to be comp… (#8)"
This reverts commit efe07bd696
.
This commit is contained in:
parent
5c032cdd3a
commit
f154c7cae6
|
@ -9,7 +9,7 @@
|
|||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Flarum\Group\Group;
|
||||
use Flarum\Core\Group;
|
||||
use Flarum\Database\Migration;
|
||||
|
||||
return Migration::addPermissions([
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
namespace Flarum\Approval\Access;
|
||||
|
||||
use Flarum\User\AbstractPolicy;
|
||||
use Flarum\User\User;
|
||||
use Flarum\Core\Access\AbstractPolicy;
|
||||
use Flarum\Core\User;
|
||||
use Flarum\Tags\Tag;
|
||||
|
||||
class TagPolicy extends AbstractPolicy
|
||||
|
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
namespace Flarum\Approval\Event;
|
||||
|
||||
use Flarum\Post\Post;
|
||||
use Flarum\User\User;
|
||||
use Flarum\Core\Post;
|
||||
use Flarum\Core\User;
|
||||
|
||||
class PostWasApproved
|
||||
{
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Flarum\Approval\Listener;
|
||||
|
||||
use Flarum\Frontend\Event\Rendering;
|
||||
use Flarum\Event\ConfigureWebApp;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
class AddClientAssets
|
||||
|
@ -21,13 +21,13 @@ class AddClientAssets
|
|||
*/
|
||||
public function subscribe(Dispatcher $events)
|
||||
{
|
||||
$events->listen(Rendering::class, [$this, 'addAssets']);
|
||||
$events->listen(ConfigureWebApp::class, [$this, 'addAssets']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Rendering $event
|
||||
* @param ConfigureClientView $event
|
||||
*/
|
||||
public function addAssets(Rendering $event)
|
||||
public function addAssets(ConfigureWebApp $event)
|
||||
{
|
||||
if ($event->isForum()) {
|
||||
$event->addAssets([
|
||||
|
|
|
@ -11,10 +11,10 @@
|
|||
|
||||
namespace Flarum\Approval\Listener;
|
||||
|
||||
use Flarum\Api\Serializer\BasicDiscussionSerializer;
|
||||
use Flarum\Api\Serializer\BasicPostSerializer;
|
||||
use Flarum\Api\Serializer\DiscussionBasicSerializer;
|
||||
use Flarum\Api\Serializer\PostBasicSerializer;
|
||||
use Flarum\Api\Serializer\PostSerializer;
|
||||
use Flarum\Api\Event\Serializing;
|
||||
use Flarum\Event\PrepareApiAttributes;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
class AddPostApprovalAttributes
|
||||
|
@ -24,15 +24,15 @@ class AddPostApprovalAttributes
|
|||
*/
|
||||
public function subscribe(Dispatcher $events)
|
||||
{
|
||||
$events->listen(Serializing::class, [$this, 'addApiAttributes']);
|
||||
$events->listen(PrepareApiAttributes::class, [$this, 'addApiAttributes']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Serializing $event
|
||||
* @param PrepareApiAttributes $event
|
||||
*/
|
||||
public function addApiAttributes(Serializing $event)
|
||||
public function addApiAttributes(PrepareApiAttributes $event)
|
||||
{
|
||||
if ($event->isSerializer(BasicDiscussionSerializer::class)
|
||||
if ($event->isSerializer(DiscussionBasicSerializer::class)
|
||||
|| $event->isSerializer(PostBasicSerializer::class)) {
|
||||
$event->attributes['isApproved'] = (bool) $event->model->is_approved;
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
namespace Flarum\Approval\Listener;
|
||||
|
||||
use Flarum\Approval\Event\PostWasApproved;
|
||||
use Flarum\User\AssertPermissionTrait;
|
||||
use Flarum\Post\Event\Saving;
|
||||
use Flarum\Core\Access\AssertPermissionTrait;
|
||||
use Flarum\Event\PostWillBeSaved;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
class ApproveContent
|
||||
|
@ -25,14 +25,14 @@ class ApproveContent
|
|||
*/
|
||||
public function subscribe(Dispatcher $events)
|
||||
{
|
||||
$events->listen(Saving::class, [$this, 'approvePost']);
|
||||
$events->listen(PostWillBeSaved::class, [$this, 'approvePost']);
|
||||
$events->listen(PostWasApproved::class, [$this, 'approveDiscussion']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Saving $event
|
||||
* @param PostWillBeSaved $event
|
||||
*/
|
||||
public function approvePost(Saving $event)
|
||||
public function approvePost(PostWillBeSaved $event)
|
||||
{
|
||||
$attributes = $event->data['attributes'];
|
||||
$post = $event->post;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Flarum\Approval\Listener;
|
||||
|
||||
use Flarum\Discussion\Discussion;
|
||||
use Flarum\Core\Discussion;
|
||||
use Flarum\Event\ScopeHiddenDiscussionVisibility;
|
||||
use Flarum\Event\ScopeModelVisibility;
|
||||
use Flarum\Event\ScopePostVisibility;
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
|
||||
namespace Flarum\Approval\Listener;
|
||||
|
||||
use Flarum\Post\Post;
|
||||
use Flarum\Core\Post;
|
||||
use Flarum\Event\ConfigureModelDefaultAttributes;
|
||||
use Flarum\Post\Event\Saving;
|
||||
use Flarum\Event\PostWillBeSaved;
|
||||
use Flarum\Flags\Flag;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
|
||||
|
@ -25,7 +25,7 @@ class UnapproveNewContent
|
|||
public function subscribe(Dispatcher $events)
|
||||
{
|
||||
$events->listen(ConfigureModelDefaultAttributes::class, [$this, 'approveByDefault']);
|
||||
$events->listen(Saving::class, [$this, 'unapproveNewPosts']);
|
||||
$events->listen(PostWillBeSaved::class, [$this, 'unapproveNewPosts']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,9 +39,9 @@ class UnapproveNewContent
|
|||
}
|
||||
|
||||
/**
|
||||
* @param Saving $event
|
||||
* @param PostWillBeSaved $event
|
||||
*/
|
||||
public function unapproveNewPosts(Saving $event)
|
||||
public function unapproveNewPosts(PostWillBeSaved $event)
|
||||
{
|
||||
$post = $event->post;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user