get.config.php

Hook-Datei zur Abfrage von Konfigurationswerten aus einem Modul

Dieses Beispiel zeigt den Aufbau einer Hook-Datei get.config.php und den Aufruf aus einem Modul bzw. den Systemfunktionen...

Hook-Datei: get.config.php

<?php
/**
 * This file is part of
 *   
 * XXX
 
 * a module build up within the ALAF - PHP Framework System.
 * Copyright by Andre Lachnicht www.alaniso.de
 *
 * $Revision: 1.1 $
 * $Author: xxx-Gronau / A.Lachnicht $
 * $Date: 2016-07-01 09:10:11 +0200 (Fr, 1. July 2016) $
 */
$hook = function ($module_name, $options, &$config) {
	
	/* $options enthält die kompletten Daten des aktuellen Admins */
	extract ( $options, EXTR_SKIP );
	
	switch ($options ['CONFIG_PARAMETER']) {
		case 'JOB_PATH' :
			include_once (ALAF_MODULES_DIR . DS . 'Lager000' . DS . 'includes' . DS . "class.lager.php");
			include_once (dirname ( dirname ( __FILE__ ) ) . DS . 'includes' . DS . "class.lager391.php");
			$myObj = new Lager391 ();
			$config [$module_name] = array (
					'JOB_PATH' => array (
							'ID' => $module_name,
							'DESCRIPTION' => $myObj->config_get_configuration_xml_value ( 'longtitle' ) . ' (' . $module_name . ')',
							'JOB_PATH' => $myObj->config_get_value ( 'JOB_PATH' ) 
					) 
			);
			unset ( $myObj );
			break;
	}
};
?>

Aufruf durch eine Funktion:

Last updated

Was this helpful?