[Cover] Added TWIG vars for profile plugins
This commit is contained in:
parent
1cfe64cc25
commit
cf8b3b7b73
@ -67,7 +67,7 @@ class Cover
|
||||
// Can only get new id after inserting
|
||||
DB::flush();
|
||||
$cover = CoverEntity::create(['gsactor_id' => $actor_id, 'file_id' => $file->getId()]);
|
||||
var_dump($cover);
|
||||
//var_dump($cover);
|
||||
DB::persist($cover);
|
||||
DB::flush();
|
||||
// Only delete files if the commit went through
|
||||
@ -76,6 +76,6 @@ class Cover
|
||||
}
|
||||
}
|
||||
|
||||
return ['_template' => 'Cover/cover.html.twig', 'form' => $form->createView()];
|
||||
return ['_template' => 'cover/cover.html.twig', 'form' => $form->createView()];
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ namespace Plugin\Cover;
|
||||
use App\Core\Event;
|
||||
use App\Core\Module;
|
||||
use App\Core\Router\RouteLoader;
|
||||
use App\Util\Common;
|
||||
|
||||
class Cover extends Module
|
||||
{
|
||||
@ -57,6 +58,10 @@ class Cover extends Module
|
||||
$vars['profile_tabs'] = [['title' => 'Cover',
|
||||
'href' => 'settings_cover',
|
||||
]];
|
||||
|
||||
if (Common::user() != null) {
|
||||
$vars['profile_temp'][] = ['name' => 'cover', 'vars' => ['href' => 'test']];
|
||||
}
|
||||
return Event::next;
|
||||
}
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
|
||||
<div class="Cover">
|
||||
</div>
|
4
templates/cover/view.html.twig
Normal file
4
templates/cover/view.html.twig
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
<div class="Cover">
|
||||
<h1> {{ vars.href }}</h1>
|
||||
</div>
|
@ -17,6 +17,9 @@
|
||||
<div class='navbar'>
|
||||
<div class="left-nav">
|
||||
<div class='profile'>
|
||||
{% for temp in profile_temp %}
|
||||
{% include '/'~ temp.name ~ '/view.html.twig' with {'vars': temp.vars} only %}
|
||||
{% endfor %}
|
||||
<a href="{{ path('settings_avatar') }}">
|
||||
<img src='{{ user_avatar }}' alt="Your avatar." class="icon icon-avatar">
|
||||
</a>
|
||||
|
Loading…
Reference in New Issue
Block a user