diff --git a/src/nineskeletor-1.0/config/packages/one_upload.yaml b/src/nineskeletor-1.0/config/packages/one_upload.yaml index ef0d245..e58ec63 100644 --- a/src/nineskeletor-1.0/config/packages/one_upload.yaml +++ b/src/nineskeletor-1.0/config/packages/one_upload.yaml @@ -4,6 +4,8 @@ oneup_uploader: frontend: dropzone logo: frontend: dropzone + header: + frontend: dropzone document: frontend: dropzone namer: app.upload.samename diff --git a/src/nineskeletor-1.0/config/routes.yaml b/src/nineskeletor-1.0/config/routes.yaml index efff704..fbecc5a 100644 --- a/src/nineskeletor-1.0/config/routes.yaml +++ b/src/nineskeletor-1.0/config/routes.yaml @@ -94,28 +94,28 @@ oneup_uploader: type: uploader #== Cron ================================================================================================================= -app_cron: - path: /admin/cron +app_cron_job: + path: /config/cron defaults: { _controller: App\Controller\CronController:list } app_cron_ajax_list: - path: /admin/cron/ajax/list + path: /config/cron/ajax/list defaults: { _controller: App\Controller\CronController:ajaxlist } app_cron_update: - path: /admin/cron/update/{id} + path: /config/cron/update/{id} defaults: { _controller: App\Controller\CronController:update } app_cron_exec: - path: /admin/cron/exec/{id} + path: /config/cron/exec/{id} defaults: { _controller: App\Controller\CronController:exec } app_cron_log: - path: /admin/cron/log + path: /config/cron/log defaults: { _controller: App\Controller\CronController:log } app_cron_getlog: - path: /admin/cron/getlog/{id} + path: /config/cron/getlog/{id} defaults: { _controller: App\Controller\CronController:getlog } #== User ======================================================================================================== @@ -147,6 +147,10 @@ app_user_profil: path: /user/profil defaults: { _controller: App\Controller\UserController:profil } +app_user_preference: + path: /user/preference + defaults: { _controller: App\Controller\UserController:preference } + #== Group ======================================================================================================== app_group: path: /admin/group diff --git a/src/nineskeletor-1.0/config/services.yaml b/src/nineskeletor-1.0/config/services.yaml index 52f1977..6a78e68 100644 --- a/src/nineskeletor-1.0/config/services.yaml +++ b/src/nineskeletor-1.0/config/services.yaml @@ -71,7 +71,8 @@ services: $ldapUser: '%ldapUser%' $ldapPassword: '%ldapPassword%' $ldapBasedn: '%ldapBasedn%' - + $wssport: '%wssport%' + # makes classes in src/ available to be used as services # this creates a service per class whose id is the fully-qualified class name App\: @@ -89,7 +90,7 @@ services: app.session.init: public: true class: App\Service\sessionInit - arguments: ["@service_container","@doctrine.orm.entity_manager","@session",] + arguments: ["@service_container","@doctrine.orm.entity_manager","@session","@security.token_storage"] tags: - { name: kernel.event_listener, event: kernel.request, method: onDomainParse } @@ -129,4 +130,8 @@ services: - [setContainer, ["@service_container"]] tags: - { name: twig.extension } - \ No newline at end of file + + app.websocket.service: + public: true + class: App\Service\messageService + arguments: ['%wssport%'] \ No newline at end of file diff --git a/src/nineskeletor-1.0/public/styles/css/style.css b/src/nineskeletor-1.0/public/styles/css/style.css index e133501..59c472f 100644 --- a/src/nineskeletor-1.0/public/styles/css/style.css +++ b/src/nineskeletor-1.0/public/styles/css/style.css @@ -1,23 +1,38 @@ -h1{ - padding: 40px 0px 9px 0px; - border-bottom: 1px solid #eee; +.headertitle a{ + text-transform: uppercase; +} +.headertitle small { + font-size:60%; +} +#switchHeader{ + cursor:pointer; } -.nav a{ - background: none; - color: #CFD8DC; - font-size: 14px; - padding: 5px 0px 5px 25px; - display: block; +.navbar { + height:60px; } - +.nav a { + padding-left: 15px; +} .page-maxed { max-width:1200px; margin:auto !important; } -/* Sidebar Styles */ +.avatar { + background-color: #343a40; + width: 35px; + height: 35px; + border-radius: 100%; + margin-top: -2px; +} + +.avatar.big{ + width: 90px; + height: 90px; + margin-bottom: 10px; +} .contentsidebar { margin-left:250px; } @@ -32,439 +47,59 @@ h1{ background: #37474F; } -#sidebar header { - background-color: #263238; - font-size: 20px; - line-height: 52px; - text-align: center; +#sidebar .nav-link.active, .nav-link:hover { + background-color:var(--colorbgbodydark-darker); } -#sidebar header a { - color: #fff; +#sidebar .nav-link { + padding:5px 0px 5px 10px; +} + +#sidebar .nav-first-level { + zoom:120% +} + +#sidebar .nav-second-level .nav-link { + padding:5px 0px 5px 25px; display: block; - text-decoration: none; -} - -#sidebar header a:hover { - color: #fff; -} - -#sidebar .nav{ - display: block; - margin: 0px 10px; -} - -#sidebar .nav a { - padding: 0px 10px 5px 10px; -} - -#sidebar .nav .last{ - border-bottom: 1px solid #455A64; - padding-bottom:5px; - margin-bottom: 10px; -} - -#sidebar .title { - color: #CFD8DC; - font-size: 16px; - padding: 0px 10px 0px 10px; - display: block; - text-transform: uppercase; - margin-left: 0px !important; - font-weight: bold; -} - -#sidebar .nav .last{ - border-bottom: 1px solid #fff; - padding-bottom: 5px; -} - -#sidebar .nav a:hover{ - background: none; - color: #ECEFF1; -} - -#sidebar .nav a i{ - margin-right: 5px; - width: 20px; - text-align: center; -} - -#sidebar .nav .select-control { - padding: 0px 10px 5px 10px; - margin-top: -12px; -} - -.avatar { - background-color: #343a40; - width: 35px; - height: 35px; - border-radius: 100%; - margin-top: -5px; -} - -.avatar.big{ - width: 90px; - height: 90px; - margin-bottom: 10px; + width:100%; } @media (max-width: 991px) { + #headercontainer{ + display:none !important; + } + + #switchHeader{ + display:none !important; + } + .contentsidebar { margin-left: auto; } - + + .navbar-toggler { + display: inline-block !important; + } + #sidebar { position: static; margin:0px -15px; width: auto; } + #sidebar .nav-second-level .nav-link { + width: auto; + } } - -a.btn { - color:#ffffff; -} - -.btn-link { - padding:0px; -} - -.media-body p { - font-size :12px; - margin-bottom:0px; -} - @media (min-width: 992px) { #sidebar { display: block; } } - - -{% if useheader is defined and useheader %} -#main { - padding-top:55px; +.page-header { + padding-top:20px; + text-transform: uppercase; + border-bottom: 3px solid var(--colorfttitlelight); + padding-bottom: 5px; } -{% endif %} - - -th.dt-center, td.dt-center { text-align: center; } - - -/* heros */ -.heroheader { - width:100%; - height:800px; - position:relative; -} -.heroheader div{ - width:100%; - height:100%; - background-size: cover; - background-position: center; - color:#fff; - text-align: center; -} - -/* Dots */ -.slick-dotted.slick-slider -{ - margin-bottom: 30px; -} - -.slick-dots -{ - position: absolute; - bottom: -105px; - - display: block; - - width: 100%; - padding: 0; - margin: 0; - - list-style: none; - - text-align: center; -} -.slick-dots li -{ - position: relative; - - display: inline-block; - - width: 20px; - height: 20px; - margin: 0 5px; - padding: 0; - - cursor: pointer; -} -.slick-dots li button -{ - font-size: 0; - line-height: 0; - - display: block; - - width: 20px; - height: 20px; - padding: 5px; - - cursor: pointer; - - color: transparent; - border: 0; - outline: none; - background: transparent; -} -.slick-dots li button:hover, -.slick-dots li button:focus -{ - outline: none; -} -.slick-dots li button:hover:before, -.slick-dots li button:focus:before -{ - opacity: 1; -} -.slick-dots li button:before -{ - font-family: 'slick'; - font-size: 6px; - line-height: 20px; - - position: absolute; - top: 0; - left: 0; - - width: 20px; - height: 20px; - - content: '•'; - text-align: center; - - opacity: .25; - color: black; - - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.slick-dots li.slick-active button:before -{ - opacity: .75; - color: black; -} - -.slick-dotted.slick-slider{margin-bottom:0px;} -.slick-dots { - position: absolute; - top: 135px; - left:46px; - text-align:left; - z-index: 9100; - bottom:unset; - width:auto; -} -.heroheader-dot { color:#fff; } - - -.herobox { - position:absolute; - float: left; - top: 0; - bottom: 0; - left: -200px; - z-index: 8000; - padding: 0; - text-align: center; - text-shadow: none; - background-color: rgba(0,0,0,0.7); - height: auto; - width: 45%; - box-shadow: 0px -1px 2px rgba(0,0,0,0.5); - margin: 0 auto; - //opacity: 0.9; - transform-origin: 50% 50%; - transform: skew(-20deg); - -webkit-transform: skew(-20deg); - -moz-transform: skew(-20deg); - -o-transform: skew(-20deg); - -ms-transform: skew(-20deg); - border-left: 1px solid #fff; - border-right: 1px solid #fff; -} - -.herotitle { - text-align: left; - position:absolute; - //width:100%; - top: 80px; - left:50px; - z-index: 9000; -} - -.herotitle h1 { - padding:0px; - border:none; -} - -.heromenu { - padding-top: 30px; - font-size: 20px; -} - -.herofloatmenu .avatar { - width: 20px; - height: 20px; - margin: 3px 3px 0px 0px; -} -.herofloatmenu a:hover { - text-decoration: none; -} - -.heromenu .linkmenu { - font-size:16px; - padding-left: 5px; -} - -.heromenu .linkmenu a { - margin-right:5px; -} - -.herologo { - position: absolute; - top: 0px; - text-align: center; - width: 100%; -} - -.herologo img {max-height:200px;} - -@media (max-width: 980px) { - .herobox { display: none; } - .herotitle { width:100%; top: 70px; left:0px; text-align:center; } - .slick-dots { top: 120px; left: 0px; text-align: center; width: 100%; } - .heromenu .facatmenu {display: none;} - .catmenu { display:none } - .linkmenu { display:none } - - .herofloatmenu a { - font-size: 40px; - } - - .herofloatmenu .avatar { - height: 40px; - width:40px; - margin-top:15px; - } -} - -.grid-sizer { width: 10%; margin-bottom: 0%;float:left;} -.grid-item-size { width: 10%; margin-bottom: 0%;float:left;} -.grid-item-size-2 { width: 20%; margin-bottom: 0%;float:left;} -.grid-item-size-3 { width: 30%; margin-bottom: 0%;float:left;} -.grid-item-size-4 { width: 40%; margin-bottom: 0%;float:left;} -.grid-item-size-5 { width: 40%; margin-bottom: 0%;float:left;} -.grid-item-size-6 { width: 60%; margin-bottom: 0%;float:left;} -.grid-item-size-7 { width: 70%; margin-bottom: 0%;float:left;} -.grid-item-size-8 { width: 80%; margin-bottom: 0%;float:left;} -.grid-item-size-9 { width: 90%; margin-bottom: 0%;float:left;} -.grid-item-full { width: 100%; margin-bottom: 0%; font-size:20px;float:left; } -.grid-item-full h1 {margin: 0; border:none; padding: 20px 0px 0px 10px; } -.gutter-sizer { width: 0%;float:left; } -@media (max-width: 980px) { - .grid-sizer { width: 50%; margin-bottom: 0%;} - .grid-item-size { width: 50%; margin-bottom: 0%;} -} - - - - - -.foliomenu { - position: fixed; - width:100%; - height:60px; - background-color: var(--colorbgbodydark) ; - z-index: 100000; - display:none; - padding-left:10px; - border-bottom: 1px solid var(--colorftbodydark); -} - -.foliomenu .logo { float:left; height:40px; margin-top:7px } -.foliomenu .avatar { height: 20px; margin: 3px 3px 0px 0px; width: 20px; } -.foliomenu div { padding: 10px; line-height:35px; float:left;} -.foliomenu a { - color: var(--colorftbodydark); - font-size: 15px; -} -.foliomenu .float-right a:hover { - text-decoration: none; -} - -.foliomenu .fa { font-size: 14px; color: var(--colorftbodydark);} - -.foliotop { - float:right; - position:fixed; - bottom: 10px; - right:10px; - z-index: 100000; - background-color: var(--colorbgbodydark) ; - padding:10px; - border-radius: 100%; - width:55px; - height:55px; - text-align: center; - line-height: 28px; - border: 1px solid var(--colorbgbodylight); - display:none; -} -.foliotop a { - color: var(--colorftbodydark); - font-size: 25px; -} - -@media (max-width: 980px) { - - .herofloatmenu { - display:none; - } - - .foliomenu { - display: block!important; - } - - .foliomenu a { - font-size:30px; - } - - .foliomenu .float-right a { - margin-top: -8px; - } - .foliomenu .float-right img { - height:35px; - width:35px; - margin-top:0px; - } - .foliomenu .float-right .fa { - font-size:30px!important; - } -} - -.linkurl a { - background-color: var(--colorbgbodylight) ; - color: var(--colorftbodylight)!important; - font-size: 14px; - padding: 5px; - display: inline-block; - margin: 0px 10px 10px 0px; -} - -.contactdescription { - max-width:300px; - text-align:justify; -} \ No newline at end of file diff --git a/src/nineskeletor-1.0/public/themes/nineblue/style.css b/src/nineskeletor-1.0/public/themes/nineblue/style.css index e95662e..c59e3d7 100644 --- a/src/nineskeletor-1.0/public/themes/nineblue/style.css +++ b/src/nineskeletor-1.0/public/themes/nineblue/style.css @@ -1,7 +1,10 @@ :root{ --colorbgbodydark: #3a539b; --colorfttitlelight: #3a539b; - + --colorbgbodydark-darker: #082169; + --colorfttitlelight-darker: #082169; + --colorbgbodydark-rgb: 58,83,155; + /* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut --colorbgbodylight: #; --colorbgbodydark: #; @@ -18,7 +21,8 @@ --colorbgbodylight-darker: #; --colorfttitlelight-darker: #; -} + --colorbgbodydark-darker: #; + --colorbgbodydark-rgb: R,V,G */ } diff --git a/src/nineskeletor-1.0/public/themes/ninedark/style.css b/src/nineskeletor-1.0/public/themes/ninedark/style.css index 27a4766..d096f59 100644 --- a/src/nineskeletor-1.0/public/themes/ninedark/style.css +++ b/src/nineskeletor-1.0/public/themes/ninedark/style.css @@ -2,6 +2,9 @@ --colorbgbodydark: #2e3131; --colorfttitlelight: #2e3131; --colorfttitlelight-darker: #95a5a6; + --colorbgbodydark-darker: #000000; + --colorfttitlelight-darker: #000000; + --colorbgbodydark-rgb: 46,49,49; /* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut --colorbgbodylight: #; @@ -19,7 +22,8 @@ --colorbgbodylight-darker: #; --colorfttitlelight-darker: #; -} + --colorbgbodydark-darker: #; + --colorbgbodydark-rgb: R,V,G */ } diff --git a/src/nineskeletor-1.0/public/themes/ninegray/style.css b/src/nineskeletor-1.0/public/themes/ninegray/style.css index 25d5baf..8a83b38 100644 --- a/src/nineskeletor-1.0/public/themes/ninegray/style.css +++ b/src/nineskeletor-1.0/public/themes/ninegray/style.css @@ -1,7 +1,10 @@ :root{ --colorbgbodydark: #6c7a89; --colorfttitlelight: #6c7a89; - + --colorbgbodydark-darker: #3a4857; + --colorfttitlelight-darker: #3a4857; + --colorbgbodydark-rgb: 108,122,137; + /* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut --colorbgbodylight: #; --colorbgbodydark: #; @@ -18,7 +21,8 @@ --colorbgbodylight-darker: #; --colorfttitlelight-darker: #; -} + --colorbgbodydark-darker: #; + --colorbgbodydark-rgb: R,V,G */ } diff --git a/src/nineskeletor-1.0/public/themes/ninegreen/style.css b/src/nineskeletor-1.0/public/themes/ninegreen/style.css index cd90511..bab6bda 100644 --- a/src/nineskeletor-1.0/public/themes/ninegreen/style.css +++ b/src/nineskeletor-1.0/public/themes/ninegreen/style.css @@ -1,7 +1,10 @@ :root{ - --colorbgbodydark: #1e824c; --colorfttitlelight: #1e824c; - + --colorbgbodydark: #1e824c; + --colorbgbodydark-darker: #00501a; + --colorfttitlelight-darker: #00501a; + --colorbgbodydark-rgb: 30,130,76; + /* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut --colorbgbodylight: #; --colorbgbodydark: #; @@ -18,7 +21,8 @@ --colorbgbodylight-darker: #; --colorfttitlelight-darker: #; -} + --colorbgbodydark-darker: #; + --colorbgbodydark-rgb: R,V,G */ } @@ -37,7 +41,3 @@ - - - - diff --git a/src/nineskeletor-1.0/public/themes/nineorange/style.css b/src/nineskeletor-1.0/public/themes/nineorange/style.css index 2d3a355..bc62e4f 100644 --- a/src/nineskeletor-1.0/public/themes/nineorange/style.css +++ b/src/nineskeletor-1.0/public/themes/nineorange/style.css @@ -1,7 +1,10 @@ :root{ --colorbgbodydark: #f15a22; --colorfttitlelight: #f15a22; - + --colorbgbodydark-darker: #bf2800; + --colorfttitlelight-darker: #bf2800; + --colorbgbodydark-rgb: 241,90,34; + /* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut --colorbgbodylight: #; --colorbgbodydark: #; @@ -18,7 +21,8 @@ --colorbgbodylight-darker: #; --colorfttitlelight-darker: #; -} + --colorbgbodydark-darker: #; + --colorbgbodydark-rgb: R,V,G */ } diff --git a/src/nineskeletor-1.0/public/themes/ninered/style.css b/src/nineskeletor-1.0/public/themes/ninered/style.css index 204f519..7f67895 100644 --- a/src/nineskeletor-1.0/public/themes/ninered/style.css +++ b/src/nineskeletor-1.0/public/themes/ninered/style.css @@ -1,7 +1,10 @@ :root{ --colorbgbodydark: #96281b; --colorfttitlelight: #96281b; - + --colorbgbodydark-darker: #640000; + --colorfttitlelight-darker: #640000; + --colorbgbodydark-rgb: 150,40,27; + /* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut --colorbgbodylight: #; --colorbgbodydark: #; @@ -18,7 +21,8 @@ --colorbgbodylight-darker: #; --colorfttitlelight-darker: #; -} + --colorbgbodydark-darker: #; + --colorbgbodydark-rgb: R,V,G */ } diff --git a/src/nineskeletor-1.0/public/themes/nineyellow/style.css b/src/nineskeletor-1.0/public/themes/nineyellow/style.css index e7427b2..e020afa 100644 --- a/src/nineskeletor-1.0/public/themes/nineyellow/style.css +++ b/src/nineskeletor-1.0/public/themes/nineyellow/style.css @@ -1,7 +1,10 @@ :root{ --colorbgbodydark: #f7ca18; - --colorfttitlelight: #171717; - + --colorfttitlelight: #c59800; + --colorbgbodydark-darker: #c59800; + --colorfttitlelight-darker: #584403; + --colorbgbodydark-rgb: 247,202,24; + /* Vous pouvez forcer l'ensemble de ces variables ou laisser la valeur par défaut --colorbgbodylight: #; --colorbgbodydark: #; @@ -18,7 +21,8 @@ --colorbgbodylight-darker: #; --colorfttitlelight-darker: #; -} + --colorbgbodydark-darker: #; + --colorbgbodydark-rgb: R,V,G */ } diff --git a/src/nineskeletor-1.0/scripts/sidebar.sql b/src/nineskeletor-1.0/scripts/sidebar.sql new file mode 100644 index 0000000..a7aa793 --- /dev/null +++ b/src/nineskeletor-1.0/scripts/sidebar.sql @@ -0,0 +1,13 @@ +TRUNCATE TABLE sidebar; +INSERT IGNORE INTO `sidebar` (`id`, `parent_id`, `roworder`, `label`, `path`, `fonticon`, `permission`, `appactivate`) VALUES +(1000, NULL, 1000, 'CONFIGURATION', NULL, 'fa fa-cog', 'ROLE_ADMIN,ROLE_MODO', ''), +(1010, 1000, 1010, 'Générale', 'app_config', 'fa fa-table', 'ROLE_ADMIN,ROLE_MODO', ''), +(1020, 1000, 1020, 'Thème', 'app_theme', 'fa fa-paint-brush', 'ROLE_ADMIN,ROLE_MODO', ''), + +(1200, NULL, 1200, 'ORGANISATION', NULL, 'fa fa-sitemap', 'ROLE_ADMIN,ROLE_MODO', ''), +(1240, 1200, 1240, 'Groupes', 'app_group', 'fa fa-users', 'ROLE_ADMIN,ROLE_MODO', ''), +(1260, 1200, 1260, 'Utilisateurs', 'app_user', 'fa fa-child', 'ROLE_ADMIN,ROLE_MODO', ''), + +(7000, NULL, 7000, 'CRON', NULL, 'fa fa-bolt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'), +(7010, 7000, 7010, 'Jobs', 'app_cron_job', 'fa fa-bullseye', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'), +(7020, 7000, 7020, 'Logs / Dump', 'app_cron_log', 'fa fa-list-alt', 'ROLE_ADMIN,ROLE_MODO', 'cron_activate'); diff --git a/src/nineskeletor-1.0/scripts/wkhtmltopdf/wkhtmltoimage b/src/nineskeletor-1.0/scripts/wkhtmltopdf/wkhtmltoimage deleted file mode 100755 index a003025..0000000 Binary files a/src/nineskeletor-1.0/scripts/wkhtmltopdf/wkhtmltoimage and /dev/null differ diff --git a/src/nineskeletor-1.0/scripts/wkhtmltopdf/wkhtmltopdf b/src/nineskeletor-1.0/scripts/wkhtmltopdf/wkhtmltopdf deleted file mode 100755 index a90fa1c..0000000 Binary files a/src/nineskeletor-1.0/scripts/wkhtmltopdf/wkhtmltopdf and /dev/null differ diff --git a/src/nineskeletor-1.0/src/Command/AppInitCommand.php b/src/nineskeletor-1.0/src/Command/AppInitCommand.php index f35d9bc..b1a95c6 100644 --- a/src/nineskeletor-1.0/src/Command/AppInitCommand.php +++ b/src/nineskeletor-1.0/src/Command/AppInitCommand.php @@ -3,12 +3,11 @@ namespace App\Command; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Filesystem\Filesystem; -use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Finder\Finder; use Ramsey\Uuid\Uuid; use Doctrine\ORM\Mapping\ClassMetadata; @@ -60,6 +59,17 @@ class AppInitCommand extends Command $this->insertUser("admin","admin"); + // Init Sidebar + $finder = new Finder(); + $finder->in('scripts'); + $finder->name('sidebar.sql'); + foreach( $finder as $file ){ + $content = $file->getContents(); + $stmt = $this->em->getConnection()->prepare($content); + $stmt->execute(); + } + $stmt->closeCursor(); + // colorbgbody = Couleur des fonds de page $this->insertConfig( 1, // order @@ -67,7 +77,7 @@ class AppInitCommand extends Command "appname", // id "Titre de votre site", // title "", // value - "", // defalut + $this->appname, // default "string", // type, true, // visible true, // changeable @@ -82,7 +92,7 @@ class AppInitCommand extends Command "appsubname", // id "Sous-titre de votre site", // title "", // value - "", // defalut + "", // default "string", // type, true, // visible true, // changeable @@ -97,7 +107,7 @@ class AppInitCommand extends Command "appdescription", // id "Description de votre site", // title "", // value - "", // defalut + "", // default "editor", // type, true, // visible true, // changeable @@ -112,7 +122,7 @@ class AppInitCommand extends Command "apptheme", // id "Thème de votre site", // title "", // value - "", // defalut + "", // default "string", // type, false, // visible true, // changeable @@ -129,7 +139,7 @@ class AppInitCommand extends Command "colorbgbodydark", // id "Couleur de fond fonçée", // title "", // value - "#2574a9", // defalut + "#2574a9", // default "color", // type, true, // visible true, // changeable @@ -144,7 +154,7 @@ class AppInitCommand extends Command "colorbgbodylight", // id "Couleur de fond claire", // title "", // value - "#ffffff", // defalut + "#ffffff", // default "color", // type, true, // visible true, // changeable @@ -160,7 +170,7 @@ class AppInitCommand extends Command "colorfttitledark", // id "Couleur des titres sur fond fonçé", // title "", // value - "#ffffff", // defalut + "#ffffff", // default "color", // type, true, // visible true, // changeable @@ -175,7 +185,7 @@ class AppInitCommand extends Command "colorfttitlelight", // id "Couleur des titres sur fond claire", // title "", // value - "#2574a9", // defalut + "#2574a9", // default "color", // type, true, // visible true, // changeable @@ -191,7 +201,7 @@ class AppInitCommand extends Command "colorftbodydark", // id "Couleur de la police sur fond fonçé", // title "", // value - "#ffffff", // defalut + "#ffffff", // default "color", // type, true, // visible true, // changeable @@ -206,7 +216,7 @@ class AppInitCommand extends Command "colorftbodylight", // id "Couleur de la police sur fond claire", // title "", // value - "#343a40", // defalut + "#343a40", // default "color", // type, true, // visible true, // changeable @@ -222,7 +232,7 @@ class AppInitCommand extends Command "fonttitle", // id "Police pour les titres", // title "", // value - "FredokaOne-Regular", // defalut + "FredokaOne-Regular", // default "font", // type, true, // visible true, // changeable @@ -237,7 +247,7 @@ class AppInitCommand extends Command "fontbody", // id "Police principale", // title "", // value - "Roboto-Regular", // defalut + "Roboto-Regular", // default "font", // type, true, // visible true, // changeable @@ -252,7 +262,7 @@ class AppInitCommand extends Command "fontsizeh1", // id "Taille des titres h1", // title "", // value - "40", // defalut + "40", // default "integer", // type, true, // visible true, // changeable @@ -267,7 +277,7 @@ class AppInitCommand extends Command "fontsizeh2", // id "Taille des titres h2", // title "", // value - "32", // defalut + "32", // default "integer", // type, true, // visible true, // changeable @@ -282,7 +292,7 @@ class AppInitCommand extends Command "fontsizeh3", // id "Taille des titres h3", // title "", // value - "28", // defalut + "28", // default "integer", // type, true, // visible true, // changeable @@ -297,7 +307,7 @@ class AppInitCommand extends Command "fontsizeh4", // id "Taille des titres h4", // title "", // value - "24", // defalut + "24", // default "integer", // type, true, // visible true, // changeable @@ -313,7 +323,7 @@ class AppInitCommand extends Command "logodark", // id "Logo sur fond fonçé", // title "", // value - "", // defalut + "logo.png", // default "logo", // type, true, // visible true, // changeable @@ -328,7 +338,7 @@ class AppInitCommand extends Command "logolight", // id "Logo sur fond clair", // title "", // value - "", // defalut + "logo.png", // default "logo", // type, true, // visible true, // changeable @@ -337,6 +347,37 @@ class AppInitCommand extends Command "Logo sur fond clair" ); + // header = + $this->insertConfig( + 1, // order + "header", // category + "headerimage", // id + "Image de fond de la bannière", // title + "", // value + "header.png", // default + "header", // type, + true, // visible + true, // changeable + false, // required + "", // grouped + "Image de fond de la bannière" + ); + + $this->insertConfig( + 1, // order + "header", // category + "headerheight", // id + "Hauteur de la bannière", // title + "", // value + "100", // default + "integer", // type, + true, // visible + true, // changeable + false, // required + "", // grouped + "Image de fond de la bannière" + ); + $output->writeln(''); return 1; diff --git a/src/nineskeletor-1.0/src/Controller/CropController.php b/src/nineskeletor-1.0/src/Controller/CropController.php index 27b0147..13cef93 100644 --- a/src/nineskeletor-1.0/src/Controller/CropController.php +++ b/src/nineskeletor-1.0/src/Controller/CropController.php @@ -54,10 +54,10 @@ class CropController extends AbstractController $ratio="1:1"; break; - case "hero": + case "header": $max_height=1600; $max_width=1600; - $ratio="16:9"; + $ratio="16:2"; break; case "image": diff --git a/src/nineskeletor-1.0/src/Controller/SecurityController.php b/src/nineskeletor-1.0/src/Controller/SecurityController.php index bee2e9a..bd81544 100755 --- a/src/nineskeletor-1.0/src/Controller/SecurityController.php +++ b/src/nineskeletor-1.0/src/Controller/SecurityController.php @@ -137,7 +137,7 @@ class SecurityController extends AbstractController $event = new InteractiveLoginEvent($request, $token); $dispatcher = new EventDispatcher(); $dispatcher->dispatch($event); - + // Redirection if($redirect) return $this->redirect($redirect); diff --git a/src/nineskeletor-1.0/src/Controller/UserController.php b/src/nineskeletor-1.0/src/Controller/UserController.php index 434a28d..dac8521 100755 --- a/src/nineskeletor-1.0/src/Controller/UserController.php +++ b/src/nineskeletor-1.0/src/Controller/UserController.php @@ -174,6 +174,7 @@ class UserController extends AbstractController 'usesidebar' => false, $this->data => $data, 'mode' => 'profil', + 'maxwidth' => true, 'form' => $form->createView() ]); } @@ -231,6 +232,50 @@ class UserController extends AbstractController return $response; } + public function preference(Request $request) { + // S'assurer que c'est un appel ajax + if (!$request->isXmlHttpRequest()) { + return new JsonResponse(array('message' => 'Interdit'), 400); + } + + $key=$request->request->get('key'); + $id=$request->request->get('id'); + $value=$request->request->get('value'); + + // Récupérer les préférences de l'utilisateur + $preference=$this->getUser()->getPreference(); + + // Mise à jour de la préférence + $toupdate=false; + if(!is_array($preference)) { + $toupdate=true; + $preference=[]; + } + + if(!array_key_exists($key,$preference)) { + $toupdate=true; + $preference[$key]=[]; + } + if((!array_key_exists($id,$preference[$key]))) { + $toupdate=true; + $preference[$key][$id]=$value; + } + if($preference[$key][$id]!=$value) { + $toupdate=true; + $preference[$key][$id]=$value; + } + + // Mise à jour des préferences + if($toupdate) { + $em = $this->getDoctrine()->getManager(); + $this->getUser()->setPreference($preference); + $em->persist($this->getUser()); + $em->flush(); + } + + return new Response(); + } + protected function getErrorForm($id,$form,$request,$data,$mode) { if ($form->get('submit')->isClicked()&&$mode=="delete") { } diff --git a/src/nineskeletor-1.0/src/Entity/Config.php b/src/nineskeletor-1.0/src/Entity/Config.php index f5c0d47..cc284fc 100644 --- a/src/nineskeletor-1.0/src/Entity/Config.php +++ b/src/nineskeletor-1.0/src/Entity/Config.php @@ -86,7 +86,8 @@ class Config public function getValue(): ?string { - return $this->value; + if($this->value=="") return $this->default; + else return $this->value; } public function setValue(string $value): self diff --git a/src/nineskeletor-1.0/src/Entity/Sidebar.php b/src/nineskeletor-1.0/src/Entity/Sidebar.php new file mode 100644 index 0000000..770c854 --- /dev/null +++ b/src/nineskeletor-1.0/src/Entity/Sidebar.php @@ -0,0 +1,288 @@ +id; + } + + /** + * Set roworder + * + * @param integer $roworder + * + * @return Sidebar + */ + public function setRoworder($roworder) + { + $this->roworder = $roworder; + + return $this; + } + + /** + * Get roworder + * + * @return integer + */ + public function getRoworder() + { + return $this->roworder; + } + + /** + * Set label + * + * @param string $label + * + * @return Sidebar + */ + public function setLabel($label) + { + $this->label = $label; + + return $this; + } + + /** + * Get label + * + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Set path + * + * @param string $path + * + * @return Sidebar + */ + public function setPath($path) + { + $this->path = $path; + + return $this; + } + + /** + * Get path + * + * @return string + */ + public function getPath() + { + return $this->path; + } + + /** + * Set fonticon + * + * @param string $fonticon + * + * @return Sidebar + */ + public function setFonticon($fonticon) + { + $this->fonticon = $fonticon; + + return $this; + } + + /** + * Get fonticon + * + * @return string + */ + public function getFonticon() + { + return $this->fonticon; + } + + /** + * Set permission + * + * @param array $permission + * + * @return Sidebar + */ + public function setPermission($permission) + { + $this->permission = $permission; + + return $this; + } + + /** + * Get permission + * + * @return array + */ + public function getPermission() + { + return $this->permission; + } + + /** + * Set appactivate + * + * @param string $appactivate + * + * @return Sidebar + */ + public function setAppactivate($appactivate) + { + $this->appactivate = $appactivate; + + return $this; + } + + /** + * Get appactivate + * + * @return string + */ + public function getAppactivate() + { + return $this->appactivate; + } + + /** + * Set parent + * + * @param Sidebar $parent + * + * @return Sidebar + */ + public function setParent(Sidebar $parent = null) + { + $this->parent = $parent; + + return $this; + } + + /** + * Get parent + * + * @return Sidebar + */ + public function getParent() + { + return $this->parent; + } + /** + * Constructor + */ + public function __construct() + { + $this->childs = new \Doctrine\Common\Collections\ArrayCollection(); + } + + /** + * Add child + * + * @param Sidebar $child + * + * @return Sidebar + */ + public function addChild(Sidebar $child) + { + $this->childs[] = $child; + + return $this; + } + + /** + * Remove child + * + * @param Sidebar $child + */ + public function removeChild(Sidebar $child) + { + $this->childs->removeElement($child); + } + + /** + * Get childs + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getChilds() + { + return $this->childs; + } +} diff --git a/src/nineskeletor-1.0/src/Entity/User.php b/src/nineskeletor-1.0/src/Entity/User.php index 2bf0f87..2b679c1 100644 --- a/src/nineskeletor-1.0/src/Entity/User.php +++ b/src/nineskeletor-1.0/src/Entity/User.php @@ -80,6 +80,10 @@ class User implements UserInterface, \Serializable */ private $apikey; + /** + * @ORM\Column(name="preference", type="array", nullable=true) + */ + private $preference; /** * @ORM\ManyToMany(targetEntity="Group", inversedBy="users", cascade={"persist"}) @@ -286,4 +290,16 @@ class User implements UserInterface, \Serializable return $this; } + public function getPreference(): ?array + { + return $this->preference; + } + + public function setPreference(?array $preference): self + { + $this->preference = $preference; + + return $this; + } + } diff --git a/src/nineskeletor-1.0/src/Form/ConfigType.php b/src/nineskeletor-1.0/src/Form/ConfigType.php index 7f89ab8..5107bfe 100644 --- a/src/nineskeletor-1.0/src/Form/ConfigType.php +++ b/src/nineskeletor-1.0/src/Form/ConfigType.php @@ -126,7 +126,7 @@ class ConfigType extends AbstractType $builder->add('value',HiddenType::class); break; - case "hero": + case "header": $builder->add('value',HiddenType::class); break; diff --git a/src/nineskeletor-1.0/src/Service/messageService.php b/src/nineskeletor-1.0/src/Service/messageService.php new file mode 100644 index 0000000..044755a --- /dev/null +++ b/src/nineskeletor-1.0/src/Service/messageService.php @@ -0,0 +1,25 @@ +wssport = $wssport; + } + + + public function addMessage($userkey,$groupid,$message){ + \Ratchet\Client\connect('ws://localhost:'.$this->wssport)->then(function($conn) use ($userkey,$groupid,$message) { + $msg = ['command' => 'pushsubscribe', 'log'=>'','channel' => 'message-'.$groupid, 'channeltype' => 'message', 'channelkey' => $groupid, 'userkey' => $userkey,"subdata"=>["command"=>"message","message"=>$message]]; + $msg = json_encode($msg); + $conn->send($msg); + $conn->close(); + }, function ($e) { + die("Could not connect: {$e->getMessage()}"); + }); + + } +} diff --git a/src/nineskeletor-1.0/src/Service/sessionInit.php b/src/nineskeletor-1.0/src/Service/sessionInit.php index 5841d00..69a0a23 100644 --- a/src/nineskeletor-1.0/src/Service/sessionInit.php +++ b/src/nineskeletor-1.0/src/Service/sessionInit.php @@ -5,95 +5,114 @@ use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpFoundation\Session\Session; use Doctrine\ORM\EntityManager; + use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; class sessionInit { private $container; protected $em; protected $session; + protected $token; - public function __construct(ContainerInterface $container, EntityManager $em,Session $session) + public function __construct(ContainerInterface $container, EntityManager $em,Session $session, TokenStorageInterface $token) { $this->container = $container; $this->session = $session; $this->em = $em; + $this->token = $token; } public function onDomainParse(RequestEvent $event) { + // Config $configs = $this->em->getRepository("App:Config")->findAll(); foreach($configs as $config) { $this->session->set($config->getId(), strval($config->getValue())); } + $this->session->set("headerimage","uploads/header/".$this->session->get("headerimage")); - // Valeur par défaut appname - if($this->session->get("appname")=="") - $this->session->set("appname", $this->container->getParameter('appName')); + // Current user + $token = $this->token->getToken(); + if(!$token) return; + $curentuser=$token->getUser(); - // Valeur par defaut colorbgbodydark = #343a40 - if($this->session->get("colorbgbodydark")=="") - $this->session->set("colorbgbodydark", $this->em->getRepository("App:Config")->find("colorbgbodydark")->getDefault()); + // Roles actif + if($curentuser=="anon.") $roles=[]; + else $roles=$curentuser->getRoles(); - // Valeur par defaut colorbgbodydark = #ffffff - if($this->session->get("colorbgbodylight")=="") - $this->session->set("colorbgbodylight",$this->em->getRepository("App:Config")->find("colorbgbodylight")->getDefault()); + // Sidebar + $sidebar=array(); + $request = $event->getRequest(); + $route = $request->attributes->get('_route'); + $nvs1 = $this->em->getRepository("App:Sidebar")->findBy(array('parent'=> NULL), array('roworder' => 'ASC')); + foreach($nvs1 as $nv1) { + if($this->haveRole($curentuser,$roles,$nv1->getPermission(),$nv1->getPath())) { + $sidebar[$nv1->getRoworder()] = array( + "fonticon" => $nv1->getFonticon(), + "label" => $nv1->getLabel(), + "path" => $nv1->getPath(), + ); - // Valeur par defaut colorfttitledark = #ffffff - if($this->session->get("colorfttitledark")=="") - $this->session->set("colorfttitledark", $this->em->getRepository("App:Config")->find("colorfttitledark")->getDefault()); + foreach($nv1->getChilds() as $nv2) { + + if($this->haveRole($curentuser,$roles,$nv2->getPermission(),$nv2->getPath())) { + $sidebar[$nv1->getRoworder()]["childs"][$nv2->getRoworder()] = array ( + "fonticon" => $nv2->getFonticon(), + "label" => $nv2->getLabel(), + "path" => $nv2->getPath(), + "active" => (stripos($route,$nv2->getPath())!==false) + ); - // Valeur par defaut colorfttitlelight = #343a40 - if($this->session->get("colorfttitlelight")=="") - $this->session->set("colorfttitlelight", $this->em->getRepository("App:Config")->find("colorfttitlelight")->getDefault()); - - // Valeur par defaut colorftbodydark = #ffffff - if($this->session->get("colorftbodydark")=="") - $this->session->set("colorftbodydark", $this->em->getRepository("App:Config")->find("colorftbodydark")->getDefault()); - - // Valeur par defaut colorftbodylight = #343a40 - if($this->session->get("colorftbodylight")=="") - $this->session->set("colorftbodylight", $this->em->getRepository("App:Config")->find("colorftbodylight")->getDefault()); - - // Valeur par defaut fonttitle = FredokaOne-Regular - if($this->session->get("fonttitle")=="") - $this->session->set("fonttitle", $this->em->getRepository("App:Config")->find("fonttitle")->getDefault()); - - // Valeur par defaut fontbody = Roboto-Regular - if($this->session->get("fontbody")=="") - $this->session->set("fontbody", $this->em->getRepository("App:Config")->find("fontbody")->getDefault()); - - // Valeur par defaut fontsizeh1 = 40 - if($this->session->get("fontsizeh1")=="") - $this->session->set("fontsizeh1", $this->em->getRepository("App:Config")->find("fontsizeh1")->getDefault()); - - // Valeur par defaut fontsizeh2 = 32 - if($this->session->get("fontsizeh2")=="") - $this->session->set("fontsizeh2", $this->em->getRepository("App:Config")->find("fontsizeh2")->getDefault()); - - // Valeur par defaut fontsizeh3 = 28 - if($this->session->get("fontsizeh3")=="") - $this->session->set("fontsizeh3", $this->em->getRepository("App:Config")->find("fontsizeh3")->getDefault()); - - // Valeur par defaut fontsizeh4 = 24 - if($this->session->get("fontsizeh4")=="") - $this->session->set("fontsizeh4", $this->em->getRepository("App:Config")->find("fontsizeh4")->getDefault()); - - - // Valeur par defaut logo - if($this->session->get("logodark")==""&&$this->session->get("logolight")=="") { - $this->session->set("logodark", "logo.png"); - $this->session->set("logolight", "logo.png"); + } + } + } + } + $this->session->set('sidebar', $sidebar); + + // Préférence + $this->session->set("fgheader", true); + if($curentuser!="anon.") { + $preference=$curentuser->getPreference(); + if(is_array($preference)) { + // Préférence header + if(array_key_exists("fgheader",$preference)) { + $fgheader=($preference["fgheader"][0]=="true"); + $this->session->set("fgheader", $fgheader); + } + } } - elseif($this->session->get("logodark")=="") - $this->session->set("logodark", $this->session->get("logolight")); - elseif($this->session->get("logolight")=="") - $this->session->set("logolight", $this->session->get("logodark")); // Calcul couleur $this->session->set("colorbgbodylight-darker", $this->adjustBrightness($this->session->get("colorbgbodylight"),-10)); - $this->session->set("colorbgbodydark-darker", $this->adjustBrightness($this->session->get("colorbgbodydark"),-50)); $this->session->set("colorfttitlelight-darker", $this->adjustBrightness($this->session->get("colorfttitlelight"),-50)); + $this->session->set("colorbgbodydark-darker", $this->adjustBrightness($this->session->get("colorbgbodydark"),-50)); + $this->session->set("colorbgbodydark-lighter", $this->adjustBrightness($this->session->get("colorbgbodydark"),+50)); + $this->session->set("colorbgbodydark-rgb", $this->hexToRgb($this->session->get("colorbgbodydark"))); + $this->session->set("colorbgbodydark-darkrgb", $this->hexToRgb($this->session->get("colorbgbodydark-darker"))); + $this->session->set("colorbgbodydark-lightrgb", $this->hexToRgb($this->session->get("colorbgbodydark-lighter"))); } + public function haveRole($curentuser,$roles,$tohave,$route) { + $haverole=false; + if($roles=="") { + if(empty($tohave)) $haverole=true; + } + else { + foreach($roles as $role) { + if(in_array($role,$tohave)) + $haverole=true; + } + } + + if($route!=null) { + if($haverole&&in_array("ROLE_MODO",$roles)) { + $permmodo=$this->em->getRepository("App:PermModo")->findOneBy(["route"=>$route,"visible"=>true,"permmodoprofil"=>$curentuser->getPermmodoprofil()]); + if(!$permmodo) $haverole=false; + } + } + + return $haverole; + } + private function adjustBrightness($hex, $steps) { // Steps should be between -255 and 255. Negative = darker, positive = lighter $steps = max(-255, min(255, $steps)); @@ -115,5 +134,15 @@ } return '#'.$return; - } + } + + public function hexToRgb($hex) { + $hex = str_replace('#', '', $hex); + $length = strlen($hex); + $rgb['r'] = hexdec($length == 6 ? substr($hex, 0, 2) : ($length == 3 ? str_repeat(substr($hex, 0, 1), 2) : 0)); + $rgb['g'] = hexdec($length == 6 ? substr($hex, 2, 2) : ($length == 3 ? str_repeat(substr($hex, 1, 1), 2) : 0)); + $rgb['b'] = hexdec($length == 6 ? substr($hex, 4, 2) : ($length == 3 ? str_repeat(substr($hex, 2, 1), 2) : 0)); + + return $rgb['r'].",".$rgb['g'].",".$rgb['b']; + } } diff --git a/src/nineskeletor-1.0/src/Websocket/MessageHandler.php b/src/nineskeletor-1.0/src/Websocket/MessageHandler.php index 84cd758..ac7e52d 100644 --- a/src/nineskeletor-1.0/src/Websocket/MessageHandler.php +++ b/src/nineskeletor-1.0/src/Websocket/MessageHandler.php @@ -8,9 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; use Doctrine\ORM\EntityManagerInterface; use SplObjectStorage; -use App\Entity\Scrum; -use App\Entity\Scrumcolumn; -use App\Entity\Scrumwidget; +use App\Entity\Message; class MessageHandler implements MessageComponentInterface { @@ -35,6 +33,7 @@ class MessageHandler implements MessageComponentInterface $this->channelkeys = []; $this->userconns = []; $this->userkeys = []; + $this->ispush = []; } public function onOpen(ConnectionInterface $conn) @@ -48,8 +47,8 @@ class MessageHandler implements MessageComponentInterface $data= new \stdClass; $data->command = "adead"; - // Envoyer le message de deconnection - if (isset($this->channels[$conn->resourceId])) { + // Envoyer le message de deconnection que si la connection n'est issu d'un push + if (isset($this->channels[$conn->resourceId])&&!$this->ispush[$conn->resourceId]) { $this->sendMessage($conn,$data,"other"); } @@ -70,11 +69,54 @@ class MessageHandler implements MessageComponentInterface $data = json_decode($msg); switch ($data->command) { - case "subscribe": + case "pushsubscribe": $this->channels[$conn->resourceId] = $data->channel; $this->channeltypes[$conn->resourceId] = $data->channeltype; $this->channelkeys[$conn->resourceId] = $data->channelkey; $this->userkeys[$conn->resourceId] = $data->userkey; + $this->ispush[$conn->resourceId] = true; + if (isset($this->channels[$conn->resourceId])) { + switch ($this->channeltypes[$conn->resourceId]) { + //case "type": $this->onMessageType($conn,$data); break; + default: + $user=$this->em->getRepository("App:User")->findOneBy(["apikey"=>$data->userkey]); + if(!$user) return false; + $group=$this->em->getRepository("App:Group")->find($data->channelkey); + if(!$group) return false; + + $message=new Message(); + $message->setTopic($data->subdata->message); + $message->setUser($user); + $message->setGroup($group); + $this->em->persist($message); + $this->em->flush(); + + $this->sendMessage($conn,$data->subdata); + break; + } + } + break; + + case "subscribe": + // Channel privé ? + switch ($data->channeltype) { + case "message": + $user=$this->em->getRepository("App:User")->findOneBy(["apikey"=>$data->userkey]); + if(!$user) return false; + $group=$this->em->getRepository("App:Group")->find($data->channelkey); + if(!$group) return false; + + if(!$user->hasRole("ROLE_ADMIN")&&$user->hasRole("ROLE_MODO")) { + $usergroup=$this->em->getRepository("App:UserGroup")->findOneBy(["user"=>$user,"group"=>$data->channelkey]); + if(!$usergroup) return false; + } + break; + } + $this->channels[$conn->resourceId] = $data->channel; + $this->channeltypes[$conn->resourceId] = $data->channeltype; + $this->channelkeys[$conn->resourceId] = $data->channelkey; + $this->userkeys[$conn->resourceId] = $data->userkey; + $this->ispush[$conn->resourceId] = false; break; case "meto": @@ -89,10 +131,28 @@ class MessageHandler implements MessageComponentInterface } break; + case "message": + if (isset($this->channels[$conn->resourceId])) { + $user=$this->em->getRepository("App:User")->findOneBy(["apikey"=>$this->userkeys[$conn->resourceId]]); + if(!$user) return false; + $group=$this->em->getRepository("App:Group")->find($this->channelkeys[$conn->resourceId]); + if(!$group) return false; + + $message=new Message(); + $message->setTopic($data->message); + $message->setUser($user); + $message->setGroup($group); + $this->em->persist($message); + $this->em->flush(); + + $this->sendMessage($conn,$data); + } + break; + default: if (isset($this->channels[$conn->resourceId])) { switch ($this->channeltypes[$conn->resourceId]) { - //case "type": $this->onMessageYype($conn,$data); break; + //case "type": $this->onMessageType($conn,$data); break; default: $this->sendMessage($conn,$data); } } @@ -118,11 +178,14 @@ class MessageHandler implements MessageComponentInterface // Send if($from && $to) { + $now=new \DateTime(); + $data->from= new \stdClass; $data->from->id = $from->getId(); $data->from->username = $from->getUsername(); $data->from->displayname = $from->getDisplayname(); $data->from->avatar = $this->getAvatar($from->getAvatar()); + $data->date = $now->format("d/m/Y H:i"); $data->log="== GET MSG from ".$data->from->username." to ".$to->getUsername()." = ".$data->command; $this->userconns[$id]->send(json_encode($data)); diff --git a/src/nineskeletor-1.0/templates/Config/edit.html.twig b/src/nineskeletor-1.0/templates/Config/edit.html.twig index 0a62546..a36562f 100755 --- a/src/nineskeletor-1.0/templates/Config/edit.html.twig +++ b/src/nineskeletor-1.0/templates/Config/edit.html.twig @@ -63,10 +63,10 @@ Modifier - {% elseif config.type=="hero" %} + {% elseif config.type=="header" %}
- - Modifier + + Modifier
{% elseif config.type=="image" %}
diff --git a/src/nineskeletor-1.0/templates/Config/list.html.twig b/src/nineskeletor-1.0/templates/Config/list.html.twig index f13c66b..bcdddf6 100644 --- a/src/nineskeletor-1.0/templates/Config/list.html.twig +++ b/src/nineskeletor-1.0/templates/Config/list.html.twig @@ -36,6 +36,12 @@ CONFIGURATIONS

Logo

{{ render(path("app_config_render",{category:"logo"})) }}
+ +
+

Bannière

+ {{ render(path("app_config_render",{category:"header"})) }} +
+ diff --git a/src/nineskeletor-1.0/templates/Config/render.html.twig b/src/nineskeletor-1.0/templates/Config/render.html.twig index 9d87611..77cc00a 100644 --- a/src/nineskeletor-1.0/templates/Config/render.html.twig +++ b/src/nineskeletor-1.0/templates/Config/render.html.twig @@ -70,6 +70,10 @@ {%if not val is empty %} {% endif %} + {% elseif config.type=="header" %} + {%if not val is empty %} + + {% endif %} {% else %} {{ val|raw }} {% endif %} diff --git a/src/nineskeletor-1.0/templates/Crop/crop02.html.twig b/src/nineskeletor-1.0/templates/Crop/crop02.html.twig index cc33eda..ced36ba 100644 --- a/src/nineskeletor-1.0/templates/Crop/crop02.html.twig +++ b/src/nineskeletor-1.0/templates/Crop/crop02.html.twig @@ -111,8 +111,8 @@ {% set nbratio=1 %} {% elseif ratio=="16:9" %} {% set nbratio=(16/9) %} - {% elseif nbratio=="16:2" %} - {% set class=(16/2) %} + {% elseif ratio=="16:2" %} + {% set nbratio=(16/2) %} {% endif %} $('#largeimg').CropSelectJs('setSelectionAspectRatio',{{nbratio}}); diff --git a/src/nineskeletor-1.0/templates/Include/javascript.js.twig b/src/nineskeletor-1.0/templates/Include/javascript.js.twig index a2dfc95..98be071 100644 --- a/src/nineskeletor-1.0/templates/Include/javascript.js.twig +++ b/src/nineskeletor-1.0/templates/Include/javascript.js.twig @@ -1,37 +1,84 @@ -$(document).ready(function() { +{% if app.request.attributes.get('_route')=='app_home' %} + {% if not app.user and app.session.get("fgforceconnect") %} + {% if appAuth=="SQL" %} + window.location="{{url("app_login")}}" + {% elseif appAuth=="CAS" %} + window.location="{{url("app_logincas")}}" + {% endif %} + {% endif %} +{% endif %} + +$(document).ready(function() { $(".pick-a-color").spectrum( { type: "text", showAlpha: false } ); - $(".pick-a-color").attr("autocomplete","off"); - - var doit = true; + var doit = true; $("a[data-method]").on('click',function(){ if($(this).data('confirm')){ doit = confirm($(this).data('confirm')); if(!doit) return false; } }); - $("button[data-method]").on('click',function(){ if($(this).data('confirm')){ doit = confirm($(this).data('confirm')); if(!doit) return false; } }); + + Resize(); }); +$( window ).resize(function() { + Resize(); +}); + +function Resize() { + if($("#headercontainer").is(":visible")){ + //$(".navbar-toggler").hide(); + $("#navbar-link").hide(); + $("#navbar-logo").hide(); + } + else { + //$(".navbar-toggler").show(); + $("#navbar-link").show(); + $("#navbar-logo").show(); + } + + $("#sidebar").css("padding-top",$(".header").height()); + $("#mycontent").css("padding-top",$(".header").height()); +} + function ModalLoad(idmodal,title,path) { $("#"+idmodal+" .modal-header h4").text(title); $("#"+idmodal+" iframe").attr("src",path); $("#"+idmodal).modal("show"); } +function switchHeader() { + {% if app.user %} + $.ajax({ + method: "POST", + url: "{{ path('app_user_preference') }}", + data: { + id:0, + key:'fgheader', + value: !($("#headercontainer").is(":visible")) + }, + success: function() { + location.reload(); + } + }); + {% endif %} +} + + {% if wssuse %} function subscribe(channeltype,channelkey,userkey) { console.log("== SUBSCRIBE "+channeltype+"-"+channelkey+" with userkey "+userkey); diff --git a/src/nineskeletor-1.0/templates/Include/sidebar.html.twig b/src/nineskeletor-1.0/templates/Include/sidebar.html.twig index 2055eed..4c73fd1 100644 --- a/src/nineskeletor-1.0/templates/Include/sidebar.html.twig +++ b/src/nineskeletor-1.0/templates/Include/sidebar.html.twig @@ -1,49 +1,32 @@ +{% set sidebar = app.session.get('sidebar') %} + + + \ No newline at end of file diff --git a/src/nineskeletor-1.0/templates/Include/style.css.twig b/src/nineskeletor-1.0/templates/Include/style.css.twig index ffec452..5249db3 100644 --- a/src/nineskeletor-1.0/templates/Include/style.css.twig +++ b/src/nineskeletor-1.0/templates/Include/style.css.twig @@ -15,6 +15,9 @@ --colorbgbodylight-darker: {{ app.session.get('colorbgbodylight-darker')|raw }}; --colorbgbodydark-darker: {{ app.session.get('colorbgbodydark-darker')|raw }}; --colorfttitlelight-darker: {{ app.session.get('colorfttitlelight-darker')|raw }}; + + --header: url("\{{ appAlias }}\uploads\header\{{ app.session.get('headerimage')|raw }}"); + --colorbgbodydark-rgb: {{ app.session.get('colorbgbodydark-rgb')|raw }}; } /* COLOR BODY */ @@ -24,6 +27,18 @@ body { color: var(--colorftbodylight); } +body .header { + color: var(--colorfttitledark); +} + +body .header a { + color: var(--colorfttitledark); +} +body .header a:hover { + color: var(--colorfttitledark); + text-decoration:none; +} + body .navbar.bg-dark { background-color: var(--colorbgbodydark)!important; } @@ -48,6 +63,10 @@ body h1, body h2, body h3, body .modal-header h4 { color: var(--colorfttitlelight); } +.btn { + color: var(--colorftbodydark) !important; +} + body a, body .btn-link { color: var(--colorfttitlelight); } @@ -105,6 +124,15 @@ body.monocolor { color: var(--colorftbodydark); } +body.monocolor .header { + color: var(--colorfttitledark); + text-decoration:none; +} + +body.monocolor .header a { + color: var(--colorfttitledark); +} + body.monocolor .navbar.bg-dark { background-color: var(--colorbgbodydark)!important; } @@ -162,11 +190,15 @@ body { font-family: var(--fontbody); } -h1,h2,h3, .navbar-brand, .card-header, .modal-header h4 { +.headertitle { + line-height:{{app.session.get("fontsizeh1")-10}}px; +} + +.headertitle, h1, h2, h3, .navbar-brand, .card-header, .modal-header h4 { font-family: var(--fonttitle); } -h1 { font-size: var(--fontsizeh1); } +.headertitle,h1 { font-size: var(--fontsizeh1); } h2 { font-size: var(--fontsizeh2); } h3 { font-size: var(--fontsizeh3); } h4 { font-size: var(--fontsizeh4); } diff --git a/src/nineskeletor-1.0/templates/base.html.twig b/src/nineskeletor-1.0/templates/base.html.twig index 2807d8c..80d34f9 100644 --- a/src/nineskeletor-1.0/templates/base.html.twig +++ b/src/nineskeletor-1.0/templates/base.html.twig @@ -51,55 +51,121 @@ {% if useheader is defined and useheader %} - + {% endif %}
@@ -115,6 +181,11 @@ {% endblock %}
+ +