diff --git a/application/views/helpers/RenderPlainObject.php b/application/views/helpers/RenderPlainObject.php new file mode 100644 index 00000000..08c2472a --- /dev/null +++ b/application/views/helpers/RenderPlainObject.php @@ -0,0 +1,11 @@ + +tabs ?> +

+ + +
+
+escape($file->getContent()) ?>
+
+
diff --git a/library/Director/PlainObjectRenderer.php b/library/Director/PlainObjectRenderer.php new file mode 100644 index 00000000..19f9278c --- /dev/null +++ b/library/Director/PlainObjectRenderer.php @@ -0,0 +1,95 @@ + $val) { + $vals[] = $prefix + . self::INDENTATION + . $key + . ': ' + . self::renderObject($val, $prefix . self::INDENTATION); + } + return "{\n" . implode(",\n", $vals) . "\n$prefix}"; + } + + protected static function renderObject($object, $prefix = '') + { + if (is_null($object)) { + return self::renderNull(); + } elseif (is_bool($object)) { + return self::renderBoolean($object); + } elseif (is_integer($object)) { + return self::renderInteger($object); + } elseif (is_float($object)) { + return self::renderFloat($object); + } elseif (is_array($object)) { + return self::renderArray($object, $prefix); + } elseif (is_object($object)) { + return self::renderHash($object, $prefix); + } elseif (is_string($object)) { + return self::renderString($object); + } else { + return '(UNKNOWN TYPE) ' . var_export($object, 1); + } + } +}