Model/Portal.php

Go to the documentation of this file.
00001 <?php
00003 // {{{ license
00004 
00005 // +----------------------------------------------------------------------+
00006 // | FastFrame Application Framework                                      |
00007 // +----------------------------------------------------------------------+
00008 // | Copyright (c) 2002-2006 The Codejanitor Group                        |
00009 // +----------------------------------------------------------------------+
00010 // | This source file is subject to the GNU Lesser Public License (LGPL), |
00011 // | that is bundled with this package in the file LICENSE, and is        |
00012 // | available at through the world-wide-web at                           |
00013 // | http://www.fsf.org/copyleft/lesser.html                              |
00014 // | If you did not receive a copy of the LGPL and are unable to          |
00015 // | obtain it through the world-wide-web, you can get it by writing the  |
00016 // | Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
00017 // | MA 02111-1307, USA.                                                  |
00018 // +----------------------------------------------------------------------+
00019 // | Authors: Jason Rust <jrust@codejanitor.com>                          |
00020 // +----------------------------------------------------------------------+
00021 
00022 // }}}
00023 // {{{ requires
00024 
00025 require_once FASTFRAME_ROOT . 'lib/FastFrame/Model.php';
00026 
00027 // }}}
00028 // {{{ class FF_Model_Portal
00029 
00040 // }}}
00041 class FF_Model_Portal extends FF_Model {
00042     // {{{ properties
00043 
00048     var $locationData = array();
00049 
00054     var $pageId;
00055 
00056     // }}}
00057     // {{{ exportToArray()
00058 
00067     function exportToArray()
00068     {
00069         $a_data = array();
00070         $a_data['page_id'] = $this->getPageId();
00071         $a_data['locationData'] = $this->locationData;
00072         return $a_data;
00073     }
00074 
00075     // }}}
00076     // {{{ getPageSettings()
00077 
00087     function getPageSettings($in_pageId, $in_prefix)
00088     {
00089         return $this->o_dataAccess->getPageSettings($in_pageId, $in_prefix);
00090     }
00091 
00092     // }}}
00093     // {{{ getBlockOptions()
00094 
00101     function getBlockOptions()
00102     {
00103         $a_opts = array('' => '&nbsp;');
00104         // get portal blocks
00105         $o_dao =& FF_DataAccess::factory('PortalBlock');
00106         return array_merge($a_opts, $o_dao->getBlockOptions(PORTAL_BLOCK . ':'));
00107     }
00108 
00109     // }}}
00110     // {{{ getBlockData()
00111 
00121     function getBlockData($in_blockType, $in_blockId)
00122     {
00123         switch ($in_blockType) {
00124             case PORTAL_BLOCK:
00125                 require_once dirname(__FILE__) . '/../Model/PortalBlock.php';
00126                 require_once dirname(__FILE__) . '/../Action/PortalBlockDisplay.php';
00127                 $o_model =& new FF_Model_PortalBlock();
00128                 $o_model->fillById($in_blockId);
00129                 $o_action =& new FF_Action_Display_PortalBlock($o_model);
00130                 return $o_action->getBlockData();
00131             break;
00132             default:
00133                 return '';
00134             break;
00135         }
00136     }
00137 
00138     // }}}
00139     // {{{ setLocationData()
00140 
00147     function setLocationData($in_locationId, $in_data)
00148     {
00149         list($s_type, $s_id) = explode(':', $in_data);
00150         $this->locationData[] = array('location_id' => $in_locationId, 'block_type' => $s_type, 'block_id' => $s_id);
00151     }
00152 
00153     // }}}
00154     // {{{ getPageId()
00155 
00156     function getPageId()
00157     {
00158         return $this->pageId;
00159     }
00160 
00161     // }}}
00162     // {{{ setPageId()
00163 
00164     function setPageId($in_value)
00165     {
00166         $this->pageId = $in_value;
00167     }
00168 
00169     // }}}
00170     // {{{ _initDataAccess()
00171 
00178     function _initDataAccess()
00179     {
00180         $this->o_dataAccess =& FF_DataAccess::factory('Portal');
00181     }
00182 
00183     // }}}
00184 }
00185 ?>

Generated on Fri Jun 23 11:38:17 2006 for FastFrame by  doxygen 1.4.4