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


PHP def_module::flush方法代码示例

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


在下文中一共展示了def_module::flush方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: elfinder_connector

 public function elfinder_connector($needInfo = false)
 {
     $needInfo = !$needInfo ? getRequest('param0') : $needInfo;
     if ($needInfo == "getSystemInfo") {
         $arData = array('maxFilesCount' => ini_get("max_file_uploads") ? ini_get("max_file_uploads") : 20);
         return def_module::flush(json_encode($arData), "text/javascript");
     }
     $elfClasses = CURRENT_WORKING_DIR . "/styles/common/other/elfinder/php/";
     require_once $elfClasses . 'elFinderConnector.class.php';
     //require_once $elfClasses . 'elFinder.class.php';
     require_once $elfClasses . 'elFinder.umi.class.php';
     require_once $elfClasses . 'elFinderVolumeDriver.class.php';
     require_once $elfClasses . 'elFinderVolumeLocalFileSystem.class.php';
     require_once $elfClasses . 'elFinderVolumeUmiLocalFileSystem.class.php';
     // full access mode for filemanager module (?full-access=1)
     $isFullAccess = (bool) getRequest('full-access');
     function elfinder_full_access($attr, $path, $data, $volume)
     {
         return strpos(basename($path), '.') === 0 ? !($attr == 'read' || $attr == 'write') : $attr == 'read' || $attr == 'write';
     }
     function elfinder_access($attr, $path, $data, $volume)
     {
         if (strpos(basename($path), '.') === 0) {
             return !($attr == 'read' || $attr == 'write');
         } else {
             if (defined("CURRENT_VERSION_LINE") && CURRENT_VERSION_LINE == "demo") {
                 return !($attr == 'write' || $attr == 'hidden');
             }
             return $attr == 'read' || $attr == 'write';
         }
     }
     $opts = array('debug' => true, 'roots' => array());
     $permissions = permissionsCollection::getInstance();
     $userId = $permissions->getUserId();
     $user = umiObjectsCollection::getInstance()->getObject($userId);
     $allowedDirectories = array();
     if (!(defined("CURRENT_VERSION_LINE") && CURRENT_VERSION_LINE == "demo") && ($filemanagerDirectory = $user->getValue('filemanager_directory'))) {
         $i = 1;
         $directories = explode(",", $filemanagerDirectory);
         foreach ($directories as $directory) {
             $directory = trim($directory);
             if (!strlen($directory)) {
                 continue;
             }
             $directory = trim($directory, "/");
             $directoryPath = realpath(CURRENT_WORKING_DIR . "/" . $directory);
             if (strpos($directoryPath, CURRENT_WORKING_DIR . '/files') === false && strpos($directoryPath, CURRENT_WORKING_DIR . '/images') === false || !is_dir($directoryPath)) {
                 continue;
             }
             $allowedDirectories[] = $directory;
         }
     }
     if (count($allowedDirectories)) {
         $i = 1;
         foreach ($allowedDirectories as $directory) {
             $opts['roots'][] = array('id' => 'files' . $i, 'driver' => 'UmiLocalFileSystem', 'path' => CURRENT_WORKING_DIR . "/" . $directory, 'URL' => "/" . $directory, 'accessControl' => 'elfinder_access');
             $i++;
         }
     } else {
         $opts['roots'][] = array('id' => 'files', 'driver' => 'UmiLocalFileSystem', 'path' => CURRENT_WORKING_DIR . '/files/', 'URL' => '/files/', 'accessControl' => $isFullAccess ? 'elfinder_full_access' : 'elfinder_access');
         $opts['roots'][] = array('id' => 'images', 'driver' => 'UmiLocalFileSystem', 'path' => CURRENT_WORKING_DIR . '/images/', 'startPath' => CURRENT_WORKING_DIR . '/images/cms/data', 'URL' => '/images/', 'accessControl' => $isFullAccess ? 'elfinder_full_access' : 'elfinder_access');
     }
     // run elFinder
     $connector = new elFinderConnector(new elFinder($opts));
     $connector->run();
 }
开发者ID:BGCX261,项目名称:zimmerli-svn-to-git,代码行数:66,代码来源:__files.php


注:本文中的def_module::flush方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。