Source for file title.php

Documentation is available at title.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 title field with an optional slug display below it.
  15.  *
  16.  * @package  FrameworkOnFramework
  17.  * @since    2.0
  18.  */
  19. class FOFFormFieldTitle extends FOFFormFieldText implements FOFFormField
  20. {
  21.     /**
  22.      * Get the rendering of this field type for a repeatable (grid) display,
  23.      * e.g. in a view listing many item (typically a "browse" task)
  24.      *
  25.      * @since 2.0
  26.      *
  27.      * @return  string  The field HTML
  28.      */
  29.     public function getRepeatable()
  30.     {
  31.         // Initialise
  32.         $slug_field        'slug';
  33.         $slug_format    '(%s)';
  34.         $slug_class        'small';
  35.  
  36.         // Get field parameters
  37.         if ($this->element['slug_field'])
  38.         {
  39.             $slug_field = (string) $this->element['slug_field'];
  40.         }
  41.  
  42.         if ($this->element['slug_format'])
  43.         {
  44.             $slug_format = (string) $this->element['slug_format'];
  45.         }
  46.  
  47.         if ($this->element['slug_class'])
  48.         {
  49.             $slug_class = (string) $this->element['slug_class'];
  50.         }
  51.  
  52.         // Get the regular display
  53.         $html parent::getRepeatable();
  54.  
  55.         $slug $this->item->$slug_field;
  56.  
  57.         $html .= '<br />' '<span class="' $slug_class '">';
  58.         $html .= JText::sprintf($slug_format$slug);
  59.         $html .= '</span>';
  60.  
  61.         return $html;
  62.     }
  63. }

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