Source for file editor.php

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

Documentation generated on Tue, 19 Nov 2013 15:02:15 +0100 by phpDocumentor 1.4.3