PageRenderTime 50ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/bitrix/modules/bitrix.sitecorporate/install/wizards/bitrix/corp_furniture/scripts/template.php

https://gitlab.com/Rad1calDreamer/honey
PHP | 590 lines | 474 code | 89 blank | 27 comment | 28 complexity | a1429b9d1423d8764595c22c1be3c6eb MD5 | raw file
  1. <?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
  2. <?
  3. class WizardTemplate extends CWizardTemplate
  4. {
  5. function GetLayout()
  6. {
  7. global $arWizardConfig;
  8. $wizard =& $this->GetWizard();
  9. $formName = htmlspecialcharsbx($wizard->GetFormName());
  10. $nextButtonID = htmlspecialcharsbx($wizard->GetNextButtonID());
  11. $prevButtonID = htmlspecialcharsbx($wizard->GetPrevButtonID());
  12. $cancelButtonID = htmlspecialcharsbx($wizard->GetCancelButtonID());
  13. $finishButtonID = htmlspecialcharsbx($wizard->GetFinishButtonID());
  14. $wizardPath = $wizard->GetPath();
  15. $obStep =& $wizard->GetCurrentStep();
  16. $arErrors = $obStep->GetErrors();
  17. $strError = "";
  18. if (count($arErrors) > 0)
  19. {
  20. foreach ($arErrors as $arError)
  21. $strError .= $arError[0]."<br />";
  22. if (strlen($strError) > 0)
  23. $strError = '<div id="step-error">'.$strError."</div>";
  24. }
  25. $stepTitle = $obStep->GetTitle();
  26. $stepSubTitle = $obStep->GetSubTitle();
  27. $BX_ROOT = BX_ROOT;
  28. $productVersion = "";
  29. //wizard customization file
  30. $bxProductConfig = array();
  31. if(file_exists($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/.config.php"))
  32. include($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/.config.php");
  33. if(isset($bxProductConfig["intranet_wizard"]["product_name"]))
  34. $title = $bxProductConfig["intranet_wizard"]["product_name"];
  35. else
  36. $title = GetMessage("WIZARD_TITLE");
  37. $title = str_replace("#VERS#", $productVersion , $title);
  38. if(isset($bxProductConfig["intranet_wizard"]["copyright"]))
  39. $copyright = $bxProductConfig["intranet_wizard"]["copyright"];
  40. else
  41. $copyright = GetMessage("COPYRIGHT");
  42. $copyright = str_replace("#CURRENT_YEAR#", date("Y") , $copyright);
  43. if(isset($bxProductConfig["intranet_wizard"]["links"]))
  44. $support = $bxProductConfig["intranet_wizard"]["links"];
  45. else
  46. $support = GetMessage("SUPPORT");
  47. if(isset($bxProductConfig["intranet_wizard"]["title"]))
  48. $wizardName = $bxProductConfig["intranet_wizard"]["title"];
  49. else
  50. $wizardName = $wizard->GetWizardName();
  51. //Images
  52. $logoImage = "";
  53. $boxImage = "";
  54. if(isset($bxProductConfig["intranet_wizard"]["logo"]))
  55. {
  56. $logoImage = $bxProductConfig["intranet_wizard"]["logo"];
  57. }
  58. else
  59. {
  60. if (file_exists($_SERVER["DOCUMENT_ROOT"].$wizardPath."/images/".LANGUAGE_ID."/logo.gif"))
  61. $logoImage = '<img src="'.$wizardPath.'/images/'.LANGUAGE_ID.'/logo.gif" alt="" />';
  62. elseif (file_exists($_SERVER["DOCUMENT_ROOT"].$wizardPath."/images/en/logo.gif"))
  63. $logoImage = '<img src="'.$wizardPath.'/images/en/logo.gif" alt="" />';
  64. }
  65. if(isset($bxProductConfig["intranet_wizard"]["product_image"]))
  66. {
  67. $boxImage = $bxProductConfig["intranet_wizard"]["product_image"];
  68. }
  69. else
  70. {
  71. if (file_exists($_SERVER["DOCUMENT_ROOT"].$wizardPath."/images/".LANGUAGE_ID."/box.jpg"))
  72. $boxImage = '<img src="'.$wizardPath.'/images/'.LANGUAGE_ID.'/box.jpg" alt="" />';
  73. elseif (file_exists($_SERVER["DOCUMENT_ROOT"].$wizardPath."/images/en/box.jpg"))
  74. $boxImage = '<img src="'.$wizardPath.'/images/en/box.jpg" alt="" />';
  75. }
  76. $strErrorMessage = "";
  77. $strWarningMessage = "";
  78. $strNavigation = "";
  79. $arSteps = $wizard->GetWizardSteps();
  80. $currentStepID = $wizard->GetCurrentStepID();
  81. if ($currentStepID == "ldap_settings" || $currentStepID == "ldap_groups")
  82. $currentStepID = "site_settings";
  83. $currentSuccess = false;
  84. $stepNumber = 1;
  85. foreach ($arSteps as $stepID => $stepObject)
  86. {
  87. if ($stepID == "ldap_settings" || $stepID == "ldap_groups")
  88. continue;
  89. if ($stepID == $currentStepID)
  90. {
  91. $class = 'class="selected"';
  92. $currentSuccess = true;
  93. }
  94. elseif ($currentSuccess)
  95. $class = '';
  96. else
  97. $class = 'class="done"';
  98. $strNavigation .= '
  99. <tr '.$class.'>
  100. <td class="menu-number">'.$stepNumber.'</td>
  101. <td class="menu-name">'.$stepObject->GetTitle().'</td>
  102. <td class="menu-end"></td>
  103. </tr>
  104. <tr class="menu-separator">
  105. <td colspan="3"></td>
  106. </tr>';
  107. $stepNumber++;
  108. }
  109. if (strlen($strNavigation) > 0)
  110. $strNavigation = '<table width="100%" cellpadding="0" cellspacing="0" id="menu">'.$strNavigation.'</table>';
  111. $jsCode = "";
  112. $jsCode = file_get_contents($_SERVER["DOCUMENT_ROOT"].$wizardPath."/scripts/script.js");
  113. $noscriptInfo = GetMessage("INST_JAVASCRIPT_DISABLED");
  114. $charset = LANG_CHARSET;
  115. $currentStep =& $wizard->GetCurrentStep();
  116. $buttons = "";
  117. if ($currentStep->GetNextStepID() != null)
  118. $buttons .= '<a onclick="this.blur(); return SubmitForm(\'next\');" href="" class="button-next"><span id="next-button-caption">'.$currentStep->GetNextCaption().'</span></a>';
  119. if ($currentStep->GetPrevStepID() != null)
  120. $buttons .= '<a onclick="this.blur(); return SubmitForm(\'prev\');" href="" class="button-prev"><span id="prev-button-caption">'.$currentStep->GetPrevCaption().'</span></a>';
  121. return <<<HTML
  122. <html>
  123. <head>
  124. <title>{$wizardName}</title>
  125. <meta http-equiv="Content-Type" content="text/html; charset={$charset}">
  126. <style type="text/css">
  127. html {height:100%;}
  128. body
  129. {
  130. background:#781813 url({$wizardPath}/images/bg_fill.gif) repeat;
  131. margin:0;
  132. padding:0;
  133. padding-bottom:6px;
  134. font-family: Arial, Verdana, Helvetica, sans-serif;
  135. font-size:82%;
  136. height:100%;
  137. color:black;
  138. box-sizing:border-box;
  139. -moz-box-sizing:border-box;
  140. }
  141. #noscript {display:none;}
  142. table {font-size:100.01%;}
  143. a {color:#2676b9}
  144. h3 {font-size:120%;}
  145. #container
  146. {
  147. padding-top:6px;
  148. height:100%;
  149. box-sizing:border-box;
  150. -moz-box-sizing:border-box;
  151. }
  152. #main-table
  153. {
  154. width:760px;
  155. height:100%;
  156. border-collapse:collapse;
  157. }
  158. #main-table td {padding:0;}
  159. td.wizard-title
  160. {
  161. background:#fefbd2 url({$wizardPath}/images/top_gradient_fill.gif) repeat-x;
  162. height:77px;
  163. color:#19448a;
  164. font-size:140%;
  165. }
  166. #step-title
  167. {
  168. color:#cd4d3e;
  169. margin: 20px;
  170. padding-bottom:20px;
  171. border-bottom:1px solid #d9d9d9;
  172. font-weight:bold;
  173. font-size:120%;
  174. }
  175. #step-content {margin:20px 25px; zoom:1;}
  176. table.data-table
  177. {
  178. width:100%;
  179. border-collapse:collapse;
  180. border:1px solid #d0d0d0;
  181. }
  182. table.data-table td
  183. {
  184. padding:5px !important;
  185. border:1px solid #d0d0d0;
  186. }
  187. table.data-table td.header
  188. {
  189. background: #e3f0f9;
  190. font-weight: bold;
  191. }
  192. #menu tr
  193. {
  194. background:#eaeaea url({$wizardPath}/images/menu_fill.gif) repeat-x;
  195. height:40px;
  196. color:#c0c0c0;
  197. }
  198. #menu tr.menu-separator
  199. {
  200. height:2px;
  201. background: none;
  202. }
  203. #menu tr.selected
  204. {
  205. background:#b41d07 url({$wizardPath}/images/menu_fill_selected.gif) repeat-x;
  206. color:white;
  207. }
  208. #menu tr.done
  209. {
  210. color:black;
  211. }
  212. #menu td.menu-end
  213. {
  214. background: url({$wizardPath}/images/menu_end.gif) repeat-x;
  215. width:11px;
  216. }
  217. #menu tr.selected td.menu-end
  218. {
  219. background: url({$wizardPath}/images/menu_end_selected.gif) repeat-x;
  220. width:11px;
  221. }
  222. #menu td.menu-number
  223. {
  224. width:30px;
  225. font-size: 170%;
  226. text-align:center;
  227. }
  228. #menu td.menu-name
  229. {
  230. font-size:110%;
  231. padding-bottom:1px;
  232. }
  233. #copyright {font-size:95%; color:#606060; margin:4px 7px 0 7px; zoom:1;}
  234. input.wizard-prev-button {background: #ffe681 url({$wizardPath}/images/prev.gif); border:none; width:116px; height:31px; font-weight:bold; padding-bottom:4px; cursor:pointer; cursor:hand;}
  235. input.wizard-next-button {background: #ffe681 url({$wizardPath}/images/next.gif); border:none; width:116px; height:31px; font-weight:bold; padding-bottom:4px; cursor:pointer; cursor:hand;}
  236. form {margin:0; padding:0;}
  237. #step-error {color:red; padding:4px 4px 4px 25px;margin-bottom:4px; background:url({$wizardPath}/images/error.gif) no-repeat;}
  238. small{font-size:85%;}
  239. .required {color:red;}
  240. a.button-next
  241. {
  242. background: transparent url({$wizardPath}/images/button_next.png) no-repeat scroll top right;
  243. display: block;
  244. float: right;
  245. font-size:14px;
  246. height: 31px;
  247. padding-right: 35px;
  248. margin-left:15px;
  249. text-decoration: none;
  250. font-weight:bold;
  251. }
  252. a.button-next span
  253. {
  254. background: transparent url({$wizardPath}/images/button_next.png) no-repeat;
  255. display: block;
  256. line-height: 17px;
  257. color:black;
  258. padding: 5px 0 9px 18px;
  259. }
  260. a.button-prev
  261. {
  262. background: transparent url({$wizardPath}/images/button_prev.png) no-repeat scroll top right;
  263. display: block;
  264. float: right;
  265. font-size:14px;
  266. height: 31px;
  267. padding-right: 18px;
  268. text-decoration: none;
  269. font-weight:bold;
  270. }
  271. a.button-prev span
  272. {
  273. background: transparent url({$wizardPath}/images/button_prev.png) no-repeat;
  274. display: block;
  275. line-height: 17px;
  276. color:black;
  277. padding: 5px 0 9px 35px;
  278. }
  279. #solutions-container
  280. {
  281. margin-bottom: 15px;
  282. }
  283. a.solution-item
  284. {
  285. display:block;
  286. border: 0;
  287. margin-bottom: 10px;
  288. color: Black;
  289. text-decoration: none;
  290. outline: none;
  291. }
  292. a.solution-item h4
  293. {
  294. margin: 10px;
  295. margin-top: 9px; /*compensating 1px padding*/
  296. font-family:Helvetica;
  297. font-size:1.5em;
  298. }
  299. a.solution-item p
  300. {
  301. margin: 10px;
  302. }
  303. div.solution-item-wrapper
  304. {
  305. width: 97px;
  306. float: left;
  307. }
  308. a.solution-picture-item
  309. {
  310. margin: 3px;
  311. text-align: center;
  312. }
  313. div.solution-description
  314. {
  315. margin-top: 3px;
  316. margin-left: 4px;
  317. color: #999;
  318. text-align:left;
  319. }
  320. a.solution-picture-item img.solution-image
  321. {
  322. width: 70px;
  323. float: none;
  324. margin: 7px 0px 7px;
  325. }
  326. img.solution-image
  327. {
  328. width: 100px;
  329. float: left;
  330. margin: 10px;
  331. border: 1px solid #CFCFCF;
  332. }
  333. input.solution-radio
  334. {
  335. float: left;
  336. margin: 10px 7px 10px 10px;
  337. height: 1.5em;
  338. }
  339. div.solution-inner-item
  340. {
  341. padding: 1px;
  342. overflow: hidden;
  343. zoom: 1;
  344. }
  345. a.solution-item div.solution-inner-item,
  346. a.solution-item b
  347. {
  348. background-color:#F7F7F7;
  349. cursor: pointer;
  350. cursor: hand;
  351. }
  352. a.solution-item:hover div.solution-inner-item,
  353. a.solution-item:hover b
  354. {
  355. background-color: #FFF0B2;
  356. }
  357. a.solution-item-selected div.solution-inner-item,
  358. a.solution-item-selected b,
  359. a.solution-item-selected:hover div.solution-inner-item,
  360. a.solution-item-selected:hover b
  361. {
  362. background-color: #CADBEC;
  363. }
  364. #solution-preview
  365. {
  366. margin-top: 10px;
  367. }
  368. #solution-preview div.solution-inner-item,
  369. #solution-preview b
  370. {
  371. background-color:#F7F7F7;
  372. }
  373. #solution-preview div.solution-inner-item
  374. {
  375. padding: 10px;
  376. text-align: center;
  377. }
  378. #solution-preview-image
  379. {
  380. border: 1px solid #CFCFCF;
  381. width: 450px;
  382. }
  383. /* Round Corners */
  384. .r0, .r1, .r2, .r3, .r4 { overflow: hidden; font-size:1px; display: block; height: 1px;}
  385. .r4 { margin: 0 4px; }
  386. .r3 { margin: 0 3px; }
  387. .r2 { margin: 0 2px; }
  388. .r1 { margin: 0 1px; }
  389. </style>
  390. <noscript>
  391. <style type="text/css">
  392. div {display: none;}
  393. #noscript {padding: 3em; font-size: 130%; background:white; display:block;}
  394. </style>
  395. </noscript>
  396. <script type="text/javascript">
  397. <!--
  398. function SubmitForm(button)
  399. {
  400. var buttons = {
  401. "next" : "{$nextButtonID}",
  402. "prev" : "{$prevButtonID}",
  403. "cancel" : "{$cancelButtonID}",
  404. "finish" : "{$finishButtonID}"
  405. };
  406. var form = document.forms["{$formName}"];
  407. if (form)
  408. {
  409. hiddenField = document.createElement("INPUT");
  410. hiddenField.type = "hidden";
  411. hiddenField.name = buttons[button];
  412. hiddenField.value = button;
  413. form.appendChild(hiddenField);
  414. form.submit();
  415. }
  416. return false;
  417. }
  418. {$jsCode}
  419. //-->
  420. </script>
  421. </head>
  422. <body id="bitrix_install_template">
  423. <p id="noscript">{$noscriptInfo}</p>
  424. <div id="container">
  425. <table id="main-table" align="center">
  426. <tr>
  427. <td width="10" height="10"><img src="{$wizardPath}/images/corner_top_left.gif" width="10" height="10" alt="" /></td>
  428. <td width="100%">
  429. <table width="100%" height="100%" cellpadding="0" cellspacing="0">
  430. <tr>
  431. <td width="215" height="10" style="background:white;"></td>
  432. <td width="525" height="10" style="background:#fefbd2;"></td>
  433. </tr>
  434. </table>
  435. </td>
  436. <td width="10" height="10"><img src="{$wizardPath}/images/corner_top_right.gif" width="10" height="10" alt="" /></td>
  437. </tr>
  438. <tr>
  439. <td colspan="3" height="100%" style="background:white">
  440. <table width="100%" height="100%" cellpadding="0" cellspacing="0">
  441. <tr>
  442. <td width="225" valign="top">
  443. <!-- Left column -->
  444. <table width="100%" height="100%" cellpadding="0" cellspacing="0">
  445. <tr><td align="center" height="185">{$boxImage}</td></tr>
  446. <tr>
  447. <td height="100%" valign="top">
  448. <!-- Menu -->
  449. {$strNavigation}
  450. </td>
  451. </tr>
  452. <tr><td align="center" height="100">{$logoImage}</td></tr>
  453. </table>
  454. </td>
  455. <td width="535" valign="top">
  456. <!-- Right column -->
  457. <table width="100%" height="77" cellpadding="0" cellspacing="0">
  458. <tr>
  459. <td width="9" style="background:#fefbd2;"><img src="{$wizardPath}/images/top_gradient_begin.gif" width="9" height="77" alt="" /></td>
  460. <td class="wizard-title" width="14">&nbsp;</td>
  461. <td class="wizard-title">{$title}</td>
  462. </tr>
  463. </table>
  464. <div id="step-title">{$stepTitle}</div>
  465. {#FORM_START#}
  466. <div id="step-content">
  467. {$strError}
  468. {#CONTENT#}
  469. <br /><br /><div class="buttons">{$buttons}</div><br />
  470. </div>
  471. {#FORM_END#}
  472. </td>
  473. </tr>
  474. </table>
  475. </td>
  476. </tr>
  477. <tr height="20" style="background:#f7f7f7;">
  478. <td colspan="3">
  479. <div id="copyright">
  480. <table width="100%" height="100%" cellpadding="0" cellspacing="5">
  481. <tr>
  482. <td>{$copyright}</td>
  483. <td align="right">{$support}</td>
  484. </tr>
  485. </table>
  486. </div>
  487. </tr>
  488. <tr>
  489. <td width="10" height="10" valign="bottom"><img src="{$wizardPath}/images/corner_bottom_left.gif" width="10" height="10" alt="" /></td>
  490. <td width="100%" style="background:#f7f7f7;"></td>
  491. <td width="10" height="10" valign="bottom"><img src="{$wizardPath}/images/corner_bottom_right.gif" width="10" height="10" alt="" /></td>
  492. </tr>
  493. </table>
  494. <script type="text/javascript">PreloadImages("{$wizardPath}/images/");</script>
  495. </div>
  496. </body>
  497. </html>
  498. HTML;
  499. }
  500. }
  501. ?>