1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-26 09:34:46 +02:00

[core + bridges] add BridgeAbstract::$inputs and BridgeAbstract::getInput()

Inputs are not stored in BridgeAbstract::$parameters anymore to separate
static data from dynamic data.
The getInput method allows for more readable code.

Also fix an "undefined index 'global'" notice

Probability of breaking bridges: high !

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière
2016-08-28 01:25:33 +02:00
parent a4fd7b8b98
commit 1b3c8a8aeb
78 changed files with 303 additions and 385 deletions

View File

@@ -90,23 +90,22 @@ class IsoHuntBridge extends BridgeAbstract{
);
public function collectData(){
$params=$this->parameters[$this->queriedContext];
$request_path = '/'; // We'll request the main page by default
if(isset($params['latest_category']['value'])){ // Requesting one of the latest categories
$this->request_latest_category($params['latest_category']['value']);
} elseif(isset($params['torrent_category']['value'])){ // Requesting one of the torrent categories
if(isset($this->getInput('latest_category'))){ // Requesting one of the latest categories
$this->request_latest_category($this->getInput('latest_category'));
} elseif(isset($this->getInput('torrent_category'))){ // Requesting one of the torrent categories
$order_popularity = false;
if(isset($params['torrent_popularity']['value']))
$order_popularity = $params['torrent_popularity']['value'];
if(isset($this->getInput('torrent_popularity')))
$order_popularity = $this->getInput('torrent_popularity');
$this->request_torrent_category($params['torrent_category']['value'], $order_popularity);
} else if(isset($params['search_name']['value'])){ // Requesting search
if(isset($params['search_category']['value']))
$this->request_search($params['search_name']['value'], $params['search_category']['value']);
$this->request_torrent_category($this->getInput('torrent_category'), $order_popularity);
} else if(isset($this->getInput('search_name'))){ // Requesting search
if(isset($this->getInput('search_category')))
$this->request_search($this->getInput('search_name'), $this->getInput('search_category'));
else
$this->request_search($params['search_name']['value']);
$this->request_search($this->getInput('search_name'));
} else {
$this->returnClientError('Unknown request!');
}