Source for file cachehandler.php

Documentation is available at cachehandler.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. if (!class_exists('JFormFieldCacheHandler'))
  12. {
  13.     require_once JPATH_LIBRARIES '/joomla/form/fields/cachehandler.php';
  14. }
  15.  
  16. /**
  17.  * Form Field class for FOF
  18.  * Joomla! cache handlers
  19.  *
  20.  * @package  FrameworkOnFramework
  21.  * @since    2.0
  22.  */
  23. {
  24.     protected $static;
  25.  
  26.     protected $repeatable;
  27.  
  28.     /** @var   FOFTable  The item being rendered in a repeatable form field */
  29.     public $item;
  30.  
  31.     /** @var int A monotonically increasing number, denoting the row number in a repeatable view */
  32.     public $rowid;
  33.  
  34.     /**
  35.      * Method to get certain otherwise inaccessible properties from the form field object.
  36.      *
  37.      * @param   string $name The property name for which to the the value.
  38.      *
  39.      * @return  mixed  The property value or null.
  40.      * @since   2.0
  41.      */
  42.     public function __get($name)
  43.     {
  44.         switch ($name)
  45.         {
  46.             case 'static':
  47.                 if (empty($this->static))
  48.                 {
  49.                     $this->static = $this->getStatic();
  50.                 }
  51.  
  52.                 return $this->static;
  53.                 break;
  54.  
  55.             case 'repeatable':
  56.                 if (empty($this->repeatable))
  57.                 {
  58.                     $this->repeatable = $this->getRepeatable();
  59.                 }
  60.  
  61.                 return $this->static;
  62.                 break;
  63.  
  64.             default:
  65.                 return parent::__get($name);
  66.         }
  67.     }
  68.  
  69.     /**
  70.      * Get the rendering of this field type for static display, e.g. in a single
  71.      * item view (typically a "read" task).
  72.      *
  73.      * @since 2.0
  74.      * @return  string  The field HTML
  75.      */
  76.     public function getStatic()
  77.     {
  78.         $class $this->element['class'' class="' . (string) $this->element['class''"' '';
  79.  
  80.         return '<span id="' $this->id . '" ' $class '>' .
  81.         htmlspecialchars(FOFFormFieldList::getOptionName($this->getOptions()$this->value)ENT_COMPAT'UTF-8'.
  82.         '</span>';
  83.     }
  84.  
  85.     /**
  86.      * Get the rendering of this field type for a repeatable (grid) display,
  87.      * e.g. in a view listing many item (typically a "browse" task)
  88.      *
  89.      * @since 2.0
  90.      * @return  string  The field HTML
  91.      */
  92.     public function getRepeatable()
  93.     {
  94.         $class $this->element['class'? (string) $this->element['class''';
  95.  
  96.         return '<span class="' $this->id . ' ' $class '">' .
  97.         htmlspecialchars(FOFFormFieldList::getOptionName($this->getOptions()$this->value)ENT_COMPAT'UTF-8'.
  98.         '</span>';
  99.     }
  100. }

Documentation generated on Tue, 19 Nov 2013 14:54:53 +0100 by phpDocumentor 1.4.3