本文整理汇总了PHP中CFile::GetImageExtensions方法的典型用法代码示例。如果您正苦于以下问题:PHP CFile::GetImageExtensions方法的具体用法?PHP CFile::GetImageExtensions怎么用?PHP CFile::GetImageExtensions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFile
的用法示例。
在下文中一共展示了CFile::GetImageExtensions方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFileInfo
/**
* @return string
*/
public function getFileInfo()
{
$fileInfo = null;
if ($this->encoding === 'B' || $this->encoding === 'BASE64') {
$type = $this->type !== '' ? strtolower($this->type) : 'jpg';
if ($type === '' || !in_array($type, explode(',', \CFile::GetImageExtensions()), true)) {
$type = 'jpg';
}
$filePath = \CTempFile::GetFileName(uniqid('vcard_img') . '.' . $type);
CheckDirPath($filePath);
//Removing of line folding
$encodedData = preg_replace("/\\\\n/i", "\n", $this->value);
if (file_put_contents($filePath, base64_decode($encodedData)) !== false) {
$fileInfo = \CFile::MakeFileArray($filePath, "image/{$type}");
}
} elseif ($this->valueType === 'URI' && \CCrmUrlUtil::HasScheme($this->value) && \CCrmUrlUtil::IsSecureUrl($this->value)) {
$fileInfo = \CFile::MakeFileArray($this->value);
}
return is_array($fileInfo) && strlen(\CFile::CheckImageFile($fileInfo)) === 0 ? $fileInfo : null;
}
示例2: GetFilrIcon
function GetFilrIcon($compPath, $pathQ, $arParams, $arF)
{
$arMime = array('pdf' => 'pdf.png', 'doc' => 'doc.png', 'docx' => 'doc.png', 'ppt' => 'ppt.png', 'pptx' => 'ppt.png', 'rar' => 'rar.png', 'xls' => 'xls.png', 'xlsx' => 'xls.png', 'zip' => 'zip.png');
$fIcon = $compPath . "/images/" . "blank.png";
$fExtQ = strtolower(GetFileExtension($pathQ));
if ($arParams["RESOURCE_TYPE"] == "IBLOCK") {
if (CFile::isImage($arF['NAME'])) {
return $compPath . "/images/img.png";
}
$icon = isset($arMime[$fExtQ]) ? $arMime[$fExtQ] : 'blank.png';
return $compPath . "/images/{$icon}";
}
$fileID = $pathQ;
$arFile = CFile::MakeFileArray($fileID);
$isPictureExt = false;
$arPExt = explode(",", CFile::GetImageExtensions());
foreach ($arPExt as $v) {
if (strtolower(trim($v)) == $fExtQ) {
$isPictureExt = true;
break;
}
}
$isPicture = false;
if ($isPictureExt && isset($arFile["tmp_name"])) {
$imgArray = CFile::GetImageSize($arFile["tmp_name"], true);
if (is_array($imgArray)) {
if ($arFIcon = CFile::ResizeImageGet($fileID, array("width" => "58", "height" => "58"), BX_RESIZE_IMAGE_EXACT, true)) {
$fIcon = $arFIcon["src"];
$isPicture = true;
}
}
}
if (!$isPicture && array_key_exists($fExtQ, $arMime)) {
$fIcon = $compPath . "/images/" . $arMime[$fExtQ];
}
return $fIcon;
}
示例3: CheckImageFile
function CheckImageFile($arFile, $iMaxSize = 0, $iMaxWidth = 0, $iMaxHeight = 0, $access_typies = array())
{
if ($arFile["name"] == "") {
return "";
}
$file_type = GetFileType($arFile["name"]);
// IMAGE by default
if (!in_array($file_type, $access_typies)) {
$file_type = "IMAGE";
}
switch ($file_type) {
case "FLASH":
$res = CFile::CheckFile($arFile, $iMaxSize, "application/x-shockwave-flash", CFile::GetFlashExtensions());
break;
default:
$res = CFile::CheckFile($arFile, $iMaxSize, "image/", CFile::GetImageExtensions());
}
if ($res != '') {
return $res;
}
$imgArray = CFile::GetImageSize($arFile["tmp_name"], true);
if (is_array($imgArray)) {
$intWIDTH = $imgArray[0];
$intHEIGHT = $imgArray[1];
} else {
return GetMessage("FILE_BAD_FILE_TYPE") . ".<br>";
}
//check for dimensions
if ($iMaxWidth > 0 && ($intWIDTH > $iMaxWidth || $intWIDTH == 0) || $iMaxHeight > 0 && ($intHEIGHT > $iMaxHeight || $intHEIGHT == 0)) {
return GetMessage("FILE_BAD_MAX_RESOLUTION") . " (" . $iMaxWidth . " * " . $iMaxHeight . " " . GetMessage("main_include_dots") . ").<br>";
}
return null;
}
示例4: checkFile
/**
* Checks file params
* @param $file
* @param $arFile
* @return mixed|null|string
*/
protected function checkFile($file, &$arFile)
{
$status = new Status("checked");
if ($file["error"] > 0) {
$status = new Error("BXU347.2", $file["error"]);
} else {
if (array_key_exists("tmp_url", $file)) {
$url = new Uri($file["tmp_url"]);
if ($url->getHost() == '' && ($tmp = \CFile::MakeFileArray($url->getPath())) && is_array($tmp)) {
$file = array_merge($tmp, $file);
} else {
if ($url->getHost() != '' && $this->http->query("HEAD", $file["tmp_url"]) && $this->http->getStatus() == "200") {
$file = array_merge($file, array("size" => (int) $this->http->getHeaders()->get("content-length"), "type" => $this->http->getHeaders()->get("content-type")));
} else {
$status = new Error("BXU347.2");
}
}
} else {
if (!is_uploaded_file($file['tmp_name']) || !file_exists($file['tmp_name'])) {
$status = new Error("BXU347.2");
}
}
}
if ($status instanceof Error) {
//
} elseif ($this->params["allowUpload"] == "I") {
$error = \CFile::CheckFile($file, $this->params["uploadMaxFilesize"], "image/", \CFile::GetImageExtensions());
if (!empty($error)) {
$status = new Error("BXU347.3", $error);
}
} elseif ($this->params["allowUpload"] == "F") {
$error = \CFile::CheckFile($file, $this->params["uploadMaxFilesize"], false, $this->params["allowUploadExt"]);
if (!empty($error)) {
$status = new Error("BXU347.3", $error);
}
} else {
$error = \CFile::CheckFile($file, $this->params["uploadMaxFilesize"]);
if (!empty($error)) {
$status = new Error("BXU347.3", $error);
}
}
if ($status instanceof Status) {
$matches = array();
$name = $file["~name"];
if (preg_match("/^(.+?)\\.ch(\\d+)\\.(\\d+)\\.chs(\\d+)\$/", $file["~name"], $matches)) {
$name = $matches[1];
}
$key = !empty($name) ? $name : 'default';
$file["copy"] = $key;
if (empty($matches)) {
$arFile["files"][$key] = $file;
} else {
$fileAddInfo = array("chunks" => array(), "chunksInfo" => array("count" => $matches[4], "uploaded" => array(), "written" => array()));
if (array_key_exists($key, $arFile["files"])) {
$fileAddInfo = $arFile["files"][$key];
}
$file["status"] = "inprogress";
$file["number"] = $matches[2];
$file["start"] = $matches[3];
$fileAddInfo["chunks"][self::getChunkKey($fileAddInfo["chunksInfo"]["count"], $file["number"])] = $file;
$arFile["files"][$key] = $fileAddInfo;
}
}
return $status;
}
示例5: CheckFields
//.........这里部分代码省略.........
break;
} elseif ($property_value['del'] == 'Y') {
$bCount--;
}
} elseif (intval($property_value) > 0) {
//This is history copy of the file
$bCount++;
break;
}
}
$bError = $bCount <= 0;
}
}
if ($arProperty["IS_REQUIRED"] == "Y" && $arProperty['PROPERTY_TYPE'] != 'F') {
$len = 0;
foreach ($property_values as $key2 => $property_value) {
if (array_key_exists("GetLength", $arUserType)) {
$len += call_user_func_array($arUserType["GetLength"], array($arProperty, array("VALUE" => $property_value)));
} else {
$len += strlen($property_value);
}
if ($len > 0) {
break;
}
}
$bError = $len <= 0;
}
if ($bError) {
$this->LAST_ERROR .= GetMessage("IBLOCK_BAD_PROPERTY", array("#PROPERTY#" => $arProperty["NAME"])) . "<br>";
}
// check file properties for correctness
if ($arProperty['PROPERTY_TYPE'] == 'F') {
$bImageOnly = False;
$arImageExtentions = explode(",", strtoupper(CFile::GetImageExtensions()));
if (strlen($arProperty["FILE_TYPE"])) {
$bImageOnly = True;
$arAvailTypes = explode(",", strtoupper($arProperty["FILE_TYPE"]));
foreach ($arAvailTypes as $avail_type) {
if (!in_array(trim($avail_type), $arImageExtentions)) {
$bImageOnly = False;
break;
}
}
}
foreach ($property_values as $key2 => $property_value) {
if (!is_array($property_value) && intval($property_value) > 0 && intval($arFields["WF_PARENT_ELEMENT_ID"]) > 0) {
if (CIBlockElement::DeleteFile($property_value, $ID, "PROPERTY", intval($arFields["WF_PARENT_ELEMENT_ID"]), $arFields["IBLOCK_ID"], true) <= 0) {
$this->LAST_ERROR .= GetMessage("IBLOCK_ERR_FILE_PROPERTY") . "<br>";
}
} elseif (is_array($property_value)) {
if (is_object($property_value["bucket"])) {
//This is trusted image from xml import
$error = "";
} else {
if ($bImageOnly) {
$error = CFile::CheckImageFile($property_value);
} else {
$error = CFile::CheckFile($property_value, 0, false, $arProperty["FILE_TYPE"]);
}
}
//For user without edit php permissions
//we allow only pictures upload
if (!is_object($USER) || !$USER->IsAdmin()) {
if (HasScriptExtension($property_value["name"])) {
$error = GetMessage("FILE_BAD_TYPE") . " (" . $property_value["name"] . ").";
}
示例6: CheckImageFile
function CheckImageFile($arFile, $iMaxSize=0, $iMaxWidth=0, $iMaxHeight=0, $access_typies=array())
{
if(strlen($arFile["name"])<=0)
return "";
if(GetFileNameWithoutExtension(RemoveScriptExtension($arFile["name"])) == '')
return GetMessage("FILE_BAD_FILENAME");
$file_type = GetFileType($arFile["name"]);
// если тип файла не входит в массив допустимых типов то
// присваиваем ему тип IMAGE по умолчанию
if(!in_array($file_type, $access_typies))
$file_type = "IMAGE";
switch ($file_type)
{
case "FLASH":
$res = CFile::CheckFile($arFile, $iMaxSize, "application/x-shockwave-flash", CFile::GetFlashExtensions());
break;
default:
$res = CFile::CheckFile($arFile, $iMaxSize, "image/", CFile::GetImageExtensions());
}
if(strlen($res)>0)
return $res;
$imgArray = CFile::GetImageSize($arFile["tmp_name"]);
if(is_array($imgArray))
{
$intWIDTH = $imgArray[0];
$intHEIGHT = $imgArray[1];
}
else
return GetMessage("FILE_BAD_FILE_TYPE").".<br>";
//проверка на максимальный размер картинки (ширина/высота)
if($iMaxWidth > 0 && ($intWIDTH > $iMaxWidth || $intWIDTH == 0) || $iMaxHeight > 0 && ($intHEIGHT > $iMaxHeight || $intHEIGHT == 0))
return GetMessage("FILE_BAD_MAX_RESOLUTION")." (".$iMaxWidth." * ".$iMaxHeight." ".GetMessage("main_include_dots").").<br>";
return null;
}
示例7: Copyright
##############################################
# Bitrix: SiteManager #
# Copyright (c) 2002 Bitrix #
# http://www.bitrix.ru #
# mailto:admin@bitrix.ru #
##############################################
*/
define("STOP_STATISTICS", "Y");
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/workflow/prolog.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/workflow/include.php";
$fname = $_REQUEST["fname"];
if ($APPLICATION->GetGroupRight("workflow") >= "R") {
session_write_close();
$src = CWorkflow::GetFileContent($did, $fname, $wf_path, $site);
$ext = strtolower(GetFileExtension($fname));
$arrExt = explode(",", strtolower(CFile::GetImageExtensions()));
if (in_array($ext, $arrExt)) {
if ($ext == "jpg") {
$ext = "jpeg";
}
header("Content-type: image/" . $ext);
header("Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
header("Pragma: public");
echo $src;
die;
}
echo TxtToHtml($src);
}
die;
示例8: CheckImageFile
public static function CheckImageFile($arFile, $iMaxSize = 0, $iMaxWidth = 0, $iMaxHeight = 0, $access_typies = array(), $bForceMD5 = false, $bSkipExt = false)
{
if ($arFile["name"] == "") {
return "";
}
if (preg_match("#^php://filter#i", $arFile["tmp_name"])) {
return GetMessage("FILE_BAD_FILE_TYPE") . ".<br>";
}
$file_type = GetFileType($arFile["name"]);
// IMAGE by default
$flashEnabled = false;
if (!in_array($file_type, $access_typies)) {
$file_type = "IMAGE";
}
if ($file_type == "FLASH") {
$flashEnabled = true;
static $flashMime = array("application/x-shockwave-flash", "application/vnd.adobe.flash.movie");
$res = CFile::CheckFile($arFile, $iMaxSize, $flashMime, CFile::GetFlashExtensions(), $bForceMD5, $bSkipExt);
} else {
$res = CFile::CheckFile($arFile, $iMaxSize, "image/", CFile::GetImageExtensions(), $bForceMD5, $bSkipExt);
}
if ($res != '') {
return $res;
}
$imgArray = CFile::GetImageSize($arFile["tmp_name"], true, $flashEnabled);
if (is_array($imgArray)) {
$intWIDTH = $imgArray[0];
$intHEIGHT = $imgArray[1];
} else {
return GetMessage("FILE_BAD_FILE_TYPE") . ".<br>";
}
//check for dimensions
if ($iMaxWidth > 0 && ($intWIDTH > $iMaxWidth || $intWIDTH == 0) || $iMaxHeight > 0 && ($intHEIGHT > $iMaxHeight || $intHEIGHT == 0)) {
return GetMessage("FILE_BAD_MAX_RESOLUTION") . " (" . $iMaxWidth . " * " . $iMaxHeight . " " . GetMessage("main_include_dots") . ").<br>";
}
return null;
}
示例9: array
'css' => $pathCSS.'/core_canvas.css',
'lang' => $pathLang.'/js_core_canvas.php',
'rel' => array('popup'),
),
'uploader' => array(
'js' => array(
$pathJS.'/core_uploader/common.js',
$pathJS.'/core_uploader/uploader.js',
$pathJS.'/core_uploader/file.js',
$pathJS.'/core_uploader/queue.js',
),
'lang_additional' => array(
"phpMaxFileUploads" => ini_get("max_file_uploads"),
"phpPostMaxSize" => CUtil::Unformat(ini_get("post_max_size")),
"phpUploadMaxFilesize" => CUtil::Unformat(ini_get("upload_max_filesize")),
"bxImageExtensions" => CFile::GetImageExtensions()
),
'lang' => $pathLang.'/js_core_uploader.php',
'rel' => array('ajax', 'dd')
),
'site_speed' => array(
'js' => $pathJS.'/site_speed/site_speed.js',
'lang' => $pathLang.'/js_site_speed.php',
'rel' => array('amcharts_serial', 'ajax', "date")
),
'qrcode' => array(
'js' => array(
'/bitrix/js/main/qrcode/qrcode.js'
)
),
示例10: CheckFile
public static function CheckFile($arFile, $iMaxSize = 0, $iMaxWidth = 0, $iMaxHeight = 0, $access_typies = array(), $bForceMD5 = false, $bSkipExt = false)
{
if ($arFile["name"] == "") {
return "";
}
if (preg_match("#^php://filter#i", $arFile["tmp_name"])) {
return GetMessage("FILE_BAD_FILE_TYPE") . ".<br>";
}
$extension = GetFileExtension(strtolower($arFile["name"]));
switch ($extension) {
case "jpg":
case "jpeg":
case "gif":
case "bmp":
case "png":
$file_type = "IMAGE";
break;
case "swf":
$file_type = "FLASH";
break;
case "mp4":
case "webm":
case "ogg":
$file_type = "VIDEO";
break;
default:
$file_type = "UNKNOWN";
}
// IMAGE by default
$flashEnabled = false;
if (!in_array($file_type, $access_typies)) {
$file_type = "IMAGE";
}
if ($file_type == "FLASH") {
$flashEnabled = true;
static $flashMime = array("application/x-shockwave-flash", "application/vnd.adobe.flash.movie");
$res = CFile::CheckFile($arFile, $iMaxSize, $flashMime, CFile::GetFlashExtensions(), $bForceMD5, $bSkipExt);
} else {
if ($file_type == "VIDEO") {
$res = CFile::CheckFile($arFile, $iMaxSize, "video/", "mp4,webm,ogg", $bForceMD5, $bSkipExt);
} else {
$res = CFile::CheckFile($arFile, $iMaxSize, "image/", CFile::GetImageExtensions(), $bForceMD5, $bSkipExt);
}
}
if ($res != '') {
return $res;
}
if ($file_type == 'IMAGE' || $file_type == "FLASH") {
$imgArray = CFile::GetImageSize($arFile["tmp_name"], true, $flashEnabled);
if (is_array($imgArray)) {
$intWIDTH = $imgArray[0];
$intHEIGHT = $imgArray[1];
} else {
return GetMessage("FILE_BAD_FILE_TYPE") . ".<br>";
}
//check for dimensions
if ($iMaxWidth > 0 && ($intWIDTH > $iMaxWidth || $intWIDTH == 0) || $iMaxHeight > 0 && ($intHEIGHT > $iMaxHeight || $intHEIGHT == 0)) {
return GetMessage("FILE_BAD_MAX_RESOLUTION") . " (" . $iMaxWidth . " * " . $iMaxHeight . " " . GetMessage("main_include_dots") . ").<br>";
}
}
return null;
}
示例11: CheckFields
public function CheckFields(&$arFields, $ID = false, $options = array())
{
global $APPLICATION, $USER_FIELD_MANAGER;
$this->LAST_ERROR = '';
if (($ID == false || isset($arFields['TITLE'])) && empty($arFields['TITLE'])) {
$this->LAST_ERROR .= GetMessage('CRM_ERROR_FIELD_IS_MISSING', array('%FIELD_NAME%' => GetMessage('CRM_FIELD_TITLE'))) . "<br />";
}
if (isset($arFields['FM']) && is_array($arFields['FM'])) {
$CCrmFieldMulti = new CCrmFieldMulti();
if (!$CCrmFieldMulti->CheckComplexFields($arFields['FM'])) {
$this->LAST_ERROR .= $CCrmFieldMulti->LAST_ERROR;
}
}
if (isset($arFields['LOGO']) && is_array($arFields['LOGO'])) {
if (($strError = CFile::CheckFile($arFields['LOGO'], 0, 0, CFile::GetImageExtensions())) != '') {
$this->LAST_ERROR .= $strError . "<br />";
}
}
$enableUserFildCheck = !(is_array($options) && isset($options['DISABLE_USER_FIELD_CHECK']) && $options['DISABLE_USER_FIELD_CHECK'] === true);
if ($enableUserFildCheck) {
// We have to prepare field data before check (issue #22966)
CCrmEntityHelper::NormalizeUserFields($arFields, self::$sUFEntityID, $USER_FIELD_MANAGER, array('IS_NEW' => $ID == false));
if (!$USER_FIELD_MANAGER->CheckFields(self::$sUFEntityID, $ID, $arFields)) {
$e = $APPLICATION->GetException();
$this->LAST_ERROR .= $e->GetString();
}
}
if (strlen($this->LAST_ERROR) > 0) {
return false;
}
return true;
}
示例12: CheckFields
public function CheckFields(&$arFields, $ID = false, $options = array())
{
global $APPLICATION, $USER_FIELD_MANAGER;
$this->LAST_ERROR = '';
if (($ID == false || isset($arFields['NAME']) && isset($arFields['LAST_NAME'])) && (empty($arFields['NAME']) && empty($arFields['LAST_NAME']))) {
$this->LAST_ERROR .= GetMessage('CRM_ERROR_REQUIRED_FIELDS') . "<br />";
}
if (isset($arFields['FM']) && is_array($arFields['FM'])) {
$CCrmFieldMulti = new CCrmFieldMulti();
if (!$CCrmFieldMulti->CheckComplexFields($arFields['FM'])) {
$this->LAST_ERROR .= $CCrmFieldMulti->LAST_ERROR;
}
}
if (isset($arFields['PHOTO']) && is_array($arFields['PHOTO'])) {
if (($strError = CFile::CheckFile($arFields['PHOTO'], 0, 0, CFile::GetImageExtensions())) != '') {
$this->LAST_ERROR .= $strError . "<br />";
}
}
if (isset($arFields['BIRTHDATE']) && $arFields['BIRTHDATE'] !== '' && !CheckDateTime($arFields['BIRTHDATE'])) {
$this->LAST_ERROR .= GetMessage('CRM_ERROR_FIELD_INCORRECT', array('%FIELD_NAME%' => self::GetFieldCaption('BIRTHDATE'))) . "<br />";
}
$enableUserFildCheck = !(is_array($options) && isset($options['DISABLE_USER_FIELD_CHECK']) && $options['DISABLE_USER_FIELD_CHECK'] === true);
if ($enableUserFildCheck) {
// We have to prepare field data before check (issue #22966)
CCrmEntityHelper::NormalizeUserFields($arFields, self::$sUFEntityID, $USER_FIELD_MANAGER, array('IS_NEW' => $ID == false));
if (!$USER_FIELD_MANAGER->CheckFields(self::$sUFEntityID, $ID, $arFields)) {
$e = $APPLICATION->GetException();
$this->LAST_ERROR .= $e->GetString();
}
}
return $this->LAST_ERROR === '';
}
示例13: array
<?php
$pathJS = '/bitrix/js/main/core';
$pathCSS = '/bitrix/js/main/core/css';
$pathCSSPanel = '/bitrix/panel/main';
$pathLang = BX_ROOT . '/modules/main/lang/' . LANGUAGE_ID;
//WARNING: Don't use CUserOptions here! CJSCore::Init can be called from php_interface/init.php where no $USER exists
$amChartsPath = '/bitrix/js/main/amcharts/3.13/';
$arJSCoreConfig = array('ajax' => array('js' => $pathJS . '/core_ajax.js'), 'admin' => array('js' => $pathJS . '/core_admin.js', 'css' => array($pathCSS . '/core_panel.css', $pathCSSPanel . '/admin-public.css'), 'lang' => $pathLang . '/js_core_admin.php', 'rel' => array('ajax'), 'use' => CJSCore::USE_PUBLIC), 'admin_interface' => array('js' => $pathJS . '/core_admin_interface.js', 'lang' => $pathLang . '/js_core_admin_interface.php', 'css' => $pathCSSPanel . '/admin-public.css', 'rel' => array('ajax', 'popup', 'window', 'date', 'fx'), 'lang_additional' => array('TITLE_PREFIX' => CUtil::JSEscape(COption::GetOptionString("main", "site_name", $_SERVER["SERVER_NAME"])) . " - ")), "admin_login" => array('js' => $pathJS . "/core_admin_login.js", 'css' => $pathCSSPanel . "/login.css", 'rel' => array("ajax", "window")), 'autosave' => array('js' => $pathJS . '/core_autosave.js', 'lang' => $pathLang . '/js_core_autosave.php', 'rel' => array('ajax')), 'fx' => array('js' => $pathJS . '/core_fx.js'), 'dd' => array('js' => $pathJS . '/core_dd.js'), 'webrtc' => array('js' => $pathJS . '/core_webrtc.js'), 'popup' => array('js' => $pathJS . '/core_popup.js', 'css' => $pathCSS . '/core_popup.css'), 'tags' => array('js' => $pathJS . '/core_tags.js', 'css' => $pathCSS . '/core_tags.css', 'lang' => $pathLang . '/js_core_tags.php', 'rel' => array('popup')), 'timer' => array('js' => $pathJS . '/core_timer.js'), 'tooltip' => array('js' => $pathJS . '/core_tooltip.js', 'css' => $pathCSS . '/core_tooltip.css', 'rel' => array('ajax'), 'lang_additional' => array('TOOLTIP_ENABLED' => IsModuleInstalled("socialnetwork") && COption::GetOptionString("socialnetwork", "allow_tooltip", "Y") == "Y" ? "Y" : "N")), 'translit' => array('js' => $pathJS . '/core_translit.js', 'lang' => $pathLang . '/js_core_translit.php', 'lang_additional' => array('YANDEX_KEY' => COption::GetOptionString('main', 'translate_key_yandex', ''))), 'image' => array('js' => $pathJS . '/core_image.js', 'css' => $pathCSS . '/core_image.css', 'rel' => array('ls')), 'viewer' => array('js' => $pathJS . '/core_viewer.js', 'css' => $pathCSS . '/core_viewer.css', 'lang' => $pathLang . '/js_core_viewer.php', 'rel' => array('ls', 'ajax', 'popup')), 'window' => array('js' => $pathJS . '/core_window.js', 'css' => $pathCSSPanel . '/popup.css', 'rel' => array('ajax')), 'access' => array('js' => $pathJS . '/core_access.js', 'css' => $pathCSS . '/core_access.css', 'rel' => array('popup', 'ajax', 'finder'), 'lang' => $pathLang . '/js_core_access.php'), 'finder' => array('js' => $pathJS . '/core_finder.js', 'css' => $pathCSS . '/core_finder.css', 'rel' => array('popup', 'ajax', 'db_indexeddb')), 'date' => array('js' => $pathJS . '/core_date.js', 'css' => $pathCSS . '/core_date.css', 'lang' => $pathLang . '/date_format.php', 'lang_additional' => array('WEEK_START' => CSite::GetWeekStart()), 'rel' => array('popup')), 'ls' => array('js' => $pathJS . '/core_ls.js', 'rel' => array('json')), 'db' => array('js' => $pathJS . '/core_db.js'), 'db_indexeddb' => array('js' => $pathJS . '/core_db_indexeddb.js'), 'fc' => array('js' => $pathJS . '/core_frame_cache.js', 'rel' => array('db', 'ajax', 'ls', 'fx')), 'canvas' => array('js' => $pathJS . '/core_canvas.js', 'css' => $pathCSS . '/core_canvas.css', 'lang' => $pathLang . '/js_core_canvas.php', 'rel' => array('popup')), 'uploader' => array('js' => array($pathJS . '/core_uploader/common.js', $pathJS . '/core_uploader/uploader.js', $pathJS . '/core_uploader/file.js', $pathJS . '/core_uploader/queue.js'), 'lang_additional' => array("phpMaxFileUploads" => ini_get("max_file_uploads"), "phpPostMaxSize" => CUtil::Unformat(ini_get("post_max_size")), "phpUploadMaxFilesize" => CUtil::Unformat(ini_get("upload_max_filesize")), "bxImageExtensions" => CFile::GetImageExtensions(), "bxUploaderLog" => COption::GetOptionString("main", "uploaderLog", "N")), 'lang' => $pathLang . '/js_core_uploader.php', 'rel' => array('ajax', 'dd')), 'site_speed' => array('js' => $pathJS . '/site_speed/site_speed.js', 'lang' => $pathLang . '/js_site_speed.php', 'rel' => array('amcharts_serial', 'ajax', "date")), 'qrcode' => array('js' => array('/bitrix/js/main/qrcode/qrcode.js')), 'fileinput' => array('js' => $pathJS . '/core_fileinput.js', 'css' => $pathCSS . '/core_fileinput.css', 'lang' => $pathLang . '/js_core_fileinput.php', 'rel' => array("ajax", "window", "popup", "uploader", "canvas", "dd")), 'jquery' => array('js' => '/bitrix/js/main/jquery/jquery-1.8.3.min.js', 'skip_core' => true), 'jquery_src' => array('js' => '/bitrix/js/main/jquery/jquery-1.8.3.js', 'skip_core' => true), 'jquery2' => array('js' => '/bitrix/js/main/jquery/jquery-2.1.3.min.js', 'skip_core' => true), 'jquery2_src' => array('js' => '/bitrix/js/main/jquery/jquery-2.1.3.js', 'skip_core' => true), 'json' => array('js' => '/bitrix/js/main/json/json2.min.js', 'skip_core' => true), 'json_src' => array('js' => '/bitrix/js/main/json/json2.js', 'skip_core' => true), 'amcharts' => array('js' => $amChartsPath . 'amcharts.js', 'lang_additional' => array('AMCHARTS_PATH' => $amChartsPath, 'AMCHARTS_IMAGES_PATH' => $amChartsPath . 'images/'), 'skip_core' => true), 'amcharts_funnel' => array('js' => $amChartsPath . 'funnel.js', 'rel' => array('amcharts'), 'skip_core' => true), 'amcharts_gauge' => array('js' => $amChartsPath . 'gauge.js', 'rel' => array('amcharts'), 'skip_core' => true), 'amcharts_pie' => array('js' => $amChartsPath . 'pie.js', 'rel' => array('amcharts'), 'skip_core' => true), 'amcharts_radar' => array('js' => $amChartsPath . 'radar.js', 'rel' => array('amcharts'), 'skip_core' => true), 'amcharts_serial' => array('js' => $amChartsPath . 'serial.js', 'rel' => array('amcharts'), 'skip_core' => true), 'amcharts_xy' => array('js' => $amChartsPath . 'xy.js', 'rel' => array('amcharts'), 'skip_core' => true));
foreach ($arJSCoreConfig as $ext => $arExt) {
CJSCore::RegisterExt($ext, $arExt);
}
示例14: GetExtensionIcon
function GetExtensionIcon($urlT)
{
$arIco = array("doc" => "doc.jpg", "docx" => "doc.jpg", "pdf" => "pdf.jpg", "pic.jpg" => "pdf.jpg", "ppt" => "ppt.jpg", "pptx" => "ppt.jpg", "xls" => "xls.jpg", "xlsx" => "xls.jpg", "txt" => "txt.jpg");
$res = "empty.jpg";
$arIm = explode(",", CFile::GetImageExtensions());
foreach ($arIm as $ci) {
if (strlen($ci) > 0) {
$arIco[$ci] = "pic.jpg";
}
}
$fExtQ = strtolower(GetFileExtension($urlT));
if (array_key_exists($fExtQ, $arIco)) {
$res = $arIco[$fExtQ];
}
return $res;
}