mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#1749 [arabam-theme] Rest of pages (profile)
This commit is contained in:
parent
34e2930c77
commit
bea817677d
@ -1,6 +1,7 @@
|
||||
<?php namespace Visiosoft\AdvsModule;
|
||||
|
||||
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
|
||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||
use Visiosoft\AdvsModule\Adv\Command\appendRequestURL;
|
||||
use Visiosoft\AdvsModule\Adv\Command\GetAd;
|
||||
use Visiosoft\AdvsModule\Adv\Command\isActive;
|
||||
@ -59,6 +60,33 @@ class AdvsModulePlugin extends Plugin
|
||||
|
||||
return $this->dispatch(new appendRequestURL($request, $url, $new_parameters));
|
||||
}
|
||||
),
|
||||
new \Twig_SimpleFunction(
|
||||
'getUserAllAdvs',
|
||||
function ($user = null) {
|
||||
if (!$user) {
|
||||
$user = auth()->user();
|
||||
}
|
||||
|
||||
$advModel = new AdvModel();
|
||||
return $advModel->newQuery()
|
||||
->where('advs_advs.created_by_id', $user->id)
|
||||
->get();
|
||||
}
|
||||
),
|
||||
new \Twig_SimpleFunction(
|
||||
'getUserPassiveAdvs',
|
||||
function ($user = null) {
|
||||
if (!$user) {
|
||||
$user = auth()->user();
|
||||
}
|
||||
|
||||
$advModel = new AdvModel();
|
||||
return $advModel->newQuery()
|
||||
->where('advs_advs.created_by_id', $user->id)
|
||||
->where('status', 'passive')
|
||||
->get();
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user