Вход Регистрация
Файл: concrete5.7.5.6/concrete/src/Page/Search/ColumnSet/DefaultSet.php
Строк: 59
<?php
namespace ConcreteCorePageSearchColumnSet;

use 
ConcreteCoreSearchColumnColumn;
use 
ConcreteCoreSearchColumnSet;
use 
UserInfo;
use 
Core;

class 
DefaultSet extends Set
{
    protected 
$attributeClass = 'CollectionAttributeKey';

    public static function 
getCollectionDatePublic($c)
    {
        return 
Core::make('helper/date')->formatDateTime($c->getCollectionDatePublic());
    }

    public static function 
getCollectionDateModified($c)
    {
        return 
Core::make('helper/date')->formatDateTime($c->getCollectionDateLastModified());
    }

    public static function 
getCollectionAuthor($c)
    {
        
$uID = $c->getCollectionUserID();
        
$ui = UserInfo::getByID($uID);
        if (
is_object($ui)) {
            return 
$ui->getUserName();
        }
    }

    public function 
__construct()
    {
        
$this->addColumn(new Column('pt.ptHandle', t('Type'), 'getPageTypeName', false));
        
$this->addColumn(new Column('cv.cvName', t('Name'), 'getCollectionName'));
        
$this->addColumn(new Column('cv.cvDatePublic', t('Date'), array('ConcreteCorePageSearchColumnSetDefaultSet', 'getCollectionDatePublic')));
        
$this->addColumn(new Column('c.cDateModified', t('Last Modified'), array('ConcreteCorePageSearchColumnSetDefaultSet', 'getCollectionDateModified')));
        
$this->addColumn(new Column('author', t('Author'), array('ConcreteCorePageSearchColumnSetDefaultSet', 'getCollectionAuthor'), false));
        
$date = $this->getColumnByKey('c.cDateModified');
        
$this->setDefaultSortColumn($date, 'desc');
    }
}
Онлайн: 3
Реклама