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 47 48 49 50 
<?php
/**
 * @access private
 * @package Helpers
 * @category Concrete
 * @author Tony Trupp <[email protected]>
 * @copyright  Copyright (c) 2003-2008 Concrete5. (http://www.concrete5.org)
 * @license    http://www.concrete5.org/license/     MIT License
 */ 

defined('C5_EXECUTE') or die("Access Denied."); 

class ConcreteScrapbookHelper {  

    function getPersonalScrapbookName() {
        return 'userScrapbook';
    }

    function getGlobalScrapbookPage(){
        return Page::getByPath('/dashboard/scrapbook'); 
    }

    function getAvailableScrapbooks(){
        $db = Loader::db();
        $scrapbookPage = ConcreteScrapbookHelper::getGlobalScrapbookPage(); 
        return $db->getAll('SELECT arID, arHandle FROM Areas WHERE cID='.intval($scrapbookPage->getCollectionId()));
    }

    /** 
     * Returns the default scrapbook to add blocks to. This is typically the last one added to.
     */
    public function getDefault() {
        $sb = $_SESSION['ccmLastViewedScrapbook'];
        if ($sb == '') {
            return $this->getPersonalScrapbookName();
        }
        return $sb;
    }
    
    /** 
     * Sets the default scrapbook to add blocks to. This is typically the last one added to.
     */
    public function setDefault($scrapbook) {
        $_SESSION['ccmLastViewedScrapbook'] = $scrapbook;
    }


}

?>