' . static::getAssets() . '
';
- }
+ public function colDiv($padLen = null)
+ {
+ $this->out .= "{$this->def['base']}><{$this->def['base']} {$this->def['cell']}>";
+ }
- public function endRoot(){
- $this->out .= "{$this->def['base']}>";
+ public function bubbles(array $items)
+ {
- // process tooltips
- $tipHtml = '';
- foreach($this->tips as $idx => $meta){
+ if (!$items) {
+ return;
+ }
- $tip = '';
- if(!is_array($meta))
- $meta = array('title' => $meta);
+ $this->out .= "<{$this->def['base']} data-mod>";
- $meta += array(
- 'title' => '',
- 'left' => '',
- 'description' => '',
- 'tags' => array(),
- 'sub' => array(),
- );
+ foreach ($items as $info) {
+ $this->out .= $this->text('mod-'.strtolower($info[1]), $info[0], $info[1]);
+ }
- $meta = static::escape($meta);
- $cols = array();
+ $this->out .= "{$this->def['base']}>";
+ }
- if($meta['left'])
- $cols[] = "<{$this->def['base']} {$this->def['cell']} data-varType>{$meta['left']}{$this->def['base']}>";
+ public function startExp()
+ {
+ $this->out .= "<{$this->def['base']} data-input>";
+ }
- $title = $meta['title'] ? "<{$this->def['base']} data-title>{$meta['title']}{$this->def['base']}>" : '';
- $desc = $meta['description'] ? "<{$this->def['base']} data-desc>{$meta['description']}{$this->def['base']}>" : '';
- $tags = '';
+ public function endExp()
+ {
+ if (ref::config('showBacktrace') && ($trace = ref::getBacktrace())) {
+ $this->out .= "<{$this->def['base']} data-backtrace>{$trace['file']}:{$trace['line']}{$this->def['base']}>";
+ }
- foreach($meta['tags'] as $tag => $values){
- foreach($values as $value){
- if($tag === 'param'){
- $value[0] = "{$value[0]} {$value[1]}";
- unset($value[1]);
- }
-
- $value = is_array($value) ? implode("{$this->def['base']}><{$this->def['base']} {$this->def['cell']}>", $value) : $value;
- $tags .= "<{$this->def['base']} {$this->def['row']}><{$this->def['base']} {$this->def['cell']}>@{$tag}{$this->def['base']}><{$this->def['base']} {$this->def['cell']}>{$value}{$this->def['base']}>{$this->def['base']}>";
- }
- }
-
- if($tags)
- $tags = "<{$this->def['base']} {$this->def['table']}>{$tags}{$this->def['base']}>";
-
- if($title || $desc || $tags)
- $cols[] = "<{$this->def['base']} {$this->def['cell']}>{$title}{$desc}{$tags}{$this->def['base']}>";
-
- if($cols)
- $tip = "<{$this->def['base']} {$this->def['row']}>" . implode('', $cols) . "{$this->def['base']}>";
-
- $sub = '';
- foreach($meta['sub'] as $line)
- $sub .= "<{$this->def['base']} {$this->def['row']}><{$this->def['base']} {$this->def['cell']}>" . implode("{$this->def['base']}><{$this->def['base']} {$this->def['cell']}>", $line) . "{$this->def['base']}>{$this->def['base']}>";
-
- if($sub)
- $tip .= "<{$this->def['base']} {$this->def['row']}><{$this->def['base']} {$this->def['cell']} data-sub><{$this->def['base']} {$this->def['table']}>{$sub}{$this->def['base']}>{$this->def['base']}>{$this->def['base']}>";
+ $this->out .= "{$this->def['base']}><{$this->def['base']} data-output>";
+ }
- if($tip)
- $this->out .= "<{$this->def['tip']}>{$tip}{$this->def['tip']}>";
- }
+ public function startRoot()
+ {
+ $this->out .= '
'.static::getAssets().'
';
+ }
- if(($timeout = ref::getTimeoutPoint()) > 0)
- $this->out .= sprintf("<{$this->def['base']} data-error>Listing incomplete. Timed-out after %4.2fs{$this->def['base']}>", $timeout);
+ public function endRoot()
+ {
+ $this->out .= "{$this->def['base']}>";
+
+ // process tooltips
+ $tipHtml = '';
+ foreach ($this->tips as $idx => $meta) {
+
+ $tip = '';
+ if (!is_array($meta)) {
+ $meta = ['title' => $meta];
+ }
+
+ $meta += [
+ 'title' => '',
+ 'left' => '',
+ 'description' => '',
+ 'tags' => [],
+ 'sub' => [],
+ ];
+
+ $meta = static::escape($meta);
+ $cols = [];
+
+ if ($meta['left']) {
+ $cols[] = "<{$this->def['base']} {$this->def['cell']} data-varType>{$meta['left']}{$this->def['base']}>";
+ }
+
+ $title = $meta['title'] ? "<{$this->def['base']} data-title>{$meta['title']}{$this->def['base']}>" : '';
+ $desc = $meta['description'] ? "<{$this->def['base']} data-desc>{$meta['description']}{$this->def['base']}>" : '';
+ $tags = '';
+
+ foreach ($meta['tags'] as $tag => $values) {
+ foreach ($values as $value) {
+ if ($tag === 'param') {
+ $value[0] = "{$value[0]} {$value[1]}";
+ unset($value[1]);
+ }
+
+ $value = is_array($value) ? implode("{$this->def['base']}><{$this->def['base']} {$this->def['cell']}>", $value) : $value;
+ $tags .= "<{$this->def['base']} {$this->def['row']}><{$this->def['base']} {$this->def['cell']}>@{$tag}{$this->def['base']}><{$this->def['base']} {$this->def['cell']}>{$value}{$this->def['base']}>{$this->def['base']}>";
+ }
+ }
- $this->out .= '
';
- }
+ if ($tags) {
+ $tags = "<{$this->def['base']} {$this->def['table']}>{$tags}{$this->def['base']}>";
+ }
+ if ($title || $desc || $tags) {
+ $cols[] = "<{$this->def['base']} {$this->def['cell']}>{$title}{$desc}{$tags}{$this->def['base']}>";
+ }
+ if ($cols) {
+ $tip = "<{$this->def['base']} {$this->def['row']}>".implode('', $cols)."{$this->def['base']}>";
+ }
- /**
- * Get styles and javascript (only generated for the 1st call)
- *
- * @return string
- */
- public static function getAssets(){
-
- // first call? include styles and javascript
- if(static::$didAssets)
- return '';
+ $sub = '';
+ foreach ($meta['sub'] as $line) {
+ $sub .= "<{$this->def['base']} {$this->def['row']}><{$this->def['base']} {$this->def['cell']}>".
+ implode("{$this->def['base']}><{$this->def['base']} {$this->def['cell']}>", $line)."{$this->def['base']}>{$this->def['base']}>";
+ }
- ob_start();
+ if ($sub) {
+ $tip .= "<{$this->def['base']} {$this->def['row']}><{$this->def['base']} {$this->def['cell']} data-sub><{$this->def['base']} {$this->def['table']}>{$sub}{$this->def['base']}>{$this->def['base']}>{$this->def['base']}>";
+ }
- if(ref::config('stylePath') !== false){
- ?>
-
- out .= "<{$this->def['tip']}>{$tip}{$this->def['tip']}>";
+ }
+ }
- if(ref::config('scriptPath') !== false){
- ?>
-
- 0) {
+ $this->out .= sprintf("<{$this->def['base']} data-error>Listing incomplete. Timed-out after %4.2fs{$this->def['base']}>", $timeout);
+ }
- // normalize space and remove comments
- $output = preg_replace('/\s+/', ' ', trim(ob_get_clean()));
- $output = preg_replace('!/\*.*?\*/!s', '', $output);
- $output = preg_replace('/\n\s*\n/', "\n", $output);
+ $this->out .= '