Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combine multi-service user insights int a single stream at insights.php
- Loading branch information
1 parent
092f407
commit e56d119
Showing
16 changed files
with
246 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
/** | ||
* | ||
* ThinkUp/webapp/_lib/controller/class.InsightStreamController.php | ||
* | ||
* Copyright (c) 2012 Gina Trapani | ||
* | ||
* LICENSE: | ||
* | ||
* This file is part of ThinkUp (http://thinkupapp.com). | ||
* | ||
* ThinkUp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public | ||
* License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any | ||
* later version. | ||
* | ||
* ThinkUp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with ThinkUp. If not, see | ||
* <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* Insights stream controller | ||
* | ||
* Displays a list of insights for authenticated service users. | ||
* | ||
* @license http://www.gnu.org/licenses/gpl.html | ||
* @copyright 2012 Gina Trapani | ||
* @author Gina Trapani <ginatrapani[at]gmail[dot]com> | ||
* | ||
*/ | ||
class InsightStreamController extends ThinkUpController { | ||
public function control() { | ||
$this->setViewTemplate('insights.tpl'); | ||
$this->addToView('enable_bootstrap', true); | ||
|
||
if ($this->shouldRefreshCache() ) { | ||
$insight_dao = DAOFactory::getDAO('InsightDAO'); | ||
if (Session::isLoggedIn()) { | ||
if ($this->isAdmin()) { | ||
///show all insights for all service users | ||
$insights = $insight_dao->getAllInstanceInsights($page_count=10, $page_number=1); | ||
$this->addToView('insights', $insights); | ||
$page = (isset($_GET['page']) && is_numeric($_GET['page']))?$_GET['page']:1; | ||
$this->addToView('next_page', $page+1); | ||
$this->addToView('last_page', $page-1); | ||
} else { | ||
//show only service users owner owns | ||
} | ||
} else { | ||
//show just public service users in stream | ||
$insights = $insight_dao->getPublicInsights($page_count=10, $page_number=1); | ||
$this->addToView('insights', $insights); | ||
} | ||
} | ||
return $this->generateView(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
/** | ||
* | ||
* ThinkUp/webapp/insights.php | ||
* | ||
* Copyright (c) 2012 Gina Trapani | ||
* | ||
* LICENSE: | ||
* | ||
* This file is part of ThinkUp (http://thinkupapp.com). | ||
* | ||
* ThinkUp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public | ||
* License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any | ||
* later version. | ||
* | ||
* ThinkUp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with ThinkUp. If not, see | ||
* <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* @author Gina Trapani <ginatrapani[at]gmail[dot]com> | ||
* @license http://www.gnu.org/licenses/gpl.html | ||
* @copyright 2012 Gina Trapani | ||
*/ | ||
require_once 'init.php'; | ||
|
||
$controller = new InsightStreamController(); | ||
echo $controller->go(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.