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


PHP FileList::filterBySet方法代码示例

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


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

示例1: view

 public function view()
 {
     $fs = FileSet::getByID($this->fsID);
     $fileList = new FileList();
     $fileList->filterBySet($fs);
     $fileList->filterByType(FileType::T_IMAGE);
     $fileList->sortByFileSetDisplayOrder();
     $images = $fileList->get(1000, 0);
     $this->set('images', $images);
     $this->set('picture', $this->getPicture());
 }
开发者ID:robchenski,项目名称:ids,代码行数:11,代码来源:controller.php

示例2: _prepare

 private function _prepare($fs)
 {
     $fl = new FileList();
     $fl->filterByExtension("js");
     $fl->filterBySet($fs);
     $files = $fl->get();
     $setFiles = array();
     foreach ($files as $f) {
         $fv = $f->getRecentVersion();
         $fn = $fv->getFileName();
         $this->_exists[$fn] = $f;
     }
 }
开发者ID:holyshared,项目名称:developer-package,代码行数:13,代码来源:importer.php

示例3: getMootoolsPluginFiles

 public function getMootoolsPluginFiles($fs)
 {
     Loader::model('file_set');
     Loader::model('file_list');
     //		$u = new User();
     $fl = new FileList();
     $fl->filterByMootoolsPlugin(true);
     $fl->filterByExtension("js");
     //		$fl->filter('u.uID', $u->getUserID(), '=');
     $fl->sortByAttributeKey("ak_" . MOOTOOLS_PLUGIN_DISPLAY_ORDER);
     $fl->filterBySet($fs);
     $files = $fl->get();
     return $files;
 }
开发者ID:holyshared,项目名称:developer-package,代码行数:14,代码来源:plugin_list.php

示例4: loadFileSet

	function loadFileSet(){
		if (intval($this->fsID) < 1) {
			return false;
		}
        Loader::helper('concrete/file');
		Loader::model('file_attributes');
		Loader::library('file/types');
		Loader::model('file_list');
		Loader::model('file_set');
		
		$ak = FileAttributeKey::getByHandle('height');

		$fs = FileSet::getByID($this->fsID);
		$fileList = new FileList();		
		$fileList->filterBySet($fs);
		$fileList->filterByType(FileType::T_IMAGE);	
		$fileList->sortByFileSetDisplayOrder();
		
		$files = $fileList->get(1000,0);
		
		
		$image = array();
		$image['duration'] = $this->duration;
		$image['fadeDuration'] = $this->fadeDuration;
		$image['groupSet'] = 0;
		$image['url'] = '';
		$images = array();
		$maxHeight = 0;
		foreach ($files as $f) {
			$fp = new Permissions($f);
			if(!$fp->canViewFile()) { continue; }
			$image['fID'] 			= $f->getFileID();
			$image['fileName'] 		= $f->getFileName();
			$image['fullFilePath'] 	= $f->getPath();
			$image['url']			= $f->getRelativePath();
			
			// find the max height of all the images so slideshow doesn't bounce around while rotating
			$vo = $f->getAttributeValueObject($ak);
			if (is_object($vo)) {
				$image['imgHeight'] = $vo->getValue('height');
			}
			if ($maxHeight == 0 || $image['imgHeight'] > $maxHeight) {
				$maxHeight = $image['imgHeight'];
			}
			$images[] = $image;
		}
		$this->images = $images;
	
	}
开发者ID:nveid,项目名称:concrete5,代码行数:49,代码来源:slideshow.php

示例5: getUnsortedPermittedFilesetImages

 public static function getUnsortedPermittedFilesetImages($fsID)
 {
     Loader::model('file_set');
     Loader::model('file_list');
     $fsHasDisplayOrder = version_compare(APP_VERSION, '5.4.1', '>=');
     $fs = FileSet::getByID($fsID);
     $fl = new FileList();
     $fl->filterBySet($fs);
     $fl->filterByType(FileType::T_IMAGE);
     if ($fsHasDisplayOrder) {
         $fl->sortByFileSetDisplayOrder();
     }
     $all_files = $fl->get();
     $permitted_files = array();
     foreach ($all_files as $f) {
         $fp = new Permissions($f);
         if ($fp->canRead()) {
             $permitted_files[] = $f;
         }
     }
     return $permitted_files;
 }
开发者ID:madmarker,项目名称:creatureslab,代码行数:22,代码来源:sortable_fancybox_gallery.php

示例6: getPermittedFilesetImages

 public static function getPermittedFilesetImages($fsID, $use_file_props_for_title_and_caption = false)
 {
     Loader::model('file_set');
     Loader::model('file_list');
     $fsHasDisplayOrder = version_compare(APP_VERSION, '5.4.1', '>=');
     $fs = FileSet::getByID($fsID);
     $fl = new FileList();
     $fl->filterBySet($fs);
     $fl->filterByType(FileType::T_IMAGE);
     if ($fsHasDisplayOrder) {
         $fl->sortByFileSetDisplayOrder();
     }
     $all_files = $fl->get();
     $permitted_files = array();
     foreach ($all_files as $f) {
         $fp = new Permissions($f);
         if ($fp->canRead()) {
             $fv = $f->getRecentVersion();
             $permitted_files[$f->fID] = array('file' => $f, 'fID' => $f->fID, 'position' => $fsHasDisplayOrder ? $f->fsDisplayOrder : 0, 'title' => $use_file_props_for_title_and_caption ? $fv->getTitle() : '', 'caption' => $use_file_props_for_title_and_caption ? $fv->getDescription() : '');
         }
     }
     return $permitted_files;
 }
开发者ID:robchenski,项目名称:ids,代码行数:23,代码来源:deluxe_image_gallery.php

示例7: getIcons

 public function getIcons()
 {
     $f = Loader::helper('file');
     Loader::model('file_list');
     Loader::model('file_set');
     $fileList = new FileList();
     $fs = FileSet::getByName('Page Type Icons');
     if (!$fs) {
         return $f->getDirectoryContents(DIR_FILES_COLLECTION_TYPE_ICONS);
     } else {
         $fileList->filterBySet($fs);
         $icons = $fileList->get(100);
         if (!count($icons)) {
             $icons = $f->getDirectoryContents(DIR_FILES_COLLECTION_TYPE_ICONS);
         }
         return $icons;
     }
 }
开发者ID:Zyqsempai,项目名称:amanet,代码行数:18,代码来源:collection_types.php

示例8: getFilesetImages

 static function getFilesetImages($fsID, $randomize = false)
 {
     Loader::model('file_set');
     Loader::model('file_list');
     $fs = FileSet::getByID($fsID);
     $fl = new FileList();
     $fl->filterBySet($fs);
     $fl->filterByType(FileType::T_IMAGE);
     $fl->setPermissionLevel('canRead');
     if ($randomize) {
         $fl->sortBy('RAND()', 'asc');
     } else {
         $fl->sortByFileSetDisplayOrder();
         //Requires 5.4.1 or higher: version_compare(APP_VERSION, '5.4.1', '>=');
     }
     $files = $fl->get();
     return $files;
 }
开发者ID:robchenski,项目名称:ids,代码行数:18,代码来源:controller.php

示例9: getRequestedSearchResults

 public function getRequestedSearchResults()
 {
     $fileList = new FileList();
     $fileList->enableStickySearchRequest();
     Loader::model('file_set');
     if ($_REQUEST['submit_search']) {
         $fileList->resetSearchRequest();
     }
     $req = $fileList->getSearchRequest();
     // first thing, we check to see if a saved search is being used
     if (isset($_REQUEST['fssID'])) {
         $fs = FileSet::getByID($_REQUEST['fssID']);
         if ($fs->getFileSetType() == FileSet::TYPE_SAVED_SEARCH) {
             $req = $fs->getSavedSearchRequest();
             $columns = $fs->getSavedSearchColumns();
             $colsort = $columns->getDefaultSortColumn();
             $fileList->addToSearchRequest('ccm_order_dir', $colsort->getColumnDefaultSortDirection());
             $fileList->addToSearchRequest('ccm_order_by', $colsort->getColumnKey());
         }
     }
     if (!isset($columns)) {
         $columns = FileManagerColumnSet::getCurrent();
     }
     $this->set('searchRequest', $req);
     $this->set('columns', $columns);
     $col = $columns->getDefaultSortColumn();
     $fileList->sortBy($col->getColumnKey(), $col->getColumnDefaultSortDirection());
     $keywords = htmlentities($req['fKeywords'], ENT_QUOTES, APP_CHARSET);
     if ($keywords != '') {
         $fileList->filterByKeywords($keywords);
     }
     if ($req['numResults']) {
         $fileList->setItemsPerPage($req['numResults']);
     }
     if (isset($req['fsIDNone']) && $req['fsIDNone'] == 1 || is_array($req['fsID']) && in_array(-1, $req['fsID'])) {
         $fileList->filterBySet(false);
     } else {
         if (is_array($req['fsID'])) {
             foreach ($req['fsID'] as $fsID) {
                 $fs = FileSet::getByID($fsID);
                 $fileList->filterBySet($fs);
             }
         } else {
             if (isset($req['fsID']) && $req['fsID'] != '' && $req['fsID'] > 0) {
                 $set = $req['fsID'];
                 $fs = FileSet::getByID($set);
                 $fileList->filterBySet($fs);
             }
         }
     }
     if (isset($_GET['fType']) && $_GET['fType'] != '') {
         $type = $_GET['fType'];
         $fileList->filterByType($type);
     }
     if (isset($_GET['fExtension']) && $_GET['fExtension'] != '') {
         $ext = $_GET['fExtension'];
         $fileList->filterByExtension($ext);
     }
     $selectedSets = array();
     if (is_array($req['selectedSearchField'])) {
         foreach ($req['selectedSearchField'] as $i => $item) {
             // due to the way the form is setup, index will always be one more than the arrays
             if ($item != '') {
                 switch ($item) {
                     case "extension":
                         $extension = $req['extension'];
                         $fileList->filterByExtension($extension);
                         break;
                     case "type":
                         $type = $req['type'];
                         $fileList->filterByType($type);
                         break;
                     case "date_added":
                         $dateFrom = $req['date_from'];
                         $dateTo = $req['date_to'];
                         if ($dateFrom != '') {
                             $dateFrom = date('Y-m-d', strtotime($dateFrom));
                             $fileList->filterByDateAdded($dateFrom, '>=');
                             $dateFrom .= ' 00:00:00';
                         }
                         if ($dateTo != '') {
                             $dateTo = date('Y-m-d', strtotime($dateTo));
                             $dateTo .= ' 23:59:59';
                             $fileList->filterByDateAdded($dateTo, '<=');
                         }
                         break;
                     case 'added_to':
                         $ocID = $req['ocIDSearchField'];
                         if ($ocID > 0) {
                             $fileList->filterByOriginalPageID($ocID);
                         }
                         break;
                     case "size":
                         $from = $req['size_from'];
                         $to = $req['size_to'];
                         $fileList->filterBySize($from, $to);
                         break;
                     default:
                         Loader::model('file_attributes');
                         $akID = $item;
//.........这里部分代码省略.........
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:101,代码来源:search.php

示例10: t

			</table>
			<?php 
    echo $form->hidden('fsID', $fs->getFileSetID());
    ?>
		</form>
	</div>
	
	<h1><span><?php 
    echo t('Files');
    ?>
</span></h1>
	<div class="ccm-dashboard-inner">
		<?php 
    Loader::model("file_list");
    $fl = new FileList();
    $fl->filterBySet($fs);
    $fl->sortByFileSetDisplayOrder();
    $files = $fl->get();
    if (count($files) > 0) {
        ?>
		
		<form id="ccm-file-set-save-sort-order" method="post" action="<?php 
        echo $this->url('/dashboard/files/sets', 'save_sort_order');
        ?>
">
			<?php 
        echo $form->hidden('fsDisplayOrder', '');
        ?>
			<?php 
        echo $form->hidden('fsID', $fs->getFileSetID());
        ?>
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:31,代码来源:sets.php

示例11: FileList

?>
                </div>
            </div>

            <section class="container-fluid padded-vertical padded-horizontal download-section" id="download">
                <div class="container">
                    <div class="titled">
                        <h2>Documents utiles</h2>
                        <span class="subtitle orange">Téléchargez ici les documents relatifs au tournoi.</span>
                        <hr>
                    </div>
                   <div class="col-sm-10 col-sm-offset-1 col-xs-12 col-xs-offset-0">
                       <?php 
$fileset = FileSet::getByName('download');
$fileslist = new FileList();
$fileslist->filterBySet($fileset);
$fileslist->sortBy('fsDisplayOrder', 'asc');
$documents = $fileslist->getResults();
foreach ($documents as $doc) {
    if ($doc->getAttribute('inactive') == 1) {
        $icon = '<i class="fa fa-chain-broken"></i>';
        $link = '';
        $class = 'not-active';
        $sup = '<br><small class="inactive">indiponible pour le moment</small>';
    } else {
        $icon = '<i class="fa fa-file-pdf-o"></i>';
        $link = $doc->getDownloadURL();
        $class = '';
        $sup = "";
    }
    ?>
开发者ID:bobzepplin,项目名称:dodgeball,代码行数:31,代码来源:home.php


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