Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 6
CRAP
0.00% covered (danger)
0.00%
0 / 40
HTMLObject
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 6
272
0.00% covered (danger)
0.00%
0 / 40
 __construct()
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 3
 renderParent()
0.00% covered (danger)
0.00%
0 / 1
30
0.00% covered (danger)
0.00%
0 / 14
 row($output, $indent = 0)
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 3
 getIndent($indent)
0.00% covered (danger)
0.00%
0 / 1
20
0.00% covered (danger)
0.00%
0 / 10
 bold($text_string)
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 urlVarStr($value_array)
0.00% covered (danger)
0.00%
0 / 1
12
0.00% covered (danger)
0.00%
0 / 9
<?php
namespace aae\html {
    class HTMLObject {
        public $indent;
        public $caption;
        public $name;
        public $title;
        public $class;
        public $id;
        public function __construct() {
            $this->id = NULL;
            $this->class = NULL;
        }
        protected function renderParent() {
            $out = NULL;
            if ($this->name !== NULL) {
                $out .= ' name="'.$this->name.'"';
            }
            if ($this->class !== NULL) {
                $out .= ' class="'.$this->class.'"';
            }
            if ($this->id !== NULL) {
                $out .= ' id="'.$this->id.'"';
            }
            if (!empty($this->title)) {
                $out .= ' title="'.$this->title.'"';
            }
            return $out;
        }
        public static function row($output, $indent = 0) {
            if ($indent >= 0) {
                return self::getIndent($indent).$output."\n";
            } else {
                return $output."\n";
            }
        }
        
        public static function getIndent($indent) {
            $space = '  ';
            for ($i = 0; $i < $indent; $i++) {
                if ($i == 0) {
                    $output = $space;
                } else {
                    $output .= $space;
                }
            }
            if (!empty($output))
                return $output;
            else return false;
        }
        public static function bold($text_string) {
            return '<strong>'.$text_string.'</strong>';
        }
        
        public static function urlVarStr($value_array) { // make url safe!!!!!!!!!!!!!!!
            $i = 0;
            foreach ($value_array as $key => $value) {
                if ($i < 1) {
                    $output = '?'.$key.'='.$value;    
                } else {
                    $output .= '&'.$key.'='.$value;
                }
                $i++;
            }
            return $output;
        }
    }
}