bssimplefieldrenderer.class.inc.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. <?php
  2. // Copyright (C) 2010-2016 Combodo SARL
  3. //
  4. // This file is part of iTop.
  5. //
  6. // iTop is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU Affero General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // iTop is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU Affero General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU Affero General Public License
  17. // along with iTop. If not, see <http://www.gnu.org/licenses/>
  18. namespace Combodo\iTop\Renderer\Bootstrap\FieldRenderer;
  19. use \utils;
  20. use \Dict;
  21. use \UserRights;
  22. use \AttributeDateTime;
  23. use \InlineImage;
  24. use \Combodo\iTop\Renderer\FieldRenderer;
  25. use \Combodo\iTop\Renderer\RenderingOutput;
  26. use \Combodo\iTop\Form\Field\TextAreaField;
  27. /**
  28. * Description of BsSimpleFieldRenderer
  29. *
  30. * @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
  31. */
  32. class BsSimpleFieldRenderer extends FieldRenderer
  33. {
  34. /**
  35. * Returns a RenderingOutput for the FieldRenderer's Field
  36. *
  37. * @return \Combodo\iTop\Renderer\RenderingOutput
  38. */
  39. public function Render()
  40. {
  41. $oOutput = new RenderingOutput();
  42. $sFieldClass = get_class($this->oField);
  43. $sFieldMandatoryClass = ($this->oField->GetMandatory()) ? 'form_mandatory' : '';
  44. // Rendering field in edition mode
  45. if (!$this->oField->GetReadOnly() && !$this->oField->GetHidden())
  46. {
  47. switch ($sFieldClass)
  48. {
  49. case 'Combodo\\iTop\\Form\\Field\\DateTimeField':
  50. $oOutput->AddHtml('<div class="form-group ' . $sFieldMandatoryClass . '">');
  51. if ($this->oField->GetLabel() !== '')
  52. {
  53. $oOutput->AddHtml('<label for="' . $this->oField->GetGlobalId() . '" class="control-label">')->AddHtml($this->oField->GetLabel(), true)->AddHtml('</label>');
  54. }
  55. $oOutput->AddHtml('<div class="help-block"></div>');
  56. $oOutput->AddHtml('<div class="input-group date" id="datepicker_' . $this->oField->GetGlobalId() . '">');
  57. $oOutput->AddHtml('<input type="text" id="' . $this->oField->GetGlobalId() . '" name="' . $this->oField->GetId() . '" value="')->AddHtml($this->oField->GetDisplayValue(), true)->AddHtml('" class="form-control" maxlength="255" />');
  58. $oOutput->AddHtml('<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>');
  59. $oOutput->AddHtml('</div>');
  60. $oOutput->AddHtml('</div>');
  61. $sJSFormat = json_encode($this->oField->GetJSDateTimeFormat());
  62. $oOutput->AddJs(
  63. <<<EOF
  64. $('#datepicker_{$this->oField->GetGlobalId()}').datetimepicker({format: $sJSFormat});
  65. EOF
  66. );
  67. break;
  68. case 'Combodo\\iTop\\Form\\Field\\PasswordField':
  69. $oOutput->AddHtml('<div class="form-group ' . $sFieldMandatoryClass . '">');
  70. if ($this->oField->GetLabel() !== '')
  71. {
  72. $oOutput->AddHtml('<label for="' . $this->oField->GetGlobalId() . '" class="control-label">')->AddHtml($this->oField->GetLabel(), true)->AddHtml('</label>');
  73. }
  74. $oOutput->AddHtml('<div class="help-block"></div>');
  75. $oOutput->AddHtml('<input type="password" id="' . $this->oField->GetGlobalId() . '" name="' . $this->oField->GetId() . '" value="')->AddHtml($this->oField->GetCurrentValue(), true)->AddHtml('" class="form-control" maxlength="255" autocomplete="off" />');
  76. $oOutput->AddHtml('</div>');
  77. break;
  78. case 'Combodo\\iTop\\Form\\Field\\StringField':
  79. $oOutput->AddHtml('<div class="form-group ' . $sFieldMandatoryClass . '">');
  80. if ($this->oField->GetLabel() !== '')
  81. {
  82. $oOutput->AddHtml('<label for="' . $this->oField->GetGlobalId() . '" class="control-label">')->AddHtml($this->oField->GetLabel(), true)->AddHtml('</label>');
  83. }
  84. $oOutput->AddHtml('<div class="help-block"></div>');
  85. $oOutput->AddHtml('<input type="text" id="' . $this->oField->GetGlobalId() . '" name="' . $this->oField->GetId() . '" value="')->AddHtml($this->oField->GetCurrentValue(), true)->AddHtml('" class="form-control" maxlength="255" />');
  86. $oOutput->AddHtml('</div>');
  87. break;
  88. case 'Combodo\\iTop\\Form\\Field\\TextAreaField':
  89. case 'Combodo\\iTop\\Form\\Field\\CaseLogField':
  90. $bRichEditor = ($this->oField->GetFormat() === TextAreaField::ENUM_FORMAT_HTML);
  91. $oOutput->AddHtml('<div class="form-group ' . $sFieldMandatoryClass . '">');
  92. if ($this->oField->GetLabel() !== '')
  93. {
  94. $oOutput->AddHtml('<label for="' . $this->oField->GetGlobalId() . '" class="control-label">')->AddHtml($this->oField->GetLabel(), true)->AddHtml('</label>');
  95. }
  96. $oOutput->AddHtml('<div class="help-block"></div>');
  97. // First the edition area
  98. $oOutput->AddHtml('<div>');
  99. $oOutput->AddHtml('<textarea id="' . $this->oField->GetGlobalId() . '" name="' . $this->oField->GetId() . '" class="form-control" rows="8">' . $this->oField->GetCurrentValue() . '</textarea>');
  100. $oOutput->AddHtml('</div>');
  101. // Then the previous entries if necessary
  102. if ($sFieldClass === 'Combodo\\iTop\\Form\\Field\\CaseLogField')
  103. {
  104. $this->PreparingCaseLogEntries($oOutput);
  105. }
  106. $oOutput->AddHtml('</div>');
  107. // Some additional stuff if we are displaying it with a rich editor
  108. if ($bRichEditor)
  109. {
  110. $sEditorLanguage = strtolower(trim(UserRights::GetUserLanguage()));
  111. $oOutput->AddJs(
  112. <<<EOF
  113. $('#{$this->oField->GetGlobalId()}').addClass('htmlEditor');
  114. $('#{$this->oField->GetGlobalId()}').ckeditor(function(){}, {language: '$sEditorLanguage', contentsLanguage: '$sEditorLanguage'});
  115. EOF
  116. );
  117. if (($this->oField->GetObject() !== null) && ($this->oField->GetTransactionId() !== null))
  118. {
  119. $oOutput->AddJs(InlineImage::EnableCKEditorImageUpload($this->oField->GetObject(), utils::GetUploadTempId($this->oField->GetTransactionId())));
  120. }
  121. }
  122. break;
  123. case 'Combodo\\iTop\\Form\\Field\\SelectField':
  124. case 'Combodo\\iTop\\Form\\Field\\MultipleSelectField':
  125. $oOutput->AddHtml('<div class="form-group ' . $sFieldMandatoryClass . '">');
  126. if ($this->oField->GetLabel() !== '')
  127. {
  128. $oOutput->AddHtml('<label for="' . $this->oField->GetGlobalId() . '" class="control-label">')->AddHtml($this->oField->GetLabel(), true)->AddHtml('</label>');
  129. }
  130. $oOutput->AddHtml('<div class="help-block"></div>');
  131. $oOutput->AddHtml('<select id="' . $this->oField->GetGlobalId() . '" name="' . $this->oField->GetId() . '" ' . ( ($this->oField->GetMultipleValuesEnabled()) ? 'multiple' : '' ) . ' class="form-control">');
  132. foreach ($this->oField->GetChoices() as $sChoice => $sLabel)
  133. {
  134. // Note : The test is a double equal on purpose as the type of the value received from the XHR is not always the same as the type of the allowed values. (eg : string vs int)
  135. $sSelectedAtt = ($this->oField->GetCurrentValue() == $sChoice) ? 'selected' : '';
  136. $oOutput->AddHtml('<option value="' . $sChoice . '" ' . $sSelectedAtt . ' >')->AddHtml($sLabel)->AddHtml('</option>');
  137. }
  138. $oOutput->AddHtml('</select>');
  139. $oOutput->AddHtml('</div>');
  140. break;
  141. case 'Combodo\\iTop\\Form\\Field\\RadioField':
  142. case 'Combodo\\iTop\\Form\\Field\\CheckboxField':
  143. $sFieldType = ($sFieldClass === 'Combodo\\iTop\\Form\\Field\\RadioField') ? 'radio' : 'checkbox';
  144. $oOutput->AddHtml('<div class="form-group ' . $sFieldMandatoryClass . '" id="' . $this->oField->GetGlobalId() . '">');
  145. if ($this->oField->GetLabel() !== '')
  146. {
  147. $oOutput->AddHtml('<div><label class="control-label">')->AddHtml($this->oField->GetLabel(), true)->AddHtml('</label></div>');
  148. }
  149. $oOutput->AddHtml('<div class="help-block"></div>');
  150. $oOutput->AddHtml('<div class="btn-group" data-toggle="buttons">');
  151. $i = 0;
  152. foreach ($this->oField->GetChoices() as $sChoice => $sLabel)
  153. {
  154. // Note : The test is a double equal on purpose as the type of the value received from the XHR is not always the same as the type of the allowed values. (eg : string vs int)
  155. $sCheckedAtt = ($this->oField->IsAmongValues($sChoice)) ? 'checked' : '';
  156. $sCheckedClass = ($this->oField->IsAmongValues($sChoice)) ? 'active' : '';
  157. $oOutput->AddHtml('<label class="btn btn-default ' . $sCheckedClass . '"><input type="' . $sFieldType . '" name="' . $this->oField->GetId() . '" id="' . $this->oField->GetId() . $i . '" value="' . $sChoice . '" ' . $sCheckedAtt . ' />' . $sLabel . '</label>');
  158. $i++;
  159. }
  160. $oOutput->AddHtml('</div>');
  161. $oOutput->AddHtml('</div>');
  162. break;
  163. case 'Combodo\\iTop\\Form\\Field\\HiddenField':
  164. $oOutput->AddHtml('<input type="hidden" id="' . $this->oField->GetGlobalId() . '" name="' . $this->oField->GetId() . '" value="')->AddHtml($this->oField->GetCurrentValue(), true)->AddHtml('"/>');
  165. break;
  166. }
  167. }
  168. // ... and in read-only mode (or hidden)
  169. else
  170. {
  171. // ... specific rendering for fields with multiple values
  172. if (($this->oField instanceof Combodo\iTop\Form\Field\MultipleChoicesField) && ($this->oField->GetMultipleValuesEnabled()))
  173. {
  174. // TODO
  175. }
  176. // ... clasic rendering for fields with only one value
  177. else
  178. {
  179. switch ($sFieldClass)
  180. {
  181. case 'Combodo\\iTop\\Form\\Field\\LabelField':
  182. $oOutput->AddHtml('<div class="form-group">');
  183. // Showing label / value only if read-only but not hidden
  184. if (!$this->oField->GetHidden())
  185. {
  186. if ($this->oField->GetLabel() !== '')
  187. {
  188. $oOutput->AddHtml('<label for="' . $this->oField->GetGlobalId() . '" class="control-label">')->AddHtml($this->oField->GetLabel(), true)->AddHtml('</label>');
  189. }
  190. $oOutput->AddHtml('<div class="form-control-static">')->AddHtml($this->oField->GetCurrentValue(), true)->AddHtml('</div>');
  191. }
  192. $oOutput->AddHtml('</div>');
  193. break;
  194. case 'Combodo\\iTop\\Form\\Field\\StringField':
  195. case 'Combodo\\iTop\\Form\\Field\\TextAreaField':
  196. $oOutput->AddHtml('<div class="form-group">');
  197. // Showing label / value only if read-only but not hidden
  198. if (!$this->oField->GetHidden())
  199. {
  200. if ($this->oField->GetLabel() !== '')
  201. {
  202. $oOutput->AddHtml('<label for="' . $this->oField->GetGlobalId() . '" class="control-label">')->AddHtml($this->oField->GetLabel(), true)->AddHtml('</label>');
  203. }
  204. if($sFieldClass === 'Combodo\\iTop\\Form\\Field\\TextAreaField')
  205. {
  206. $bEncodeHtmlEntities = false;
  207. if($this->oField->GetFormat() === TextAreaField::ENUM_FORMAT_HTML)
  208. {
  209. $sDisplayValue = $this->oField->GetCurrentValue();
  210. }
  211. else
  212. {
  213. $sDisplayValue = utils::TextToHtml($this->oField->GetCurrentValue());
  214. }
  215. }
  216. else
  217. {
  218. $bEncodeHtmlEntities = true;
  219. $sDisplayValue = $this->oField->GetCurrentValue();
  220. }
  221. $oOutput->AddHtml('<div class="form-control-static">')->AddHtml($sDisplayValue, $bEncodeHtmlEntities)->AddHtml('</div>');
  222. }
  223. $oOutput->AddHtml('<input type="hidden" id="' . $this->oField->GetGlobalId() . '" name="' . $this->oField->GetId() . '" value="')->AddHtml($this->oField->GetCurrentValue(), true)->AddHtml('" class="form-control" />');
  224. $oOutput->AddHtml('</div>');
  225. break;
  226. case 'Combodo\\iTop\\Form\\Field\\CaseLogField':
  227. $oOutput->AddHtml('<div class="form-group ' . $sFieldMandatoryClass . '">');
  228. if ($this->oField->GetLabel() !== '')
  229. {
  230. $oOutput->AddHtml('<label for="' . $this->oField->GetGlobalId() . '" class="control-label">')->AddHtml($this->oField->GetLabel(), true)->AddHtml('</label>');
  231. }
  232. // Entries if necessary
  233. $this->PreparingCaseLogEntries($oOutput);
  234. $oOutput->AddHtml('</div>');
  235. break;
  236. case 'Combodo\\iTop\\Form\\Field\\DateTimeField':
  237. $oOutput->AddHtml('<div class="form-group">');
  238. // Showing label / value only if read-only but not hidden
  239. if (!$this->oField->GetHidden())
  240. {
  241. if ($this->oField->GetLabel() !== '')
  242. {
  243. $oOutput->AddHtml('<label for="' . $this->oField->GetGlobalId() . '" class="control-label">')->AddHtml($this->oField->GetLabel(), true)->AddHtml('</label>');
  244. }
  245. $oOutput->AddHtml('<div class="form-control-static">')->AddHtml($this->oField->GetDisplayValue(), true)->AddHtml('</div>');
  246. }
  247. $oOutput->AddHtml('<input type="hidden" id="' . $this->oField->GetGlobalId() . '" name="' . $this->oField->GetId() . '" value="')->AddHtml($this->oField->GetDisplayValue(), true)->AddHtml('" class="form-control" />');
  248. $oOutput->AddHtml('</div>');
  249. break;
  250. case 'Combodo\\iTop\\Form\\Field\\RadioField':
  251. case 'Combodo\\iTop\\Form\\Field\\SelectField':
  252. case 'Combodo\\iTop\\Form\\Field\\MultipleSelectField':
  253. $aFieldChoices = $this->oField->GetChoices();
  254. $sFieldValue = (isset($aFieldChoices[$this->oField->GetCurrentValue()])) ? $aFieldChoices[$this->oField->GetCurrentValue()] : Dict::S('UI:UndefinedObject');
  255. $oOutput->AddHtml('<div class="form-group">');
  256. // Showing label / value only if read-only but not hidden
  257. if (!$this->oField->GetHidden())
  258. {
  259. if ($this->oField->GetLabel() !== '')
  260. {
  261. $oOutput->AddHtml('<label for="' . $this->oField->GetGlobalId() . '" class="control-label">')->AddHtml($this->oField->GetLabel(), true)->AddHtml('</label>');
  262. }
  263. $oOutput->AddHtml('<div class="form-control-static">' . $sFieldValue . '</div>');
  264. }
  265. $oOutput->AddHtml('<input type="hidden" id="' . $this->oField->GetGlobalId() . '" name="' . $this->oField->GetId() . '" value="' . $this->oField->GetCurrentValue() . '" class="form-control" />');
  266. $oOutput->AddHtml('</div>');
  267. break;
  268. case 'Combodo\\iTop\\Form\\Field\\HiddenField':
  269. $oOutput->AddHtml('<input type="hidden" id="' . $this->oField->GetGlobalId() . '" name="' . $this->oField->GetId() . '" value="')->AddHtml($this->oField->GetCurrentValue(), true)->AddHtml('"/>');
  270. break;
  271. }
  272. }
  273. }
  274. // JS FieldChange trigger (:input are not always at the same depth)
  275. switch ($sFieldClass)
  276. {
  277. case 'Combodo\\iTop\\Form\\Field\\PasswordField':
  278. case 'Combodo\\iTop\\Form\\Field\\StringField':
  279. case 'Combodo\\iTop\\Form\\Field\\TextAreaField':
  280. case 'Combodo\\iTop\\Form\\Field\\CaseLogField':
  281. case 'Combodo\\iTop\\Form\\Field\\SelectField':
  282. case 'Combodo\\iTop\\Form\\Field\\MultipleSelectField':
  283. case 'Combodo\\iTop\\Form\\Field\\HiddenField':
  284. $oOutput->AddJs(
  285. <<<EOF
  286. $("#{$this->oField->GetGlobalId()}").off("change keyup").on("change keyup", function(){
  287. var me = this;
  288. $(this).closest(".field_set").trigger("field_change", {
  289. id: $(me).attr("id"),
  290. name: $(me).closest(".form_field").attr("data-field-id"),
  291. value: $(me).val()
  292. });
  293. });
  294. EOF
  295. );
  296. break;
  297. case 'Combodo\\iTop\\Form\\Field\\DateTimeField':
  298. // We need the focusout event has the datepicker widget seems to override the change event
  299. $oOutput->AddJs(
  300. <<<EOF
  301. $("#{$this->oField->GetGlobalId()}").off("change keyup focusout").on("change keyup focusout", function(){
  302. var me = this;
  303. $(this).closest(".field_set").trigger("field_change", {
  304. id: $(me).attr("id"),
  305. name: $(me).closest(".form_field").attr("data-field-id"),
  306. value: $(me).val()
  307. });
  308. });
  309. EOF
  310. );
  311. break;
  312. case 'Combodo\\iTop\\Form\\Field\\RadioField':
  313. case 'Combodo\\iTop\\Form\\Field\\CheckboxField':
  314. $oOutput->AddJs(
  315. <<<EOF
  316. $("#{$this->oField->GetGlobalId()} input").off("change").on("change", function(){
  317. var me = this;
  318. $(this).closest(".field_set").trigger("field_change", {
  319. id: $(me).closest("#{$this->oField->GetGlobalId()}").attr("id"),
  320. name: $(me).attr("name"),
  321. value: $(me).val()
  322. });
  323. });
  324. EOF
  325. );
  326. break;
  327. }
  328. // JS Form field widget construct
  329. $aValidators = array();
  330. foreach ($this->oField->GetValidators() as $oValidator)
  331. {
  332. $aValidators[$oValidator::GetName()] = array(
  333. 'reg_exp' => $oValidator->GetRegExp(),
  334. 'message' => Dict::S($oValidator->GetErrorMessage())
  335. );
  336. }
  337. $sFormFieldOptions = json_encode(array(
  338. 'validators' => $aValidators
  339. ));
  340. switch ($sFieldClass)
  341. {
  342. case 'Combodo\\iTop\\Form\\Field\\PasswordField':
  343. case 'Combodo\\iTop\\Form\\Field\\StringField':
  344. case 'Combodo\\iTop\\Form\\Field\\SelectField':
  345. case 'Combodo\\iTop\\Form\\Field\\MultipleSelectField':
  346. case 'Combodo\\iTop\\Form\\Field\\HiddenField':
  347. case 'Combodo\\iTop\\Form\\Field\\RadioField':
  348. case 'Combodo\\iTop\\Form\\Field\\CheckboxField':
  349. case 'Combodo\\iTop\\Form\\Field\\DateTimeField':
  350. $oOutput->AddJs(
  351. <<<EOF
  352. $("[data-field-id='{$this->oField->GetId()}'][data-form-path='{$this->oField->GetFormPath()}']").portal_form_field($sFormFieldOptions);
  353. EOF
  354. );
  355. break;
  356. case 'Combodo\\iTop\\Form\\Field\\TextAreaField':
  357. case 'Combodo\\iTop\\Form\\Field\\CaseLogField':
  358. // Overloading $sFormFieldOptions to include the set_current_value_callback. It would have been nicer to refactor the variable for all field types, but as this is a fix for a maintenance release, we rather be safe.
  359. $sValidators = json_encode($aValidators);
  360. $oOutput->AddJs(
  361. <<<EOF
  362. $("[data-field-id='{$this->oField->GetId()}'][data-form-path='{$this->oField->GetFormPath()}']").portal_form_field_html({
  363. validators: $sValidators,
  364. set_current_value_callback: function(me, oEvent, oData){ $(me.element).find('textarea').val(oData); }
  365. });
  366. EOF
  367. );
  368. // MagnificPopup on images
  369. $oOutput->AddJs(InlineImage::FixImagesWidth());
  370. break;
  371. }
  372. return $oOutput;
  373. }
  374. protected function PreparingCaseLogEntries(RenderingOutput &$oOutput)
  375. {
  376. $aEntries = $this->oField->GetEntries();
  377. if (count($aEntries) > 0)
  378. {
  379. $oOutput->AddHtml('<div>');
  380. for ($i = 0; $i < count($aEntries); $i++)
  381. {
  382. $sEntryDate = AttributeDateTime::GetFormat()->Format($aEntries[$i]['date']);
  383. $sEntryUser = $aEntries[$i]['user_login'];
  384. $sEntryHeader = Dict::Format('UI:CaseLog:Header_Date_UserName', $sEntryDate, $sEntryUser);
  385. // Only the last 2 entries are expanded by default
  386. $sEntryContentExpanded = ($i < 2) ? 'true' : 'false';
  387. $sEntryHeaderButtonClass = ($i < 2) ? '' : 'collapsed';
  388. $sEntryContentClass = ($i < 2) ? 'in' : '';
  389. $sEntryContentId = 'caselog_field_entry_content-' . $this->oField->GetGlobalId() . '-' . $i;
  390. // Note : We use CKEditor stylesheet to format this
  391. $oOutput->AddHtml(
  392. <<<EOF
  393. <div class="caselog_field_entry cke_inner">
  394. <div class="caselog_field_entry_header">
  395. {$sEntryHeader}
  396. <div class="pull-right">
  397. <span class="caselog_field_entry_button {$sEntryHeaderButtonClass}" data-toggle="collapse" href="#{$sEntryContentId}" aria-expanded="{$sEntryContentExpanded}" aria-controls="{$sEntryContentId}"></span>
  398. </div>
  399. </div>
  400. <div class="caselog_field_entry_content collapse {$sEntryContentClass}" id="{$sEntryContentId}">
  401. {$aEntries[$i]['message_html']}
  402. </div>
  403. </div>
  404. EOF
  405. );
  406. }
  407. $oOutput->AddHtml('</div>');
  408. }
  409. }
  410. }