diff --git a/application/config/autoload.php b/application/config/autoload.php index 4d2676de3..97eac47b8 100755 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -58,9 +58,7 @@ $autoload['packages'] = array(); | | $autoload['libraries'] = array('user_agent' => 'ua'); */ - -//$autoload['libraries'] = array(); -$autoload['libraries'] = array('Session', 'FHC_Auth', 'TemplateLib'); +$autoload['libraries'] = array('Session', 'FHC_Auth'); /* | ------------------------------------------------------------------- diff --git a/application/controllers/system/Messages.php b/application/controllers/system/Messages.php index bdfa946ac..d11eed4e1 100755 --- a/application/controllers/system/Messages.php +++ b/application/controllers/system/Messages.php @@ -7,7 +7,13 @@ class Messages extends VileSci_Controller public function __construct() { parent::__construct(); + + // Loads the message library $this->load->library('MessageLib'); + + // Loads the widget library + $this->load->library('WidgetLib'); + $this->load->model('person/Person_model', 'PersonModel'); } diff --git a/application/controllers/system/Phrases.php b/application/controllers/system/Phrases.php index 46d3add59..7c85de9bf 100644 --- a/application/controllers/system/Phrases.php +++ b/application/controllers/system/Phrases.php @@ -7,8 +7,13 @@ class Phrases extends FHC_Controller public function __construct() { parent::__construct(); + + // Loads the phrases library $this->load->library('PhrasesLib'); + // Loads the widget library + $this->load->library('WidgetLib'); + // Loads helper message to manage returning messages $this->load->helper('message'); } diff --git a/application/controllers/system/Templates.php b/application/controllers/system/Templates.php index e33eed087..52731cbfc 100755 --- a/application/controllers/system/Templates.php +++ b/application/controllers/system/Templates.php @@ -7,7 +7,12 @@ class Templates extends FHC_Controller public function __construct() { parent::__construct(); + + // Loads the vorlage library $this->load->library('VorlageLib'); + + // Loads the widget library + $this->load->library('WidgetLib'); } public function index() diff --git a/application/core/APIv1_Controller.php b/application/core/APIv1_Controller.php index 5c529a4b4..26fbeddac 100644 --- a/application/core/APIv1_Controller.php +++ b/application/core/APIv1_Controller.php @@ -9,6 +9,6 @@ class APIv1_Controller extends REST_Controller parent::__construct(); // Loads return messages - $this->load->helper('Message'); + $this->load->helper('message'); } } \ No newline at end of file diff --git a/application/core/FHC_Controller.php b/application/core/FHC_Controller.php index 497f996a9..fcffd7a82 100644 --- a/application/core/FHC_Controller.php +++ b/application/core/FHC_Controller.php @@ -7,7 +7,7 @@ class FHC_Controller extends CI_Controller public function __construct() { parent::__construct(); - $this->load->library('session'); + $this->load->helper('fhcauth'); } } \ No newline at end of file diff --git a/application/libraries/TemplateLib.php b/application/libraries/WidgetLib.php similarity index 92% rename from application/libraries/TemplateLib.php rename to application/libraries/WidgetLib.php index 6cc001f1f..e8e8d302a 100644 --- a/application/libraries/TemplateLib.php +++ b/application/libraries/WidgetLib.php @@ -24,12 +24,10 @@ * THE SOFTWARE. */ -if (!defined("BASEPATH")) - exit("No direct script access allowed"); +if (!defined("BASEPATH")) exit("No direct script access allowed"); -class TemplateLib +class WidgetLib { - /* default values */ private $_template = 'template'; private $_parser = FALSE; @@ -604,26 +602,29 @@ class Partial class Widget extends Partial { - - /* (non-PHPdoc) - * @see Partial::content() - */ - public function content() { - if (!$this->_cached) { - if (method_exists($this, 'display')) { - // capture output - ob_start(); - $this->display($this->_args); - $buffer = ob_get_clean(); - - // if no content is produced but there was direct ouput we set - // that output as content - if (!$this->_content && $buffer) { - $this->set($buffer); - } - } - } - - return parent::content(); - } -} + /* (non-PHPdoc) + * @see Partial::content() + */ + public function content() + { + if (!$this->_cached) + { + if (method_exists($this, 'display')) + { + // capture output + ob_start(); + $this->display($this->_args); + $buffer = ob_get_clean(); + + // if no content is produced but there was direct ouput we set + // that output as content + if (!$this->_content && $buffer) + { + $this->set($buffer); + } + } + } + + return parent::content(); + } +} \ No newline at end of file diff --git a/application/views/system/messageReply.php b/application/views/system/messageReply.php index 8fe3a0511..6cb77f639 100644 --- a/application/views/system/messageReply.php +++ b/application/views/system/messageReply.php @@ -18,7 +18,7 @@
           - templatelib->widget("Vorlage_widget", array("title" => "Vorlage")); ?> + widgetlib->widget("Vorlage_widget", array("title" => "Vorlage")); ?>
diff --git a/application/views/system/messageWrite.php b/application/views/system/messageWrite.php index a987b00d7..501498811 100644 --- a/application/views/system/messageWrite.php +++ b/application/views/system/messageWrite.php @@ -72,7 +72,7 @@
- templatelib->widget("Vorlage_widget", array("title" => "Vorlage")); ?> + widgetlib->widget("Vorlage_widget", array("title" => "Vorlage")); ?>   diff --git a/application/views/system/phraseinhaltEdit.php b/application/views/system/phraseinhaltEdit.php index 37cd9fa40..8110cd8e5 100644 --- a/application/views/system/phraseinhaltEdit.php +++ b/application/views/system/phraseinhaltEdit.php @@ -11,11 +11,11 @@ - + - - + + templatelib->widget("tinymce_widget", array('name' => 'text', 'text' => $text)); + //echo $this->widgetlib->widget("tinymce_widget", array('name' => 'text', 'text' => $text)); ?>
OEtemplatelib->widget("organisationseinheit_widget", array('oe_kurzbz' => $orgeinheit_kurzbz)); ?>widgetlib->widget("organisationseinheit_widget", array('oe_kurzbz' => $orgeinheit_kurzbz)); ?> Preview
Orgformtemplatelib->widget("orgform_widget", array('orgform_kurzbz' => $orgform_kurzbz)); ?>
Sprachetemplatelib->widget("sprache_widget", array('sprache' => $sprache)); ?>
Orgformwidgetlib->widget("orgform_widget", array('orgform_kurzbz' => $orgform_kurzbz)); ?>
Sprachewidgetlib->widget("sprache_widget", array('sprache' => $sprache)); ?>
Text
@@ -35,7 +35,7 @@
diff --git a/application/views/system/phrasesList.php b/application/views/system/phrasesList.php index 9f036af24..ed12f1926 100644 --- a/application/views/system/phrasesList.php +++ b/application/views/system/phrasesList.php @@ -9,7 +9,7 @@ App: aufnahme templatelib->widget("mimetype_widget", array('mimetype' => $mimetype)); + //echo $this->widgetlib->widget("mimetype_widget", array('mimetype' => $mimetype)); ?> diff --git a/application/views/system/templatesEdit.php b/application/views/system/templatesEdit.php index 53c61eb6d..46d63a88c 100644 --- a/application/views/system/templatesEdit.php +++ b/application/views/system/templatesEdit.php @@ -8,9 +8,9 @@ Bezeichnung: Anmerkung:
- MimeType:templatelib->widget("mimetype_widget", array('mimetype' => $vorlage->mimetype)); ?> + MimeType:widgetlib->widget("mimetype_widget", array('mimetype' => $vorlage->mimetype)); ?> - Attribute: templatelib->widget("jsoneditor_widget", array('json' => $vorlage->attribute)); ?> + Attribute: widgetlib->widget("jsoneditor_widget", array('json' => $vorlage->attribute)); ?> diff --git a/application/views/system/templatesList.php b/application/views/system/templatesList.php index e1a7d0ee8..1543a804e 100644 --- a/application/views/system/templatesList.php +++ b/application/views/system/templatesList.php @@ -8,7 +8,7 @@ MimeType templatelib->widget("mimetype_widget", array('mimetype' => $mimetype)); + echo $this->widgetlib->widget("mimetype_widget", array('mimetype' => $mimetype)); ?> diff --git a/application/views/system/templatetextEdit.php b/application/views/system/templatetextEdit.php index b5e011086..a2e490fc8 100644 --- a/application/views/system/templatetextEdit.php +++ b/application/views/system/templatetextEdit.php @@ -7,22 +7,22 @@

Vorlagetext:

- OE:templatelib->widget("organisationseinheit_widget", array('oe_kurzbz' => $oe_kurzbz, 'typ' => "'Erhalter','Studienzentrum','Studiengang','Lehrgang'")); ?> - Sprache:templatelib->widget("sprache_widget", array('sprache' => $sprache)); ?> - OrgForm:templatelib->widget("orgform_widget", array('orgform' => $orgform_kurzbz)); ?> + OE:widgetlib->widget("organisationseinheit_widget", array('oe_kurzbz' => $oe_kurzbz, 'typ' => "'Erhalter','Studienzentrum','Studiengang','Lehrgang'")); ?> + Sprache:widgetlib->widget("sprache_widget", array('sprache' => $sprache)); ?> + OrgForm:widgetlib->widget("orgform_widget", array('orgform' => $orgform_kurzbz)); ?> Version: Aktiv: templatelib->widget("tinymce_widget", array('name' => 'text', 'text' => $text)); + echo $this->widgetlib->widget("tinymce_widget", array('name' => 'text', 'text' => $text)); ?>

Preview-Data

- templatelib->widget("jsonforms_widget", array('id' => 'dataform', 'schema' => $schema)); ?> + widgetlib->widget("jsonforms_widget", array('id' => 'dataform', 'schema' => $schema)); ?>
diff --git a/application/views/system/users.php b/application/views/system/users.php index 5bda4f1b5..564c2c95d 100644 --- a/application/views/system/users.php +++ b/application/views/system/users.php @@ -4,7 +4,7 @@
templatelib->widget( + echo $this->widgetlib->widget( 'Usersfilters_widget', array( 'studiengang' => $studiengang,