whereTitle(trans('article::module.blog')); if (!$blogSubmenu) { $blogSubmenu = $menu->dropdown(trans('article::module.blog'), function ($sub) { }, 20, ['icon' => 'fa fa-fw fa-book']); } $blogSubmenu->dropdown(trans('article::module.name'), function ($sub) { $sub->route('content.new', trans('article::article.new'), ['id' => config('article.alias')], 10, ['icon' => 'fa fa-fw fa-pencil']); $sub->route('content.overview', trans('article::article.overview'), ['id' => config('article.alias')], 30, ['icon' => 'fa fa-fw fa-book']); }, 10, ['icon' => 'fa fa-fw fa-book']); $blogSubmenu->route('comments.overview', trans('article::module.commentsOverview'), [], 20, ['icon' => 'fa fa-fw fa-commenting-o']); } /** * Install module */ public static function install() { $types = [ [ 'string_id' => 'commentCreated', 'name' => 'article::comments.events.names.commentCreated', 'value' => 'article::comments.events.descriptions.commentCreated', ], [ 'string_id' => 'commentDeleted', 'name' => 'article::comments.events.names.commentDeleted', 'value' => 'article::comments.events.descriptions.commentDeleted', ], [ 'string_id' => 'commentApproved', 'name' => 'article::comments.events.names.commentApproved', 'value' => 'article::comments.events.descriptions.commentApproved', ], ]; foreach ($types as $type) { ActionLogType::create($type); } } /** * Uninstalls module * * @param Module $module * * @return mixed|void */ public static function uninstall(Module $module) { ActionLogType::whereIn('string_id', ['commentCreated', 'commentDeleted', 'commentApproved']) ->delete(); } /** * Get translated title for pages overview of given type. * * This value is used for rendering list of all content pages of given type in administration. * * @return string */ public static function getOverviewTitle() { return trans('article::module.allArticles'); } /** * Title displayed above for for creating new content page * * @return string */ public static function getCreateNewTitle() { return trans('article::module.newArticle'); } /** * Title for form displayed for editin content page * * @param Content $content * * @return mixed */ public static function getEditTitle(Content $content) { return trans('article::module.editArticle'); } /** * Method called right after content page is marked as deleted * * This method is supposed to clean after "deleted" page. * * @param Content $content * * @return mixed */ public static function delete(Content $content) { } /** * Does this module support categories? * * @return boolean */ public static function supportCategories() { return true; } }