summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d9f56b0)
raw | patch | inline | side by side (parent: d9f56b0)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 May 2010 13:07:34 +0000 (13:07 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 May 2010 13:07:34 +0000 (13:07 +0000) |
-Allow to load <xml> strings too, instead of onyl files. This allow us to modify the xml content before parsing.
-I've used this to display the available services in the server service menu.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18552 594d385d-05f5-0310-b6e9-bd551577e9d8
-I've used this to display the available services in the server service menu.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18552 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_listing.inc | patch | blob | history |
index 3a4f6f9948b1a57772b1f70283a8b483784972e3..225509525ad1420ae3c3b97d4b2ddb220d2473ec 100644 (file)
var $baseSelector;
- function listing($filename)
+ function listing($source, $isString = FALSE)
{
global $config;
global $class_mapping;
// Initialize pid
$this->pid= preg_replace("/[^0-9]/", "", microtime(TRUE));
- if (!$this->load($filename)) {
- die("Cannot parse $filename!");
+ if($isString){
+ if(!$this->loadString($source)){
+ die("Cannot parse $source!");
+ }
+ }else{
+ if (!$this->loadFile($source)) {
+ die("Cannot parse $source!");
+ }
}
// Set base for filter
return false;
}
+ function loadFile($filename)
+ {
+ return($this->loadString(file_get_contents($filename)));
+ }
- function load($filename)
+ function loadString($contents)
{
- $contents = file_get_contents($filename);
$this->xmlData= xml::xml2array($contents, 1);
if (!isset($this->xmlData['list'])) {