Source for file captcha.php

Documentation is available at captcha.php

  1. <?php
  2. /**
  3.  * @package    FrameworkOnFramework
  4.  * @subpackage form
  5.  * @copyright  Copyright (C) 2010 - 2012 Akeeba Ltd. All rights reserved.
  6.  * @license    GNU General Public License version 2 or later; see LICENSE.txt
  7.  */
  8. // Protect from unauthorized access
  9. defined('_JEXEC'or die;
  10.  
  11.  
  12. /**
  13.  * Form Field class for the FOF framework
  14.  * Supports a captcha field.
  15.  *
  16.  * @package  FrameworkOnFramework
  17.  * @since    2.0
  18.  */
  19. class FOFFormFieldCaptcha extends JFormFieldCaptcha implements FOFFormField
  20. {
  21.     protected $static;
  22.  
  23.     protected $repeatable;
  24.     
  25.     /** @var   FOFTable  The item being rendered in a repeatable form field */
  26.     public $item;
  27.     
  28.     /** @var int A monotonically increasing number, denoting the row number in a repeatable view */
  29.     public $rowid;
  30.  
  31.     /**
  32.      * Method to get certain otherwise inaccessible properties from the form field object.
  33.      *
  34.      * @param   string  $name  The property name for which to the the value.
  35.      *
  36.      * @return  mixed  The property value or null.
  37.      *
  38.      * @since   2.0
  39.      */
  40.     public function __get($name)
  41.     {
  42.         switch ($name)
  43.         {
  44.             case 'static':
  45.                 if (empty($this->static))
  46.                 {
  47.                     $this->static = $this->getStatic();
  48.                 }
  49.  
  50.                 return $this->static;
  51.                 break;
  52.  
  53.             case 'repeatable':
  54.                 if (empty($this->repeatable))
  55.                 {
  56.                     $this->repeatable = $this->getRepeatable();
  57.                 }
  58.  
  59.                 return $this->static;
  60.                 break;
  61.  
  62.             default:
  63.                 return parent::__get($name);
  64.         }
  65.     }
  66.  
  67.     /**
  68.      * Get the rendering of this field type for static display, e.g. in a single
  69.      * item view (typically a "read" task).
  70.      *
  71.      * @since 2.0
  72.      *
  73.      * @return  string  The field HTML
  74.      */
  75.     public function getStatic()
  76.     {
  77.         return $this->getInput();
  78.     }
  79.  
  80.     /**
  81.      * Get the rendering of this field type for a repeatable (grid) display,
  82.      * e.g. in a view listing many item (typically a "browse" task)
  83.      *
  84.      * @since 2.0
  85.      *
  86.      * @return  string  The field HTML
  87.      */
  88.     public function getRepeatable()
  89.     {
  90.         return $this->getInput();
  91.     }
  92. }

Documentation generated on Tue, 19 Nov 2013 14:55:03 +0100 by phpDocumentor 1.4.3