mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
Merge pull request #608 from openclassify/dia
#1749 [arabam-theme] Rest of pages (profile)
This commit is contained in:
commit
110498d8b6
@ -1,6 +1,7 @@
|
|||||||
<?php namespace Visiosoft\AdvsModule;
|
<?php namespace Visiosoft\AdvsModule;
|
||||||
|
|
||||||
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
|
use Anomaly\Streams\Platform\Addon\Plugin\Plugin;
|
||||||
|
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||||
use Visiosoft\AdvsModule\Adv\Command\appendRequestURL;
|
use Visiosoft\AdvsModule\Adv\Command\appendRequestURL;
|
||||||
use Visiosoft\AdvsModule\Adv\Command\GetAd;
|
use Visiosoft\AdvsModule\Adv\Command\GetAd;
|
||||||
use Visiosoft\AdvsModule\Adv\Command\isActive;
|
use Visiosoft\AdvsModule\Adv\Command\isActive;
|
||||||
@ -59,6 +60,33 @@ class AdvsModulePlugin extends Plugin
|
|||||||
|
|
||||||
return $this->dispatch(new appendRequestURL($request, $url, $new_parameters));
|
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