Esempio n. 1
0
	/**
	 * Получает все изображения коллекции медиабиблиотеки
	 * @param $medialibraryCollectionId
	 * @return array
	 */
	public function getImagesFromMedialibraryCollection($medialibraryCollectionId)
	{		
		$images = array();
		
		CMedialib::Init(); //Классы медиабиблиотеки недоступны до ее инициализации
		
		$items = CMedialibItem::GetList(array(
			'arCollections' => array(
				$medialibraryCollectionId,
			)
		));

		/**
		 * В CMedialibItem::GetList нет возможности фильтрации по типу элемента коллекции, 
		 * поэтому придется выбрать изображения вручную
		 */
		foreach ($items as $item)
		{
			if ($item['TYPE'] === 'image')
			{
				$image = array(
					'HEIGHT' => $item['HEIGHT'],
					'WIDTH' => $item['WIDTH'],
					'PATH' => $item['PATH'],
					'THUMB_PATH' => $item['THUMB_PATH'],
					'DESCRIPTION' => $item['DESCRIPTION'],
				);
				$images[] = $image;
			}
		}
		
		return $images;
	}
 function onBeforeUpload(&$package, $upload, $post, $files, &$error)
 {
     $post["collectionId"] = intval($post['collection_id']);
     $this->post = $post;
     if ($post["collectionId"] <= 0) {
         $error = "Bad collection";
         return false;
     } else {
         if (!CMedialib::CanDoOperation("medialib_new_item", $post["collectionId"])) {
             $error = "Access denied";
             return false;
         }
     }
     $package["collectionId"] = $post["collectionId"];
     $package["ml_type"] = $post["ml_type"];
     return true;
 }
Esempio n. 3
0
		alert("<?php 
echo GetMessage('FM_ML_UPL_ACCESS_DENIED');
?>
");
}

<?
$strFileMask = '';
$arExt = CMedialib::GetMediaExtentions(false);
for ($i = 0, $l = count($arExt); $i < $l; $i++)
	$strFileMask .= '*.'.CUtil::JSEscape(strtolower($arExt[$i])).';';
$strFileMask = trim($strFileMask, ' ;');

$str = '';
foreach ($res['Collections'] as $id => $col)
	$str .= $col['ID'].': "'.CMedialib::CanDoOperation('medialib_new_item', $col['ID']).'",';

$arCookie = array();
foreach ($_COOKIE as $key => $val)
	$arCookie[] = $key."=".$val."; ";

?>
window.oColAccess = {<?php 
echo trim($str, ', ');
?>
};

//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("ImageUploaderML", 700, 600);
iu.activeXControlCodeBase = "<?php 
echo $arAppletVersion["activeXControlCodeBase"];
Esempio n. 4
0
            if (isset($_REQUEST['admin_mnu_menu_id'])) {
                if ($_REQUEST['admin_mnu_menu_id'] == "menu_fileman_file_" . $site_id . "_") {
                    $sShowOnly = "";
                } elseif (substr($_REQUEST['admin_mnu_menu_id'], 0, strlen("menu_fileman_file_" . $site_id . "_")) == "menu_fileman_file_" . $site_id . "_") {
                    $sShowOnly = substr($_REQUEST['admin_mnu_menu_id'], strlen("menu_fileman_file_" . $site_id . "_"));
                }
            } elseif (isset($_REQUEST['path'])) {
                $sShowOnly = rtrim($_REQUEST['path'], "/");
                $bFullList = true;
            }
            $aMenu["items"][] = array("text" => GetMessage("FILEMAN_MNU_F_AND_F"), "url" => "fileman_admin.php?lang=" . LANG . '&' . $addUrl, "dynamic" => true, "items_id" => "menu_fileman_file_" . $site_id . "_", "module_id" => "fileman", "more_url" => array("fileman_admin.php?lang=" . LANG, "fileman_admin.php?lang=" . LANG . "&" . $addUrl, "fileman_access.php?" . $addUrl, "fileman_admin.php?" . $addUrl, "fileman_file_download.php?" . $addUrl, "fileman_file_edit.php?" . $addUrl, "fileman_html_edit.php?" . $addUrl, "fileman_file_upload.php?" . $addUrl, "fileman_file_view.php?" . $addUrl, "fileman_folder.php?" . $addUrl, "fileman_menu_edit.php?" . $addUrl, "fileman_newfolder.php?" . $addUrl), "title" => GetMessage("FILEMAN_MNU_F_AND_F_TITLE"), "items" => $sShowOnly !== false ? __fileman_mnu_gen(false, $bFullList, $site_id, "", $sShowOnly, array(), false, $arSitesDR_) : array());
        }
    }
}
if (COption::GetOptionString('fileman', "use_medialib", "Y") != "N" && CModule::IncludeModule("fileman") && CMedialib::CanDoOperation('medialib_view_collection', 0, false, true)) {
    if (!is_array($aMenu)) {
        $aMenu = array("parent_menu" => "global_menu_content", "section" => "fileman", "sort" => 100, "text" => GetMessage("FM_MENU_TITLE"), "title" => GetMessage("FM_MENU_DESC"), "url" => "", "icon" => "fileman_menu_icon", "page_icon" => "fileman_page_icon", "items_id" => "menu_fileman", "more_url" => array("fileman_admin.php", "fileman_file_edit.php", "fileman_file_view.php", "fileman_folder.php", "fileman_html_edit.php", "fileman_menu_edit.php", "fileman_newfolder.php", "fileman_rename.php"), "items" => array());
    }
    $arMLTypes = CMedialib::GetTypes();
    $arItemTypes = array();
    for ($i = 0, $l = count($arMLTypes); $i < $l; $i++) {
        $arItemTypes[] = array("text" => htmlspecialcharsex($arMLTypes[$i]["name"]), "url" => "fileman_medialib_admin.php?lang=" . LANGUAGE_ID . "&type=" . $arMLTypes[$i]["id"], "dynamic" => false, "items_id" => "menu_medialib_" . $arMLTypes[$i]["code"], "module_id" => "fileman", "more_url" => array("fileman_medialib_upload.php?lang=" . LANGUAGE_ID . "&type=" . $arMLTypes[$i]["id"], "fileman_medialib_access.php?lang=" . LANGUAGE_ID . "&type=" . $arMLTypes[$i]["id"]));
    }
    $aMenu["items"][] = array("text" => GetMessage("FM_MENU_MEDIALIB"), "title" => GetMessage("FM_MENU_MEDIALIB_TITLE"), "url" => "fileman_medialib_admin.php?lang=" . LANGUAGE_ID, "dynamic" => false, "items_id" => "menu_medialib", "module_id" => "fileman", "more_url" => array("fileman_medialib_upload.php", "fileman_medialib_access.php"), "items" => $arItemTypes);
}
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/classes/general/sticker.php";
if (CSticker::CanDoOperation('sticker_view')) {
    $aMenuStickers = array("parent_menu" => "global_menu_services", "section" => "stickers", "sort" => 100, "text" => GetMessage("FMST_STICKERS"), "title" => GetMessage("FMST_STICKERS_TITLE"), "url" => "fileman_stickers_admin.php?lang=" . LANG, "icon" => "fileman_sticker_icon", "page_icon" => "fileman_sticker_icon_sections", "items_id" => "menu_stickers", "more_url" => array("fileman_stickers_admin.php"), "items" => array());
    $aMenu = array($aMenu, $aMenuStickers);
}
return $aMenu;
				<td>
					<a id="action_delete_button" class="context-button icon ma-but-delete" title="<?php 
    echo GetMessage('ML_DELETE');
    ?>
" onclick="" hidefocus="true" href="javascript:void(0);"><?php 
    echo GetMessage('ML_DELETE');
    ?>
</a>
				</td>
				</tr>
			</table>
		</td>
		<td class="right"><div class="empty"/></td>
	</tr>
	<tr class="bottom"><td class="left"><div class="empty"/></td><td><div class="empty"/></td><td class="right"><div class="empty"/></td></tr>
</table>
<?php 
}
?>

<div class="bxml-subdialog-cont">
<?php 
CMedialib::BuildAddCollectionDialog($Params);
CMedialib::BuildAddItemDialog($Params);
CMedialib::BuildConfirmDialog($Params);
CMedialib::BuildViewItemDialog($Params);
CMedialib::BuildChangeType($Params);
?>
</div>
<?php 
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
Esempio n. 6
0
	function BuildSceleton($display = true)
	{
		$width = isset($this->jsConfig['width']) && intval($this->jsConfig['width']) > 0 ? $this->jsConfig['width'] : "100%";
		$height = isset($this->jsConfig['height']) && intval($this->jsConfig['height']) > 0 ? $this->jsConfig['height'] : "100%";

		$widthUnit = strpos($width, "%") === false ? "px" : "%";
		$heightUnit = strpos($height, "%") === false ? "px" : "%";
		$width = intval($width);
		$height = intval($height);

		?>
		<div class="bx-html-editor" id="bx-html-editor-<?php 
echo $this->id;
?>
" style="width:<?php 
echo $width . $widthUnit;
?>
; height:<?php 
echo $height . $heightUnit;
?>
; <?php 
echo $display ? '' : 'display: none;';
?>
">
			<div class="bxhtmled-toolbar-cnt" id="bx-html-editor-tlbr-cnt-<?php 
echo $this->id;
?>
">
				<div class="bxhtmled-toolbar" id="bx-html-editor-tlbr-<?php 
echo $this->id;
?>
"></div>
			</div>
			<div class="bxhtmled-search-cnt" id="bx-html-editor-search-cnt-<?php 
echo $this->id;
?>
" style="display: none;"></div>
			<div class="bxhtmled-area-cnt" id="bx-html-editor-area-cnt-<?php 
echo $this->id;
?>
">
				<div class="bxhtmled-iframe-cnt" id="bx-html-editor-iframe-cnt-<?php 
echo $this->id;
?>
"></div>
				<div class="bxhtmled-textarea-cnt" id="bx-html-editor-ta-cnt-<?php 
echo $this->id;
?>
"></div>
				<div class="bxhtmled-resizer-overlay" id="bx-html-editor-res-over-<?php 
echo $this->id;
?>
"></div>
				<div id="bx-html-editor-split-resizer-<?php 
echo $this->id;
?>
"></div>
			</div>
			<div class="bxhtmled-nav-cnt" id="bx-html-editor-nav-cnt-<?php 
echo $this->id;
?>
" style="display: none;"></div>
			<div class="bxhtmled-taskbar-cnt bxhtmled-taskbar-hidden" id="bx-html-editor-tskbr-cnt-<?php 
echo $this->id;
?>
">
				<div class="bxhtmled-taskbar-top-cnt" id="bx-html-editor-tskbr-top-<?php 
echo $this->id;
?>
"></div>
				<div class="bxhtmled-taskbar-resizer" id="bx-html-editor-tskbr-res-<?php 
echo $this->id;
?>
">
					<div class="bxhtmled-right-side-split-border">
						<div data-bx-tsk-split-but="Y" class="bxhtmled-right-side-split-btn"></div>
					</div>
				</div>
				<div class="bxhtmled-taskbar-search-nothing" id="bxhed-tskbr-search-nothing-<?php 
echo $this->id;
?>
"><?php 
echo GetMessage('HTMLED_SEARCH_NOTHING');
?>
</div>
				<div class="bxhtmled-taskbar-search-cont" id="bxhed-tskbr-search-cnt-<?php 
echo $this->id;
?>
" data-bx-type="taskbar_search">
					<div class="bxhtmled-search-alignment" id="bxhed-tskbr-search-ali-<?php 
echo $this->id;
?>
">
						<input type="text" class="bxhtmled-search-inp" id="bxhed-tskbr-search-inp-<?php 
echo $this->id;
?>
" placeholder="<?php 
echo GetMessage('HTMLED_SEARCH_PLACEHOLDER');
?>
"/>
					</div>
					<div class="bxhtmled-search-cancel" data-bx-type="taskbar_search_cancel" title="<?php 
echo GetMessage('HTMLED_SEARCH_CANCEL');
?>
"></div>
				</div>
			</div>
		</div>
		<div style="display: none;">
			<?
			CAdminFileDialog::ShowScript(Array
				(
					"event" => "BxOpenFileBrowserWindFile".$this->id,
					"arResultDest" => Array("FUNCTION_NAME" => "OnFileDialogSelect".$this->id),
					"arPath" => Array("SITE" => SITE_ID),
					"select" => 'F',
					"operation" => 'O',
					"showUploadTab" => true,
					"showAddToMenuTab" => false,
					"fileFilter" => '',
					"allowAllFiles" => true,
					"SaveConfig" => true
				)
			);

			CAdminFileDialog::ShowScript(Array
				(
					"event" => "BxOpenFileBrowserImgFile".$this->id,
					"arResultDest" => Array("FUNCTION_NAME" => "OnFileDialogImgSelect".$this->id),
					//"arPath" => Array("SITE" => $_GET["site"], "PATH" =>(strlen($str_FILENAME) > 0 ? GetDirPath($str_FILENAME) : '')),
					"select" => 'F',
					"operation" => 'O',
					"showUploadTab" => true,
					"showAddToMenuTab" => false,
					"fileFilter" => 'image',
					"allowAllFiles" => true,
					"SaveConfig" => true
				)
			);

			CMedialib::ShowBrowseButton(
				array(
					'value' => '...',
					'event' => "BxOpenFileBrowserImgFile".$this->id,
					'button_id' => "bx-open-file-medialib-but-".$this->id,
					'id' => "bx_open_file_medialib_button_".$this->id,
					'MedialibConfig' => array(
						"event" => "BxOpenFileBrowserImgFileMl".$this->id,
						"arResultDest" => Array("FUNCTION_NAME" => "OnFileDialogImgSelect".$this->id),
						"types" => array('image')
					)
				)
			);
			?>
		</div>
	<?
	}
Esempio n. 7
0
 public static function Delete($ID, $bCurrent, $colId)
 {
     global $DB;
     if ($bCurrent) {
         if (!CMedialib::CanDoOperation('medialib_del_item', $colId)) {
             return false;
         }
         $strSql = "DELETE FROM b_medialib_collection_item WHERE ITEM_ID=" . IntVal($ID) . " AND COLLECTION_ID=" . IntVal($colId);
         $z = $DB->Query($strSql, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
     } else {
         $arCols = CMedialibItem::GetItemCollections(array('ID' => $ID));
         for ($i = 0, $l = count($arCols); $i < $l; $i++) {
             if (!CMedialib::CanDoOperation('medialib_del_item', $arCols[$i])) {
                 // Check access
                 return false;
             }
         }
         $strSql = "DELETE FROM b_medialib_collection_item WHERE ITEM_ID=" . IntVal($ID);
         $z = $DB->Query($strSql, false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
     }
     CMedialibItem::DeleteEmpty();
     return $z;
 }
Esempio n. 8
0
				'NAME'
			),
			false
		);

		while($iblockSectionInfo = $dbIblockSections->GetNext())
		{
			$availableSources[$iblockSectionInfo['ID']] = $iblockSectionInfo['NAME'];
		}
	}
}
elseif ($arCurrentValues['SOURCE_TYPE'] === CFotoramaComponent::SOURCE_TYPE_MEDIALIBRARY_COLLECTION && isset($sourceTypes[CFotoramaComponent::SOURCE_TYPE_MEDIALIBRARY_COLLECTION]))
{
	$sourceIdParameterName = GetMessage('MEDIALIBRARY_COLLECTION');

	CMedialib::Init(); //Классы медиабиблиотеки недоступны до ее инициализации

	//CMedialibCollection::GetList возвращает сразу массив с информацией о коллекциях 
	$medialibraryCollections = CMedialibCollection::GetList(
		array(
			'arFilter' => array(
				'ACTIVE' => 'Y'
			)
		)
	);

	foreach($medialibraryCollections as $medialibraryCollection)
	{
		$collectionId = $medialibraryCollection['ID'];
		$collectionName = $medialibraryCollection['NAME'];
		$availableSources[$collectionId] = $collectionName;
Esempio n. 9
0
 class="bx-ml-hidden-row">
		<td><label for="medialib_use_default"><?php 
echo GetMessage("FILEMAN_MEDIA_USE_DEF");
?>
:</label></td>
		<td><input type="checkbox" value="Y" <?php 
if (COption::GetOptionString($module_id, "ml_use_default", true)) {
    echo " checked";
}
?>
 id="medialib_use_default" name="medialib_use_default"/></td>
	</tr>

<?php 
CMedialib::Init();
$arMLTypes = CMedialib::GetTypes(array(), true);
$maxCount = 0;
?>
	<tr class="heading bx-ml-hidden-row" <?php 
echo $displ;
?>
>
		<td colspan=2><?php 
echo GetMessage("FILEMAN_SEC_MEDIALIB_TYPES");
?>
</td>
	</tr>
	<tr <?php 
echo $displ;
?>
 class="bx-ml-hidden-row"><td colspan="2" align="center">
Esempio n. 10
0
elseif ($action == 'multi_del')
{
	CMedialib::MultiActionDelete(array(
		'Items' => $_POST['items'],
		'Cols' => $_POST['cols']
	));
}
elseif ($action == 'search')
{
	CMedialib::SearchItems(array(
		'query' => $APPLICATION->UnJSEscape($_POST['q']),
		'types' => $_POST['types']
	));
}
elseif ($action == 'get_item_view')
{
	CMedialib::GetItemViewHTML(intVal($_POST['id']));
}
elseif ($action == 'change_col_type')
{
	CMedialib::ChangeColType(array(
		'col' => intVal($_POST['col']),
		'type' => intVal($_POST['type']),
		'parent' => intVal($_POST['parent']),
		'childCols' => $_POST['children']
	));
}

require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_after.php");
?>
Esempio n. 11
0
function __CanDoAccess($colId)
{
    return CMedialib::CanDoOperation('medialib_view_collection', $colId) && CMedialib::CanDoOperation('medialib_access', $colId);
}
	public static function DisplayFileDialogsScripts()
	{
		for($i = 0, $l = count(self::$fileDialogs); $i < $l; $i++)
		{
			$fd = self::$fileDialogs[$i];
			if ($fd['USE_ML'])
			{
				$MLRes = CMedialib::ShowBrowseButton(
					array(
						'mode' => $fd['ONLY_ML'] ? 'medialib' : 'select',
						'value' => '...',
						'event' => "BX_FD_".$fd['NAME'],
						'id' => "bx_fd_input_".strtolower($fd['NAME']),
						'MedialibConfig' => array(
							"event" => "bx_ml_event_".$fd['NAME'],
							"arResultDest" => Array("FUNCTION_NAME" => "BX_FD_ONRESULT_".$fd['NAME']),
							"types" => $fd['ML_TYPES']
						),
						'bReturnResult' => true
					)
				);
				?><script>window._bxMlBrowseButton_<?php 
echo strtolower($fd['NAME']);
?>
 = '<?php 
echo CUtil::JSEscape($MLRes);
?>
';</script><?
			}

			CAdminFileDialog::ShowScript(Array
			(
				"event" => "BX_FD_".$fd['NAME'],
				"arResultDest" => Array("FUNCTION_NAME" => "BX_FD_ONRESULT_".$fd['NAME']),
				"arPath" => Array(),
				"select" => $fd['TARGET'], // F - file only, D - folder only, DF - files & dirs
				"operation" => 'O',
				"showUploadTab" => $fd['UPLOAD'],
				"showAddToMenuTab" => false,
				"fileFilter" => $fd['EXT'],
				"allowAllFiles" => true,
				"SaveConfig" => true
			));
		}
	}
Esempio n. 13
0
 private function getExtDialogs()
 {
     if ($this->uploadSetts["medialib"] && Loader::includeModule("fileman")) {
         $this->uploadSetts["medialib"] = array("click" => "OpenMedialibDialog" . $this->id, "handler" => "SetValueFromMedialib" . $this->id);
         \CMedialib::ShowDialogScript(array("event" => $this->uploadSetts["medialib"]["click"], "arResultDest" => array("FUNCTION_NAME" => $this->uploadSetts["medialib"]["handler"])));
     }
     if ($this->uploadSetts["fileDialog"]) {
         $this->uploadSetts["fileDialog"] = array("click" => "OpenFileDialog" . $this->id, "handler" => "SetValueFromFileDialog" . $this->id);
         \CAdminFileDialog::ShowScript(array("event" => $this->uploadSetts["fileDialog"]["click"], "arResultDest" => array("FUNCTION_NAME" => $this->uploadSetts["fileDialog"]["handler"]), "arPath" => array("SITE" => SITE_ID, "PATH" => "/upload"), "select" => 'F', "operation" => 'O', "showUploadTab" => true, "allowAllFiles" => true, "SaveConfig" => true));
     }
 }
Esempio n. 14
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("fileman")) {
    return;
}
$source_base = dirname(__FILE__);
$documentRoot = rtrim(str_replace(array("\\\\", "//", "\\"), array("\\", "/", "/"), $_SERVER["DOCUMENT_ROOT"]), "\\/");
$source_base = substr($source_base, strLen($documentRoot));
$source_base = str_replace(array("\\", "//"), "/", "/" . $source_base . "/");
__IncludeLang(dirname(__FILE__) . "/lang/" . LANGUAGE_ID . '/' . basename(__FILE__));
$arCollections = array(array('name' => GetMessage('ML_COL_NAME_0'), 'desc' => GetMessage('ML_COL_DESC_0')), array('name' => GetMessage('ML_COL_NAME_1'), 'desc' => GetMessage('ML_COL_DESC_1')), array('name' => GetMessage('ML_COL_NAME_2'), 'desc' => GetMessage('ML_COL_DESC_2'), 'ex_parent' => 0));
$arExCols = array();
for ($i = 0, $l = count($arCollections); $i < $l; $i++) {
    $arExCols[$i] = CMedialib::EditCollection(array('name' => $arCollections[$i]['name'], 'desc' => $arCollections[$i]['desc'], 'keywords' => '', 'parent' => isset($arCollections[$i]['ex_parent'], $arExCols[$arCollections[$i]['ex_parent']]) ? intVal($arExCols[$arCollections[$i]['ex_parent']]) : 0, 'type' => 0));
}
// Save elements
$arItems = array(array('fname' => 'ml01.jpg', 'name' => GetMessage('ML_IT_NAME_1'), 'ex_cols' => array(2)), array('fname' => 'ml02.jpg', 'name' => GetMessage('ML_IT_NAME_2'), 'ex_cols' => array(1)), array('fname' => 'ml03.jpg', 'name' => GetMessage('ML_IT_NAME_3'), 'ex_cols' => array(2)), array('fname' => 'ml04.jpg', 'name' => GetMessage('ML_IT_NAME_4'), 'ex_cols' => array(1)), array('fname' => 'ml05.jpg', 'name' => GetMessage('ML_IT_NAME_5'), 'ex_cols' => array(2)), array('fname' => 'ml06.jpg', 'name' => GetMessage('ML_IT_NAME_6'), 'ex_cols' => array(1, 2)), array('fname' => 'ml07.jpg', 'name' => GetMessage('ML_IT_NAME_7'), 'ex_cols' => array(1, 2)), array('fname' => 'ml08.jpg', 'name' => GetMessage('ML_IT_NAME_8'), 'ex_cols' => array(1)), array('fname' => 'ml09.jpg', 'name' => GetMessage('ML_IT_NAME_9'), 'ex_cols' => array(0, 1)), array('fname' => 'ml10.jpg', 'name' => GetMessage('ML_IT_NAME_10'), 'ex_cols' => array(0, 1)));
for ($i = 0, $l = count($arItems); $i < $l; $i++) {
    $path = $source_base . 'files/' . $arItems[$i]['fname'];
    $arCols = array();
    for ($j = 0, $n = count($arItems[$i]['ex_cols']); $j < $n; $j++) {
        $arCols[] = $arExCols[$arItems[$i]['ex_cols'][$j]];
    }
    CMedialibItem::Edit(array('path' => $path, 'arFields' => array('NAME' => $arItems[$i]['name'], 'DESCRIPTION' => '', 'KEYWORDS' => ''), 'arCollections' => $arCols));
}
function ShowFileDialogsScripts()
{
    global $arFD;
    $l = count($arFD);
    if ($l < 1) {
        return;
    }
    for ($i = 0; $i < $l; $i++) {
        if ($arFD[$i]['USE_ML']) {
            $MLRes = CMedialib::ShowBrowseButton(array('mode' => $arFD[$i]['ONLY_ML'] ? 'medialib' : 'select', 'value' => '...', 'event' => "BX_FD_" . $arFD[$i]['NAME'], 'id' => "bx_fd_input_" . strtolower($arFD[$i]['NAME']), 'MedialibConfig' => array("event" => "bx_ml_event_" . $arFD[$i]['NAME'], "arResultDest" => array("FUNCTION_NAME" => "BX_FD_ONRESULT_" . $arFD[$i]['NAME']), "types" => $arFD[$i]['ML_TYPES']), 'bReturnResult' => true));
            ?>
			<script>window._bxMlBrowseButton_<?php 
            echo strtolower($arFD[$i]['NAME']);
            ?>
 = '<?php 
            echo CUtil::JSEscape($MLRes);
            ?>
';</script>
			<?php 
        }
        CAdminFileDialog::ShowScript(array("event" => "BX_FD_" . $arFD[$i]['NAME'], "arResultDest" => array("FUNCTION_NAME" => "BX_FD_ONRESULT_" . $arFD[$i]['NAME']), "arPath" => array(), "select" => $arFD[$i]['TARGET'], "operation" => 'O', "showUploadTab" => $arFD[$i]['UPLOAD'], "showAddToMenuTab" => false, "fileFilter" => $arFD[$i]['EXT'], "allowAllFiles" => true, "SaveConfig" => true));
    }
}
Esempio n. 16
0
    CAdminFileDialog::ShowScript(array("event" => "OpenFileBrowserWindImage", "arResultDest" => array("FUNCTION_NAME" => "SetUrl"), "arPath" => array("SITE" => $_GET["site"], "PATH" => strlen($str_FILENAME) > 0 ? GetDirPath($str_FILENAME) : ''), "select" => 'F', "operation" => 'O', "showUploadTab" => true, "showAddToMenuTab" => false, "fileFilter" => 'image', "allowAllFiles" => true, "SaveConfig" => true));
    ?>

<?php 
    ob_start();
    ?>
<table class="bx-image-dialog-tbl">
	<tr>
		<td class="bx-par-title"><label for="bx_src"><?php 
    echo GetMessage("FILEMAN_ED_IMG_PATH");
    ?>
</label></td>
		<td class="bx-par-val">
			<input type="text" size="25" value="" id="bx_src" style="float: left;" />
			<?php 
    CMedialib::ShowBrowseButton(array('value' => '...', 'event' => 'OpenFileBrowserWindImage', 'id' => 'OpenFileBrowserWindImage_button', 'MedialibConfig' => array("arResultDest" => array("FUNCTION_NAME" => "SetUrl"), "types" => array('image'))));
    ?>
		</td>
	</tr>
	<tr>
		<td class="bx-par-title"><label for="bx_img_title"><?php 
    echo GetMessage("FILEMAN_ED_IMG_TITLE");
    ?>
</label></td>
		<td class="bx-par-val"><input type="text" size="30" value="" id="bx_img_title" /></td>
	</tr>
	<tr>
		<td class="bx-par-title"><label for="bx_width"><?php 
    echo GetMessage("FILEMAN_SIZES");
    ?>
:</label></td>
Esempio n. 17
0
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();

CModule::IncludeModule("fileman");
CMedialib::Init();

$dbMediaTypes = CMedialib::GetTypes(array(), true);
foreach ($dbMediaTypes as $vals)
{
	$arMediaTypes[$vals[id]] = $vals[name];
};

ksort($arMediaTypes);

$dbMediaCollections = CMediaLibCollection::GetList(array('arOrder' => array('ID'=>'ASC'),'arFilter' => array('ACTIVE' => 'Y', 'ML_TYPE' => $arCurrentValues[MEDIATYPE])));
foreach ($dbMediaCollections as $vals)
{
	$arMediaCollections[$vals[ID]] = $vals[NAME];
};

$arComponentParameters = array(
	'PARAMETERS' => array (
		'MEDIATYPE' => array (
			'PARENT' => 'BASE',
			'NAME' => GetMessage('ALKOM_DOCBAR_MEDIALIB_TYPE'),
			'TYPE' => 'LIST',
			'MULTIPLE' => 'N',
			'ADDITIONAL_VALUES' => 'N',
			'VALUES' => $arMediaTypes,
			'DEFAULT' => 'N',
			'REFRESH' => 'Y',
Esempio n. 18
0
 public static function RequestAction($action = '')
 {
     global $USER, $APPLICATION;
     $result = array();
     switch ($action) {
         case "load_site_template":
             if (!$USER->CanDoOperation('fileman_view_file_structure')) {
                 break;
             }
             $siteTemplate = $_REQUEST['site_template'];
             $siteId = isset($_REQUEST['site_id']) ? $_REQUEST['site_id'] : SITE_ID;
             $result = self::GetSiteTemplateParams($siteTemplate, $siteId);
             break;
         case "load_components_list":
             if (!$USER->CanDoOperation('fileman_view_file_structure')) {
                 break;
             }
             $siteTemplate = $_REQUEST['site_template'];
             $componentFilter = isset($_REQUEST['componentFilter']) ? $_REQUEST['componentFilter'] : false;
             $result = self::GetComponents($siteTemplate, true, $componentFilter);
             break;
         case "video_oembed":
             $result = self::GetVideoOembed($_REQUEST['video_source']);
             break;
             // Snippets actions
         // Snippets actions
         case "load_snippets_list":
             if (!$USER->CanDoOperation('fileman_view_file_structure')) {
                 break;
             }
             $template = $_REQUEST['site_template'];
             $result = array('result' => true, 'snippets' => array($template => self::GetSnippets($template, $_REQUEST['clear_cache'] == 'Y')));
             break;
         case "edit_snippet":
             if (!$USER->CanDoOperation('fileman_view_file_structure')) {
                 break;
             }
             CUtil::JSPostUnEscape();
             $template = $_REQUEST['site_template'];
             // Update
             if ($_REQUEST['current_path']) {
                 $result = CSnippets::Update(array('template' => $template, 'path' => $_REQUEST['path'], 'code' => $_REQUEST['code'], 'title' => $_REQUEST['name'], 'current_path' => $_REQUEST['current_path'], 'description' => $_REQUEST['description']));
             } else {
                 $result = CSnippets::Add(array('template' => $template, 'path' => $_REQUEST['path'], 'code' => $_REQUEST['code'], 'title' => $_REQUEST['name'], 'description' => $_REQUEST['description']));
             }
             if ($result && $result['result']) {
                 $result['snippets'] = array($template => self::GetSnippets($template));
             }
             break;
         case "remove_snippet":
             if (!$USER->CanDoOperation('fileman_view_file_structure')) {
                 break;
             }
             CUtil::JSPostUnEscape();
             $template = $_REQUEST['site_template'];
             $res = CSnippets::Remove(array('template' => $template, 'path' => $_REQUEST['path']));
             if ($res) {
                 $result = array('result' => true, 'snippets' => array($template => self::GetSnippets($template)));
             } else {
                 $result = array('result' => false);
             }
             break;
         case "snippet_add_category":
             if (!$USER->CanDoOperation('fileman_view_file_structure')) {
                 break;
             }
             CUtil::JSPostUnEscape();
             $template = $_REQUEST['site_template'];
             $res = CSnippets::CreateCategory(array('template' => $template, 'name' => $_REQUEST['category_name'], 'parent' => $_REQUEST['category_parent']));
             if ($res) {
                 $result = array('result' => true, 'snippets' => array($template => self::GetSnippets($template)));
             } else {
                 $result = array('result' => false);
             }
             break;
         case "snippet_remove_category":
             if (!$USER->CanDoOperation('fileman_view_file_structure')) {
                 break;
             }
             CUtil::JSPostUnEscape();
             $template = $_REQUEST['site_template'];
             $res = CSnippets::RemoveCategory(array('template' => $template, 'path' => $_REQUEST['category_path']));
             if ($res) {
                 $result = array('result' => true, 'snippets' => array($template => self::GetSnippets($template)));
             } else {
                 $result = array('result' => false);
             }
             break;
         case "snippet_rename_category":
             if (!$USER->CanDoOperation('fileman_view_file_structure')) {
                 break;
             }
             CUtil::JSPostUnEscape();
             $template = $_REQUEST['site_template'];
             $res = CSnippets::RenameCategory(array('template' => $template, 'path' => $_REQUEST['category_path'], 'new_name' => $_REQUEST['category_new_name']));
             if ($res) {
                 $result = array('result' => true, 'snippets' => array($template => self::GetSnippets($template)));
             } else {
                 $result = array('result' => false);
             }
             break;
             // END *** Snippets actions
             // spellcheck
         // END *** Snippets actions
         // spellcheck
         case "spellcheck_words":
         case "spellcheck_add_word":
             CUtil::JSPostUnEscape();
             $spellChecker = new CSpellchecker(array("lang" => $_REQUEST['lang'], "skip_length" => 2, "use_pspell" => $_REQUEST['use_pspell'] !== "N", "use_custom_spell" => $_REQUEST['use_custom_spell'] !== "N", "mode" => PSPELL_FAST));
             if ($action == "spellcheck_words") {
                 $words = isset($_REQUEST['words']) && is_array($_REQUEST['words']) ? $_REQUEST['words'] : array();
                 $result = array('words' => $spellChecker->checkWords($words));
             } else {
                 $word = CFileMan::SecurePathVar($_REQUEST['word']);
                 $spellChecker->addWord($word);
             }
             break;
             // END *** spellcheck
         // END *** spellcheck
         case "load_file_dialogs":
             $editorId = $_REQUEST['editor_id'];
             $editorId = preg_replace("/[^a-zA-Z0-9_-]/is", "_", $editorId);
             CAdminFileDialog::ShowScript(array("event" => "BxOpenFileBrowserWindFile" . $editorId, "arResultDest" => array("FUNCTION_NAME" => "OnFileDialogSelect" . $editorId), "arPath" => array("SITE" => SITE_ID), "select" => 'F', "operation" => 'O', "showUploadTab" => true, "showAddToMenuTab" => false, "fileFilter" => 'image', "allowAllFiles" => true, "SaveConfig" => true));
             CMedialib::ShowBrowseButton(array('value' => '...', 'event' => "BxOpenFileBrowserWindFile" . $editorId, 'button_id' => "bx-open-file-link-medialib-but-" . $editorId, 'id' => "bx_open_file_link_medialib_button_" . $editorId, 'MedialibConfig' => array("event" => "BxOpenFileBrowserFileMl" . $editorId, "arResultDest" => array("FUNCTION_NAME" => "OnFileDialogSelect" . $editorId)), 'useMLDefault' => false));
             CMedialib::ShowBrowseButton(array('value' => '...', 'event' => "BxOpenFileBrowserWindFile" . $editorId, 'button_id' => "bx-open-file-medialib-but-" . $editorId, 'id' => "bx_open_file_medialib_button_" . $editorId, 'MedialibConfig' => array("event" => "BxOpenFileBrowserImgFileMl" . $editorId, "arResultDest" => array("FUNCTION_NAME" => "OnFileDialogImgSelect" . $editorId), "types" => array('image'))));
             $result = array('result' => true);
             break;
     }
     self::ShowResponse(intVal($_REQUEST['reqId']), $result);
 }
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$APPLICATION->AddHeadScript($componentPath . '/jssor.slider.min.js');
if ($this->StartResultCache($arParams["CACHE_TIME"])) {
    CModule::IncludeModule("fileman");
    CMedialib::Init();
    $arResult['COLLECTION_ITEMS'] = CMediaLibItem::GetList(array('arCollections' => array("0" => $arParams['SRC_COLLECTION'])));
    $this->IncludeComponentTemplate();
}
Esempio n. 20
0
 private static function DisplayDialogs()
 {
     if (self::$bUseMedialib) {
         CMedialib::ShowDialogScript(array("event" => "OpenMedialibDialog" . self::$jsId, "arResultDest" => array("FUNCTION_NAME" => "SetValueFromMedialib" . self::$jsId)));
     }
     if (self::$bUseFileDialog) {
         CAdminFileDialog::ShowScript(array("event" => "OpenFileDialog" . self::$jsId, "arResultDest" => array("FUNCTION_NAME" => "SetValueFromFileDialog" . self::$jsId), "arPath" => array("SITE" => SITE_ID, "PATH" => "/upload"), "select" => 'F', "operation" => 'O', "showUploadTab" => true, "allowAllFiles" => true, "SaveConfig" => true));
     }
 }
Esempio n. 21
0
    function BaseGetEditFormHTML($set, $val, $name, $controlMode = false)
    {
        global $APPLICATION;
        $id = str_replace(array("[", "]", ":"), "_", $name);
        $path = $val["path"];
        if (intVal($val['width']) <= 0) {
            $val['width'] = 400;
        }
        if (intVal($val['height']) <= 0) {
            $val['height'] = 300;
        }
        ob_start();
        ?>
<div style="padding: 5px;">
<style>
table.bx-video-prop-tbl{border-collapse: collapse! important; border: 1px solid #E0E4F1;}
table.bx-video-prop-tbl td{padding: 3px 5px! important; border-bottom: 1px dotted #BABABA !important;}
table.bx-video-prop-tbl tr.bx-prop-main-title td{background: #E0E4F1! important; color: #525355! important; font-weight: bold! important; text-align: center! important; border-bottom-width: 0px !important; padding: 5px! important;}
table.bx-video-prop-tbl tr.bx-prop-sub-title td{background: #E2E1E0! important; color: #525355! important; font-weight: bold! important; text-align: left! important; border-bottom-width: 0px !important;}
table.bx-video-prop-tbl td.bx-pr-title{text-align: right! important; vertical-align: top! important; padding-top: 8px !important;}
div.bx-path-div a{float: right !important;}
div.bx-path-div a.bx-leave{display: none;}
div.bx-path-div-changed a.bx-leave{display: block !important;}
div.bx-path-div-changed a.bx-change{display: none !important;}
div.bx-path-div input.bx-path{color: #525355 !important;}
div.bx-path-div-changed input.bx-path{text-decoration: line-through !important;}
table.bx-video-prop-tbl img.spacer{display:block;float:left;height:1px;margin-top:-2px;width:220px;}
</style>

<table class="bx-video-prop-tbl">
	<tr class="bx-prop-main-title"><td colSpan="2"><?php 
        echo GetMessage('IBLOCK_PROP_VIDEO_PARAMS_TITLE');
        ?>
</td></tr>
	<?php 
        if ($controlMode != "iblock_element_admin") {
            ?>
		<?php 
            if (strlen($path) > 0) {
                ?>
			<tr class="heading"><td colSpan="2"><?php 
                echo GetMessage('IBLOCK_PROP_VIDEO_PARAMS_TITLE_VIEW');
                ?>
</td></tr>
			<tr>
				<td colSpan="2" style="text-align: center;">
		<?php 
                $APPLICATION->IncludeComponent("bitrix:player", "", array("PLAYER_TYPE" => "auto", "PATH" => $path, "WIDTH" => $val['width'], "HEIGHT" => $val['height'], "FILE_TITLE" => $val['title'], "FILE_DURATION" => intVal($val['duration']), "FILE_AUTHOR" => $val['author'], "FILE_DATE" => $val['date'], "FILE_DESCRIPTION" => $val['desc'], "SKIN_PATH" => CVideoProperty::GetSkinPath(), "SKIN" => $set["SKIN"], "CONTROLBAR" => $set["CONTROLBAR"], "WMODE" => $set["WMODE_FLV"], "WMODE_WMV" => $set["WMODE_WMV"], "SHOW_CONTROLS" => $set["CONTROLBAR"] != 'none' ? "Y" : "N", "CONTROLS_BGCOLOR" => $set["CONTROLS_BGCOLOR"], "CONTROLS_COLOR" => $set["CONTROLS_COLOR"], "CONTROLS_OVER_COLOR" => $set["CONTROLS_OVER_COLOR"], "SCREEN_COLOR" => $set["SCREEN_COLOR"], "AUTOSTART" => $set["AUTOSTART"], "VOLUME" => $set["VOLUME"], "ADDITIONAL_FLASHVARS" => $set["FLASHVARS"], "BUFFER_LENGTH" => $set["BUFFER_LENGTH"], "ADDITIONAL_WMVVARS" => $set["SILVERVARS"], "ALLOW_SWF" => "N", "LOGO_POSITION" => "none"), false, array('HIDE_ICONS' => 'Y'));
                ?>
				</td>
			</tr>
		<?php 
            }
            ?>

		<tr><td class="bx-pr-title" style="width: 300px;"></td><td style="width: 240px;"></td></tr>

		<tr class="heading"><td colSpan="2"><?php 
            echo GetMessage('IBLOCK_PROP_VIDEO_PARAMS_TITLE_MAIN');
            ?>
</td></tr>

		<?php 
            if (strlen($path) > 0) {
                ?>
			<tr>
				<td class="bx-pr-title"><?php 
                echo GetMessage('IBLOCK_PROP_VIDEO_FILE');
                ?>
:</td>
				<td>
					<div id="bx_video_path_div_<?php 
                echo $id;
                ?>
" class="bx-path-div">
					<input type="hidden" value="<?php 
                echo $path;
                ?>
" name= "<?php 
                echo $name;
                ?>
[CUR_PATH]" />
					<input id="bx_video_b_new_file_<?php 
                echo $id;
                ?>
" type="hidden" value="N" name= "<?php 
                echo $name;
                ?>
[B_NEW_FILE]" />
					<input class="bx-path" readonly="readonly" value="<?php 
                echo htmlspecialcharsex($path);
                ?>
" size="30" />
					<br />
					<a href="javascript: void(0)" onclick="return ChangeOrLeaveFile<?php 
                echo $id;
                ?>
(true);" class="bx-change" id="bx-change"><?php 
                echo GetMessage('IBLOCK_PROP_VIDEO_FILE_CHANGE');
                ?>
</a>
					<a href="javascript: void(0)" onclick="return ChangeOrLeaveFile<?php 
                echo $id;
                ?>
(false);"  class="bx-leave"><?php 
                echo GetMessage('IBLOCK_PROP_VIDEO_FILE_LEAVE');
                ?>
</a>
					</div>
				</td>
			</tr>
			<?php 
                if (CVideoProperty::CheckFileInUploadDir($path)) {
                    ?>
				<tr id="bx_video_del_row_<?php 
                    echo $id;
                    ?>
" style="display: none;">
					<td class="bx-pr-title"></td>
					<td>
						<input type="checkbox" value="Y" id="bx_video_del_<?php 
                    echo $id;
                    ?>
" checked="checked" name= "<?php 
                    echo $name;
                    ?>
[DEL_CUR_FILE]" /><label for="bx_video_del_<?php 
                    echo $id;
                    ?>
"><?php 
                    echo GetMessage('IBLOCK_PROP_VIDEO_DEL_FILE');
                    ?>
</label>
					</td>
				</tr>
			<?php 
                }
                ?>
		<?php 
            }
            ?>

		<tr id="bx_video_new_path_row_<?php 
            echo $id;
            ?>
" <?php 
            if (strlen($path) > 0) {
                echo 'style="display: none;"';
            }
            ?>
>
			<td class="bx-pr-title" style="width: 300px;"><?php 
            echo GetMessage(strlen($path) > 0 ? 'IBLOCK_PROP_VIDEO_PATH_NEW' : 'IBLOCK_PROP_VIDEO_PATH');
            ?>
:</td>
			<td style="width: 240px;">
			<img src="/bitrix/images/1.gif" class="spacer" />
			<div id="bx_video_path_cont1_<?php 
            echo $id;
            ?>
" style="display: none;">
			<input type="text" size="30" value="" id="bx_video_path_<?php 
            echo $id;
            ?>
"  style="float:left;" name= "<?php 
            echo $name;
            ?>
[PATH]" />
			<?php 
            CAdminFileDialog::ShowScript(array("event" => "OpenFileBrowser_" . $id, "arResultDest" => array("FUNCTION_NAME" => "SetVideoPath" . $id), "arPath" => array(), "select" => 'F', "operation" => 'O', "showUploadTab" => false, "showAddToMenuTab" => false, "fileFilter" => 'flv,mp4,mp3,wmv', "allowAllFiles" => true, "SaveConfig" => true));
            CMedialib::ShowBrowseButton(array("id" => 'OpenFileBrowser_but_' . $id, "event" => "OpenFileBrowser_" . $id, 'MedialibConfig' => array("event" => "OpenFileBrowser_ml_" . $id, "arResultDest" => array("FUNCTION_NAME" => "SetVideoPath" . $id))));
            ?>
			<br />
			<a href="javascript: void(0)" onclick="return DisplayCont('bx_video_path_cont2_<?php 
            echo $id;
            ?>
', 'bx_video_path_cont1_<?php 
            echo $id;
            ?>
');" style="float: right;"><?php 
            echo GetMessage('IBLOCK_PROP_VIDEO_PATH_FROM_PC');
            ?>
</a>
			</div>
			<div id="bx_video_path_cont2_<?php 
            echo $id;
            ?>
">
				<input type="file" value="" id="bx_video_path_<?php 
            echo $id;
            ?>
" name= "<?php 
            echo $name;
            ?>
[FILE]" />
				<br />
				<a href="javascript: void(0)" onclick="return DisplayCont('bx_video_path_cont1_<?php 
            echo $id;
            ?>
', 'bx_video_path_cont2_<?php 
            echo $id;
            ?>
');" style="float: right;"><?php 
            echo GetMessage('IBLOCK_PROP_VIDEO_PATH_FROM_FD');
            ?>
</a>
			</div>
			</td>
		</tr>
	<?php 
        } else {
            ?>
		<tr>
			<td class="bx-pr-title"><?php 
            echo GetMessage('IBLOCK_PROP_VIDEO_FILE');
            ?>
:</td>
			<td>
				<div id="bx_video_path_div_<?php 
            echo $id;
            ?>
" class="bx-path-div">
					<input type="text" size="25" value="<?php 
            echo htmlspecialcharsex($path);
            ?>
" size="30" name="<?php 
            echo $name;
            ?>
[PATH]"/>
				</div>
			</td>
		</tr>
	<?php 
        }
        ?>

	<tr>
		<td class="bx-pr-title"><?php 
        echo GetMessage('IBLOCK_PROP_VIDEO_SIZE');
        ?>
:</td>
		<td>
			<input  id="bx_video_width_<?php 
        echo $id;
        ?>
" type="text" size="10" style="width: 70px;" value="<?php 
        echo $val['width'];
        ?>
" name= "<?php 
        echo $name;
        ?>
[WIDTH]" />
			x
			<input id="bx_video_height_<?php 
        echo $id;
        ?>
" type="text" size="10" style="width: 70px;" value="<?php 
        echo $val['height'];
        ?>
" name= "<?php 
        echo $name;
        ?>
[HEIGHT]" />
		</td>
	</tr>
	<tr class="heading"><td colSpan="2"><?php 
        echo GetMessage('IBLOCK_PROP_VIDEO_PARAMS_TITLE_INFO');
        ?>
</td></tr>
	<tr>
		<td class="bx-pr-title"><?php 
        echo GetMessage('IBLOCK_PROP_VIDEO_TITLE');
        ?>
:</td>
		<td><input id="bx_video_title_<?php 
        echo $id;
        ?>
" type="text" size="30" value="<?php 
        echo $val['title'];
        ?>
" name="<?php 
        echo $name;
        ?>
[TITLE]" /></td>
	</tr>
	<tr>
		<td class="bx-pr-title"><?php 
        echo GetMessage('IBLOCK_PROP_VIDEO_DURATION');
        ?>
:</td>
		<td><input id="bx_video_duration_<?php 
        echo $id;
        ?>
" type="text" size="30" value="<?php 
        echo $val['duration'];
        ?>
" name="<?php 
        echo $name;
        ?>
[DURATION]"/></td>
	</tr>
	<tr>
		<td class="bx-pr-title"><?php 
        echo GetMessage('IBLOCK_PROP_VIDEO_AUTHOR');
        ?>
:</td>
		<td><input id="bx_video_author_<?php 
        echo $id;
        ?>
" type="text" size="30" value="<?php 
        echo $val['author'];
        ?>
" name="<?php 
        echo $name;
        ?>
[AUTHOR]"/></td>
	</tr>
	<tr>
		<td class="bx-pr-title"><?php 
        echo GetMessage('IBLOCK_PROP_VIDEO_DATE');
        ?>
:</td>
		<td><input id="bx_video_date_<?php 
        echo $id;
        ?>
" type="text" size="30" value="<?php 
        echo $val['date'];
        ?>
" name="<?php 
        echo $name;
        ?>
[DATE]" /></td>
	</tr>
	<tr>
		<td class="bx-pr-title"><?php 
        echo GetMessage('IBLOCK_PROP_VIDEO_DESC');
        ?>
:</td>
		<td><input id="bx_video_desc_<?php 
        echo $id;
        ?>
" type="text" size="30" value="<?php 
        echo $val['desc'];
        ?>
" name="<?php 
        echo $name;
        ?>
[DESC]"/></td>
	</tr>
</table>
<script>
function DisplayCont(id1, id2)
{
	var
		el1 = document.getElementById(id1),
		el2 = document.getElementById(id2);

	if (el1 && el2)
	{
		el1.style.display = "block";
		el2.style.display = "none";
	}
	return false;
}

function SetVideoPath<?php 
        echo $id;
        ?>
(filename, path, site)
{
	var
		url,
		srcInput = document.getElementById("bx_video_path_<?php 
        echo $id;
        ?>
");

	if (typeof filename == 'object') // Using medialibrary
	{
		url = filename.src;
		document.getElementById("bx_video_title_<?php 
        echo $id;
        ?>
").value = filename.name || '';
		document.getElementById("bx_video_desc_<?php 
        echo $id;
        ?>
").value = filename.description || '';
	}
	else // Using file dialog
	{
		url = (path == '/' ? '' : path) + '/'+filename;
	}

	srcInput.value = url;
	if(srcInput.onchange)
		srcInput.onchange();
	srcInput.focus();
	srcInput.select();
}

function ChangeOrLeaveFile<?php 
        echo $id;
        ?>
(bChange)
{
	var
		pDiv = document.getElementById("bx_video_path_div_<?php 
        echo $id;
        ?>
"),
		pDelRow = document.getElementById("bx_video_del_row_<?php 
        echo $id;
        ?>
"),
		pBNewFile = document.getElementById("bx_video_b_new_file_<?php 
        echo $id;
        ?>
"),
		pNewFileRow = document.getElementById("bx_video_new_path_row_<?php 
        echo $id;
        ?>
"),
		_display = jsUtils.IsIE() ? "inline" : "table-row";

	if (pBNewFile)
		pBNewFile.value = bChange ? "Y" : "N";

	if (pDelRow)
		pDelRow.style.display = bChange ? _display : 'none';

	if (pNewFileRow)
		pNewFileRow.style.display = bChange ? _display : 'none';

	pDiv.className = bChange ? "bx-path-div bx-path-div-changed" : "bx-path-div";

	return false;
}
</script>
</div>
<?php 
        $s = ob_get_contents();
        ob_end_clean();
        return $s;
    }
Esempio n. 22
0
//********************
//Descr Tab
//********************
$tabControl->BeginNextTab();
$str_PREVIEW_PICTURE = intval($arVote["IMAGE_ID"]);
$bFileman = CModule::IncludeModule("fileman");
?>
	<tr class="adm-detail-file-row">
		<td width="40%"><?php 
echo GetMessage("VOTE_IMAGE");
?>
</td>
		<td width="60%">
		<?php 
if ($bFileman) {
    echo CMedialib::InputFile("IMAGE_ID", $str_PREVIEW_PICTURE, array("IMAGE" => "Y", "PATH" => "Y", "FILE_SIZE" => "Y", "DIMENSIONS" => "Y", "IMAGE_POPUP" => "Y", "MAX_SIZE" => array("W" => 200, "H" => 200)), array(), array(), array(), array(), array(), '');
} else {
    CFile::InputFile("IMAGE_ID", 20, $arVote["IMAGE_ID"]);
    if (strlen($arVote["IMAGE_ID"]) > 0) {
        echo "<br />";
        CFile::ShowImage($arVote["IMAGE_ID"], 200, 200, "border=0", "", true);
    }
}
?>
		</td>
	</tr>
	<tr class="heading">
		<td colspan="2"><?php 
echo GetMessage("VOTE_DESCR");
?>
</td>
Esempio n. 23
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
CMedialib::ShowDialogScript(array("event" => "LHED_Img_MLOpen", "arResultDest" => array("FUNCTION_NAME" => "LHED_Img_SetUrl")));
CAdminFileDialog::ShowScript(array("event" => "LHED_Link_FDOpen", "arResultDest" => array("ELEMENT_ID" => "lhed_link_href"), "arPath" => array("SITE" => SITE_ID), "select" => 'F', "operation" => 'O', "showUploadTab" => true, "showAddToMenuTab" => false, "fileFilter" => 'php, html', "allowAllFiles" => true, "SaveConfig" => true));
CAdminFileDialog::ShowScript(array("event" => "LHED_Img_FDOpen", "arResultDest" => array("FUNCTION_NAME" => "LHED_Img_SetUrl"), "arPath" => array("SITE" => SITE_ID), "select" => 'F', "operation" => 'O', "showUploadTab" => true, "showAddToMenuTab" => false, "fileFilter" => 'image', "allowAllFiles" => true, "SaveConfig" => true));
Esempio n. 24
0
	function InitMedialibDialogs()
	{
		CMedialib::ShowDialogScript(array(
			"event" => "LHED_Img_MLOpen",
			"arResultDest" => Array("FUNCTION_NAME" => "LHED_Img_SetUrl")
		));
		CMedialib::ShowDialogScript(array(
			"event" => "LHED_Video_MLOpen",
			"arResultDest" => Array("FUNCTION_NAME" => "LHED_Video_SetPath")
		));
	}
Esempio n. 25
0
                            $res .= '<textarea name=\\\'' . $ID . '[]\\\' cols=\\\'' . $prop["COLS"] . '\\\'></textarea>';
                        } else {
                            $res .= '<input type=\\\'text\\\' name=\\\'' . $ID . '[]\\\' size=\\\'' . $prop["COLS"] . '\\\'>';
                        }
                        $res .= '\'">';
                    } else {
                        if ($prop['ROWS'] > 1) {
                            $res .= '<textarea name="' . $ID . '" cols=' . $prop["COLS"] . '>' . htmlspecialcharsbx($val) . '</textarea>';
                        } else {
                            if ($prop["TYPE"] == 'FILE') {
                                CAdminFileDialog::ShowScript(array("event" => "BX_FD_" . $ID, "arResultDest" => array("FUNCTION_NAME" => "BX_FD_ONRESULT_" . $ID), "arPath" => array(), "select" => isset($prop['FD_TARGET']) ? $prop['FD_TARGET'] : 'F', "operation" => 'O', "showUploadTab" => isset($prop['FD_UPLOAD']) && $prop['FD_UPLOAD'] && $prop['FD_TARGET'] == 'F', "showAddToMenuTab" => false, "fileFilter" => isset($prop['FD_EXT']) ? $prop['FD_EXT'] : '', "allowAllFiles" => true, "SaveConfig" => true));
                                $bML = isset($prop['FD_USE_MEDIALIB']) && $prop['FD_USE_MEDIALIB'];
                                $res .= '<input id="__FD_PARAM_' . $ID . '" name="' . $ID . '" size=' . $prop["COLS"] . ' value="' . htmlspecialcharsbx($val) . '" type="text" ' . ($bML ? 'style="float:left;"' : '') . '>';
                                // Using medialib
                                if ($bML) {
                                    $res .= "<div>" . CMedialib::ShowBrowseButton(array('mode' => $prop['FD_USE_ONLY_MEDIALIB'] ? 'medialib' : 'select', 'value' => '...', 'event' => "BX_FD_" . $ID, 'id' => "bx_fd_input_" . strtolower($ID), 'MedialibConfig' => array("event" => "bx_ml_event_" . $ID, "arResultDest" => array("FUNCTION_NAME" => "BX_FD_ONRESULT_" . $ID), "types" => is_array($prop['FD_MEDIALIB_TYPES']) ? $prop['FD_MEDIALIB_TYPES'] : false), 'bReturnResult' => true)) . "</div>";
                                } else {
                                    // Use old good file dialog
                                    $res .= '<input size=' . $prop["COLS"] . ' value="..." type="button" onclick="window.BX_FD_' . $ID . '();">';
                                }
                                $res .= '<script>
					setTimeout(function(){
						if (BX("bx_fd_input_' . strtolower($ID) . '"))
							BX("bx_fd_input_' . strtolower($ID) . '").onclick = window.BX_FD_' . $ID . ';
					}, 200);

					window.BX_FD_ONRESULT_' . $ID . ' = function(filename, filepath)
					{
						var oInput = BX("__FD_PARAM_' . $ID . '");
						if (typeof filename == "object")
							oInput.value = filename.src;
Esempio n. 26
0
<?
}
else
{
	$APPLICATION->AddHeadScript('/bitrix/image_uploader/iuembed.js');
?>
<form name="ml_upload">
<div  style="margin: 10px; font-size: 13px;">
<?php 
echo GetMessage('FM_ML_UPL_LOACATE');
?>
: <select title="<?php 
echo GetMessage('ML_ADD_COL2ITEM');
?>
" name="collection_id" onchange="itemColsSelChange2(this, arguments[0] || window.event);"><?php 
echo CMedialib::_BuildCollectionsSelectOptions($trees['Collections'], $trees['arColTree'], 0, intVal($_GET['col_id']));
?>
</select>
</div>
</form>

<?
include_once($_SERVER['DOCUMENT_ROOT']."/bitrix/image_uploader/version.php");
include_once($_SERVER['DOCUMENT_ROOT']."/bitrix/image_uploader/localization.php");
?>

<div style="border: 1px solid #94918C; float: left; padding: 5px;">
<script>
function itemColsSelChange2(pEl, e)
{
	if (window.oColAccess[pEl.value] != '1')