• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/wizard.php
  • Класс: CWizardStep
  • Вызов: CWizardStep::ShowFileField
function ShowFileField($name, $arAttributes = Array())
{
	$wizard = $this->GetWizard();
	$strReturn = "";

	if (array_key_exists("max_file_size", $arAttributes))
	{
		$strReturn .= '';
		unset($arAttributes["max_file_size"]);
	}

	$strReturn .= '_ShowAttributes($arAttributes).' />';

	$fileID = intval($wizard->GetVar($name));
	if ($fileID > 0)
	{
		$obFile = CFile::GetByID($fileID);
		if ($arFile = $obFile->Fetch())
		{
			$deleteName = $wizard->GetRealName($name."_del");
			$oldName = $wizard->GetRealName($name."_old");

			$show_file_info = (isset($arAttributes["show_file_info"]) && $arAttributes["show_file_info"] == "N" ? false : true);

			if ($show_file_info)
			{
				$strReturn .= "
 ".GetMessage("MAIN_WIZARD_FILE_NAME").": ".htmlspecialcharsEx($arFile["ORIGINAL_NAME"]); if ($arFile["HEIGHT"] > 0 && $arFile["WIDTH"]) { $strReturn .= "
 ".GetMessage("MAIN_WIZARD_FILE_WIDTH").": ".intval($arFile["WIDTH"]); $strReturn .= "
 ".GetMessage("MAIN_WIZARD_FILE_HEIGHT").": ".intval($arFile["HEIGHT"]); } $sizes = array("b", "Kb", "Mb", "Gb"); $pos = 0; $size = $arFile["FILE_SIZE"]; while($size >= 1024) { $size /= 1024; $pos++; } $strReturn .= "
 ".GetMessage("MAIN_WIZARD_FILE_SIZE").": ".round($size, 2)." ".$sizes[$pos]; } $strReturn .= '
'; $strReturn .= ''; $strReturn .= ''; } } return $strReturn; }