Exemplo n.º 1
0
    function ShowStep()
    {
        $this->SetAutoSubmit(false);
        $wizard =& $this->GetWizard();
        $servicePath = $_SERVER["DOCUMENT_ROOT"] . $wizard->GetPath() . "/modules/";
        $arServiceSelected = $wizard->GetVar("services");
        if (!$arServiceSelected) {
            $arServiceSelected = array();
        }
        $arServices = DemoSiteUtil::GetServices($servicePath, $arFilter = array("SERVICES" => $arServiceSelected));
        /*$package =& $wizard->GetPackage();
        		$arServiceSelected = array_keys(DemoSiteUtil::GetSelectedServices($package->GetSiteStructureID()));
        		*/
        //$this->content .= "<pre>".print_r($wizard->GetVar("services"), true)."</pre>";
        list($firstService, $stage, $status) = $this->GetFirstStep($arServices);
        $this->content .= '
			<table border="0" cellspacing="0" cellpadding="2" width="550">
				<tr>
					<td colspan="2"><div id="status"></div></td>
				</tr>
				<tr>
					<td width="90%" height="10">
						<div style="border:1px solid #B9CBDF; width:100%;"><div id="indicator" style="height:10px; width:0%; background-color:#B9CBDF"></div></div>
					</td>
					<td width="10%">&nbsp;<span id="percent">0%</span></td>
				</tr>
			</table>
			<div id="wait" align=center>
			<br />
			<table width=200 cellspacing=0 cellpadding=0 border=0 style="border:1px solid #EFCB69" bgcolor="#FFF7D7">
				<tr>
					<td height=50 width="50" valign="middle" align=center><img src="/bitrix/wizards/bitrix/demo/images/wait.gif"></td>
					<td height=50 width=150>' . GetMessage("MAIN_WIZARD_WAIT_WINDOW_TEXT") . '</td>
				</tr>
			</table>
		</div><br />
			<br />
			<div id="error_container" style="display:none">
				<div id="error_notice"><span style="color:red;">' . GetMessage("INST_ERROR_OCCURED") . '<br />' . GetMessage("INST_TEXT_ERROR") . ':</span></div>
				<div id="error_text"></div>
				<div><span style="color:red;">' . GetMessage("INST_ERROR_NOTICE") . '</span></div>
				<div id="error_buttons" align="center">
				<br /><input type="button" value="' . GetMessage("INST_RETRY_BUTTON") . '" id="error_retry_button" onclick="" />&nbsp;<input type="button" id="error_skip_button" value="' . GetMessage("INST_SKIP_BUTTON") . '" onclick="" />&nbsp;</div>
			</div>

		' . $this->ShowHiddenField("nextStep", $firstService) . '
		' . $this->ShowHiddenField("nextStepStage", $stage) . '
		<iframe style="display:none;" id="iframe-post-form" name="iframe-post-form" src="javascript:\'\'"></iframe>';
        $wizard =& $this->GetWizard();
        $formName = $wizard->GetFormName();
        $nextButtonID = $wizard->GetNextButtonID();
        $NextStepVarName = $wizard->GetRealName("nextStep");
        $this->content .= '
		<script type="text/javascript">
			var ajaxForm = new CAjaxForm("' . $formName . '", "iframe-post-form", "' . $NextStepVarName . '");
			ajaxForm.Post("' . $firstService . '", "' . $stage . '", "' . $status . '");
		</script>';
        $package =& $wizard->GetPackage();
        //$this->content = print_r($package->GetSiteStructureID(), true);
        //$this->content .= "<pre>".print_r($arServices, true)."</pre>";
        //setTimeout(function () {document.forms["'.$formName.'"].elements["'.$nextButtonID.'"].style.display = "none"}, 1000);
    }
Exemplo n.º 2
0
 function ShowStep()
 {
     $wizard =& $this->GetWizard();
     $package =& $wizard->GetPackage();
     $servicePath = $_SERVER["DOCUMENT_ROOT"] . $wizard->GetPath() . "/modules/";
     $arServices = DemoSiteUtil::GetServices($servicePath, $skipFilter = array("SKIP_INSTALL_ONLY" => "Y"));
     //$this->content .= "<pre>".print_r($arServices, true)."</pre>";
     $this->content .= '<table width="100%" cellspacing="1" cellpadding="0">';
     foreach ($arServices as $serviceID => $arService) {
         $this->content .= '<tr>';
         if (!isset($arService["DEFAULT"]) || $arService["DEFAULT"] != "N") {
             $wizard->SetDefaultVar("services[]", $serviceID);
         }
         $this->content .= '<td valign="top">' . $this->ShowCheckboxField("services[]", $serviceID, array("id" => $serviceID)) . '</td>';
         $this->content .= '<td valign="top">';
         if (isset($arService["ICON"]) && strlen($arService["ICON"]) > 0) {
             $this->content .= '<label for="' . $serviceID . '"><img src="' . $package->GetPath() . '/' . $arService["ICON"] . '" /></label>';
         }
         $this->content .= '</td>';
         $this->content .= '<td valign="top" width="100%">';
         $this->content .= '<label for="' . $serviceID . '">&nbsp;' . $arService["NAME"] . '</label><br />';
         if (isset($arService["DESCRIPTION"]) && strlen($arService["DESCRIPTION"]) > 0) {
             $this->content .= '<div style="margin-left:20px;"><label for="' . $serviceID . '"><i>' . $arService["DESCRIPTION"] . '</i></label></div>';
         }
         $this->content .= '</td>';
         $this->content .= '</tr>';
     }
     $this->content .= '</table>';
 }