diff --git a/agents/bottomlevel/MailreceiverAgent.inc b/agents/bottomlevel/MailreceiverAgent.inc new file mode 100644 index 00000000..aab709df --- /dev/null +++ b/agents/bottomlevel/MailreceiverAgent.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 generate a mail receiver salutation. + * + * @author Oliver Hanraths + */ + class MailreceiverAgent extends \nre\agents\BottomlevelAgent + { + + + + + /** + * Action: index. + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + } + + } + +?> diff --git a/agents/toplevel/HtmlmailAgent.inc b/agents/toplevel/HtmlmailAgent.inc new file mode 100644 index 00000000..13e6c7a1 --- /dev/null +++ b/agents/toplevel/HtmlmailAgent.inc @@ -0,0 +1,45 @@ + + * @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\toplevel; + + + /** + * Agent for generating a HTML-mail message. + * + * @author Oliver Hanraths + */ + class HtmlmailAgent extends \hhu\z\agents\ToplevelAgent + { + + + + + /** + * Construct a new HtmlmailAgent. + */ + protected function __construct(\nre\core\Request $request, \nre\core\Response $response, \nre\core\Logger $log=null) + { + parent::__construct($request, $response, $log); + } + + + /** + * Action: index. + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubagent('mailreceiver', 'index', $request->getParam(3)); + } + + } + +?> diff --git a/agents/toplevel/TextmailAgent.inc b/agents/toplevel/TextmailAgent.inc new file mode 100644 index 00000000..b2b0fa90 --- /dev/null +++ b/agents/toplevel/TextmailAgent.inc @@ -0,0 +1,47 @@ + + * @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\toplevel; + + + /** + * Agent for generating a simple text-mail message. + * + * @author Oliver Hanraths + */ + class TextmailAgent extends \hhu\z\agents\ToplevelAgent + { + + + + + /** + * Construct a new TextmailAgent. + */ + protected function __construct(\nre\core\Request $request, \nre\core\Response $response, \nre\core\Logger $log=null) + { + parent::__construct($request, $response, $log); + } + + + + + /** + * Action: index. + */ + public function index(\nre\core\Request $request, \nre\core\Response $response) + { + $this->addSubagent('mailreceiver', 'index', $request->getParam(3)); + } + + } + +?> diff --git a/configs/AppConfig.inc b/configs/AppConfig.inc index 77a1894a..0391a93a 100644 --- a/configs/AppConfig.inc +++ b/configs/AppConfig.inc @@ -34,6 +34,7 @@ 'genericname' => 'The Legend of Z', 'namespace' => 'hhu\\z\\', 'timeZone' => 'Europe/Berlin', + 'url' => 'http://zyren.inf-d.de', 'mailsender' => 'questlab@hhu.de' ); diff --git a/controllers/HtmlmailController.inc b/controllers/HtmlmailController.inc new file mode 100644 index 00000000..e36da004 --- /dev/null +++ b/controllers/HtmlmailController.inc @@ -0,0 +1,54 @@ + + * @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 HtmlmailAgent for generating a HTML-mail message. + * + * @author Oliver Hanraths + */ + class HtmlmailController extends \nre\core\Controller + { + + + + + /** + * Prefilter. + * + * @param Request $request Current request + * @param Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + + // Set application URL + $this->set('url', \nre\configs\AppConfig::$app['url']); + } + + + /** + * Action: index. + * + * Create HTML-structure of mail message. + */ + public function index() + { + $this->set('appname', \nre\configs\AppConfig::$app['name']); + } + + } + +?> diff --git a/controllers/MailreceiverController.inc b/controllers/MailreceiverController.inc new file mode 100644 index 00000000..6e854b2c --- /dev/null +++ b/controllers/MailreceiverController.inc @@ -0,0 +1,37 @@ + + * @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 MailreceiverAgent to generate a mail receiver + * salutation. + * + * @author Oliver Hanraths + */ + class MailreceiverController extends \nre\core\Controller + { + + + + + /** + * Action: index. + */ + public function index($user) + { + $this->set('user', $user); + } + + } + +?> diff --git a/controllers/TextmailController.inc b/controllers/TextmailController.inc new file mode 100644 index 00000000..563c6bd6 --- /dev/null +++ b/controllers/TextmailController.inc @@ -0,0 +1,55 @@ + + * @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 TextmailAgent for generating a simple text-mail + * message. + * + * @author Oliver Hanraths + */ + class TextmailController extends \nre\core\Controller + { + + + + + /** + * Prefilter. + * + * @param Request $request Current request + * @param Response $response Current response + */ + public function preFilter(\nre\core\Request $request, \nre\core\Response $response) + { + parent::preFilter($request, $response); + + + // Set application URL + $this->set('url', \nre\configs\AppConfig::$app['url']); + } + + + /** + * Action: index. + * + * Create simple text-mail message. + */ + public function index() + { + $this->set('appname', \nre\configs\AppConfig::$app['name']); + } + + } + +?> diff --git a/views/htmlmail/htmlmail.tpl b/views/htmlmail/htmlmail.tpl new file mode 100644 index 00000000..d6f2a4c0 --- /dev/null +++ b/views/htmlmail/htmlmail.tpl @@ -0,0 +1,17 @@ + + + + + + + + +

,

+

+ +

+ +

+ + + diff --git a/views/htmlmail/mailreceiver/index.tpl b/views/htmlmail/mailreceiver/index.tpl new file mode 100644 index 00000000..2017262d --- /dev/null +++ b/views/htmlmail/mailreceiver/index.tpl @@ -0,0 +1 @@ + diff --git a/views/textmail/mailreceiver/index.tpl b/views/textmail/mailreceiver/index.tpl new file mode 100644 index 00000000..2017262d --- /dev/null +++ b/views/textmail/mailreceiver/index.tpl @@ -0,0 +1 @@ + diff --git a/views/textmail/textmail.tpl b/views/textmail/textmail.tpl new file mode 100644 index 00000000..f6836506 --- /dev/null +++ b/views/textmail/textmail.tpl @@ -0,0 +1,8 @@ +, + + + + +– + +