This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 
<?php
    defined('C5_EXECUTE') or die("Access Denied.");
/**
 * The controller for the block that displays featured add-ons in the dashboard news overlay.
 *
 * @package Blocks
 * @subpackage Dashboard Featured Add-On
 * @author Andrew Embler <[email protected]>
 * @copyright  Copyright (c) 2003-2012 Concrete5. (http://www.concrete5.org)
 * @license    http://www.concrete5.org/license/     MIT License
 *
 */
    class Concrete5_Controller_Block_DashboardFeaturedAddon extends BlockController {

        protected $btCacheBlockRecord = true;
        protected $btCacheBlockOutput = true;
        protected $btCacheBlockOutputOnPost = true;
        protected $btCacheBlockOutputForRegisteredUsers = true;
        protected $btCacheBlockOutputLifetime = 7200;

        protected $btIsInternal = true;     
        protected $btInterfaceWidth = 300;
        protected $btInterfaceHeight = 100;
        
        public function getBlockTypeDescription() {
            return t("Features an add-on from concrete5.org.");
        }
        
        public function getBlockTypeName() {
            return t("Dashboard Featured Add-On");
        }
        
        public function view() {
            Loader::model('marketplace_remote_item');
            $mri = new MarketplaceRemoteItemList();
            $mri->sortBy('recommended');
            $mri->setItemsPerPage(1);
            $mri->setType('addons');
            $mri->execute();
            $items = $mri->getPage();
            if (is_object($items[0])) {
                $this->set('remoteItem', $items[0]);
            }
        }
        
    }