Вход Регистрация
Файл: concrete5.7.5.6/concrete/blocks/dashboard_newsflow_latest/controller.php
Строк: 58
<?php
namespace ConcreteBlockDashboardNewsflowLatest;
use 
ConcreteControllerSinglePageDashboardNews;
use 
Loader;
use 
ConcreteCoreBlockBlockController;
use 
ConcreteCoreActivityNewsflow;

/**
 * @property mixed $slot
 * Class Controller
 * @package ConcreteBlockDashboardNewsflowLatest
 */
class Controller extends BlockController {

    protected 
$btCacheBlockRecord true;
    protected 
$btCacheBlockOutput true;
    protected 
$btCacheBlockOutputOnPost true;
    protected 
$btCacheBlockOutputLifetime 7200;
    protected 
$btTable 'btDashboardNewsflowLatest';
    protected 
$btCacheBlockOutputForRegisteredUsers true;
    protected 
$btIsInternal true;
    
    public function 
getBlockTypeDescription() {
        return 
t("Grabs the latest newsflow data from concrete5.org.");
    }
    
    public function 
getBlockTypeName() {
        return 
t("Dashboard Newsflow Latest");
    }

    public function 
view() {
        
$newsflow = new Newsflow();
        
// get the latest data as well
        
$slots $newsflow->getSlotContents();
        
$this->set('slot'$slots[$this->slot]);
        
        
// this is kind of a hack
        
if ($this->slot == 'C') { 
            
$ni false;
            try
            {
                
// in case we are not connected $ni will throw an exception ...
                
$ni $newsflow->getEditionByPath('/newsflow');
            }
            catch ( 
Exception $e ) {}
            if (
$ni !== false) {
                
$this->set('editionTitle'$ni->getTitle());
                
$this->set('editionDescription'$ni->getDescription());
                
$this->set('editionDate'$ni->getDate());
                
$this->set('editionID'$ni->getID());
            } else {
            
            }
        }
    }
    
}
Онлайн: 0
Реклама