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/Dashboard/Controller.php
parent4658d92891093982d979e7ec8343ee4ccc510a38 (diff)
getting rid of the fetch parameter
Diffstat (limited to 'plugins/Dashboard/Controller.php')
-rw-r--r--plugins/Dashboard/Controller.php25
1 files changed, 10 insertions, 15 deletions
diff --git a/plugins/Dashboard/Controller.php b/plugins/Dashboard/Controller.php
index 7fd5666bf7..d8bab8424d 100644
--- a/plugins/Dashboard/Controller.php
+++ b/plugins/Dashboard/Controller.php
@@ -54,7 +54,7 @@ class Controller extends \Piwik\Plugin\Controller
{
$view = $this->_getDashboardView('@Dashboard/embeddedIndex');
- echo $view->render();
+ return $view->render();
}
public function index()
@@ -66,7 +66,7 @@ class Controller extends \Piwik\Plugin\Controller
$view->dashboards = $this->dashboard->getAllDashboards($login);
}
- echo $view->render();
+ return $view->render();
}
public function getAvailableWidgets()
@@ -74,7 +74,7 @@ class Controller extends \Piwik\Plugin\Controller
$this->checkTokenInUrl();
Json::sendHeaderJSON();
- echo Common::json_encode(WidgetsList::get());
+ return Common::json_encode(WidgetsList::get());
}
public function getDashboardLayout()
@@ -85,7 +85,7 @@ class Controller extends \Piwik\Plugin\Controller
$layout = $this->getLayout($idDashboard);
- echo $layout;
+ return $layout;
}
/**
@@ -165,16 +165,14 @@ class Controller extends \Piwik\Plugin\Controller
if (Piwik::isUserIsAnonymous()) {
Json::sendHeaderJSON();
- echo '[]';
-
- return;
+ return '[]';
}
$login = Piwik::getCurrentUserLogin();
$dashboards = $this->dashboard->getAllDashboards($login);
Json::sendHeaderJSON();
- echo Common::json_encode($dashboards);
+ return Common::json_encode($dashboards);
}
/**
@@ -186,8 +184,7 @@ class Controller extends \Piwik\Plugin\Controller
$this->checkTokenInUrl();
if (Piwik::isUserIsAnonymous()) {
- echo '0';
- return;
+ return '0';
}
$user = Piwik::getCurrentUserLogin();
$nextId = $this->getNextIdDashboard($user);
@@ -205,7 +202,7 @@ class Controller extends \Piwik\Plugin\Controller
Db::query($query, array($user, $nextId, $name, $layout));
Json::sendHeaderJSON();
- echo Common::json_encode($nextId);
+ return Common::json_encode($nextId);
}
private function getNextIdDashboard($login)
@@ -226,8 +223,7 @@ class Controller extends \Piwik\Plugin\Controller
$this->checkTokenInUrl();
if (!Piwik::isUserIsSuperUser()) {
- echo '0';
- return;
+ return '0';
}
$login = Piwik::getCurrentUserLogin();
$name = urldecode(Common::getRequestVar('name', '', 'string'));
@@ -243,8 +239,7 @@ class Controller extends \Piwik\Plugin\Controller
Db::query($query, array($user, $nextId, $name, $layout));
Json::sendHeaderJSON();
- echo Common::json_encode($nextId);
- return;
+ return Common::json_encode($nextId);
}
}