当前位置: 首页>>代码示例>>PHP>>正文


PHP CFileInput::menuNew方法代码示例

本文整理汇总了PHP中CFileInput::menuNew方法的典型用法代码示例。如果您正苦于以下问题:PHP CFileInput::menuNew方法的具体用法?PHP CFileInput::menuNew怎么用?PHP CFileInput::menuNew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFileInput的用法示例。


在下文中一共展示了CFileInput::menuNew方法的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::menuNew方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。