/**
     * {@inheritdoc}
     */
    protected function getMultipleEditHtml()
    {
        $inputHidden = array();
        $inputName = array();
        if (!empty($this->data['ID'])) {
            $entityName = $this->entityName;
            $rsEntityData = $entityName::getList(array('select' => array('REFERENCE_' => $this->getCode() . '.*'), 'filter' => array('=ID' => $this->data['ID'])));
            while ($referenceData = $rsEntityData->fetch()) {
                $inputName[$this->code . '[' . $referenceData['REFERENCE_ID'] . ']'] = $referenceData['REFERENCE_VALUE'];
                $inputHidden[$referenceData['REFERENCE_ID']] = $referenceData['REFERENCE_VALUE'];
            }
        }
        if (class_exists('\\Bitrix\\Main\\UI\\FileInput', true) && $this->getSettings('IMAGE') === true) {
            $html = \Bitrix\Main\UI\FileInput::createInstance(array('name' => $this->code . '[n#IND#]', 'description' => $this->getSettings('DESCRIPTION_FIELD'), 'upload' => $this->getSettings('UPLOAD'), 'allowUpload' => 'I', 'medialib' => $this->getSettings('MEDIALIB'), 'fileDialog' => $this->getSettings('FILE_DIALOG'), 'cloud' => $this->getSettings('CLOUD'), 'delete' => $this->getSettings('DELETE'), 'edit' => $this->getSettings('EDIT')))->show($inputName);
        } else {
            $html = \CFileInput::ShowMultiple($inputName, $this->code . '[n#IND#]', array('IMAGE' => $this->getSettings('IMAGE') === true ? 'Y' : 'N', 'PATH' => 'Y', 'FILE_SIZE' => 'Y', 'DIMENSIONS' => 'Y', 'IMAGE_POPUP' => 'Y'), false, array('upload' => $this->getSettings('UPLOAD'), 'medialib' => $this->getSettings('MEDIALIB'), 'file_dialog' => $this->getSettings('FILE_DIALOG'), 'cloud' => $this->getSettings('CLOUD'), 'del' => $this->getSettings('DELETE'), 'description' => $this->getSettings('DESCRIPTION_FIELD')));
        }
        foreach ($inputHidden as $key => $input) {
            if (!empty($input)) {
                $html .= '<input type="hidden" name="' . $this->code . '[' . $key . '][ID]" value=' . $key . '>
					<input type="hidden" name="' . $this->code . '[' . $key . '][VALUE]" value=' . $input . '>';
            }
        }
        return $html;
    }
Ejemplo n.º 2
0
				elseif($prop['PROPERTY_TYPE']=='F' && ($last_property_id != $prop["ID"]))
				{
					if($prop['MULTIPLE'] == "Y")
					{
						$inputName = array();
						foreach($arProperties[$prop["ID"]] as $g_prop)
						{
							$inputName['FIELDS['.$f_TYPE.$f_ID.'][PROPERTY_'.$prop['ID'].']['.$g_prop['PROPERTY_VALUE_ID'].'][VALUE]'] = $g_prop["VALUE"];
						}
						if (class_exists('\Bitrix\Main\UI\FileInput', true))
						{
							$arEditHTML[] = \Bitrix\Main\UI\FileInput::createInstance(array(
									"name" => 'FIELDS['.$f_TYPE.$f_ID.'][PROPERTY_'.$prop['ID'].'][n#IND#]',
									"description" => $prop["WITH_DESCRIPTION"]=="Y",
									"upload" => true,
									"medialib" => false,
									"fileDialog" => false,
									"cloud" => false,
									"delete" => true,
								))->show($inputName);
						}
						else
						{
							$arEditHTML[] = CFileInput::ShowMultiple($inputName, 'FIELDS['.$f_TYPE.$f_ID.'][PROPERTY_'.$prop['ID'].'][n#IND#]', array(
								"IMAGE" => "Y",
								"PATH" => "Y",
								"FILE_SIZE" => "Y",
								"DIMENSIONS" => "Y",
								"IMAGE_POPUP" => "Y",
								"MAX_SIZE" => $maxImageSize,
								"MIN_SIZE" => $minImageSize,
Ejemplo n.º 3
0
    echo empty($str_MESSAGE) ? 'style="display: none;"' : '';
    ?>
>
				<td class="adm-detail-valign-top"><?php 
    echo GetMessage("sender_chain_edit_field_attachment");
    ?>
:</td>
				<td>
					<?php 
    $arInputControlValues = array();
    foreach ($arMailngChainAttachment as $arFile) {
        $arInputControlValues["FILES[" . $arFile["ID"] . "]"] = $arFile["ID"];
    }
    \Bitrix\Main\Loader::includeModule("fileman");
    if (class_exists('\\Bitrix\\Main\\UI\\FileInput', true)) {
        echo \Bitrix\Main\UI\FileInput::createInstance(array("name" => "NEW_FILE[n#IND#]", "upload" => true, "medialib" => true, "fileDialog" => true, "cloud" => true))->show($arInputControlValues);
    } else {
        echo CFileInput::ShowMultiple($arInputControlValues, "NEW_FILE[n#IND#]", array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y"), false, array('upload' => true, 'medialib' => true, 'file_dialog' => true, 'cloud' => true, 'del' => true, 'description' => false));
    }
    ?>
				</td>
			</tr>

		</table>
		<script>
			BX.message({"SENDER_SHOW_TEMPLATE_LIST" : "<?php 
    echo GetMessage('SENDER_SHOW_TEMPLATE_LIST');
    ?>
"});

				function ShowTemplateListL(bShow)
Ejemplo n.º 4
0
    echo $tabControl->GetCustomLabelHTML();
    ?>
:</td>
		<td width="60%">
			<?php 
    if ($historyId > 0) {
        ?>
				<?php 
        echo CFileInput::Show("SUB_DETAIL_PICTURE", $str_DETAIL_PICTURE, array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => array("W" => COption::GetOptionString("iblock", "detail_image_size"), "H" => COption::GetOptionString("iblock", "detail_image_size"))));
        ?>
			<?php 
    } else {
        ?>
				<?php 
        if (class_exists('\\Bitrix\\Main\\UI\\FileInput', true)) {
            echo \Bitrix\Main\UI\FileInput::createInstance(array("name" => "SUB_DETAIL_PICTURE", "description" => true, "upload" => true, "allowUpload" => "I", "medialib" => true, "fileDialog" => true, "cloud" => true, "delete" => true, "maxCount" => 1))->show($str_DETAIL_PICTURE);
        } else {
            ?>
					<?php 
            echo CFileInput::Show("SUB_DETAIL_PICTURE", $ID > 0 && !$bSubCopy ? $str_DETAIL_PICTURE : 0, array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => array("W" => COption::GetOptionString("iblock", "detail_image_size"), "H" => COption::GetOptionString("iblock", "detail_image_size"))), array('upload' => true, 'medialib' => true, 'file_dialog' => true, 'cloud' => true, 'del' => true, 'description' => true));
        }
        ?>
			<?php 
    }
    ?>
		</td>
	</tr>
<?php 
    $tabControl->EndCustomField("SUB_DETAIL_PICTURE", "");
    $tabControl->BeginCustomField("SUB_DETAIL_TEXT", GetMessage("IBLOCK_FIELD_DETAIL_TEXT"), $arIBlock["FIELDS"]["DETAIL_TEXT"]["IS_REQUIRED"] === "Y");
    ?>
Ejemplo n.º 5
0
    echo GetMessage("ADV_FLASH_IMAGE");
    ?>
</td>
		<td><?php 
    if ($bCopy) {
        ?>
				<input type="hidden" name="FLASH_IMAGE" value="<?php 
        echo $str_FLASH_IMAGE;
        ?>
">
			<?php 
    }
    ?>
			<?php 
    if (class_exists('\\Bitrix\\Main\\UI\\FileInput', true)) {
        echo \Bitrix\Main\UI\FileInput::createInstance(array("name" => "FLASH_IMAGE", "description" => false, "allowUpload" => "I", "upload" => true, "medialib" => true, "fileDialog" => true, "cloud" => true, "delete" => true, "maxCount" => 1))->show($str_FLASH_IMAGE);
    } else {
        echo CFileInput::Show("FLASH_IMAGE", $str_FLASH_IMAGE, array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y"), array('upload' => true, 'medialib' => true, 'file_dialog' => true, 'cloud' => true, 'del' => true, 'description' => false));
    }
    ?>
		</td>
	</tr>
	<tr id="eFlashUrl" style="display: none;">
		<td><?php 
    echo GetMessage("ADV_BANNER_NO_LINK");
    ?>
:<?php 
    if ($isEditMode) {
        ?>
<span class="required"><sup>1</sup></span><?php 
    }
Ejemplo n.º 6
0
function _ShowFilePropertyField($name, $property_fields, $values, $max_file_size_show = 50000, $bVarsFromForm = false)
{
    global $bCopy, $historyId;
    static $maxSize = array();
    if (empty($maxSize)) {
        $detailImageSize = (int) Main\Config\Option::get('iblock', 'detail_image_size');
        $maxSize = array('W' => $detailImageSize, 'H' => $detailImageSize);
        unset($detailImageSize);
    }
    CModule::IncludeModule('fileman');
    $bVarsFromForm = false;
    if (empty($values) || $bCopy || !is_array($values)) {
        $values = array("n0" => 0);
    }
    if ($property_fields["MULTIPLE"] == "N") {
        foreach ($values as $key => $val) {
            if (is_array($val)) {
                $file_id = $val["VALUE"];
            } else {
                $file_id = $val;
            }
            if ($historyId > 0) {
                echo CFileInput::Show($name . "[" . $key . "]", $file_id, array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => $maxSize));
            } else {
                echo CFileInput::Show($name . "[" . $key . "]", $file_id, array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => $maxSize), array('upload' => true, 'medialib' => true, 'file_dialog' => true, 'cloud' => true, 'del' => true, 'description' => $property_fields["WITH_DESCRIPTION"] == "Y"));
            }
            break;
        }
    } else {
        $inputName = array();
        foreach ($values as $key => $val) {
            if (is_array($val)) {
                $inputName[$name . "[" . $key . "]"] = $val["VALUE"];
            } else {
                $inputName[$name . "[" . $key . "]"] = $val;
            }
        }
        if (class_exists('\\Bitrix\\Main\\UI\\FileInput', true)) {
            echo \Bitrix\Main\UI\FileInput::createInstance(array("name" => $name . "[n#IND#]", "id" => $name . "[n#IND#]_" . mt_rand(1, 1000000), "description" => $property_fields["WITH_DESCRIPTION"] == "Y", "allowUpload" => "F", "allowUploadExt" => $property_fields["FILE_TYPE"]) + ($historyId > 0 ? array("delete" => false, "edit" => false) : array("upload" => true, "medialib" => true, "fileDialog" => true, "cloud" => true)))->show($inputName);
        } else {
            if ($historyId > 0) {
                echo CFileInput::ShowMultiple($inputName, $name . "[n#IND#]", array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => $maxSize), false);
            } else {
                echo CFileInput::ShowMultiple($inputName, $name . "[n#IND#]", array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => $maxSize), false, array('upload' => true, 'medialib' => true, 'file_dialog' => true, 'cloud' => true, 'del' => true, 'description' => $property_fields["WITH_DESCRIPTION"] == "Y"));
            }
        }
    }
}
Ejemplo n.º 7
0
function _ShowFilePropertyField($name, $property_fields, $values, $max_file_size_show=50000, $bVarsFromForm = false)
{
	global $bCopy, $historyId;

	CModule::IncludeModule('fileman');
	$bVarsFromForm = false;

	if(!is_array($values) || $bCopy || empty($values))
	{
		$values = array(
			"n0" => 0,
		);
	}

	if($property_fields["MULTIPLE"] == "N")
	{
		foreach($values as $key => $val)
		{
			if(is_array($val))
				$file_id = $val["VALUE"];
			else
				$file_id = $val;

			if($historyId > 0)
				echo CFileInput::Show($name."[".$key."]", $file_id, array(
					"IMAGE" => "Y",
					"PATH" => "Y",
					"FILE_SIZE" => "Y",
					"DIMENSIONS" => "Y",
					"IMAGE_POPUP" => "Y",
					"MAX_SIZE" => array(
						"W" => COption::GetOptionString("iblock", "detail_image_size"),
						"H" => COption::GetOptionString("iblock", "detail_image_size"),
					),
				));
			else
				echo CFileInput::Show($name."[".$key."]", $file_id, array(
					"IMAGE" => "Y",
					"PATH" => "Y",
					"FILE_SIZE" => "Y",
					"DIMENSIONS" => "Y",
					"IMAGE_POPUP" => "Y",
					"MAX_SIZE" => array(
						"W" => COption::GetOptionString("iblock", "detail_image_size"),
						"H" => COption::GetOptionString("iblock", "detail_image_size"),
					),
				), array(
					'upload' => true,
					'medialib' => true,
					'file_dialog' => true,
					'cloud' => true,
					'del' => true,
					'description' => $property_fields["WITH_DESCRIPTION"]=="Y",
				));
			break;
		}
	}
	else
	{
		$inputName = array();
		foreach($values as $key=>$val)
		{
			if(is_array($val))
				$inputName[$name."[".$key."]"] = $val["VALUE"];
			else
				$inputName[$name."[".$key."]"] = $val;
		}

		if (class_exists('\Bitrix\Main\UI\FileInput', true))
		{
			echo \Bitrix\Main\UI\FileInput::createInstance((
				array(
					"name" => $name."[n#IND#]",
					"description" => $property_fields["WITH_DESCRIPTION"]=="Y"
				) + ($historyId > 0 ? array(
					"delete" => false,
					"edit" => false
				) : array(
					"upload" => true,
					"medialib" => true,
					"fileDialog" => true,
					"cloud" => true
				))
			))->show($inputName);
		}
		else if($historyId > 0)
			echo CFileInput::ShowMultiple($inputName, $name."[n#IND#]", array(
				"IMAGE" => "Y",
				"PATH" => "Y",
				"FILE_SIZE" => "Y",
				"DIMENSIONS" => "Y",
				"IMAGE_POPUP" => "Y",
				"MAX_SIZE" => array(
					"W" => COption::GetOptionString("iblock", "detail_image_size"),
					"H" => COption::GetOptionString("iblock", "detail_image_size"),
				),
			), false);
		else
			echo CFileInput::ShowMultiple($inputName, $name."[n#IND#]", array(
				"IMAGE" => "Y",
				"PATH" => "Y",
				"FILE_SIZE" => "Y",
				"DIMENSIONS" => "Y",
				"IMAGE_POPUP" => "Y",
				"MAX_SIZE" => array(
					"W" => COption::GetOptionString("iblock", "detail_image_size"),
					"H" => COption::GetOptionString("iblock", "detail_image_size"),
				),
			), false, array(
				'upload' => true,
				'medialib' => true,
				'file_dialog' => true,
				'cloud' => true,
				'del' => true,
				'description' => $property_fields["WITH_DESCRIPTION"]=="Y",
			));
	}
}
Ejemplo n.º 8
0
    echo $tabControl->GetCustomLabelHTML();
    ?>
:</td>
		<td width="60%">
			<?php 
    if ($historyId > 0) {
        ?>
				<?php 
        echo CFileInput::Show("SUB_DETAIL_PICTURE", $str_DETAIL_PICTURE, array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => array("W" => COption::GetOptionString("iblock", "detail_image_size"), "H" => COption::GetOptionString("iblock", "detail_image_size"))));
        ?>
			<?php 
    } else {
        ?>
				<?php 
        if (class_exists('\\Bitrix\\Main\\UI\\FileInput', true)) {
            echo \Bitrix\Main\UI\FileInput::createInstance(array("name" => "SUB_DETAIL_PICTURE", "id" => "SUB_DETAIL_PICTURE_" . mt_rand(1, 1000000), "description" => true, "upload" => true, "allowUpload" => "I", "medialib" => true, "fileDialog" => true, "cloud" => true, "delete" => true, "maxCount" => 1))->show($ID > 0 && !$bSubCopy ? $str_DETAIL_PICTURE : 0);
        } else {
            ?>
					<?php 
            echo CFileInput::Show("SUB_DETAIL_PICTURE", $ID > 0 && !$bSubCopy ? $str_DETAIL_PICTURE : 0, array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => array("W" => COption::GetOptionString("iblock", "detail_image_size"), "H" => COption::GetOptionString("iblock", "detail_image_size"))), array('upload' => true, 'medialib' => true, 'file_dialog' => true, 'cloud' => true, 'del' => true, 'description' => true));
        }
        ?>
			<?php 
    }
    ?>
		</td>
	</tr>
<?php 
    $tabControl->EndCustomField("SUB_DETAIL_PICTURE", "");
    $tabControl->BeginCustomField("SUB_DETAIL_TEXT", GetMessage("IBLOCK_FIELD_DETAIL_TEXT"), $arIBlock["FIELDS"]["DETAIL_TEXT"]["IS_REQUIRED"] === "Y");
    ?>