Source for file contenthistory.php

Documentation is available at contenthistory.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Libraries
  4.  * @subpackage  Form
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE
  8.  */
  9.  
  10. defined('JPATH_PLATFORM') or die;
  11.  
  12. /**
  13.  * Field to select a user id from a modal list.
  14.  *
  15.  * @package     Joomla.Libraries
  16.  * @subpackage  Form
  17.  * @since       3.2
  18.  */
  19. {
  20.     /**
  21.      * The form field type.
  22.      *
  23.      * @var    string 
  24.      * @since  3.2
  25.      */
  26.     public $type = 'ContentHistory';
  27.  
  28.     /**
  29.      * Method to get the content history field input markup.
  30.      *
  31.      * @return  string  The field input markup.
  32.      *
  33.      * @since   3.2
  34.      */
  35.     protected function getInput()
  36.     {
  37.         $typeId = JTable::getInstance('Contenttype')->getTypeId($this->element['data-typeAlias']);
  38.         $itemId = $this->form->getValue('id');
  39.         $label = JText::_('JTOOLBAR_VERSIONS');
  40.         $html = array();
  41.         $link = 'index.php?option=com_contenthistory&amp;view=history&amp;layout=modal&amp;tmpl=component&amp;field='
  42.             . $this->id . '&amp;item_id=' . $itemId . '&amp;type_id=' . $typeId . '&amp;type_alias='
  43.             . $this->element['data-typeAlias'] . '&amp;' . JSession::getFormToken() . '=1';
  44.  
  45.         // Load the modal behavior script.
  46.         JHtml::_('behavior.modal', 'a.modal_' . $this->id);
  47.  
  48.         $html[] = '        <a class="btn modal_' . $this->id . '" title="' . $label . '" href="' . $link . '"'
  49.             . ' rel="{handler: \'iframe\', size: {x: 800, y: 500}}">';
  50.         $html[] = '<i class="icon-archive"></i>';
  51.         $html[] = $label;
  52.         $html[] = '</a>';
  53.  
  54.         return implode("\n", $html);
  55.     }
  56. }

Documentation generated on Tue, 19 Nov 2013 14:56:59 +0100 by phpDocumentor 1.4.3