<?xml version="1.0" standalone="yes"?>
<!DOCTYPE container>
<container
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xml="http://www.w3.org/XML/1998/namespace"
    xmlns:var="http://www.skyrix.com/od/binding"
    xmlns:const="http://www.skyrix.com/od/constant"
    xmlns:rsrc="OGo:url"
    xmlns:label="OGo:label"
    xmlns:bool="OGo:bool">

  <var:string var:value="doctype" const:escapeHTML="NO" />
  <var:if condition="hideFrame" const:negate="YES">
    <html const:xmlns="http://www.w3.org/1999/xhtml" var:lang="localeCode">
      <head>
        <title var:sg-default="title"><var:string value="title"/></title>
        <meta name="hideFrame" var:content="hideFrame" />
        <meta name="description" content="SOGo Web Interface" />
        <meta name="author" content="Inverse inc." />
        <meta name="robots" content="noindex, nofollow" />
        <meta name="build" var:content="buildDate" />
        <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1" />
        <link href="mailto:support@sogo.nu" rev="made" />
        <link rel="shortcut icon" var:href="siteFavicon" type="image/x-icon" />
        <var:if condition="isUIxDebugEnabled" const:negate="YES">
          <link type="text/css" rel="stylesheet" rsrc:href="css/theme-default.css" />
        </var:if>
        <link type="text/css" rel="stylesheet" rsrc:href="css/styles.css" />
        <var:if condition="hasPageSpecificCSS">
          <link type="text/css" rel="stylesheet" var:href="pageCSSURL"/>
        </var:if>
        <var:foreach list="additionalCSSFiles" item="item">
          <link type="text/css" rel="stylesheet" var:href="item"/>
        </var:foreach>
        <var:if-ie>
          <link type="text/css" rel="stylesheet" rsrc:href="css/no-animation.css"/>
        </var:if-ie>
      </head>

      <body var:class="bodyClasses" var:ng-app="angularModule" bool:md-no-ink="disableInk">

        <noscript>
          <div layout="column" layout-align="center center" layout-fill="layout-fill">
            <div class="md-padding">
              <var:string label:value="noJavascriptError"/>
            </div>
            <div>
              <a class="md-button" var:href="context.applicationURL">
                <var:string label:value="noJavascriptRetry"/>
              </a>
            </div>
          </div>
        </noscript>

        <var:if condition="isCompatibleBrowser">
          <var:if condition="singleWindowModeEnabled">
            <div id="popupFrame" style="display: none;">
              <iframe width="100%" height="100%" src="/SOGo/loading"><!-- space --></iframe>
            </div>
          </var:if>

          <!-- MAIN CONTENT ROW -->
          <var:component-content />
          
          <script type="text/javascript">
            var ApplicationBaseURL = '<var:string value="modulePath" />';
            var ResourcesURL = '<var:string value="applicationPath" />.woa/WebServerResources';
            var minimumSearchLength = <var:string value="minimumSearchLength" />;
            var minimumSearchLengthLabel = '<var:string value="minimumSearchLengthLabel" />';
            <var:if condition="isUIxDebugEnabled">
              var DebugEnabled = true;
            </var:if>
            <var:if condition="isUIxDebugEnabled" const:negate="YES">
              var DebugEnabled = false;
            </var:if>
            <var:if condition="isSuperUser">
              var IsSuperUser = true;
            </var:if>
            <var:if condition="isSuperUser" const:negate="YES">
              var IsSuperUser = false;
            </var:if>
            <var:if condition="usesCASAuthentication">
              var usesCASAuthentication = true;
            </var:if>
            <var:if condition="usesCASAuthentication" const:negate="YES">
              var usesCASAuthentication = false;
            </var:if>
            <var:if condition="usesSAML2Authentication">
              var usesSAML2Authentication = true;
            </var:if>
            <var:if condition="usesSAML2Authentication" const:negate="YES">
              var usesSAML2Authentication = false;
            </var:if>
            <var:if condition="shortUserNameForDisplay" const:value="anonymous" const:negate="YES">
              var UserFolderURL = '<var:string value="userFolderPath" const:escapeHTML="NO" />';
              var UserLogin = '<var:string value="shortUserNameForDisplay" const:escapeHTML="NO" />';
              var UserIdentification = <var:string value="userIdentification.doubleQuotedString" const:escapeHTML="NO" />;
              var UserEmail = '<var:string value="userEmail" const:escapeHTML="NO" />';
              var UserLanguage = '<var:string value="userLanguage" const:escapeHTML="NO" />';

              // Application paths
              var UserCalendarPath = '';
              <var:if condition="userHasCalendarAccess">
                UserCalendarPath = '<var:string value="relativeCalendarPath" const:escapeHTML="NO" />';
              </var:if>

              var UserContactsPath = '<var:string value="relativeContactsPath" const:escapeHTML="NO" />';

              var UserMailPath = '';
              <var:if condition="userHasMailAccess">
                UserMailPath = '<var:string value="relativeMailPath" const:escapeHTML="NO" />';
              </var:if>

              var UserPreferencesPath = '<var:string value="relativePreferencesPath" const:escapeHTML="NO" />';

              <var:if condition="isSuperUser">
                var UserAdministrationPath = '<var:string value="relativeAdministrationPath" const:escapeHTML="NO" />';
              </var:if>

              var UserLogoffPath = '';
              <var:if condition="canLogoff">
                UserLogoffPath = '<var:string value="logoffPath" const:escapeHTML="NO" />';
              </var:if>

              var HelpURL =  '<var:string value="helpURL" const:escapeHTML="NO" />';
            </var:if>

            // This is the equivalent of an AJAX call to /SOGo/so/_UserLogin_/date
            var currentDay = <var:string value="currentDayDescription" const:escapeHTML="NO"/>;

            <var:string value="commonLocalizableStrings" const:escapeHTML="NO" />
            <var:string value="productLocalizableStrings" const:escapeHTML="NO" />
          </script>

          <var:if condition="shortUserNameForDisplay" const:value="anonymous" const:negate="YES">
            <var:component className="UIxJSONPreferences"/>
          </var:if>

          <!-- JAVASCRIPT IMPORTS -->
          <script type="text/javascript" rsrc:src="js/vendor/lodash.min.js"><!-- space --></script>
          <script type="text/javascript" rsrc:src="js/vendor/angular.min.js"><!-- space --></script>
          <script type="text/javascript" rsrc:src="js/vendor/angular-animate.min.js"><!-- space --></script>
          <script type="text/javascript" rsrc:src="js/vendor/angular-sanitize.min.js"><!-- space --></script>
          <script type="text/javascript" rsrc:src="js/vendor/angular-aria.min.js"><!-- space --></script>
          <script type="text/javascript" rsrc:src="js/vendor/angular-cookies.min.js"><!-- space --></script>
          <script type="text/javascript" rsrc:src="js/vendor/angular-messages.min.js"><!-- space --></script>
          <script type="text/javascript" rsrc:src="js/vendor/angular-material.min.js"><!-- space --></script>
          <script type="text/javascript" rsrc:src="js/vendor/angular-ui-router.min.js"><!-- space --></script>

          <var:if condition="hasProductSpecificJavaScript">
            <script type="text/javascript" var:src="productJavaScriptURL"><!-- space --></script>
          </var:if>
          <var:if condition="hasPageSpecificJavaScript">
            <script type="text/javascript" var:src="pageJavaScriptURL"><!-- space --></script>
          </var:if>
          <var:foreach list="additionalJSFiles" item="item">
            <script type="text/javascript" var:src="item"><!-- space --></script>
          </var:foreach>
          <var:foreach list="systemAdditionalJSFiles" item="item">
            <script type="text/javascript" var:src="item"><!-- space --></script>
          </var:foreach>
        </var:if>
        <var:if condition="isCompatibleBrowser" const:negate="YES">
          <var:component className="SOGoBrowsersPanel"/>
        </var:if>

      </body>
    </html>
  </var:if>

  <var:if condition="hideFrame">
    <var:component-content />
  </var:if>
</container>
