add basic map design (issue #12)
This commit is contained in:
parent
c22d66943d
commit
66a72dd1a6
13 changed files with 1166 additions and 18 deletions
68
controllers/MapController.inc
Normal file
68
controllers/MapController.inc
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The Legend of Z
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
* @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 the MapAgent to display a map.
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
*/
|
||||
class MapController extends \hhu\z\controllers\SeminaryController
|
||||
{
|
||||
/**
|
||||
* Required models
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $models = array('seminaries');
|
||||
/**
|
||||
* User permissions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $permissions = array(
|
||||
'index' => array('admin', 'moderator', 'user')
|
||||
);
|
||||
/**
|
||||
* User seminary permissions
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $seminaryPermissions = array(
|
||||
'index' => array('admin', 'moderator', 'user')
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Action: index.
|
||||
*
|
||||
* Draw the map.
|
||||
*
|
||||
* @throws \nre\exceptions\IdNotFoundException
|
||||
* @param string $seminaryUrl URL-Title of Seminary
|
||||
*/
|
||||
public function index($seminaryUrl)
|
||||
{
|
||||
// Get Seminary
|
||||
$seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl);
|
||||
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -27,6 +27,7 @@
|
|||
public $permissions = array(
|
||||
'index' => array('admin', 'moderator', 'user', 'guest'),
|
||||
'seminarymoodpic' => array('admin', 'moderator', 'user'),
|
||||
'seminarymap' => array('admin', 'moderator', 'user'),
|
||||
'seminary' => array('admin', 'moderator', 'user'),
|
||||
'avatar' => array('admin', 'moderator', 'user'),
|
||||
'achievement' => array('admin', 'moderator', 'user'),
|
||||
|
|
@ -142,6 +143,34 @@
|
|||
$this->set('media', $media);
|
||||
$this->set('file', $file);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Action: seminarymap
|
||||
*
|
||||
* Display the map of a Seminary.
|
||||
*
|
||||
* @throws \nre\exceptions\IdNotFoundException
|
||||
* @param string $seminaryUrl URL-title of the Seminary
|
||||
*/
|
||||
public function seminarymap($seminaryUrl)
|
||||
{
|
||||
// Get Seminary
|
||||
$seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl);
|
||||
|
||||
// Get media
|
||||
$media = $this->Media->getSeminaryMediaById($seminary['map_seminarymedia_id']);
|
||||
|
||||
// Get file
|
||||
$file = $this->getMediaFile($media);
|
||||
if(is_null($file)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Pass data to view
|
||||
$this->set('media', $media);
|
||||
$this->set('file', $file);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue