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


PHP CFileInput::menuExist方法代碼示例

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


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

示例1: DisplayControl

    private static function DisplayControl($inputs = array())
    {
        self::$menuNew = array();
        self::$menuExist = array();
        if ($inputs['upload']) {
            self::$menuNew[] = array("ID" => "upload", "GLOBAL_ICON" => "adm-menu-upload-pc", "TEXT" => GetMessage("ADM_FILE_UPLOAD"), "CLOSE_ON_CLICK" => false);
            self::$menuExist[] = array("ID" => "upload", "GLOBAL_ICON" => "adm-menu-upload-pc", "TEXT" => GetMessage("ADM_FILE_NEW_UPLOAD"), "CLOSE_ON_CLICK" => false);
        }
        if ($inputs['medialib']) {
            self::$menuNew[] = array("TEXT" => GetMessage("ADM_FILE_MEDIALIB"), "GLOBAL_ICON" => "adm-menu-upload-medialib", "ONCLICK" => "OpenMedialibDialog" . self::$jsId . "()");
            self::$menuExist[] = array("TEXT" => GetMessage("ADM_FILE_NEW_MEDIALIB"), "GLOBAL_ICON" => "adm-menu-upload-medialib", "ONCLICK" => "OpenMedialibDialog" . self::$jsId . "()");
        }
        if ($inputs['file_dialog']) {
            self::$menuNew[] = array("TEXT" => GetMessage("ADM_FILE_SITE"), "GLOBAL_ICON" => "adm-menu-upload-site", "ONCLICK" => "OpenFileDialog" . self::$jsId . "()");
            self::$menuExist[] = array("TEXT" => GetMessage("ADM_FILE_NEW_SITE"), "GLOBAL_ICON" => "adm-menu-upload-site", "ONCLICK" => "OpenFileDialog" . self::$jsId . "()");
        }
        if ($inputs['cloud']) {
            self::$menuNew[] = array("TEXT" => GetMessage("ADM_FILE_CLOUD"), "GLOBAL_ICON" => "adm-menu-upload-cloud", "ONCLICK" => "OpenCloudDialog" . self::$jsId . "()");
            self::$menuExist[] = array("TEXT" => GetMessage("ADM_FILE_NEW_CLOUD"), "GLOBAL_ICON" => "adm-menu-upload-cloud", "ONCLICK" => "OpenCloudDialog" . self::$jsId . "()");
        }
        $arConfig = array('id' => self::$jsId, 'fileExists' => self::$bFileExists, 'files' => self::$curFiles, 'menuNew' => self::$menuNew, 'menuExist' => self::$menuExist, 'multiple' => self::$bMultiple, 'useUpload' => self::$bUseUpload, 'useMedialib' => self::$bUseMedialib, 'useFileDialog' => self::$bUseFileDialog, 'useCloud' => self::$bUseCloud, 'delName' => self::$delInputName, 'descName' => self::$descInputName, 'inputSize' => self::$inputSize, 'minPreviewHeight' => self::$minPreviewHeight, 'minPreviewWidth' => self::$minPreviewWidth, 'showDesc' => self::$bShowDescInput, 'showDel' => self::$bShowDelInput, 'maxCount' => self::$maxCount, 'viewMode' => self::$bViewMode);
        if (self::$bMultiple) {
            $arConfig['inputNameTemplate'] = self::$inputNameTemplate;
        } else {
            $arConfig['inputs'] = self::$arInputs;
        }
        if (self::$bUseCloud) {
            $arConfig['cloudDialogPath'] = '/bitrix/admin/clouds_file_search.php?lang=' . LANGUAGE_ID . '&n=';
        }
        //Base container
        ?>
<div class="adm-input-file-control" id="<?php 
        echo self::$jsId . '_cont';
        ?>
"><?php 
        if (!self::$bViewMode) {
            self::DisplayDialogs();
        }
        if (self::$bFileExists) {
            foreach (self::$curFiles as $ind => $arFile) {
                self::DisplayFile($arFile, $ind);
            }
        }
        ?>
		<script type="text/javascript">new top.BX.file_input(<?php 
        echo CUtil::PHPToJSObject($arConfig);
        ?>
);</script>
		</div>
		<?php 
        /* Used to refresh form content - workaround for IE bug (mantis:37969) */
        ?>
	<div id="<?php 
        echo self::$jsId . '_ie_bogus_container';
        ?>
"><input type="hidden" value="" /></div>
	<?php 
    }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:58,代碼來源:file_input.php


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