mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 00:54:27 +00:00
Libs and Vorlagen
This commit is contained in:
Executable
+80
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Templates extends FHC_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->library('VorlageLib');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('system/templates.php');
|
||||
}
|
||||
|
||||
public function table()
|
||||
{
|
||||
$mimetype = $this->input->post('mimetype', TRUE);
|
||||
if (is_null($mimetype))
|
||||
$mimetype = 'text/html';
|
||||
if ($mimetype == '')
|
||||
$mimetype = null;
|
||||
$vorlage = $this->vorlagelib->getVorlageByMimetype($mimetype);
|
||||
if ($vorlage->error)
|
||||
show_error($vorlage->retval);
|
||||
//var_dump($vorlage);
|
||||
|
||||
$data = array
|
||||
(
|
||||
'mimetype' => $mimetype,
|
||||
'vorlage' => $vorlage->retval
|
||||
);
|
||||
$v = $this->load->view('system/templatesList.php', $data);
|
||||
}
|
||||
|
||||
public function edit($vorlage_kurzbz = null)
|
||||
{
|
||||
if (empty($vorlage_kurzbz))
|
||||
exit;
|
||||
$vorlage = $this->vorlagelib->getVorlage($vorlage_kurzbz);
|
||||
//var_dump($vorlage);
|
||||
if ($vorlage->error)
|
||||
show_error($vorlage->retval);
|
||||
if (count($vorlage->retval) != 1)
|
||||
show_error('Nachricht nicht vorhanden! ID: '.$vorlage_kurzbz);
|
||||
|
||||
$data = array
|
||||
(
|
||||
'vorlage' => $vorlage->retval[0]
|
||||
);
|
||||
//var_dump($data['message']);
|
||||
$v = $this->load->view('system/templatesEdit', $data);
|
||||
}
|
||||
|
||||
public function write($vorlage_kurzbz = null)
|
||||
{
|
||||
$data = array
|
||||
(
|
||||
'subject' => 'TestSubject',
|
||||
'body' => 'TestDevelopmentBodyText'
|
||||
);
|
||||
$v = $this->load->view('system/messageWrite', $data);
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
$vorlage_kurzbz = $this->input->post('vorlage_kurzbz', TRUE);
|
||||
$data['bezeichnung'] = $this->input->post('bezeichnung', TRUE);
|
||||
$data['anmerkung'] = $this->input->post('anmerkung', TRUE);
|
||||
$data['mimetype'] = $this->input->post('mimetype', TRUE);
|
||||
$vorlage = $this->vorlagelib->saveVorlage($vorlage_kurzbz, $data);
|
||||
if ($vorlage->error)
|
||||
show_error($vorlage->retval);
|
||||
$vorlage_kurzbz = $vorlage->retval;
|
||||
|
||||
redirect('/system/Templates/edit/'.$vorlage_kurzbz);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user