Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
alikon committed Nov 26, 2019
1 parent eb7c28e commit e0e01f1
Showing 1 changed file with 3 additions and 42 deletions.
45 changes: 3 additions & 42 deletions api/components/com_plugins/Controller/PluginsController.php
Expand Up @@ -113,51 +113,12 @@ public function displayList()
{
$this->input->set('model_state',
[
'filter.element' => $this->getElementFromInput(),
'filter.enabled' => $this->getEnabledFromInput(),
'filter.folder' => $this->getFolderFromInput(),
'filter.element' => $this->input->get('element', $this->input->post->get('element')),
'filter.enabled' => $this->input->get('enabled', $this->input->post->get('enabled')),
'filter.folder' => $this->input->get('folder', $this->input->post->get('folder')),
]
);

return parent::displayList();
}

/**
* Get element from input
*
* @return string
*
* @since 4.0
*/
private function getElementFromInput()
{
return $this->input->exists('element') ?
$this->input->get('element') : $this->input->post->get('element');
}

/**
* Get enabled from input
*
* @return string
*
* @since 4.0
*/
private function getEnabledFromInput()
{
return $this->input->exists('enabled') ?
$this->input->get('enabled') : $this->input->post->get('enabled');
}

/**
* Get folder from input
*
* @return string
*
* @since 4.0
*/
private function getFolderFromInput()
{
return $this->input->exists('folder') ?
$this->input->get('folder') : $this->input->post->get('folder');
}
}

0 comments on commit e0e01f1

Please sign in to comment.