svg
This commit is contained in:
parent
8692adeae3
commit
fefc4036fa
|
@ -1,262 +1,266 @@
|
||||||
#== Home ========================================================================================================
|
#== Home ========================================================================================================
|
||||||
app_home:
|
app_home:
|
||||||
path: /
|
path: /
|
||||||
defaults: { _controller: App\Controller\HomeController:home }
|
defaults: { _controller: App\Controller\HomeController:home }
|
||||||
|
|
||||||
app_feed:
|
app_feed:
|
||||||
path: /feed/{nb}
|
path: /feed/{nb}
|
||||||
defaults: { _controller: App\Controller\HomeController:feed, nb: 0 }
|
defaults: { _controller: App\Controller\HomeController:feed, nb: 0 }
|
||||||
|
|
||||||
app_admin:
|
app_admin:
|
||||||
path: /admin/home
|
path: /admin/home
|
||||||
defaults: { _controller: App\Controller\HomeController:admin }
|
defaults: { _controller: App\Controller\HomeController:admin }
|
||||||
|
|
||||||
app_ckeditor_upload:
|
app_ckeditor_upload:
|
||||||
path: /user/activity/upload
|
path: /user/activity/upload
|
||||||
defaults: { _controller: App\Controller\HomeController:upload }
|
defaults: { _controller: App\Controller\HomeController:upload }
|
||||||
|
|
||||||
#== Security ====================================================================================================
|
#== Security ====================================================================================================
|
||||||
app_login:
|
app_login:
|
||||||
path: /login
|
path: /login
|
||||||
defaults: { _controller: App\Controller\SecurityController:login }
|
defaults: { _controller: App\Controller\SecurityController:login }
|
||||||
|
|
||||||
app_logout:
|
app_logout:
|
||||||
path: /logout
|
path: /logout
|
||||||
defaults: { _controller: App\Controller\SecurityController:logout }
|
defaults: { _controller: App\Controller\SecurityController:logout }
|
||||||
|
|
||||||
app_logincas:
|
app_logincas:
|
||||||
path: /logincas
|
path: /logincas
|
||||||
defaults: { _controller: App\Controller\SecurityController:login }
|
defaults: { _controller: App\Controller\SecurityController:login }
|
||||||
|
|
||||||
app_logoutcas:
|
app_logoutcas:
|
||||||
path: /logoutcas
|
path: /logoutcas
|
||||||
defaults: { _controller: App\Controller\SecurityController:logout }
|
defaults: { _controller: App\Controller\SecurityController:logout }
|
||||||
|
|
||||||
#== Crop =========================================================================================================
|
#== Crop =========================================================================================================
|
||||||
app_crop01:
|
app_crop01:
|
||||||
path: /user/crop01/{type}/{reportinput}
|
path: /user/crop01/{type}/{reportinput}
|
||||||
defaults: { _controller: App\Controller\CropController:crop01 }
|
defaults: { _controller: App\Controller\CropController:crop01 }
|
||||||
|
|
||||||
app_crop02:
|
app_crop02:
|
||||||
path: /user/crop02/{type}/{reportinput}
|
path: /user/crop02/{type}/{reportinput}
|
||||||
defaults: { _controller: App\Controller\CropController:crop02 }
|
defaults: { _controller: App\Controller\CropController:crop02 }
|
||||||
|
|
||||||
oneup_uploader:
|
oneup_uploader:
|
||||||
resource: .
|
resource: .
|
||||||
type: uploader
|
type: uploader
|
||||||
|
|
||||||
#== Cron ========================================================================================================
|
#== Cron ========================================================================================================
|
||||||
app_cron:
|
app_cron:
|
||||||
path: /admin/cron
|
path: /admin/cron
|
||||||
defaults: { _controller: App\Controller\CronController:list }
|
defaults: { _controller: App\Controller\CronController:list }
|
||||||
|
|
||||||
app_cron_ajax_list:
|
app_cron_ajax_list:
|
||||||
path: /admin/cron/ajax/list
|
path: /admin/cron/ajax/list
|
||||||
defaults: { _controller: App\Controller\CronController:ajaxlist }
|
defaults: { _controller: App\Controller\CronController:ajaxlist }
|
||||||
|
|
||||||
app_cron_update:
|
app_cron_update:
|
||||||
path: /admin/cron/update/{id}
|
path: /admin/cron/update/{id}
|
||||||
defaults: { _controller: App\Controller\CronController:update }
|
defaults: { _controller: App\Controller\CronController:update }
|
||||||
|
|
||||||
app_cron_exec:
|
app_cron_exec:
|
||||||
path: /admin/cron/exec/{id}
|
path: /admin/cron/exec/{id}
|
||||||
defaults: { _controller: App\Controller\CronController:exec }
|
defaults: { _controller: App\Controller\CronController:exec }
|
||||||
|
|
||||||
app_cron_log:
|
app_cron_log:
|
||||||
path: /admin/cron/log
|
path: /admin/cron/log
|
||||||
defaults: { _controller: App\Controller\CronController:log }
|
defaults: { _controller: App\Controller\CronController:log }
|
||||||
|
|
||||||
app_cron_getlog:
|
app_cron_getlog:
|
||||||
path: /admin/cron/getlog/{id}
|
path: /admin/cron/getlog/{id}
|
||||||
defaults: { _controller: App\Controller\CronController:getlog }
|
defaults: { _controller: App\Controller\CronController:getlog }
|
||||||
|
|
||||||
#== Config ========================================================================================================
|
#== Config ========================================================================================================
|
||||||
app_config:
|
app_admin_config:
|
||||||
path: /admin/config
|
path: /admin/config
|
||||||
defaults: { _controller: App\Controller\ConfigController:list }
|
defaults: { _controller: App\Controller\ConfigController:list }
|
||||||
|
|
||||||
app_config_render:
|
app_admin_config_render:
|
||||||
path: /admin/config/render/{mode}/{category}/{userid}
|
path: /admin/config/render/{by}/{category}/{userid}
|
||||||
defaults: { _controller: App\Controller\ConfigController:listrender }
|
defaults: { _controller: App\Controller\ConfigController:listrender }
|
||||||
|
|
||||||
app_config_user_render:
|
app_user_config_render:
|
||||||
path: /user/config/render/{mode}/{category}
|
path: /user/config/render/{by}/{category}
|
||||||
defaults: { _controller: App\Controller\ConfigController:listuserrender }
|
defaults: { _controller: App\Controller\ConfigController:listuserrender }
|
||||||
|
|
||||||
app_config_update:
|
app_admin_config_update:
|
||||||
path: /admin/config/update/{mode}/{id}/{userid}
|
path: /admin/config/update/{by}/{id}/{userid}
|
||||||
defaults: { _controller: App\Controller\ConfigController:update }
|
defaults: { _controller: App\Controller\ConfigController:update }
|
||||||
|
|
||||||
app_config_user_update:
|
app_user_config_update:
|
||||||
path: /user/config/update/{mode}/{id}
|
path: /user/config/update/{by}/{id}
|
||||||
defaults: { _controller: App\Controller\ConfigController:updateuser }
|
defaults: { _controller: App\Controller\ConfigController:updateuser }
|
||||||
|
|
||||||
app_config_delete:
|
app_admin_config_delete:
|
||||||
path: /admin/config/delete/{mode}/{id}/{userid}
|
path: /admin/config/delete/{by}/{id}/{userid}
|
||||||
defaults: { _controller: App\Controller\ConfigController:delete }
|
defaults: { _controller: App\Controller\ConfigController:delete }
|
||||||
|
|
||||||
app_config_user_delete:
|
app_user_config_delete:
|
||||||
path: /user/config/delete/{mode}/{id}
|
path: /user/config/delete/{by}/{id}
|
||||||
defaults: { _controller: App\Controller\ConfigController:deleteuser }
|
defaults: { _controller: App\Controller\ConfigController:deleteuser }
|
||||||
|
|
||||||
app_config_logo:
|
app_user_config_logo:
|
||||||
path: /admin/config/logo
|
path: /admin/config/logo
|
||||||
defaults: { _controller: App\Controller\ConfigController:logo }
|
defaults: { _controller: App\Controller\ConfigController:logo }
|
||||||
|
|
||||||
#== User ========================================================================================================
|
#== User ========================================================================================================
|
||||||
app_user:
|
app_user:
|
||||||
path: /admin/user
|
path: /admin/user
|
||||||
defaults: { _controller: App\Controller\UserController:list }
|
defaults: { _controller: App\Controller\UserController:list }
|
||||||
|
|
||||||
app_user_submit:
|
app_user_submit:
|
||||||
path: /admin/user/submit
|
path: /admin/user/submit
|
||||||
defaults: { _controller: App\Controller\UserController:submit }
|
defaults: { _controller: App\Controller\UserController:submit }
|
||||||
|
|
||||||
app_user_update:
|
app_user_update:
|
||||||
path: /admin/user/update/{id}
|
path: /admin/user/update/{id}
|
||||||
defaults: { _controller: App\Controller\UserController:update }
|
defaults: { _controller: App\Controller\UserController:update }
|
||||||
|
|
||||||
app_user_delete:
|
app_user_delete:
|
||||||
path: /admin/user/delete/{id}
|
path: /admin/user/delete/{id}
|
||||||
defaults: { _controller: App\Controller\UserController:delete }
|
defaults: { _controller: App\Controller\UserController:delete }
|
||||||
|
|
||||||
app_user_select:
|
app_user_select:
|
||||||
path: /user/user/select
|
path: /user/user/select
|
||||||
defaults: { _controller: App\Controller\UserController:select }
|
defaults: { _controller: App\Controller\UserController:select }
|
||||||
|
|
||||||
app_user_info:
|
app_user_info:
|
||||||
path: /user/info
|
path: /user/info
|
||||||
defaults: { _controller: App\Controller\UserController:info }
|
defaults: { _controller: App\Controller\UserController:info }
|
||||||
|
|
||||||
app_user_profil:
|
app_user_profil:
|
||||||
path: /user/profil
|
path: /user/profil
|
||||||
defaults: { _controller: App\Controller\UserController:profil }
|
defaults: { _controller: App\Controller\UserController:profil }
|
||||||
|
|
||||||
#== Group ========================================================================================================
|
#== Group ========================================================================================================
|
||||||
app_group:
|
app_group:
|
||||||
path: /admin/group
|
path: /admin/group
|
||||||
defaults: { _controller: App\Controller\GroupController:list }
|
defaults: { _controller: App\Controller\GroupController:list }
|
||||||
|
|
||||||
app_group_submit:
|
app_group_submit:
|
||||||
path: /admin/group/submit
|
path: /admin/group/submit
|
||||||
defaults: { _controller: App\Controller\GroupController:submit }
|
defaults: { _controller: App\Controller\GroupController:submit }
|
||||||
|
|
||||||
app_group_update:
|
app_group_update:
|
||||||
path: /admin/group/update/{id}
|
path: /admin/group/update/{id}
|
||||||
defaults: { _controller: App\Controller\GroupController:update }
|
defaults: { _controller: App\Controller\GroupController:update }
|
||||||
|
|
||||||
app_group_delete:
|
app_group_delete:
|
||||||
path: /admin/group/delete/{id}
|
path: /admin/group/delete/{id}
|
||||||
defaults: { _controller: App\Controller\GroupController:delete }
|
defaults: { _controller: App\Controller\GroupController:delete }
|
||||||
|
|
||||||
app_group_select:
|
app_group_select:
|
||||||
path: /user/group/select
|
path: /user/group/select
|
||||||
defaults: { _controller: App\Controller\GroupController:select }
|
defaults: { _controller: App\Controller\GroupController:select }
|
||||||
|
|
||||||
app_group_info:
|
app_group_info:
|
||||||
path: /user/group/info
|
path: /user/group/info
|
||||||
defaults: { _controller: App\Controller\GroupController:info }
|
defaults: { _controller: App\Controller\GroupController:info }
|
||||||
|
|
||||||
#== Category ======================================================================================================
|
#== Category ======================================================================================================
|
||||||
app_category:
|
app_category:
|
||||||
path: /admin/category
|
path: /admin/category
|
||||||
defaults: { _controller: App\Controller\CategoryController:list }
|
defaults: { _controller: App\Controller\CategoryController:list }
|
||||||
|
|
||||||
app_category_submit:
|
app_category_submit:
|
||||||
path: /admin/category/submit
|
path: /admin/category/submit
|
||||||
defaults: { _controller: App\Controller\CategoryController:submit }
|
defaults: { _controller: App\Controller\CategoryController:submit }
|
||||||
|
|
||||||
app_category_update:
|
app_category_update:
|
||||||
path: /admin/category/update/{id}
|
path: /admin/category/update/{id}
|
||||||
defaults: { _controller: App\Controller\CategoryController:update }
|
defaults: { _controller: App\Controller\CategoryController:update }
|
||||||
|
|
||||||
app_category_delete:
|
app_category_delete:
|
||||||
path: /admin/category/delete/{id}
|
path: /admin/category/delete/{id}
|
||||||
defaults: { _controller: App\Controller\CategoryController:delete }
|
defaults: { _controller: App\Controller\CategoryController:delete }
|
||||||
|
|
||||||
#== Link ===========================================================================================================
|
|
||||||
app_link:
|
|
||||||
path: /admin/link
|
|
||||||
defaults: { _controller: App\Controller\LinkController:list }
|
|
||||||
|
|
||||||
app_link_submit:
|
|
||||||
path: /admin/link/submit
|
|
||||||
defaults: { _controller: App\Controller\LinkController:submit }
|
|
||||||
|
|
||||||
app_link_update:
|
|
||||||
path: /admin/link/update/{id}
|
|
||||||
defaults: { _controller: App\Controller\LinkController:update }
|
|
||||||
|
|
||||||
app_link_delete:
|
|
||||||
path: /admin/link/delete/{id}
|
|
||||||
defaults: { _controller: App\Controller\LinkController:delete }
|
|
||||||
|
|
||||||
#== Illustration ==================================================================================================
|
#== Illustration ==================================================================================================
|
||||||
app_illustration:
|
app_admin_illustration:
|
||||||
path: /admin/illustration/list/{by}
|
path: /admin/illustration/list/{by}/{userid}
|
||||||
defaults: { _controller: App\Controller\IllustrationController:list, by: 'home' }
|
defaults: { _controller: App\Controller\IllustrationController:list }
|
||||||
|
|
||||||
|
app_user_illustration:
|
||||||
|
path: /user/illustration/list
|
||||||
|
defaults: { _controller: App\Controller\IllustrationController:listuser }
|
||||||
|
|
||||||
app_illustration_submit:
|
app_illustration_submit:
|
||||||
path: /admin/illustration/submit/{by}
|
path: /user/illustration/submit/{by}/{userid}
|
||||||
defaults: { _controller: App\Controller\IllustrationController:submit, by: 'home' }
|
defaults: { _controller: App\Controller\IllustrationController:submit }
|
||||||
|
|
||||||
app_illustration_update:
|
app_illustration_update:
|
||||||
path: /admin/illustration/update/{id}/{by}
|
path: /user/illustration/update/{id}/{by}
|
||||||
defaults: { _controller: App\Controller\IllustrationController:update, by: 'home' }
|
defaults: { _controller: App\Controller\IllustrationController:update }
|
||||||
|
|
||||||
app_illustration_delete:
|
app_illustration_delete:
|
||||||
path: /admin/illustration/delete/{id}/{by}
|
path: /user/illustration/delete/{id}/{by}
|
||||||
defaults: { _controller: App\Controller\IllustrationController:delete, by: 'home' }
|
defaults: { _controller: App\Controller\IllustrationController:delete }
|
||||||
|
|
||||||
app_illustration_view:
|
|
||||||
path: /illustration/view/{idcat}/{id}/{by}
|
|
||||||
defaults: { _controller: App\Controller\IllustrationController:view, by: 'home' }
|
|
||||||
|
|
||||||
app_illustration_crop:
|
app_illustration_crop:
|
||||||
path: /admin/illustration/crop/{type}/{reportinput}/{by}
|
path: /user/illustration/crop/{type}/{reportinput}
|
||||||
defaults: { _controller: App\Controller\CropController:crop02, by: 'home' }
|
defaults: { _controller: App\Controller\CropController:crop02 }
|
||||||
|
|
||||||
app_illustration_upload:
|
app_illustration_upload:
|
||||||
path: /admin/illustration/upload
|
path: /user/illustration/upload
|
||||||
defaults: { _controller: App\Controller\IllustrationController:upload }
|
defaults: { _controller: App\Controller\IllustrationController:upload }
|
||||||
|
|
||||||
|
app_illustration_view:
|
||||||
|
path: /illustration/view/{idcat}/{id}/{by}
|
||||||
|
defaults: { _controller: App\Controller\IllustrationController:view }
|
||||||
|
|
||||||
#== Webzine ==================================================================================================
|
#== Webzine ==================================================================================================
|
||||||
app_webzine:
|
app_webzine:
|
||||||
path: /admin/webzine/list/{by}
|
path: /admin/webzine/list/{by}
|
||||||
defaults: { _controller: App\Controller\WebzineController:list, by: 'home' }
|
defaults: { _controller: App\Controller\WebzineController:list }
|
||||||
|
|
||||||
app_webzine_submit:
|
app_webzine_submit:
|
||||||
path: /admin/webzine/submit/{by}
|
path: /admin/webzine/submit/{by}
|
||||||
defaults: { _controller: App\Controller\WebzineController:submit, by: 'home' }
|
defaults: { _controller: App\Controller\WebzineController:submit }
|
||||||
|
|
||||||
app_webzine_update:
|
app_webzine_update:
|
||||||
path: /admin/webzine/update/{id}/{by}
|
path: /admin/webzine/update/{id}/{by}
|
||||||
defaults: { _controller: App\Controller\WebzineController:update, by: 'home' }
|
defaults: { _controller: App\Controller\WebzineController:update }
|
||||||
|
|
||||||
app_webzine_delete:
|
app_webzine_delete:
|
||||||
path: /admin/webzine/delete/{id}/{by}
|
path: /admin/webzine/delete/{id}/{by}
|
||||||
defaults: { _controller: App\Controller\WebzineController:delete, by: 'home' }
|
defaults: { _controller: App\Controller\WebzineController:delete }
|
||||||
|
|
||||||
app_webzine_view:
|
app_webzine_view:
|
||||||
path: /webzine/view/{idcat}/{id}/{by}
|
path: /webzine/view/{idcat}/{id}/{by}
|
||||||
defaults: { _controller: App\Controller\WebzineController:view, by: 'home' }
|
defaults: { _controller: App\Controller\WebzineController:view }
|
||||||
|
|
||||||
app_webzine_crop:
|
app_webzine_crop:
|
||||||
path: /admin/webzine/crop/{type}/{reportinput}/{by}
|
path: /admin/webzine/crop/{type}/{reportinput}/{by}
|
||||||
defaults: { _controller: App\Controller\CropController:crop02, by: 'home' }
|
defaults: { _controller: App\Controller\CropController:crop02 }
|
||||||
|
|
||||||
app_webzine_upload:
|
app_webzine_upload:
|
||||||
path: /admin/webzine/upload
|
path: /admin/webzine/upload
|
||||||
defaults: { _controller: App\Controller\WebzineController:upload }
|
defaults: { _controller: App\Controller\WebzineController:upload }
|
||||||
|
|
||||||
|
#== Link ===========================================================================================================
|
||||||
|
app_link:
|
||||||
|
path: /admin/link
|
||||||
|
defaults: { _controller: App\Controller\LinkController:list }
|
||||||
|
|
||||||
|
app_link_submit:
|
||||||
|
path: /admin/link/submit
|
||||||
|
defaults: { _controller: App\Controller\LinkController:submit }
|
||||||
|
|
||||||
|
app_link_update:
|
||||||
|
path: /admin/link/update/{id}
|
||||||
|
defaults: { _controller: App\Controller\LinkController:update }
|
||||||
|
|
||||||
|
app_link_delete:
|
||||||
|
path: /admin/link/delete/{id}
|
||||||
|
defaults: { _controller: App\Controller\LinkController:delete }
|
||||||
|
|
||||||
#== Slide =====================================================================================================
|
#== Slide =====================================================================================================
|
||||||
|
|
||||||
app_slide:
|
app_slide:
|
||||||
path: /slide
|
path: /slide
|
||||||
defaults: { _controller: App\Controller\SlideController:slide }
|
defaults: { _controller: App\Controller\SlideController:slide }
|
||||||
|
|
||||||
#== Home USer==================================================================================================
|
#== Home USer==================================================================================================
|
||||||
|
|
||||||
app_home_user:
|
app_home_user:
|
||||||
path: /{userpseudo}
|
path: /{userpseudo}
|
||||||
defaults: { _controller: App\Controller\HomeController:user }
|
defaults: { _controller: App\Controller\HomeController:user }
|
||||||
|
|
|
@ -26,11 +26,11 @@ class ConfigController extends AbstractController
|
||||||
$this->data."s" => $datas,
|
$this->data."s" => $datas,
|
||||||
"useheader" => true,
|
"useheader" => true,
|
||||||
"usesidebar" => true,
|
"usesidebar" => true,
|
||||||
"mode" => "config",
|
"by" => "admin",
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function listrender($mode,$category,$userid)
|
public function listrender($by,$category,$userid)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$user=null;
|
$user=null;
|
||||||
|
@ -41,12 +41,12 @@ class ConfigController extends AbstractController
|
||||||
$this->data."s" => $datas,
|
$this->data."s" => $datas,
|
||||||
"useheader" => true,
|
"useheader" => true,
|
||||||
"usesidebar" => true,
|
"usesidebar" => true,
|
||||||
"mode" => $mode,
|
"by" => $by,
|
||||||
"userid" => $userid,
|
"userid" => $userid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function listuserrender($mode,$category)
|
public function listuserrender($by,$category)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$datas = $em->getRepository($this->entity)->findBy(["visible"=>true,"category"=>$category,"user"=>$this->getUser()]);
|
$datas = $em->getRepository($this->entity)->findBy(["visible"=>true,"category"=>$category,"user"=>$this->getUser()]);
|
||||||
|
@ -55,17 +55,17 @@ class ConfigController extends AbstractController
|
||||||
$this->data."s" => $datas,
|
$this->data."s" => $datas,
|
||||||
"useheader" => true,
|
"useheader" => true,
|
||||||
"usesidebar" => true,
|
"usesidebar" => true,
|
||||||
"mode" => $mode,
|
"by" => $by,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update($mode,$id,$userid,Request $request)
|
public function update($by,$id,$userid,Request $request)
|
||||||
{
|
{
|
||||||
// Initialisation de l'enregistrement
|
// Initialisation de l'enregistrement
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
$user=null;
|
$user=null;
|
||||||
if($mode!="config") $user=$em->getRepository("App:User")->find($userid);
|
if($by!="admin") $user=$em->getRepository("App:User")->find($userid);
|
||||||
$data=$em->getRepository($this->entity)->findOneBy(["id"=>$id,"user"=>$user]);
|
$data=$em->getRepository($this->entity)->findOneBy(["id"=>$id,"user"=>$user]);
|
||||||
|
|
||||||
// Création du formulaire
|
// Création du formulaire
|
||||||
|
@ -84,7 +84,7 @@ class ConfigController extends AbstractController
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
// Retour à la liste
|
// Retour à la liste
|
||||||
if($mode!="config") {
|
if($by!="admin") {
|
||||||
return $this->redirectToRoute("app_user_update",["id"=>$userid]);
|
return $this->redirectToRoute("app_user_update",["id"=>$userid]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -97,20 +97,20 @@ class ConfigController extends AbstractController
|
||||||
'useheader' => true,
|
'useheader' => true,
|
||||||
'usesidebar' => true,
|
'usesidebar' => true,
|
||||||
$this->data => $data,
|
$this->data => $data,
|
||||||
'mode' => $mode,
|
'by' => $by,
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
'userid' => $userid,
|
'userid' => $userid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateuser($mode,$id,Request $request)
|
public function updateuser($by,$id,Request $request)
|
||||||
{
|
{
|
||||||
// Initialisation de l'enregistrement
|
// Initialisation de l'enregistrement
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$data=$em->getRepository($this->entity)->findOneBy(["id"=>$id,"user"=>$this->getUser()]);
|
$data=$em->getRepository($this->entity)->findOneBy(["id"=>$id,"user"=>$this->getUser()]);
|
||||||
|
|
||||||
// Création du formulaire
|
// Création du formulaire
|
||||||
$form = $this->createForm(Form::class,$data,array("mode"=>"update","id"=>$data->getId(),"type"=>$data->getType(),"required"=>$data->getRequired()));
|
$form = $this->createForm(Form::class,$data,array("mode "=>"update","id"=>$data->getId(),"type"=>$data->getType(),"required"=>$data->getRequired()));
|
||||||
|
|
||||||
// Récupération des data du formulaire
|
// Récupération des data du formulaire
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
@ -133,13 +133,13 @@ class ConfigController extends AbstractController
|
||||||
'useheader' => true,
|
'useheader' => true,
|
||||||
'usesidebar' => false,
|
'usesidebar' => false,
|
||||||
$this->data => $data,
|
$this->data => $data,
|
||||||
'mode' => $mode,
|
'by' => $by,
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
'userid' => $this->getUser()->getId(),
|
'userid' => $this->getUser()->getId(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete($mode,$id,$userid,Request $request)
|
public function delete($by,$id,$userid,Request $request)
|
||||||
{
|
{
|
||||||
// Récupération de l'enregistrement courant
|
// Récupération de l'enregistrement courant
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
@ -149,7 +149,7 @@ class ConfigController extends AbstractController
|
||||||
$em->persist($config);
|
$em->persist($config);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
// Retour à la liste
|
// Retour à la liste
|
||||||
if($mode!="config") {
|
if($by!="admin") {
|
||||||
return $this->redirectToRoute("app_user_update",["id"=>$userid]);
|
return $this->redirectToRoute("app_user_update",["id"=>$userid]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -70,7 +70,7 @@ class CropController extends AbstractController
|
||||||
// Construction du formulaire
|
// Construction du formulaire
|
||||||
$submited=false;
|
$submited=false;
|
||||||
$form = $this->createFormBuilder()
|
$form = $this->createFormBuilder()
|
||||||
->add('submit',SubmitType::class,array("label" => "Valider","attr" => array("class" => "btn btn-success","onclick" => "reportThumb()")))
|
->add('submit',SubmitType::class,array("label" => "Valider","attr" => array("class" => "btn btn-success")))
|
||||||
->add('x',HiddenType::class)
|
->add('x',HiddenType::class)
|
||||||
->add('y',HiddenType::class)
|
->add('y',HiddenType::class)
|
||||||
->add('w',HiddenType::class)
|
->add('w',HiddenType::class)
|
||||||
|
@ -90,9 +90,15 @@ class CropController extends AbstractController
|
||||||
$data = $form->getData();
|
$data = $form->getData();
|
||||||
$thumb_image_location = "uploads/$type/thumb_".$file;
|
$thumb_image_location = "uploads/$type/thumb_".$file;
|
||||||
$cropped = $this->resizeThumbnailImage($thumb_image_location, $large_image_location,$data["ws"],$data["hs"],$data["xs"],$data["ys"],$scale);
|
$cropped = $this->resizeThumbnailImage($thumb_image_location, $large_image_location,$data["ws"],$data["hs"],$data["xs"],$data["ys"],$scale);
|
||||||
$submited=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return $this->render('Crop/crop03.html.twig', [
|
||||||
|
'useheader' => false,
|
||||||
|
'usesidebar' => false,
|
||||||
|
'type' => $type,
|
||||||
|
'file' => $file,
|
||||||
|
"reportinput" => $reportinput,
|
||||||
|
]);
|
||||||
|
}
|
||||||
return $this->render('Crop/crop02.html.twig', [
|
return $this->render('Crop/crop02.html.twig', [
|
||||||
'useheader' => false,
|
'useheader' => false,
|
||||||
'usesidebar' => false,
|
'usesidebar' => false,
|
||||||
|
@ -184,7 +190,7 @@ class CropController extends AbstractController
|
||||||
$source=imagecreatefrompng($image);
|
$source=imagecreatefrompng($image);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
imagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);
|
$ok=imagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);
|
||||||
switch($imageType) {
|
switch($imageType) {
|
||||||
case "image/gif":
|
case "image/gif":
|
||||||
imagegif($newImage,$thumb_image_name);
|
imagegif($newImage,$thumb_image_name);
|
||||||
|
@ -199,7 +205,7 @@ class CropController extends AbstractController
|
||||||
imagepng($newImage,$thumb_image_name);
|
imagepng($newImage,$thumb_image_name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
chmod($thumb_image_name, 0640);
|
chmod($thumb_image_name, 0644);
|
||||||
return $thumb_image_name;
|
return $thumb_image_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,23 +13,185 @@ use App\Form\IllustrationType as Form;
|
||||||
class IllustrationController extends AbstractController
|
class IllustrationController extends AbstractController
|
||||||
{
|
{
|
||||||
private $data = "illustration";
|
private $data = "illustration";
|
||||||
private $route = "app_illustration";
|
private $route = "app_admin_illustration";
|
||||||
private $render = "Illustration/";
|
private $render = "Illustration/";
|
||||||
private $entity = "App:Illustration";
|
private $entity = "App:Illustration";
|
||||||
|
|
||||||
public function list(Request $request)
|
public function list($by,$userid)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$datas = $em->getRepository($this->entity)->findAll();
|
if($by=="admin") {
|
||||||
|
$datas = $em->getRepository($this->entity)->findAll();
|
||||||
|
return $this->render($this->render.'list.html.twig',[
|
||||||
|
$this->data."s" => $datas,
|
||||||
|
"useheader" => true,
|
||||||
|
"usesidebar" => true,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$datas = $em->getRepository($this->entity)->findByUser($em->getRepository("App:User")->find($userid));
|
||||||
|
|
||||||
return $this->render($this->render.'list.html.twig',[
|
return $this->render($this->render.'listrender.html.twig',[
|
||||||
|
$this->data."s" => $datas,
|
||||||
|
"by" => $by,
|
||||||
|
"userid" => $userid,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function listuser(Request $request)
|
||||||
|
{
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
|
$datas = $em->getRepository($this->entity)->findByUser($this->getUser());
|
||||||
|
|
||||||
|
return $this->render($this->render.'listrender.html.twig',[
|
||||||
$this->data."s" => $datas,
|
$this->data."s" => $datas,
|
||||||
"useheader" => true,
|
"by" => "profil",
|
||||||
"usesidebar" => true,
|
"userid" => $this->getUser()->getId(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function view($idcat,$id,Request $request)
|
public function submit($by, $userid, Request $request)
|
||||||
|
{
|
||||||
|
// Initialisation de l'enregistrement
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$data = new Entity();
|
||||||
|
|
||||||
|
// Création du formulaire
|
||||||
|
if($by=="admin"||$by=="update") {
|
||||||
|
$form = $this->createForm(Form::class,$data,array("mode"=>"submit","by"=>$by,"user"=>$em->getRepository("App:User")->find($userid)));
|
||||||
|
} else {
|
||||||
|
$userid=$this->getUser()->getId();
|
||||||
|
$form = $this->createForm(Form::class,$data,array("mode"=>"submit","by"=>$by,"user"=>$this->getUser()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Récupération des data du formulaire
|
||||||
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
// Sur erreur
|
||||||
|
$this->getErrorForm(null,$form,$request,$data,"submit");
|
||||||
|
|
||||||
|
// Sur validation
|
||||||
|
if ($form->get('submit')->isClicked() && $form->isValid()) {
|
||||||
|
$data = $form->getData();
|
||||||
|
$data->setSubmittime(new \DateTime());
|
||||||
|
$em->persist($data);
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
// Retour à la liste
|
||||||
|
if($by=="admin")
|
||||||
|
return $this->redirectToRoute($this->route,["by"=>$by,"userid"=>-1]);
|
||||||
|
elseif($by=="update")
|
||||||
|
return $this->redirectToRoute("app_user_update",["id"=>$data->getCategory()->getUser()->getId()]);
|
||||||
|
elseif($by=="profil")
|
||||||
|
return $this->redirectToRoute("app_user_profil");
|
||||||
|
else
|
||||||
|
return $this->redirectToRoute("app_illustration_view",["by"=>"user","idcat"=>$data->getCategory()->getId(),"id"=>$data->getId()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Affichage du formulaire
|
||||||
|
return $this->render($this->render.'edit.html.twig', [
|
||||||
|
'useheader' => true,
|
||||||
|
'usesidebar' => false,
|
||||||
|
$this->data => $data,
|
||||||
|
'mode' => 'submit',
|
||||||
|
'form' => $form->createView(),
|
||||||
|
'by' => $by,
|
||||||
|
'userid' => $userid,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update($id,$by,Request $request)
|
||||||
|
{
|
||||||
|
// Initialisation de l'enregistrement
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$data=$em->getRepository($this->entity)->find($id);
|
||||||
|
|
||||||
|
if($by!="admin"&&$by!="update") {
|
||||||
|
if($this->getUser()!=$data->getCategory()->getUser()&&!$this->getUser()->hasRole("ROLE_ADMIN"))
|
||||||
|
return $this->redirectToRoute("app_home");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Création du formulaire
|
||||||
|
$form = $this->createForm(Form::class,$data,array("mode"=>"update","by"=>$by,"user"=>$this->getUser()));
|
||||||
|
|
||||||
|
// Récupération des data du formulaire
|
||||||
|
$form->handleRequest($request);
|
||||||
|
|
||||||
|
// Sur erreur
|
||||||
|
$this->getErrorForm($id,$form,$request,$data,"update");
|
||||||
|
|
||||||
|
// Sur validation
|
||||||
|
if ($form->get('submit')->isClicked() && $form->isValid()) {
|
||||||
|
$data = $form->getData();
|
||||||
|
$em->persist($data);
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
// Retour à l'illustration
|
||||||
|
// Retour à la liste
|
||||||
|
if($by=="admin")
|
||||||
|
return $this->redirectToRoute($this->route,["by"=>$by,"userid"=>-1]);
|
||||||
|
elseif($by=="update")
|
||||||
|
return $this->redirectToRoute("app_user_update",["id"=>$data->getCategory()->getUser()->getId()]);
|
||||||
|
elseif($by=="profil")
|
||||||
|
return $this->redirectToRoute("app_user_profil");
|
||||||
|
elseif($by=="illustration")
|
||||||
|
return $this->redirectToRoute("app_illustration_view",["by"=>"user","idcat"=>$data->getCategory()->getId(),"id"=>$data->getId()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Affichage du formulaire
|
||||||
|
return $this->render($this->render.'edit.html.twig', [
|
||||||
|
'useheader' => true,
|
||||||
|
'usesidebar' => false,
|
||||||
|
$this->data => $data,
|
||||||
|
'mode' => 'update',
|
||||||
|
'form' => $form->createView(),
|
||||||
|
'by' => $by,
|
||||||
|
'userid' => $data->getCategory()->getUser()->getId(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function delete($id,$by,Request $request)
|
||||||
|
{
|
||||||
|
// Initialisation de l'enregistrement
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$data=$em->getRepository($this->entity)->find($id);
|
||||||
|
|
||||||
|
if($by!="admin"&&$by!="update") {
|
||||||
|
if($this->getUser()!=$data->getCategory()->getUser()&&!$this->getUser()->hasRole("ROLE_ADMIN"))
|
||||||
|
return $this->redirectToRoute("app_home");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Controle avant suppression
|
||||||
|
$error=false;
|
||||||
|
if($id<0) $error=true;
|
||||||
|
|
||||||
|
if($error)
|
||||||
|
return $this->redirectToRoute($this->route."_update",["id"=>$id]);
|
||||||
|
else {
|
||||||
|
$em->remove($data);
|
||||||
|
$em->flush();
|
||||||
|
|
||||||
|
// Retour à la liste
|
||||||
|
if($by=="admin")
|
||||||
|
return $this->redirectToRoute($this->route,["by"=>$by,"userid"=>-1]);
|
||||||
|
elseif($by=="update")
|
||||||
|
return $this->redirectToRoute("app_user_update",["id"=>$data->getCategory()->getUser()->getId()]);
|
||||||
|
elseif($by=="profil")
|
||||||
|
return $this->redirectToRoute("app_user_profil");
|
||||||
|
elseif($by=="illustration")
|
||||||
|
return $this->redirectToRoute("app_home_user",["userpseudo"=>$data->getCategory()->getUser()->getSlug()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function upload()
|
||||||
|
{
|
||||||
|
return $this->render($this->render.'upload.html.twig');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function view($idcat,$id,$by,Request $request)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$data=$em->getRepository($this->entity)->find($id);
|
$data=$em->getRepository($this->entity)->find($id);
|
||||||
|
@ -47,121 +209,11 @@ class IllustrationController extends AbstractController
|
||||||
"next" => $datanext,
|
"next" => $datanext,
|
||||||
"pathinfo" => $pathinfo,
|
"pathinfo" => $pathinfo,
|
||||||
"usemonocolor" => true,
|
"usemonocolor" => true,
|
||||||
|
"by" => $by,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function submit($by, Request $request)
|
|
||||||
{
|
|
||||||
// Initialisation de l'enregistrement
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$data = new Entity();
|
|
||||||
|
|
||||||
// Création du formulaire
|
|
||||||
$form = $this->createForm(Form::class,$data,array("mode"=>"submit"));
|
|
||||||
|
|
||||||
// Récupération des data du formulaire
|
|
||||||
$form->handleRequest($request);
|
|
||||||
|
|
||||||
// Sur erreur
|
|
||||||
$this->getErrorForm(null,$form,$request,$data,"submit");
|
|
||||||
|
|
||||||
// Sur validation
|
|
||||||
if ($form->get('submit')->isClicked() && $form->isValid()) {
|
|
||||||
$data = $form->getData();
|
|
||||||
$data->setSubmittime(new \DateTime());
|
|
||||||
$em->persist($data);
|
|
||||||
$em->flush();
|
|
||||||
|
|
||||||
// Retour à la liste
|
|
||||||
if($by=="console")
|
|
||||||
return $this->redirectToRoute($this->route);
|
|
||||||
else
|
|
||||||
return $this->redirectToRoute("app_home");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Affichage du formulaire
|
|
||||||
return $this->render($this->render.'edit.html.twig', [
|
|
||||||
'useheader' => true,
|
|
||||||
'usesidebar' => false,
|
|
||||||
$this->data => $data,
|
|
||||||
'mode' => 'submit',
|
|
||||||
'form' => $form->createView(),
|
|
||||||
'by' => $by,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function update($id,$by,Request $request)
|
|
||||||
{
|
|
||||||
// Initialisation de l'enregistrement
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$data=$em->getRepository($this->entity)->find($id);
|
|
||||||
|
|
||||||
// Création du formulaire
|
|
||||||
$form = $this->createForm(Form::class,$data,array("mode"=>"update"));
|
|
||||||
|
|
||||||
// Récupération des data du formulaire
|
|
||||||
$form->handleRequest($request);
|
|
||||||
|
|
||||||
// Sur erreur
|
|
||||||
$this->getErrorForm($id,$form,$request,$data,"update");
|
|
||||||
|
|
||||||
// Sur validation
|
|
||||||
if ($form->get('submit')->isClicked() && $form->isValid()) {
|
|
||||||
$data = $form->getData();
|
|
||||||
$em->persist($data);
|
|
||||||
$em->flush();
|
|
||||||
|
|
||||||
// Retour à l'illustration
|
|
||||||
if($by=="console")
|
|
||||||
return $this->redirectToRoute($this->route);
|
|
||||||
else
|
|
||||||
return $this->redirectToRoute($this->route.'_view',array("idcat"=>$data->getCategory()->getId(),"id"=> $id));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Affichage du formulaire
|
|
||||||
return $this->render($this->render.'edit.html.twig', [
|
|
||||||
'useheader' => true,
|
|
||||||
'usesidebar' => false,
|
|
||||||
$this->data => $data,
|
|
||||||
'mode' => 'update',
|
|
||||||
'form' => $form->createView(),
|
|
||||||
'by' => $by,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function delete($id,$by,Request $request)
|
|
||||||
{
|
|
||||||
// Initialisation de l'enregistrement
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
$data=$em->getRepository($this->entity)->find($id);
|
|
||||||
|
|
||||||
// Controle avant suppression
|
|
||||||
$error=false;
|
|
||||||
if($id<0) $error=true;
|
|
||||||
|
|
||||||
if($error)
|
|
||||||
return $this->redirectToRoute($this->route."_update",["id"=>$id]);
|
|
||||||
else {
|
|
||||||
$em->remove($data);
|
|
||||||
$em->flush();
|
|
||||||
|
|
||||||
// Retour à la liste
|
|
||||||
if($by=="console")
|
|
||||||
return $this->redirectToRoute($this->route);
|
|
||||||
else
|
|
||||||
return $this->redirectToRoute("app_home");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function upload()
|
|
||||||
{
|
|
||||||
return $this->render($this->render.'upload.html.twig');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected function getDataAllNext($idcat,$id)
|
protected function getDataAllNext($idcat,$id)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
|
@ -10,6 +10,8 @@ use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use FOS\CKEditorBundle\Form\Type\CKEditorType;
|
use FOS\CKEditorBundle\Form\Type\CKEditorType;
|
||||||
|
|
||||||
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
|
||||||
class IllustrationType extends AbstractType
|
class IllustrationType extends AbstractType
|
||||||
{
|
{
|
||||||
|
@ -40,13 +42,32 @@ class IllustrationType extends AbstractType
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$builder->add('category',
|
if($options["by"]=="admin") {
|
||||||
EntityType::class, [
|
$builder->add('category',
|
||||||
"class" => "App:Category",
|
EntityType::class, [
|
||||||
"label" => "Categorie",
|
"class" => "App:Category",
|
||||||
"choice_label"=> "name",
|
"label" => "Categorie",
|
||||||
]
|
"choice_label"=> function($category) {
|
||||||
);
|
return $category->getUser()->getUsername(). ' = ' . $category->getName();
|
||||||
|
},
|
||||||
|
"group_by" => function($category) {
|
||||||
|
return $category->getUser()->getUsername();
|
||||||
|
},
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$builder->add('category',
|
||||||
|
EntityType::class, [
|
||||||
|
"class" => "App:Category",
|
||||||
|
"label" => "Categorie",
|
||||||
|
"choice_label"=> "name",
|
||||||
|
'query_builder' => function (EntityRepository $er) use ($options): QueryBuilder {
|
||||||
|
return $er->createQueryBuilder('c')->where('c.user=:user')->setParameter('user',$options['user']->getId())->orderBy('c.order', 'ASC');
|
||||||
|
},
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$builder->add('illustration',HiddenType::class);
|
$builder->add('illustration',HiddenType::class);
|
||||||
$builder->add('width',HiddenType::class);
|
$builder->add('width',HiddenType::class);
|
||||||
|
@ -58,6 +79,8 @@ class IllustrationType extends AbstractType
|
||||||
$resolver->setDefaults(array(
|
$resolver->setDefaults(array(
|
||||||
'data_class' => 'App\Entity\Illustration',
|
'data_class' => 'App\Entity\Illustration',
|
||||||
'mode' => 'string',
|
'mode' => 'string',
|
||||||
|
'by' => 'string',
|
||||||
|
'user' => 'App\Entity\User'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Repository;
|
namespace App\Repository;
|
||||||
|
|
||||||
use App\Entity\Illustration;
|
use App\Entity\Illustration;
|
||||||
|
use App\Entity\User;
|
||||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
@ -12,4 +13,19 @@ class IllustrationRepository extends ServiceEntityRepository
|
||||||
{
|
{
|
||||||
parent::__construct($registry, Illustration::class);
|
parent::__construct($registry, Illustration::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function findByUser(User $user) {
|
||||||
|
$illustrations=[];
|
||||||
|
if($user) {
|
||||||
|
$illustrations=$this->createQueryBuilder('illustration')
|
||||||
|
->from('App\Entity\Category','category')
|
||||||
|
->andWhere('category.user = :user')
|
||||||
|
->andWhere('category.id = illustration.category')
|
||||||
|
->setParameter('user',$user)
|
||||||
|
->orderBy('illustration.submittime', 'DESC')
|
||||||
|
->getQuery()->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $illustrations;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue