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


PHP manager::getFolderInfo方法代码示例

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


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

示例1: SessionAction

		/**
		 * constructor
		 *
		 * @param string $rootFolder
		 */
		function __construct($rootFolder)
		{
			$this->rootFolder = $rootFolder;
			$this->sessionAction = new SessionAction();
			$objRootFolder = new file($this->rootFolder);
			$tem = $objRootFolder->getFileInfo();
			$obj = new manager($this->rootFolder, false);			
			$obj->setSessionAction($this->sessionAction);
			$selectedDocuments = $this->sessionAction->get();					
			$fileType = $obj->getFolderInfo($this->rootFolder);
			
			foreach($fileType as $k=>$v)
			{
				$tem[$k] = $v;
			}
			
			$tem['path'] = backslashToSlash($this->rootFolder);		
			$tem['type'] = (is_dir($this->rootFolder)?'folder':'file');
			$tem['size'] = (is_dir($this->rootFolder)?'':transformFileSize(@filesize($this->rootFolder)));
			//$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
			//$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
			$tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag');
			$tem['url'] = getFileUrl($this->rootFolder);
			$tem['friendly_path'] = transformFilePath($this->rootFolder);
			$tem['file'] = 0;
			$tem['subdir'] = 0;
			$manager = null;
			$this->rootFolderInfo = $tem;
			$tem = null;			
		}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:35,代码来源:class.search.php

示例2: SessionAction

        $search->addSearchKeyword('size_from', @$_GET['search_size_from']);
        $search->addSearchKeyword('size_to', @$_GET['search_size_to']);
        $search->addSearchKeyword('recursive', @$_GET['search_recursively']);
        $search->addSearchKeyword('name', @$_GET['search_name']);
        $search->doSearch();
        $fileList = $search->getFoundFiles();
        $folderInfo = $search->getRootFolderInfo();
    } else {
        include_once CLASS_MANAGER;
        include_once CLASS_SESSION_ACTION;
        $sessionAction = new SessionAction();
        include_once DIR_AJAX_INC . "class.manager.php";
        $manager = new manager();
        $manager->setSessionAction($sessionAction);
        $fileList = $manager->getFileList();
        $folderInfo = $manager->getFolderInfo();
    }
    $pagination->setUrl(CONFIG_URL_FILEnIMAGE_MANAGER);
} else {
    include_once CLASS_PAGINATION;
    $pagination = new pagination(false);
}
$pagination->setTotal(sizeof($fileList));
$pagination->setFirstText(PAGINATION_FIRST);
$pagination->setPreviousText(PAGINATION_PREVIOUS);
$pagination->setNextText(PAGINATION_NEXT);
$pagination->setLastText(PAGINATION_LAST);
$pagination->setLimit(!empty($_GET['limit']) ? (int) $_GET['limit'] : CONFIG_DEFAULT_PAGINATION_LIMIT);
echo $pagination->getPaginationHTML();
echo "<script type=\"text/javascript\">\n";
echo "parentFolder = {path:'" . getParentFolderPath($folderInfo['path']) . "'};\n";
开发者ID:greench,项目名称:prestashop,代码行数:31,代码来源:ajax_get_file_listing.php

示例3: elseif

} elseif (empty($_POST['new_folder'])) {
    $error = ERR_FOLDER_NAME_EMPTY;
} elseif (!preg_match("/^[a-zA-Z0-9_\\- ]+\$/", $_POST['new_folder'])) {
    $error = ERR_FOLDER_FORMAT;
} else {
    if (empty($_POST['currentFolderPath']) || !isUnderRoot($_POST['currentFolderPath'])) {
        $error = ERR_FOLDER_PATH_NOT_ALLOWED;
    } elseif (file_exists(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'])) {
        $error = ERR_FOLDER_EXISTS;
    } else {
        include_once CLASS_FILE;
        $file = new file();
        if ($file->mkdir(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], 0775)) {
            include_once CLASS_MANAGER;
            $manager = new manager(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], false);
            $pathInfo = $manager->getFolderInfo(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']);
            foreach ($pathInfo as $k => $v) {
                switch ($k) {
                    case "ctime":
                    case "mtime":
                    case "atime":
                        $v = date(DATE_TIME_FORMAT, $v);
                        break;
                    case 'name':
                        $info .= sprintf(", %s:'%s'", 'short_name', shortenFileName($v));
                        break;
                    case 'cssClass':
                        $v = 'folderEmpty';
                        break;
                }
                $info .= sprintf(", %s:'%s'", $k, $v);
开发者ID:bachnx92,项目名称:vemaybay,代码行数:31,代码来源:ajax_create_folder.php

示例4: getFolderInfo

 /**
  * get current or the specified dir information
  *
  * @param string $path
  * @return array
  */
 function getFolderInfo($path = null)
 {
     if (is_null($path)) {
         return $this->currentFolderInfo;
     } else {
         $obj = new manager($path, false);
         $obj->setSessionAction($this->sessionAction);
         $obj->getFileList();
         return $obj->getFolderInfo();
     }
 }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:17,代码来源:class.manager.php

示例5: SessionAction

    $sessionAction = new SessionAction();
    $selectedDocuments = $sessionAction->get();
    if (removeTrailingSlash($sessionAction->getFolder()) == getParentPath($_POST['original_path']) && sizeof($selectedDocuments)) {
        if (($key = array_search(basename($_POST['original_path']), $selectedDocuments)) !== false) {
            $selectedDocuments[$key] = $_POST['name'];
            $sessionAction->set($selectedDocuments);
        }
    } elseif (removeTrailingSlash($sessionAction->getFolder()) == removeTrailingSlash($_POST['original_path'])) {
        $sessionAction->setFolder($_POST['original_path']);
    }
    $path = addTrailingSlash(getParentPath($_POST['original_path'])) . $_POST['name'];
    if (is_file($path)) {
        include_once CLASS_FILE;
        $file = new file($path);
        $fileInfo = $file->getFileInfo();
        $fileInfo['mtime'] = date(DATE_TIME_FORMAT, $fileInfo['mtime']);
    } else {
        include_once CLASS_MANAGER;
        $manager = new manager($path, false);
        $fileInfo = $manager->getFolderInfo();
        $fileInfo['mtime'] = date(DATE_TIME_FORMAT, $fileInfo['mtime']);
    }
    event_system(LOG_MY_FOLDER_CHANGE, LOG_MY_FOLDER_PATH, $_POST['original_path']);
    event_system(LOG_MY_FOLDER_CHANGE, LOG_MY_FOLDER_NEW_PATH, $path);
}
echo "{";
echo "error:'" . $error . "' ";
foreach ($fileInfo as $k => $v) {
    echo "," . $k . ":'" . $v . "' ";
}
echo "}";
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:ajax_save_name.php


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