improve map feature by using its own database table and model
This commit is contained in:
parent
acfae8f2ca
commit
3ce0a6d710
5 changed files with 85 additions and 7 deletions
|
|
@ -24,7 +24,7 @@
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public $models = array('seminaries');
|
||||
public $models = array('seminaries', 'map');
|
||||
/**
|
||||
* User permissions
|
||||
*
|
||||
|
|
@ -58,9 +58,13 @@
|
|||
// Get Seminary
|
||||
$seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl);
|
||||
|
||||
// Get map
|
||||
$map = $this->Map->getMapOfSeminary($seminary['id']);
|
||||
|
||||
|
||||
// Pass data to view
|
||||
$this->set('seminary', $seminary);
|
||||
$this->set('map', $map);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public $models = array('seminaries', 'achievements', 'media', 'avatars', 'charactergroups', 'charactergroupsquests');
|
||||
public $models = array('seminaries', 'achievements', 'media', 'avatars', 'charactergroups', 'charactergroupsquests', 'map');
|
||||
|
||||
|
||||
|
||||
|
|
@ -158,8 +158,14 @@
|
|||
// Get Seminary
|
||||
$seminary = $this->Seminaries->getSeminaryByUrl($seminaryUrl);
|
||||
|
||||
// Get map
|
||||
$map = $this->Map->getMapOfSeminary($seminary['id']);
|
||||
if(is_null($map)) {
|
||||
throw new \nre\exceptions\IdNotFoundException($seminaryUrl);
|
||||
}
|
||||
|
||||
// Get media
|
||||
$media = $this->Media->getSeminaryMediaById($seminary['map_seminarymedia_id']);
|
||||
$media = $this->Media->getSeminaryMediaById($map['seminarymedia_id']);
|
||||
|
||||
// Get file
|
||||
$file = $this->getMediaFile($media);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue