當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CLightHTMLEditor::IsMobileDevice方法代碼示例

本文整理匯總了PHP中CLightHTMLEditor::IsMobileDevice方法的典型用法代碼示例。如果您正苦於以下問題:PHP CLightHTMLEditor::IsMobileDevice方法的具體用法?PHP CLightHTMLEditor::IsMobileDevice怎麽用?PHP CLightHTMLEditor::IsMobileDevice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CLightHTMLEditor的用法示例。


在下文中一共展示了CLightHTMLEditor::IsMobileDevice方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Init


//.........這裏部分代碼省略.........
		$this->bManualResize = $this->bResizable && $arParams['bManualResize'] !== false;
		$this->bAutoResize = $arParams['bAutoResize'] !== false;
		$this->bInitByJS = $arParams['bInitByJS'] === true;
		$this->bSaveOnBlur = $arParams['bSaveOnBlur'] !== false;
		$this->content = $arParams['content'];
		$this->inputName = isset($arParams['inputName']) ? $arParams['inputName'] : 'lha_content';
		$this->inputId = isset($arParams['inputId']) ? $arParams['inputId'] : 'lha_content_id';
		$this->videoSettings = is_array($arParams['videoSettings']) ? $arParams['videoSettings'] : array(
				'maxWidth' => 640,
				'maxHeight' => 480,
				'WMode' => 'transparent',
				'windowless' => true,
				'bufferLength' => 20,
				'skin' => '/freetrix/components/freetrix/player/mediaplayer/skins/freetrix.swf',
				'logo' => ''
			);

		if (!is_array($arParams['arFonts']) || count($arParams['arFonts']) <= 0)
			$arParams['arFonts'] = array('Arial', 'Verdana', 'Times New Roman', 'Courier', 'Tahoma', 'Georgia', 'Optima', 'Impact', 'Geneva', 'Helvetica');

		if (!is_array($arParams['arFontSizes']) || count($arParams['arFontSizes']) <= 0)
			$arParams['arFontSizes'] = array('1' => 'xx-small', '2' => 'x-small', '3' => 'small', '4' => 'medium', '5' => 'large', '6' => 'x-large', '7' => 'xx-large');

		// Tables
		//$this->arJSPath[] = $this->GetActualPath($basePath.'le_table.js');
		$this->jsObjName = (isset($arParams['jsObjName']) && strlen($arParams['jsObjName']) > 0) ? $arParams['jsObjName'] : 'LightHTMLEditor'.$this->Id;

		if ($this->bResizable)
		{
			// Get height user settings
			$userOpt = CUserOptions::GetOption(
				'fileman',
				'LHESize_'.$this->Id,
				array('height' => $arParams['height'])
			);
			$arParams['height'] = intval($userOpt['height']) > 0 ? $userOpt['height'] : $arParams['height'];
		}

		$this->JSConfig = array(
			'id' => $this->Id,
			'content' => $this->content,
			'bBBCode' => $this->bBBCode,
			'bUseFileDialogs' => $this->bUseFileDialogs,
			'bUseMedialib' => $this->bUseMedialib,
			'arSmiles' => $arParams['arSmiles'],
			'arFonts' => $arParams['arFonts'],
			'arFontSizes' => $arParams['arFontSizes'],
			'inputName' => $this->inputName,
			'inputId' => $this->inputId,
			'videoSettings' => $this->videoSettings,
			'bSaveOnBlur' => $this->bSaveOnBlur,
			'bResizable' => $this->bResizable,
			'autoResizeSaveSize' => $arParams['autoResizeSaveSize'] !== false,
			'bManualResize' => $this->bManualResize,
			'bAutoResize' => $this->bAutoResize,
			'bReplaceTabToNbsp' => true,
			'bSetDefaultCodeView' => isset($arParams['bSetDefaultCodeView']) && $arParams['bSetDefaultCodeView'],
			'bBBParseImageSize' => isset($arParams['bBBParseImageSize']) && $arParams['bBBParseImageSize'],
			'smileCountInToolbar' => intVal($arParams['smileCountInToolbar']),
			'bQuoteFromSelection' => isset($arParams['bQuoteFromSelection']) && $arParams['bQuoteFromSelection'],
			'bConvertContentFromBBCodes' => isset($arParams['bConvertContentFromBBCodes']) && $arParams['bConvertContentFromBBCodes'],
			'oneGif' => '/freetrix/images/1.gif',
			'imagePath' => '/freetrix/images/fileman/light_htmledit/'
		);

		// Set editor from visual mode to textarea for mobile devices
		if (!isset($this->JSConfig['bSetDefaultCodeView']) && CLightHTMLEditor::IsMobileDevice())
			$this->JSConfig['bSetDefaultCodeView'] = true;

		if (isset($arParams['width']) && intVal($arParams['width']) > 0)
			$this->JSConfig['width'] = $arParams['width'];
		if (isset($arParams['height']) && intVal($arParams['height']) > 0)
			$this->JSConfig['height'] = $arParams['height'];
		if (isset($arParams['toolbarConfig']))
			$this->JSConfig['toolbarConfig'] = $arParams['toolbarConfig'];
		if (isset($arParams['documentCSS']))
			$this->JSConfig['documentCSS'] = $arParams['documentCSS'];
		if (isset($arParams['fontFamily']))
			$this->JSConfig['fontFamily'] = $arParams['fontFamily'];
		if (isset($arParams['fontSize']))
			$this->JSConfig['fontSize'] = $arParams['fontSize'];
		if (isset($arParams['lineHeight']))
			$this->JSConfig['lineHeight'] = $arParams['lineHeight'];
		if (isset($arParams['bHandleOnPaste']))
			$this->JSConfig['bHandleOnPaste'] = $arParams['bHandleOnPaste'];
		if (isset($arParams['autoResizeOffset']))
			$this->JSConfig['autoResizeOffset'] = $arParams['autoResizeOffset'];
		if (isset($arParams['autoResizeMaxHeight']))
			$this->JSConfig['autoResizeMaxHeight'] = $arParams['autoResizeMaxHeight'];
		if (isset($arParams['controlButtonsHeight']))
			$this->JSConfig['controlButtonsHeight'] = $arParams['controlButtonsHeight'];

		if ($this->bBBCode)
		{
			$this->JSConfig['bParceBBImageSize'] = true;
		}

		if (isset($arParams['ctrlEnterHandler']))
			$this->JSConfig['ctrlEnterHandler'] = $arParams['ctrlEnterHandler'];
	}
開發者ID:ASDAFF,項目名稱:open_bx,代碼行數:101,代碼來源:light_editor.php


注:本文中的CLightHTMLEditor::IsMobileDevice方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。