tag : LI
mode : OPEN

@param  array $param
@return boolean
423576
protected function _tag_open_LI($param)
    {
        if ($this->_isForOneLine) {
            return false;
        }

        $this->_listeAddLi();

        if (!isset($param['style']['width'])) {
            $param['style']['width'] = '100%';
        }

        $paramPUCE = $param;

        $inf = $this->_listeGetLi();
        if ($inf[0]) {
            if ($inf[0] === 'zapfdingbats') {
                // ensure the correct icon is used despite external css rules
                $paramPUCE['style']['text-transform']  = 'lowercase';
            }
            $paramPUCE['style']['font-family']     = $inf[0];
            $paramPUCE['style']['text-align']      = 'li_right';
            $paramPUCE['style']['vertical-align']  = 'top';
            $paramPUCE['style']['width']           = $this->_listeGetWidth();
            $paramPUCE['style']['padding-right']   = $this->_listeGetPadding();
            $paramPUCE['txt'] = $inf[2];
        } else {
            $paramPUCE['style']['text-align']      = 'li_right';
            $paramPUCE['style']['vertical-align']  = 'top';
            $paramPUCE['style']['width']           = $this->_listeGetWidth();
            $paramPUCE['style']['padding-right']   = $this->_listeGetPadding();
            $paramPUCE['src'] = $inf[2];
            $paramPUCE['sub_li'] = true;
        }

        $this->_tag_open_TR($param, 'li');

        $this->parsingCss->save();

        // if small LI
        if ($inf[1]) {
            $this->parsingCss->value['mini-decal']+= $this->parsingCss->value['mini-size']*0.045;
            $this->parsingCss->value['mini-size'] *= 0.75;
        }

        // if we are in a sub html => prepare. Else : display
        if ($this->_subPart) {
            // TD for the puce
            $tmpPos = $this->_tempPos;
            $tmpLst1 = $this->parsingHtml->code[$tmpPos+1];
            $tmpLst2 = $this->parsingHtml->code[$tmpPos+2];

            $name = isset($paramPUCE['src']) ? 'img' : 'write';
            $params = $paramPUCE;
            unset($params['style']['width']);
            $this->parsingHtml->code[$tmpPos+1] = new Node($name, $params, false);
            $this->parsingHtml->code[$tmpPos+2] = new Node('li', $paramPUCE, true);
            $this->_tag_open_TD($paramPUCE, 'li_sub');
            $this->_tag_close_TD($param);
            $this->_tempPos = $tmpPos;
            $this->parsingHtml->code[$tmpPos+1] = $tmpLst1;
            $this->parsingHtml->code[$tmpPos+2] = $tmpLst2;
        } else {
            // TD for the puce
            $this->_tag_open_TD($paramPUCE, 'li_sub');
            unset($paramPUCE['style']['width']);
            if (isset($paramPUCE['src'])) {
                $this->_tag_open_IMG($paramPUCE);
            } else {
                $this->_tag_open_WRITE($paramPUCE);
            }
            $this->_tag_close_TD($paramPUCE);
        }
        $this->parsingCss->load();


        // TD for the content
        $this->_tag_open_TD($param, 'li');

        return true;
    }
471941
protected function _tag_open_INPUT($param)
    {
        if (!isset($param['name'])) {
            $param['name']  = 'champs_pdf_'.(count($this->_lstField)+1);
        }
        if (!isset($param['value'])) {
            $param['value'] = '';
        }
        if (!isset($param['type'])) {
            $param['type']  = 'text';
        }

        $param['name'] = strtolower($param['name']);
        $param['type'] = strtolower($param['type']);

        // the type must be valid
        if (!in_array($param['type'], array('text', 'checkbox', 'radio', 'hidden', 'submit', 'reset', 'button'))) {
            $param['type'] = 'text';
        }

        if (isset($this->_lstField[$param['name']])) {
            $this->_lstField[$param['name']]++;
        } else {
            $this->_lstField[$param['name']] = 1;
        }

        $this->parsingCss->save();
        $this->parsingCss->analyse('input', $param);
        $this->parsingCss->setPosition();
        $this->parsingCss->fontSet();

        $name = $param['name'];

        $x = $this->pdf->GetX();
        $y = $this->pdf->GetY();
        $f = 1.08*$this->parsingCss->value['font-size'];

        $prop = $this->parsingCss->getFormStyle();

        switch ($param['type']) {
            case 'checkbox':
                $w = 4;
                $h = $w;
                if ($h<$f) {
                    $y+= ($f-$h)*0.5;
                }
                $checked = (isset($param['checked']) && $param['checked'] === 'checked');
                $this->pdf->CheckBox($name, $w, $checked, $prop, array(), ($param['value'] ? $param['value'] : 'Yes'), $x, $y);
                break;

            case 'radio':
                $w = 4;
                $h = $w;
                if ($h<$f) {
                    $y+= ($f-$h)*0.5;
                }
                $checked = (isset($param['checked']) && $param['checked'] === 'checked');
                $this->pdf->RadioButton($name, $w, $prop, array(), ($param['value'] ? $param['value'] : 'On'), $checked, $x, $y);
                break;

            case 'hidden':
                $w = 0;
                $h = 0;
                $prop['value'] = $param['value'];
                $this->pdf->TextField($name, $w, $h, $prop, array(), $x, $y);
                break;

            case 'text':
                $w = $this->parsingCss->value['width'];
                if (!$w) {
                    $w = 40;
                }
                $h = $f*1.3;
                $prop['value'] = $param['value'];
                $this->pdf->TextField($name, $w, $h, $prop, array(), $x, $y);
                break;

            case 'submit':
                $w = $this->parsingCss->value['width'];
                if (!$w) {
                    $w = 40;
                }
                $h = $this->parsingCss->value['height'];
                if (!$h) {
                    $h = $f*1.3;
                }
                $action = array('S'=>'SubmitForm', 'F'=>$this->_isInForm, 'Flags'=>array('ExportFormat'));
                $this->pdf->Button($name, $w, $h, $param['value'], $action, $prop, array(), $x, $y);
                break;

            case 'reset':
                $w = $this->parsingCss->value['width'];
                if (!$w) {
                    $w = 40;
                }
                $h = $this->parsingCss->value['height'];
                if (!$h) {
                    $h = $f*1.3;
                }
                $action = array('S'=>'ResetForm');
                $this->pdf->Button($name, $w, $h, $param['value'], $action, $prop, array(), $x, $y);
                break;

            case 'button':
                $w = $this->parsingCss->value['width'];
                if (!$w) {
                    $w = 40;
                }
                $h = $this->parsingCss->value['height'];
                if (!$h) {
                    $h = $f*1.3;
                }
                $action = isset($param['onclick']) ? $param['onclick'] : '';
                $this->pdf->Button($name, $w, $h, $param['value'], $action, $prop, array(), $x, $y);
                break;

            default:
                $w = 0;
                $h = 0;
                break;
        }

        $this->_maxX = max($this->_maxX, $x+$w);
        $this->_maxY = max($this->_maxY, $y+$h);
        $this->_maxH = max($this->_maxH, $h);
        $this->_maxE++;
        $this->pdf->SetX($x+$w);

        $this->parsingCss->load();
        $this->parsingCss->fontSet();

        return true;
    }
317047
protected function _tag_close_FORM($param)
    {
        $this->_isInForm = false;
        $this->parsingCss->load();
        $this->parsingCss->fontSet();

        return true;
    }
317240
protected function _tag_open_H1($param, $other = 'h1')
    {
        if ($this->_isForOneLine) {
            return false;
        }

        if ($this->_maxH) {
            $this->_tag_open_BR(array());
        }
        $this->parsingCss->save();
        $this->parsingCss->value['font-bold'] = true;

        $size = array('h1' => '28px', 'h2' => '24px', 'h3' => '20px', 'h4' => '16px', 'h5' => '12px', 'h6' => '9px');
        $this->parsingCss->value['margin']['l'] = 0;
        $this->parsingCss->value['margin']['r'] = 0;
        $this->parsingCss->value['margin']['t'] = $this->cssConverter->convertToMM('16px');
        $this->parsingCss->value['margin']['b'] = $this->cssConverter->convertToMM('16px');
        $this->parsingCss->value['font-size'] = $this->cssConverter->convertFontSize($size[$other]);

        $this->parsingCss->analyse($other, $param);
        $this->parsingCss->setPosition();
        $this->parsingCss->fontSet();
        $this->_setNewPositionForNewLine();

        return true;
    }
1294718
protected function _tag_open_PAGE_FOOTER_SUB($param)
    {
        if ($this->_isForOneLine) {
            return false;
        }

        // save the current stat
        $this->_subSTATES = array();
        $this->_subSTATES['x']    = $this->pdf->GetX();
        $this->_subSTATES['y']    = $this->pdf->GetY();
        $this->_subSTATES['s']    = $this->parsingCss->value;
        $this->_subSTATES['t']    = $this->parsingCss->table;
        $this->_subSTATES['ml']    = $this->_margeLeft;
        $this->_subSTATES['mr']    = $this->_margeRight;
        $this->_subSTATES['mt']    = $this->_margeTop;
        $this->_subSTATES['mb']    = $this->_margeBottom;
        $this->_subSTATES['mp']    = $this->_pageMarges;

        // new stat for the footer
        $this->_pageMarges  = array();
        $this->_margeLeft   = $this->_defaultLeft;
        $this->_margeRight  = $this->_defaultRight;
        $this->_margeTop    = $this->_defaultTop;
        $this->_margeBottom = $this->_defaultBottom;
        $this->pdf->SetMargins($this->_margeLeft, $this->_margeTop, $this->_margeRight);
        $this->pdf->SetAutoPageBreak(false, $this->_margeBottom);
        $this->pdf->SetXY($this->_defaultLeft, $this->_defaultTop);

        $this->parsingCss->initStyle();
        $this->parsingCss->resetStyle();
        $this->parsingCss->value['width']    = $this->pdf->getW() - $this->_defaultLeft - $this->_defaultRight;
        $this->parsingCss->table                = array();

        // we create a sub HTML2PFDF, and we execute on it the content of the footer, to get the height of it
        $sub = $this->createSubHTML();
        $sub->parsingHtml->code = $this->parsingHtml->getLevel($this->_parsePos);
        $sub->_makeHTMLcode();
        $this->pdf->SetY($this->pdf->getH() - $sub->_maxY - $this->_defaultBottom - 0.01);
        $this->_destroySubHTML($sub);

        $this->parsingCss->save();
        $this->parsingCss->analyse('page_footer_sub', $param);
        $this->parsingCss->setPosition();
        $this->parsingCss->fontSet();
        $this->_setNewPositionForNewLine();

        return true;
    }
699807
public function init($param)
    {

        if (empty($param)) return false;

        $this->header = '';

        $param_list = new ParamList();
        foreach ($param as $key => $value) {
            if (property_exists($this, $key)) $this->$key = $value;
            elseif (property_exists($param_list, strtolower(str_replace('-', '_', $key)))) {
                if (is_string($value)) {
                    $this->header[] = new SingleParam($key, $value);
                } elseif (is_array($value)) {
                    $this->header[] = new MultiParam($key, $value);
                }
            }

        }


        return true;
    }
208003
public function get($param)
    {
        if ( ! $this->isOpened()) {
            $this->start();
        }
        return isset($this->attributes[$param]) ? $this->attributes[$param] : null;
    }
1127537
protected function _tag_open_HR($param)
    {
        if ($this->_isForOneLine) {
            return false;
        }
        $oldAlign = $this->parsingCss->value['text-align'];
        $this->parsingCss->value['text-align'] = 'left';

        if ($this->_maxH) {
            $this->_tag_open_BR($param);
        }

        $fontSize = $this->parsingCss->value['font-size'];
        $this->parsingCss->value['font-size']=$fontSize*0.5;
        $this->_tag_open_BR($param);
        $this->parsingCss->value['font-size']=$fontSize;

        $param['style']['width'] = '100%';

        $this->parsingCss->save();
        $this->parsingCss->value['height']=$this->cssConverter->convertToMM('1mm');

        $this->parsingCss->analyse('hr', $param);
        $this->parsingCss->setPosition();
        $this->parsingCss->fontSet();

        $h = $this->parsingCss->value['height'];
        if ($h) {
            $h-= $this->parsingCss->value['border']['t']['width']+$this->parsingCss->value['border']['b']['width'];
        }
        if ($h<=0) {
            $h = $this->parsingCss->value['border']['t']['width']+$this->parsingCss->value['border']['b']['width'];
        }

        $this->_drawRectangle($this->pdf->GetX(), $this->pdf->GetY(), $this->parsingCss->value['width'], $h, $this->parsingCss->value['border'], 0, 0, $this->parsingCss->value['background']);
        $this->_maxH = $h;

        $this->parsingCss->load();
        $this->parsingCss->fontSet();

        $this->parsingCss->value['font-size'] = 0;
        $this->_tag_open_BR($param);

        $this->parsingCss->value['font-size']=$fontSize*0.5;
        $this->_tag_open_BR($param);
        $this->parsingCss->value['font-size']=$fontSize;

        $this->parsingCss->value['text-align'] = $oldAlign;
        $this->_setNewPositionForNewLine();

        return true;
    }
830669
public function bind(array $param) {
		$ref    = new \ReflectionClass('mysqli_stmt');
		$method = $ref->getMethod("bind_param");
		$method->invokeArgs($this->result, $param);
	}
1371409
public function __isset(string $param): bool
    {
        return isset(self::$data[self::$method][$param]);
    }
1349176
protected function _tag_open_WRITE($param)
    {
        $fill = ($this->parsingCss->value['background']['color'] !== null && $this->parsingCss->value['background']['image'] === null);
        if (in_array($this->parsingCss->value['id_tag'], array('fieldset', 'legend', 'div', 'table', 'tr', 'td', 'th'))) {
            $fill = false;
        }

        // get the text to write
        $txt = $param['txt'];

        if ($this->_isAfterFloat) {
            $txt = ltrim($txt);
            $this->_isAfterFloat = false;
        }

        $txt = str_replace('[[page_nb]]', $this->pdf->getMyAliasNbPages(), $txt);
        $txt = str_replace('[[page_cu]]', $this->pdf->getMyNumPage($this->_page), $txt);

        if ($this->parsingCss->value['text-transform'] !== 'none') {
            if ($this->parsingCss->value['text-transform'] === 'capitalize') {
                $txt = mb_convert_case($txt, MB_CASE_TITLE, $this->_encoding);
            } elseif ($this->parsingCss->value['text-transform'] === 'uppercase') {
                $txt = mb_convert_case($txt, MB_CASE_UPPER, $this->_encoding);
            } elseif ($this->parsingCss->value['text-transform'] === 'lowercase') {
                $txt = mb_convert_case($txt, MB_CASE_LOWER, $this->_encoding);
            }
        }

        // size of the text
        $h  = 1.08*$this->parsingCss->value['font-size'];
        $dh = $h*$this->parsingCss->value['mini-decal'];
        $lh = $this->parsingCss->getLineHeight();

        // identify the align
        $align = 'L';
        if ($this->parsingCss->value['text-align'] === 'li_right') {
            $w = $this->parsingCss->value['width'];
            $align = 'R';
        }

        // calculate the width of each words, and of all the sentence
        $w = 0;
        $words = explode(' ', $txt);
        foreach ($words as $k => $word) {
            $words[$k] = array($word, $this->pdf->GetStringWidth($word));
            $w+= $words[$k][1];
        }
        $space = $this->pdf->GetStringWidth(' ');
        $w+= $space*(count($words)-1);

        // position in the text
        $currPos = 0;

        // the bigger width of the text, after automatic break line
        $maxX = 0;

        // position of the text
        $x = $this->pdf->GetX();
        $y = $this->pdf->GetY();
        $dy = $this->_getElementY($lh);

        // margins
        list($left, $right) = $this->_getMargins($y);

        // number of lines after automatic break line
        $nb = 0;

        // while we have words, and the text does not fit on the line => we cut the sentence
        while ($x+$w>$right && $x<$right+$space && count($words)) {
            // adding words 1 by 1 to fit on the line
            $i=0;
            $old = array('', 0);
            $str = $words[0];
            $add = false;
            while (($x+$str[1])<$right) {
                $i++;
                $add = true;

                array_shift($words);
                $old = $str;

                if (!count($words)) {
                    break;
                }
                $str[0].= ' '.$words[0][0];
                $str[1]+= $space+$words[0][1];
            }
            $str = $old;

            // if nothing fits on the line, and if the first word does not fit on the line => the word is too long, we put it
            if ($i == 0 && (($left+$words[0][1])>=$right)) {
                $str = $words[0];
                array_shift($words);
                $i++;
                $add = true;
            }
            $currPos+= ($currPos ? 1 : 0)+strlen($str[0]);

            // write the extract sentence that fit on the page
            $wc = ($align === 'L' ? $str[1] : $this->parsingCss->value['width']);
            if ($right - $left<$wc) {
                $wc = $right - $left;
            }

            if (strlen($str[0])) {
                $this->pdf->SetXY($this->pdf->GetX(), $y+$dh+$dy);
                $this->pdf->Cell($wc, $h, $str[0], 0, 0, $align, $fill, $this->_isInLink);
                $this->pdf->SetXY($this->pdf->GetX(), $y);
            }
            $this->_maxH = max($this->_maxH, $lh);

            // max width
            $maxX = max($maxX, $this->pdf->GetX());

            // new position and new width for the "while"
            $w-= $str[1];
            $y = $this->pdf->GetY();
            $x = $this->pdf->GetX();
            $dy = $this->_getElementY($lh);

            // if we have again words to write
            if (count($words)) {
                // remove the space at the end
                if ($add) {
                    $w-= $space;
                }

                // if we don't add any word, and if the first word is empty => useless space to skip
                if (!$add && $words[0][0] === '') {
                    array_shift($words);
                }

                // if it is just to calculate for one line => adding the number of words
                if ($this->_isForOneLine) {
                    $this->_maxE+= $i;
                    $this->_maxX = max($this->_maxX, $maxX);
                    return null;
                }

                // automatic line break
                $this->_tag_open_BR(array('style' => ''), $currPos);

                // new position
                $y = $this->pdf->GetY();
                $x = $this->pdf->GetX();
                $dy = $this->_getElementY($lh);

                // if the next line does  not fit on the page => new page
                if ($y + $h>=$this->pdf->getH() - $this->pdf->getbMargin()) {
                    if (!$this->_isInOverflow && !$this->_isInFooter) {
                        $this->_setNewPage(null, '', null, $currPos);
                        $y = $this->pdf->GetY();
                        $x = $this->pdf->GetX();
                        $dy = $this->_getElementY($lh);
                    }
                }

                // if more than X line => error
                $nb++;
                if ($nb > $this->_sentenceMaxLines) {
                    $txt = '';
                    foreach ($words as $k => $word) {
                        $txt.= ($k ? ' ' : '').$word[0];
                    }
                    $e = new LongSentenceException(
                        'The current sentence takes more than '.$this->_sentenceMaxLines.' lines is the current box'
                    );
                    $e->setSentence($txt);
                    $e->setWidthBox($right-$left);
                    $e->setLength($w);
                    throw $e;
                }

                // new margins for the new line
                list($left, $right) = $this->_getMargins($y);
            }
        }

        // if we have words after automatic cut, it is because they fit on the line => we write the text
        if (count($words)) {
            $txt = '';
            foreach ($words as $k => $word) {
                $txt.= ($k ? ' ' : '').$word[0];
            }
            $w+= $this->pdf->getWordSpacing()*(count($words));
            $this->pdf->SetXY($this->pdf->GetX(), $y+$dh+$dy);
            $this->pdf->Cell(($align === 'L' ? $w : $this->parsingCss->value['width']), $h, $txt, 0, 0, $align, $fill, $this->_isInLink);
            $this->pdf->SetXY($this->pdf->GetX(), $y);
            $this->_maxH = max($this->_maxH, $lh);
            $this->_maxE+= count($words);
        }

        $maxX = max($maxX, $this->pdf->GetX());
        $maxY = $this->pdf->GetY()+$h;

        $this->_maxX = max($this->_maxX, $maxX);
        $this->_maxY = max($this->_maxY, $maxY);

        return true;
    }
957219
public static function prepareParams(array $param){

        $fillable = static::getInstance()->getFillables();

        foreach($param as $key => $value){
            if(!in_array($key, $fillable)){
                unset($param[$key]);
            } elseif(!$value){
                unset($param[$key]);
            }
        }

        return $param;
    }
399786
protected function _tag_open_TEXTAREA($param)
    {
        if (!isset($param['name'])) {
            $param['name'] = 'champs_pdf_'.(count($this->_lstField)+1);
        }

        $param['name'] = strtolower($param['name']);

        if (isset($this->_lstField[$param['name']])) {
            $this->_lstField[$param['name']]++;
        } else {
            $this->_lstField[$param['name']] = 1;
        }

        $this->parsingCss->save();
        $this->parsingCss->analyse('textarea', $param);
        $this->parsingCss->setPosition();
        $this->parsingCss->fontSet();

        $x = $this->pdf->GetX();
        $y = $this->pdf->GetY();
        $fx = 0.65*$this->parsingCss->value['font-size'];
        $fy = 1.08*$this->parsingCss->value['font-size'];

        // extract the content the textarea : value
        $level = $this->parsingHtml->getLevel($this->_parsePos);
        $this->_parsePos+= count($level);

        // automatic size, from cols and rows properties
        $w = $fx*(isset($param['cols']) ? $param['cols'] : 22)+1;
        $h = $fy*1.07*(isset($param['rows']) ? $param['rows'] : 3)+3;

        $prop = $this->parsingCss->getFormStyle();

        $prop['multiline'] = true;
        $prop['value'] = $level[0]->getParam('txt', '');

        $this->pdf->TextField($param['name'], $w, $h, $prop, array(), $x, $y);

        $this->_maxX = max($this->_maxX, $x+$w);
        $this->_maxY = max($this->_maxY, $y+$h);
        $this->_maxH = max($this->_maxH, $h);
        $this->_maxE++;
        $this->pdf->SetX($x+$w);

        return true;
    }
1126116
protected function _tag_open_UL($param, $other = 'ul')
    {
        if ($this->_isForOneLine) {
            return false;
        }

        if (!in_array($this->_previousCall, array('_tag_close_P', '_tag_close_UL'))) {
            if ($this->_maxH) {
                $this->_tag_open_BR(array());
            }
            if (!count($this->_defList)) {
                $this->_tag_open_BR(array());
            }
        }

        if (!isset($param['style']['width'])) {
            $param['allwidth'] = true;
        }
        $param['cellspacing'] = 0;

        // a list is like a table
        $this->_tag_open_TABLE($param, $other);

        // add a level of list
        $start = (isset($this->parsingCss->value['start']) ? $this->parsingCss->value['start'] : null);
        $this->_listeAddLevel($other, $this->parsingCss->value['list-style-type'], $this->parsingCss->value['list-style-image'], $start);

        return true;
    }
1129567
public function getParam(string $param)
    {
        if (! empty($this->match['params'][$param])) {
            return $this->match['params'][$param];
        }
    }
1193401
public function load($param = null)
    {

        $configSet = $this->_getConfigSet();

        if (0 === count($configSet)) {
            // set default config set for the default execution
            $configSet = [
                realpath(
                    "{$this->config_path}/{$this->get(self::HIERARCHY_PLACEHOLDER_INDEX)}"
                    . (string) self::CONFIG_DELIMITER
                    . (string) self::FILE_EXTENSION
                )
            ];
            $this->set('config_set', $configSet);
        }

        return $this->populateEngine(
            $this->checkConfigForDefaultConfig($configSet)
        );
    }
1276995
public function open($mode)
    {
        if ($this->handle) $this->close();
        $this->handle = $this->fs->fopen($this->name, $mode);
        return true;
    }