Frontend
[ class tree: Frontend ] [ index: Frontend ] [ all elements ]

Source for file UserView.php

Documentation is available at UserView.php

  1. <?php
  2. /**
  3. * DotBoost Technologies Inc.
  4. * DotKernel Application Framework
  5. *
  6. @category   DotKernel
  7. @package    Frontend
  8. @copyright  Copyright (c) 2009 DotBoost  Technologies (http://www.dotboost.com)
  9. @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  10. @version    $Id: UserView.php 152 2010-06-18 07:39:40Z teo $
  11. */
  12.  
  13. /**
  14. * User View Class
  15. * class that prepare output related to User controller
  16. @category   DotKernel
  17. @package    Frontend
  18. @author     DotKernel Team <team@dotkernel.com>
  19. */
  20.  
  21. class User_View extends View
  22. {
  23.     /**
  24.      * Constructor
  25.      * @access public
  26.      * @param Dot_Template $tpl 
  27.      */
  28.     public function __construct($tpl)
  29.     {
  30.         $this->tpl $tpl;
  31.         $this->settings Zend_Registry::get('settings');
  32.     }
  33.     /**
  34.      * Display the login form
  35.      * @access public
  36.      * @param string $templateFile 
  37.      * @return void 
  38.      */
  39.     public function loginForm($templateFile)
  40.     {
  41.         $this->tpl->setFile('tpl_main''user/' $templateFile '.tpl');
  42.     }
  43.     /**
  44.      * Display user's signup form
  45.      * @access public
  46.      * @param string $templateFile 
  47.      * @param array $data [optional]
  48.      * @return void 
  49.      */
  50.     public function details($templateFile$data=array())
  51.     {
  52.         $this->tpl->setFile('tpl_main''user/' $templateFile '.tpl');                
  53.         foreach ($data as $k=>$v)
  54.         {
  55.             $this->tpl->setVar(strtoupper($k)$v);
  56.         }
  57.         if('add' == $templateFile)
  58.         {
  59.             $this->tpl->setVar('SECUREIMAGE',$this->getRecaptcha());            
  60.         }
  61.     }
  62.     /**
  63.      * Get captcha display box using Zend_Service_ReCaptcha api
  64.      * @access public
  65.      * @return Zend_Service_ReCaptcha 
  66.      */
  67.     public function getRecaptcha()
  68.     {
  69.         $option Zend_Registry::get('option');
  70.         // add secure image using ReCaptcha
  71.         $recaptcha new Zend_Service_ReCaptcha($option->captchaOptions->recaptchaPublicKey$option->captchaOptions->recaptchaPrivateKey);
  72.         $recaptcha->setOptions($option->captchaOptions->toArray());
  73.         return $recaptcha;
  74.     }
  75. }

Documentation generated on Wed, 21 Jul 2010 07:34:47 +0000 by phpDocumentor 1.4.3