merge branch ?charactergroupsqueststations?
This commit is contained in:
parent
476c18b6a9
commit
538e1aa8b0
75 changed files with 19305 additions and 959 deletions
79
app/views/StationtypeView.inc
Normal file
79
app/views/StationtypeView.inc
Normal file
|
@ -0,0 +1,79 @@
|
|||
<?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\views;
|
||||
|
||||
|
||||
/**
|
||||
* Abstract class for implementing a StationtypeView.
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
*/
|
||||
class StationtypeView extends \nre\core\View
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Load and instantiate the StationtypeView of a StationtypeAgent.
|
||||
*
|
||||
* @throws \nre\exceptions\ViewNotFoundException
|
||||
* @param string $layoutName Name of Layout in use
|
||||
* @param string $agentName Name of the Agent
|
||||
* @param string $action Current Action
|
||||
* @param bool $isToplevel Agent is a ToplevelAgent
|
||||
*/
|
||||
public static function loadAndFactory($layoutName, $agentName=null, $action=null, $isToplevel=false)
|
||||
{
|
||||
return new StationtypeView($layoutName, $agentName, $action, $isToplevel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Construct a new StationtypeView.
|
||||
*
|
||||
* @throws \nre\exceptions\ViewNotFoundException
|
||||
* @param string $layoutName Name of Layout in use
|
||||
* @param string $agentName Name of the Agent
|
||||
* @param string $action Current Action
|
||||
* @param bool $isToplevel Agent is a ToplevelAgent
|
||||
*/
|
||||
protected function __construct($layoutName, $agentName=null, $action=null, $isToplevel=false)
|
||||
{
|
||||
// Create template filename
|
||||
// LayoutName
|
||||
$fileName = ROOT.DS.
|
||||
\nre\configs\AppConfig::$dirs['stationtypes'].DS.
|
||||
strtolower($agentName).DS.
|
||||
strtolower($layoutName).DS;
|
||||
|
||||
// Action
|
||||
$fileName .= strtolower($action);
|
||||
|
||||
// File extension
|
||||
$fileName .= \nre\configs\CoreConfig::getFileExt('views');
|
||||
|
||||
|
||||
// Check template file
|
||||
if(!file_exists($fileName)) {
|
||||
throw new \nre\exceptions\ViewNotFoundException($fileName);
|
||||
}
|
||||
|
||||
// Save filename
|
||||
$this->templateFilename = $fileName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue