templates/header.html.twig line 1

Open in your IDE?
  1. {% set logo = asset('images/' ~ app.session.get('server').logoUrl) %}
  2. {% set css = asset('css/' ~ app.session.get('server').cssUrl) %}
  3. {% set flagImage = asset('images/flag_square_' ~ app.session.get('lang').langKey ~ '.png') %}
  4. <link rel="stylesheet" href="{{ css }}" />
  5. <div class="topBarContainer">
  6. <td class="topBar">
  7.     {% if app.session.get('user') %}
  8.      <div class="logo3DAdmin">
  9.         <x3d width='60px' height='40px' profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.3.xsd'>
  10.           <scene>
  11.             <Transform DEF = 'CubeGallery'
  12.               translation = '0 0 0'
  13.               scale = '10 10 10'>
  14.               <Inline nameSpaceName="LogoCubex" mapDEFToID="true" url="/Logo_Cubes_Admin.x3d" ></Inline>
  15.             </Transform>
  16.           </scene>
  17.         </x3d>
  18.       </div>
  19.       <!-- quick menu panel -->
  20.       <div class="quickMenuPanel">
  21.         <form method="GET" action="./newlang">
  22.                 <select name="route" id="route" onchange="document.location=getElementById('route').value;" class="routeSelector">
  23.                   <!-- quick menu routes list -->
  24.                   <option value="">{{ 'service.quick_menu_title'|trans }}</option>
  25.                   <option value="{{ path('root') }}homeuser">{{ 'user.admin'|trans }} - home</option>
  26.                   <?php
  27.                   //we display e-shop options
  28.                   if(!empty($headerData['services']) && array_key_exists('1'$headerData['services'])) {
  29.                   ?>
  30.                     <option value="{{ path('root') }}eshopAdmin" class="routeOption">{{ 'service.eshop'|trans }}</option>
  31.                     <option value="{{ path('root') }}productedit" class="subOption">{{ 'eshop.products'|trans }}</option>
  32.                     <option value="{{ path('root') }}categories" class="subOption">{{ 'eshop.categories'|trans }}</option>
  33.                     <option value="{{ path('root') }}productnew" class="subOption">{{ 'eshop.new_product'|trans }}</option>
  34.                   <?php
  35.                   }
  36.                   if(!empty($headerData['services']) && array_key_exists('10'$headerData['modules'])) {
  37.                   ?>
  38.                     <option value="{{ path('root') }}productParameter" class="subOption">{{ 'module.productParameter'|trans }}</option>
  39.                   <?php
  40.                   }
  41.                   ?>
  42.                   <?php
  43.                   //we display knowledgebase options
  44.                   if(!empty($headerData['services']) && array_key_exists('2'$headerData['services'])) {
  45.                   ?>
  46.                     <option value="{{ path('root') }}knowledgebaseAdmin" class="routeOption">{{ 'service.knowledgebase'|trans }}</option>
  47.                     <?php
  48.                     if(array_key_exists('16'$headerData['modules'])) {
  49.                     ?>
  50.                     <option value="{{ path('root') }}contacts" class="subOption">{{ 'knowledgebase.contacts'|trans }}</option>
  51.                     <?php
  52.                     }
  53.                     if(array_key_exists('17'$headerData['modules'])) {
  54.                     ?>
  55.                     <option value="{{ path('root') }}lists" class="subOption">{{ 'knowledgebase.lists'|trans }}</option>
  56.                     <?php
  57.                     }
  58.                     if(array_key_exists('24'$headerData['modules'])) {
  59.                     ?>
  60.                     <option value="{{ path('root') }}tasks" class="subOption">{{ 'knowledgebase.tasks'|trans }}</option>
  61.                     <?php
  62.                     }
  63.                     ?>
  64.                   <?php
  65.                   }
  66.                   ?>
  67.                   <?php
  68.                   //we display webpages options
  69.                   if(!empty($headerData['services']) && array_key_exists('3'$headerData['services'])) {
  70.                   ?>
  71.                     <option value="{{ path('root') }}webpagesAdmin" class="routeOption">{{ 'service.webpages'|trans }}</option>
  72.                     <option value="{{ path('root') }}webMenu" class="subOption">{{ 'webpages.web_menus'|trans }}</option>
  73.                     <?php
  74.                     if(array_key_exists('2'$headerData['modules'])) {
  75.                     ?>
  76.                     <option value="{{ path('root') }}fileManager" class="subOption">{{ 'module.fileManager'|trans }}</option>
  77.                     <?php
  78.                     }
  79.                     if(array_key_exists('3'$headerData['modules'])) {
  80.                     ?>
  81.                     <option value="{{ path('root') }}gallery" class="subOption">{{ 'module.gallery'|trans }}</option>
  82.                     <?php
  83.                     }
  84.                     if(array_key_exists('1'$headerData['modules'])) {
  85.                     ?>
  86.                     <option value="{{ path('root') }}cssDesigner" class="subOption">{{ 'module.cssDesigner'|trans }}</option>
  87.                     <?php
  88.                     }
  89.                     if(array_key_exists('8'$headerData['modules'])) {
  90.                     ?>
  91.                     <option value="{{ path('root') }}redaction" class="subOption">{{ 'module.redaction'|trans }}</option>
  92.                     <?php
  93.                     }
  94.                     if(array_key_exists('12'$headerData['modules'])) {
  95.                     ?>
  96.                     <option value="{{ path('root') }}formBuilder" class="subOption">{{ 'module.formBuilder'|trans }}</option>
  97.                     <?php
  98.                     }
  99.                     ?>
  100.                   <?php
  101.                   }
  102.                   ?>
  103.                   <?php
  104.                   //we display marketplace options
  105.                   if(!empty($headerData['services']) && array_key_exists('4'$headerData['services'])) {
  106.                   ?>
  107.                     <option value="{{ path('root') }}marketplaceAdmin" class="routeOption">{{ 'service.marketplace'|trans }}</option>
  108.                   <?php
  109.                   }
  110.                   ?>
  111.                   <?php
  112.                   //we display 3D services options
  113.                   if(!empty($headerData['services']) && array_key_exists('5'$headerData['services'])) {
  114.                   ?>
  115.                     <option value="{{ path('root') }}services3dAdmin" class="routeOption">{{ 'service.services3d'|trans }}</option>
  116.                   <?php
  117.                   }
  118.                   ?>
  119.                   <?php
  120.                   //we display Connector service options
  121.                   if(!empty($headerData['services']) && array_key_exists('7'$headerData['services'])) {
  122.                   ?>
  123.                     <option value="{{ path('root') }}connectorAdmin" class="routeOption">{{ 'service.connector'|trans }}</option>
  124.                   <?php
  125.                   }
  126.                   ?>
  127. {#                  <?php#}
  128. {#                  //we display Game zone service options#}
  129. {#                  if(!empty($headerData['services']) && array_key_exists('8', $headerData['services'])) {#}
  130. {#                  ?>#}
  131. {#                    <option value="{{ path('root') }}gameZoneAdmin" class="routeOption">{{ 'service.gameZone'|trans }}</option>#}
  132. {#                  <?php#}
  133. {#                  }#}
  134. {#                  ?>#}
  135.                 </select>
  136.               </form>
  137.       </div>
  138.     {% endif %}
  139. <!-- users panel -->
  140.     {% if app.session.get('user') %}
  141.         <div class="userPanel">
  142.             <span class="userLabel">{{ 'webpages.user'|trans }}: <strong>{{ app.session.get('user').userName }}</strong></span>
  143.             <span class="userLabel"><a href="{{ path('root') }}homeuser" class="boldPlainLink">Admin</a></span>
  144.             {% if app.session.get('user').username == 'Kantona' %}
  145.               <span class="userLabel"><a href="{{ path('root') }}admin" class="boldPlainLink">SuperAdmin</a></span>
  146.             {% endif %}
  147.             <span class="userLabel"><a href="{{ path('root') }}logout" class="boldPlainLink">Logout</a></span>
  148.         </div>
  149.         <?php
  150.     {% else %}
  151.         <!-- login and register panel -->
  152.         <table border='0' class='headerTable'>
  153.           <tr>
  154.               <td valign='top' class='logo3dHeader'>
  155.                   <x3d width='60px' height='40px' profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='http://www.web3d.org/specifications/x3d-3.3.xsd'>
  156.                       <scene>
  157.                           <Transform DEF 'CubeGallery'
  158.                                      translation '0 0 0'
  159.                                      scale '10 10 10'>
  160.                               <Inline nameSpaceName="LogoCubex" mapDEFToID="true" url="/Logo_Cubes.x3d" ></Inline>
  161.                           </Transform>
  162.                       </scene>
  163.                   </x3d>
  164.               </td>
  165.              <td valign='top' class='logoHeader'>
  166.                   <div class="logoPanel">
  167.                       <a href="{{ path('root') }}" class="logoLink">
  168.                           {% if logo != null and logo != '' and logo != '/images/' %}
  169.                             <img src="{{ logo }}" alt="{{ app.session.get('label') }}" title="{{ app.session.get('label') }}" border="0" class="logoImg">
  170.                           {% else %}
  171.                             <span class="logoLabel">{{ app.session.get('label') }}</span>
  172.                           {% endif %}
  173.                       </a>
  174.                   </div>
  175.               </td>
  176.              <td valign='top'>
  177.                 <div class="userPanel">
  178.                     <a href="{{ path('root') }}login" class="boldPlainLink">Login</a>
  179.                     &nbsp;&nbsp;|
  180. {#                    : :#}
  181. {#                    <a href="{{ path('root') }}newaccount" class="boldPlainLink">{{ 'user.new_account'|trans }}</a>#}
  182.                 </div>
  183.              </td>
  184.               {% for service in app.session.get('server').services %}
  185.                   {% set serviceId service.serviceId %}
  186.                   {% set link path('root') ~ service.landingUrl %}
  187.                   {% set localisedServiceName = ('service.' service.action)|trans %}
  188.                   <td valign='top' class='serviceTopMenuCell'>
  189.                       <a href="{{ link }}" class="boldPlainLink">{{ localisedServiceName }}</a>
  190.                   </td>
  191.               {% endfor %}
  192.            </tr>
  193.          </table>
  194.     {% endif %}
  195.    <div class="optionsPanel">
  196.       <!-- select language -->
  197.       <div class="languagesPanel">
  198.         <div class="languageSelectorPanel">
  199.           <form method="GET" action="{{ path('root') }}newlang">
  200.             <input type="hidden" name="routePath" value="{{ app.request.uri }}">
  201.             <input type="hidden" name="routeName" value="{{ app.request.attributes.get('_route') }}">
  202.             <label for="newlang" class="hiddenText">Select language</label>
  203.             <select name="newlang" onchange="this.form.submit()" class="languageSelector" id="newlang" >
  204.               <!-- languages list -->
  205.                 {% for lang in app.session.get('langList') %}
  206.                     {% if app.session.get('lang') and lang.langKey == app.session.get('lang').langKey %}
  207.                         {% set selected "selected" %}
  208.                     {% else %}
  209.                         {% set selected "" %}
  210.                     {% endif %}
  211.                     <option value="{{ lang.langKey }}" {{ selected }}>{{ lang.langName }}</option>
  212.                 {% endfor %}
  213.             </select
  214.           </form>
  215.         </div>
  216.         <!--
  217.         <div class="flagPanel">
  218.           <img src="{{ flagImage }}" alt="{{ app.session.get('lang').langKey }}" title="{{ app.session.get('lang').langKey }}" class="flagImage">
  219.         </div>
  220.         -->
  221.       </div>
  222.       <!-- select currency -->
  223.       <div class="currencyPanel">
  224.         <div class="currencySelectorPanel">
  225.           <form method="GET" action="{{ path('root') }}">
  226.           <input type="hidden" name="routePath" value="<?= $app->getRequest()->getPathInfo() ?>">
  227.             <label for="newcurrency" class="hiddenText">Select currency</label>
  228.             <select name="newcurrency" onchange="this.form.submit()" class="currencySelector" id="newcurrency">
  229.               <!-- currency list -->
  230.                 {% for currency in app.session.get('currencyList') %}
  231.                     {% if currency.currencyKey == app.session.get('currency').currencyKey %}
  232.                         {% set selected "selected" %}
  233.                     {% else %}
  234.                         {% set selected "" %}
  235.                     {% endif %}
  236.                     <option value="{{ currency.currencyKey }}" {{ selected }}>{{ currency.currencyKey }}</option>
  237.                 {% endfor %}
  238.             </select>
  239.           </form>
  240.         </div>
  241.         <!--
  242.         <div class="currencySymbolPanel">
  243.             {{ app.session.get('currency').getCurrencyKey }}
  244.         </div>
  245.         -->
  246.       </div>
  247.    </div>  
  248. </div
  249. </div
  250. <!-- logoff header panel -->