本文整理汇总了PHP中CFileInput::ShowMultiple方法的典型用法代码示例。如果您正苦于以下问题:PHP CFileInput::ShowMultiple方法的具体用法?PHP CFileInput::ShowMultiple怎么用?PHP CFileInput::ShowMultiple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileInput
的用法示例。
在下文中一共展示了CFileInput::ShowMultiple方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetPropertyFieldHtmlMulty
public function GetPropertyFieldHtmlMulty($arProperty, $arValues, $strHTMLControlName)
{
if ($strHTMLControlName["MODE"] == "FORM_FILL" && CModule::IncludeModule('fileman')) {
$inputName = array();
$description = array();
foreach ($arValues as $intPropertyValueID => $arOneValue) {
$key = $strHTMLControlName["VALUE"] . "[" . $intPropertyValueID . "]";
$inputName[$key . "[VALUE]"] = $arOneValue["VALUE"];
$description[$key . "[DESCRIPTION]"] = $arOneValue["DESCRIPTION"];
}
return CFileInput::ShowMultiple($inputName, $strHTMLControlName["VALUE"] . "[n#IND#][VALUE]", array("PATH" => "Y", "IMAGE" => "N", "MAX_SIZE" => array("W" => COption::GetOptionString("iblock", "detail_image_size"), "H" => COption::GetOptionString("iblock", "detail_image_size"))), false, array('upload' => false, 'medialib' => true, 'file_dialog' => true, 'cloud' => true, 'del' => true, 'description' => $arProperty["WITH_DESCRIPTION"] == "Y" ? array("VALUES" => $description, 'NAME_TEMPLATE' => $strHTMLControlName["VALUE"] . "[n#IND#][DESCRIPTION]") : false));
} else {
$table_id = md5($strHTMLControlName["VALUE"]);
$return = '<table id="tb' . $table_id . '" border=0 cellpadding=0 cellspacing=0>';
foreach ($arValues as $intPropertyValueID => $arOneValue) {
$return .= '<tr><td>';
$return .= '<input type="text" name="' . htmlspecialcharsbx($strHTMLControlName["VALUE"] . "[{$intPropertyValueID}][VALUE]") . '" size="' . $arProperty["COL_COUNT"] . '" value="' . htmlspecialcharsEx($arOneValue["VALUE"]) . '">';
if ($arProperty["WITH_DESCRIPTION"] == "Y" && '' != trim($strHTMLControlName["DESCRIPTION"])) {
$return .= ' <span title="' . GetMessage("IBLOCK_PROP_FILEMAN_DESCRIPTION_TITLE") . '">' . GetMessage("IBLOCK_PROP_FILEMAN_DESCRIPTION_LABEL") . ':<input name="' . htmlspecialcharsEx($strHTMLControlName["DESCRIPTION"] . "[{$intPropertyValueID}][DESCRIPTION]") . '" value="' . htmlspecialcharsEx($arOneValue["DESCRIPTION"]) . '" size="18" type="text"></span>';
}
$return .= '</td></tr>';
}
$return .= '<tr><td>';
$return .= '<input type="text" name="' . htmlspecialcharsbx($strHTMLControlName["VALUE"] . "[n0][VALUE]") . '" size="' . $arProperty["COL_COUNT"] . '" value="">';
if ($arProperty["WITH_DESCRIPTION"] == "Y" && '' != trim($strHTMLControlName["DESCRIPTION"])) {
$return .= ' <span title="' . GetMessage("IBLOCK_PROP_FILEMAN_DESCRIPTION_TITLE") . '">' . GetMessage("IBLOCK_PROP_FILEMAN_DESCRIPTION_LABEL") . ':<input name="' . htmlspecialcharsEx($strHTMLControlName["DESCRIPTION"] . "[n0][DESCRIPTION]") . '" value="" size="18" type="text"></span>';
}
$return .= '</td></tr>';
$return .= '<tr><td><input type="button" value="' . GetMessage("IBLOCK_PROP_FILEMAN_ADD") . '" onClick="addNewRow(\'tb' . $table_id . '\')"></td></tr>';
return $return . '</table>';
}
}
示例2: getMultipleEditHtml
/**
* {@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;
}
示例3: array
"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,
), false, array(
'upload' => true,
'medialib' => false,
'file_dialog' => false,
'cloud' => false,
'del' => true,
'description' => $prop["WITH_DESCRIPTION"]=="Y",
)
);
}
}
else
{
$arEditHTML[] = CFileInput::Show($VALUE_NAME, $prop["VALUE"], array(
"IMAGE" => "Y",
"PATH" => "Y",
示例4: fShowFilePropertyField
function fShowFilePropertyField($name, $property_fields, $values, $max_file_size_show=50000)
{
global $crmMode;
$disableFiles = (isset($crmMode) && $crmMode);
$res = "";
if (CModule::IncludeModule('fileman'))
{
if (!is_array($values) || 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;
$res = CFileInput::Show(
$name."[".$key."]",
$file_id,
array(
"IMAGE" => "Y",
"PATH" => "Y",
"FILE_SIZE" => "Y",
"DIMENSIONS" => "Y",
"IMAGE_POPUP" => "Y",
"MAX_SIZE" => array("W" => 200, "H" => 170),
),
array(
'upload' => !$disableFiles,
'del' => !$disableFiles,
'medialib' => false,
'file_dialog' => false,
'cloud' => false,
'description' => false
)
);
}
}
else
{
$inputName = array();
foreach($values as $key=>$val)
{
if(is_array($val))
$inputName[$name."[".$key."]"] = $val["VALUE"];
else
$inputName[$name."[".$key."]"] = $val;
}
$res = CFileInput::ShowMultiple($inputName, $name."[n#IND#]", array(
"IMAGE" => "Y",
"PATH" => "Y",
"FILE_SIZE" => "Y",
"DIMENSIONS" => "Y",
"IMAGE_POPUP" => "Y",
"MAX_SIZE" => array("W" => 200, "H" => 170),
), false, array(
'upload' => !$disableFiles,
'del' => !$disableFiles,
'medialib' => false,
'file_dialog' => false,
'cloud' => false,
'description' => false
));
}
}
return $res;
}
示例5: empty
<tr class="hidden-when-show-template-list" <?php
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");
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>
<?php
} elseif ($step == 'chain_send_type') {
?>
<table class="adm-detail-content-table edit-table">
<tr>
<td colspan="2">
<p class="adm-white-container-p"><?php
echo GetMessage("sender_chain_edit_field_send_type_desc");
?>
</p>
</td>
示例6: _ShowFilePropertyField
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 ($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"));
}
}
}
示例7: _ShowFilePropertyField
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"));
}
}
}
}
示例8: _ShowFilePropertyField
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",
//.........这里部分代码省略.........