Action/CheckoutProfile.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 // don't require unless we have to since it means using the registry
00026 if (!class_exists('ff_action_abstractprofile')) {
00027     $o_registry =& FF_Registry::singleton();
00028     require_once $o_registry->getAppFile('Action/AbstractProfile.php', 'profile', 'libs');
00029 }
00030 
00031 
00032 // }}}
00033 // {{{ class FF_Action_CheckoutProfile
00034 
00046 // }}}
00047 class FF_Action_CheckoutProfile extends FF_Action_AbstractProfile {
00048     // {{{ constructor
00049 
00053     function FF_Action_AbstractProfile()
00054     {
00055 
00056     }
00057 
00058     // }}}
00059     // {{{ getTableData()
00060 
00072     function getTableData(&$in_rendererObj, $in_appName, $in_readOnly)
00073     {
00074         if ($in_readOnly || !FF_Request::getParam('isMyProfile', 'g', false) ||
00075             $this->o_model->getBorrowerId() === false) {
00076             return array();
00077         }
00078 
00079         $a_data = array();
00080         FF_Request::setParam('objectId', $this->o_model->getBorrowerId(), 's');
00081         FF_Request::setParam('objectDesc', $this->o_model->getBorrowerName(), 's');
00082         FF_Request::setParam('fromProfile', true, 's');
00083         if ($this->o_perms->hasPerm(array('can_use_demo', 'can_view_borrower_demos'))) {
00084             require_once dirname(__FILE__) . '/../ActionHandler/actions.php';
00085             $a_data[] = array(
00086                 'title' => _('Your Demos:'),
00087                 'data' => $this->o_output->link(
00088                     FastFrame::selfURL(array('module' => 'Demo', 
00089                             'actionId' => ACTION_LIST_BORROWER_DEMOS,
00090                             'app' => $this->o_registry->getCurrentApp())),
00091                     _('Click Here To View')),
00092                 'dataIsSafe' => true,
00093             );
00094         }
00095 
00096         if ($this->o_perms->hasPerm('can_use_reddot')) {
00097             require_once dirname(__FILE__) . '/../Model/Reddot.php';
00098             $o_reddotModel =& new FF_Model_Reddot();
00099             $s_reddotCount = $o_reddotModel->getReddotCountForBorrower($this->o_model->getId());
00100             $s_message = sprintf(_('You have <b>%s</b> red dots in the last %s days. '), $s_reddotCount, 
00101                     $this->o_registry->getConfigParam('reddot/active_cutoff'));
00102             
00103             if ($o_reddotModel->getProblemReddotCountForBorrower($this->o_model->getId()) >= 1 && 
00104                 $s_reddotCount >= $this->o_registry->getConfigParam('reddot/max_active')) {
00105                 $s_message .= _(' <b>You are currently in a red dot penalty period.</b>');
00106             }
00107 
00108             $a_data[] = array(
00109                 'title' => _('Your Reddots:'),
00110                 'data' => '<div>' . $s_message . '</div>'. $this->o_output->link(  
00111                     FastFrame::selfURL(array('module' => 'Reddot', 'actionId' => ACTION_LIST,
00112                             'app' => $this->o_registry->getCurrentApp())),
00113                     _('Click Here To View')),
00114                 'dataIsSafe' => true,
00115             );
00116         }
00117 
00118         return $a_data;
00119     }
00120 
00121     // }}}
00122 }
00123 ?>

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