- md5
- 5a4f9b1cd7cbc9df528ad673e5e09420
- sha1
- 98b374a4ba178d9fb005ab178aadad50bc83aeb3
- sha256
- fe40e56eaa150424f264ba31deb77580355a519851124a36e895a860a5940137
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
<?php
/**
* @package Joomla.API
* @subpackage com_fields
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Fields\Api\Controller;
defined('_JEXEC') or die;
use Joomla\CMS\MVC\Controller\ApiController;
/**
* The fields controller
*
* @since 4.0.0
*/
class FieldsController extends ApiController
{
/**
* The content type of the item.
*
* @var string
* @since 4.0.0
*/
protected $contentType = 'fields';
/**
* The default view for the display method.
*
* @var string
* @since 3.0
*/
protected $default_view = 'fields';
/**
* Basic display of an item view
*
* @param integer $id The primary key to display. Leave empty if you want to retrieve data from the request
*
* @return static A \JControllerLegacy object to support chaining.
*
* @since 4.0.0
*/
public function displayItem($id = null)
{
$this->input->set('model_state', ['filter.context' => $this->getContextFromInput()]);
return parent::displayItem($id);
}
/**
* Basic display of a list view
*
* @return static A \JControllerLegacy object to support chaining.
*
* @since 4.0.0
*/
public function displayList()
{
$this->input->set('model_state', ['filter.context' => $this->getContextFromInput()]);
return parent::displayList();
}
/**
* Get extension from input
*
* @return string
*
* @since 4.0
*/
private function getContextFromInput()
{
return $this->input->exists('context') ?
$this->input->get('context') : $this->input->post->get('context');
}
}
No other release has this exact content. See every version of this file.