diff --git a/agents/bottomlevel/QuestgroupspictureAgent.inc b/agents/bottomlevel/QuestgroupspictureAgent.inc new file mode 100644 index 00000000..8cdca7cd --- /dev/null +++ b/agents/bottomlevel/QuestgroupspictureAgent.inc @@ -0,0 +1,35 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\agents\bottomlevel; + + + /** + * Agent to display the picture of a Questgroup. + * + * @author Oliver Hanraths + */ + class QuestgroupspictureAgent extends \nre\agents\BottomlevelAgent + { + + + + + /** + * Action: index. + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/controllers/QuestgroupspictureController.inc b/controllers/QuestgroupspictureController.inc new file mode 100644 index 00000000..182c2b50 --- /dev/null +++ b/controllers/QuestgroupspictureController.inc @@ -0,0 +1,60 @@ + + * @copyright 2014 Heinrich-Heine-Universität Düsseldorf + * @license http://www.gnu.org/licenses/gpl.html + * @link https://bitbucket.org/coderkun/the-legend-of-z + */ + + namespace hhu\z\controllers; + + + /** + * Controller of QuestgroupspictureAgent to display the picture of a + * Questgroups. + * + * @author Oliver Hanraths + */ + class QuestgroupspictureController extends \hhu\z\Controller + { + /** + * Required models + * + * @var array + */ + public $models = array('seminaries', 'questgroups', 'media'); + + + + + /** + * Action: index. + * + * Show the picture of a Questgroup. + * + * @param string $seminaryUrl URL-Title of a Seminary + * @param string $questgroupUrl URL-Title of a Questgroup + */ + public function index($seminaryUrl, $questgroupUrl) + { + // Get Seminary + $seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl); + + // Get Questgroup + $questgroup = $this->Questgroups->getQuestgroupByUrl($seminary['id'], $questgroupUrl); + + // Get Picture + $picture = $this->Media->getMediaById($questgroup['questgroupspicture_id']); + + + // Pass data to view + $this->set('seminary', $seminary); + $this->set('picture', $picture); + } + + } + +?> diff --git a/views/html/questgroupspicture/index.tpl b/views/html/questgroupspicture/index.tpl new file mode 100644 index 00000000..d8c7b32c --- /dev/null +++ b/views/html/questgroupspicture/index.tpl @@ -0,0 +1,3 @@ + + +