Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2013-11-18 07:02:19 +0400
committerThomas Steur <thomas.steur@gmail.com>2013-11-18 07:02:19 +0400
commit9060f0180cb935efd1925942d3a8ce1cf309459a (patch)
treeb474d8758f3b45063e4bd430f5daa028b369c879 /plugins/UserCountry/Controller.php
parent4658d92891093982d979e7ec8343ee4ccc510a38 (diff)
getting rid of the fetch parameter
Diffstat (limited to 'plugins/UserCountry/Controller.php')
-rw-r--r--plugins/UserCountry/Controller.php50
1 files changed, 23 insertions, 27 deletions
diff --git a/plugins/UserCountry/Controller.php b/plugins/UserCountry/Controller.php
index d3fb01889b..301d276f47 100644
--- a/plugins/UserCountry/Controller.php
+++ b/plugins/UserCountry/Controller.php
@@ -42,7 +42,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$view->dataTableRegion = $this->getRegion(true);
$view->dataTableCity = $this->getCity(true);
- echo $view->render();
+ return $view->render();
}
public function adminIndex()
@@ -86,7 +86,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$this->setBasicVariablesView($view);
$this->setBasicVariablesAdminView($view);
- echo $view->render();
+ return $view->render();
}
/**
@@ -134,9 +134,9 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$result['next_screen'] = $this->getGeoIpUpdaterManageScreen();
}
- echo Common::json_encode($result);
+ return Common::json_encode($result);
} catch (Exception $ex) {
- echo Common::json_encode(array('error' => $ex->getMessage()));
+ return Common::json_encode(array('error' => $ex->getMessage()));
}
}
}
@@ -203,13 +203,12 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
// the browser so it can download it next
$info = $this->getNextMissingDbUrlInfo();
if ($info !== false) {
- echo Common::json_encode($info);
- return;
+ return Common::json_encode($info);
} else {
- echo 1;
+ return 1;
}
} catch (Exception $ex) {
- echo Common::json_encode(array('error' => $ex->getMessage()));
+ return Common::json_encode(array('error' => $ex->getMessage()));
}
}
}
@@ -263,14 +262,13 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$info = $this->getNextMissingDbUrlInfo();
if ($info !== false) {
- echo Common::json_encode($info);
- return;
+ return Common::json_encode($info);
}
}
- echo Common::json_encode($result);
+ return Common::json_encode($result);
} catch (Exception $ex) {
- echo Common::json_encode(array('error' => $ex->getMessage()));
+ return Common::json_encode(array('error' => $ex->getMessage()));
}
}
}
@@ -295,7 +293,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
if ($provider === false) {
throw new Exception("Invalid provider ID: '$providerId'.");
}
- echo 1;
+ return 1;
}
}
@@ -322,51 +320,49 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$location = LocationProvider::prettyFormatLocation(
$location, $newline = '<br/>', $includeExtra = true);
- echo $location;
+ return $location;
}
- public function getCountry($fetch = false)
+ public function getCountry()
{
- return $this->renderReport(__FUNCTION__, $fetch);
+ return $this->renderReport(__FUNCTION__);
}
- public function getContinent($fetch = false)
+ public function getContinent()
{
- return $this->renderReport(__FUNCTION__, $fetch);
+ return $this->renderReport(__FUNCTION__);
}
/**
* Echo's or returns an HTML view of the visits by region report.
*
- * @param bool $fetch If true, returns the HTML as a string, otherwise it is echo'd.
* @return string
*/
- public function getRegion($fetch = false)
+ public function getRegion()
{
- return $this->renderReport(__FUNCTION__, $fetch);
+ return $this->renderReport(__FUNCTION__);
}
/**
* Echo's or returns an HTML view of the visits by city report.
*
- * @param bool $fetch If true, returns the HTML as a string, otherwise it is echo'd.
* @return string
*/
- public function getCity($fetch = false)
+ public function getCity()
{
- return $this->renderReport(__FUNCTION__, $fetch);
+ return $this->renderReport(__FUNCTION__);
}
- public function getNumberOfDistinctCountries($fetch = false)
+ public function getNumberOfDistinctCountries()
{
return $this->getNumericValue('UserCountry.getNumberOfDistinctCountries');
}
- public function getLastDistinctCountriesGraph($fetch = false)
+ public function getLastDistinctCountriesGraph()
{
$view = $this->getLastUnitGraph('UserCountry', __FUNCTION__, "UserCountry.getNumberOfDistinctCountries");
$view->config->columns_to_display = array('UserCountry_distinctCountries');
- return $this->renderView($view, $fetch);
+ return $this->renderView($view);
}
/**