The following has evaluated to null or missing: ==> request.getHeader("User-Agent") [in template "20101#20128#35927" at line 63, column 27] ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign uAgent = request.getHeader("U... [in template "20101#20128#35927" at line 63, column 9] ----
1<#if entries?has_content>
2 <#assign languageId = localeUtil.toLanguageId(locale) />
3 <style>
4 .taglib-language-option {background: none no-repeat 5px center;padding-left: 25px;text-transform: capitalize;}
5 <#list entries as entry>
6 .taglib-language-option-${entry.getW3cLanguageId()} {background-image: url(${themeDisplay.getPathThemeImages()}/language/${entry.getLanguageId()}.png);}
7 </#list>
8
9 .cus-sel {position: relative;width:125px;}
10 .cus-sel select {display: none;}
11 .select-selected:after {
12 position: absolute;
13 content: "";
14 top: 14px;
15 right: 10px;
16 width: 0;
17 height: 0;
18 border: 6px solid transparent;
19 border-color: #404040 transparent transparent transparent;
20 }
21
22 /*point the arrow upwards when the select box is open (active):*/
23 .select-selected.select-arrow-active:after {
24 border-color: transparent transparent #404040 transparent;
25 top: 7px;
26 }
27
28 /*style the items (options), including the selected item:*/
29 .select-items div,.select-selected { color: #404040;
30 padding: 8px 5px 8px 10px;
31 cursor: pointer;
32 user-select: none;
33 }
34 .select-items div { color: #022241 !important;}
35
36 /*style items (options):*/
37 .select-items {
38 position: absolute;
39 background-color: #f8efe0;
40 top: 100%;
41 left: 0;
42 right: 0;
43 z-index: 99;
44 }
45
46 /*hide the items when the select box is closed:*/
47 .select-hide {
48 display: none;
49 }
50
51 .select-items div:hover, .same-as-selected {
52 background-color: rgba(0, 0, 0, 0.1);
53 }
54
55 </style>
56
57 <@liferay_aui["form"]
58 action=formAction
59 method="post"
60 name='${namespace + formName}'
61 useNamespace=false
62 >
63 <#assign uAgent = request.getHeader("User-Agent")?lower_case />
64 <#if uAgent?contains("mobile")>
65 <div class="cus-sel">
66 <@liferay_aui["select"]
67 changesContext=true
68 id='${namespace + formName}'
69 label=""
70 name='${name}'
71 onChange='${namespace + "changeLanguage();"}'
72 title="language"
73 >
74 <#list entries as entry>
75 <#assign labelL = entry.getShortDisplayName()?upper_case />
76 <@liferay_aui["option"]
77 cssClass="taglib-language-option taglib-language-option-${entry.getW3cLanguageId()} g-text-transform-upper"
78 disabled=entry.isDisabled()
79 label=labelL
80 lang=entry.getW3cLanguageId()
81 localizeLabel=false
82 selected=entry.isSelected()
83 value=entry.getLanguageId()
84 />
85 </#list>
86 </@>
87 </div>
88 <#else>
89 <div class="cus-sel">
90 <@liferay_aui["select"]
91 changesContext=true
92 id='${namespace + formName}'
93 label=""
94 name='${name}'
95 onChange='${namespace + "changeLanguage();"}'
96 title="language"
97 >
98 <#list entries as entry>
99 <#assign labelL = entry.getLongDisplayName()?upper_case />
100 <#if entry.getW3cLanguageId() == "es-ES">
101 <#assign labelL = "CASTELLANO" />
102 <#elseif entry.getW3cLanguageId() == "eu-ES">
103 <#assign labelL = "EUSKERA" />
104 <#elseif entry.getW3cLanguageId() == "gl-ES">
105 <#assign labelL = "GALEGO" />
106 </#if>
107 <@liferay_aui["icon"] cssClass=cssClass image=entry.getW3cLanguageId()?lower_case markupView="lexicon" message=entry.getLongDisplayName() />
108 <@liferay_aui["option"]
109 cssClass="taglib-language-option taglib-language-option-${entry.getW3cLanguageId()} g-text-transform-upper"
110 disabled=entry.isDisabled()
111 label=labelL
112 lang=entry.getW3cLanguageId()
113 localizeLabel=false
114 selected=entry.isSelected()
115 value=entry.getLanguageId()
116 />
117 </#list>
118 </@>
119 </div>
120 </#if>
121 </@>
122
123 <@liferay_aui["script"]>
124 function ${namespace}changeLanguage() {
125 submitForm(document.${namespace + formName});
126 }
127 </@>
128 <script>
129 var x, i, j, l, ll, selElmnt, a, b, c;
130 /*look for any elements with the class "cus-sel":*/
131 x = document.getElementsByClassName("cus-sel");
132 l = x.length;
133 for (i = 0; i < l; i++) {
134 selElmnt = x[i].getElementsByTagName("select")[0];
135 ll = selElmnt.length;
136 /*for each element, create a new DIV that will act as the selected item:*/
137 a = document.createElement("DIV");
138 a.setAttribute("class", "select-selected g-brd-white-left");
139 a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;
140 x[i].appendChild(a);
141 /*for each element, create a new DIV that will contain the option list:*/
142 b = document.createElement("DIV");
143 b.setAttribute("class", "select-items select-hide");
144 for (j = 0; j < ll; j++) {
145 /*for each option in the original select element, create a new DIV that will act as an option item:*/
146 c = document.createElement("DIV");
147 c.innerHTML = selElmnt.options[j].innerHTML;
148 c.addEventListener("click", function(e) {
149 /*when an item is clicked, update the original select box, and the selected item:*/
150 var y, i, k, s, h, sl, yl;
151 s = this.parentNode.parentNode.getElementsByTagName("select")[0];
152 sl = s.length;
153 h = this.parentNode.previousSibling;
154 for (i = 0; i < sl; i++) {
155 if (s.options[i].innerHTML == this.innerHTML) {
156 s.selectedIndex = i;
157 h.innerHTML = this.innerHTML;
158 y = this.parentNode.getElementsByClassName("same-as-selected");
159 yl = y.length;
160 for (k = 0; k < yl; k++) {
161 y[k].removeAttribute("class");
162 }
163 this.setAttribute("class", "same-as-selected");
164 break;
165 }
166 }
167 h.click();
168 });
169 b.appendChild(c);
170 }
171 x[i].appendChild(b);
172 a.addEventListener("click", function(e) {
173 /*when the select box is clicked, close any other select boxes, and open/close the current select box:*/
174 e.stopPropagation();
175 closeAllSelect(this);
176 this.nextSibling.classList.toggle("select-hide");
177 this.classList.toggle("select-arrow-active");
178 if(this.nextSibling.classList.value.includes("hide")){
179 ${namespace}changeLanguage();
180 }
181 });
182 }
183
184 function closeAllSelect(elmnt) {
185 /*a function that will close all select boxes in the document, except the current select box:*/
186 var x, y, i, xl, yl, arrNo = [];
187 x = document.getElementsByClassName("select-items");
188 y = document.getElementsByClassName("select-selected");
189 xl = x.length;
190 yl = y.length;
191 for (i = 0; i < yl; i++) {
192 if (elmnt == y[i]) {
193 arrNo.push(i)
194 } else {
195 y[i].classList.remove("select-arrow-active");
196 }
197 }
198 for (i = 0; i < xl; i++) {
199 if (arrNo.indexOf(i)) {
200 x[i].classList.add("select-hide");
201 }
202 }
203 }
204
205 /*if the user clicks anywhere outside the select box, then close all select boxes:*/
206 document.addEventListener("click", closeAllSelect);
207 </script>
208
209</#if>
CARTOCIUDAD