diff options
author | David Flatz | 2014-03-18 15:28:22 +0100 |
---|---|---|
committer | David Flatz | 2014-03-18 15:28:22 +0100 |
commit | c9fe7448f79fcd7e1d73b1a3001eb13cfdff17a8 (patch) | |
tree | 9f9369c5489c3269d1162c25075de403c987523e | |
parent | 92ab40fab705f6a13751dce256dca0b1f57fbcc8 (diff) | |
download | itools-c9fe7448f79fcd7e1d73b1a3001eb13cfdff17a8.tar.gz itools-c9fe7448f79fcd7e1d73b1a3001eb13cfdff17a8.tar.bz2 itools-c9fe7448f79fcd7e1d73b1a3001eb13cfdff17a8.zip |
allow to override srclines when instantiating it_html
-rw-r--r-- | it_html.class | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/it_html.class b/it_html.class index 44be793..007f8a9 100644 --- a/it_html.class +++ b/it_html.class @@ -85,6 +85,7 @@ function it_html($p = array()) 'tags' => "a,b,br,button,div,em,fieldset,form,h1,h2,h3,h4,h5,h6,hr,input,label,legend,li,meta,noscript,p,pre,span,style,table,tbody,td,textarea,tfoot,th,thead,tr,ul,article,section", 'title' => '', # HTML title (default: no title added) 'use_it_state' => false, # If true, generate code needed by state.js (aka 'history iframe') + 'srclines' => $GLOBALS['debug_srclines'], # append stackdump to each tag ); $this->p['notexported'] = trim($p['notexported'] . ',configure,sanitize', ','); @@ -138,7 +139,7 @@ function configure($p) $ithtml->p = $p + (array)$ithtml->p; $ithtml->hasnonewline = array_flip(explode(',', $ithtml->p['nonewlinetags'])); $ithtml->alwaysclose = array_flip(explode(',', $ithtml->p['alwaysclosetags'])); - $ithtml->fasttag = function_exists("it_tag") && ($GLOBALS['debug_fasttag'] || ($ithtml->p['name'] == "it_html" && !$GLOBALS['debug_srclines'] && !$GLOBALS['debug_utf8check'] && $ithtml->p['charset'] == "utf-8" && !$ithtml->p['prettyprint'])); + $ithtml->fasttag = function_exists("it_tag") && ($GLOBALS['debug_fasttag'] || ($ithtml->p['name'] == "it_html" && !$ithtml->p['srclines'] && !$GLOBALS['debug_utf8check'] && $ithtml->p['charset'] == "utf-8" && !$ithtml->p['prettyprint'])); } /** @@ -292,7 +293,7 @@ function _tag($name, $args) $data = str_replace("\n", "\n ", "\n" . trim($data)) . "\n"; # debugging aid: add backtrace - if (($levels = intval($GLOBALS['debug_srclines'])) && !it::match('^(head|meta|title|script|style|link)', $name)) + if (($levels = intval($this->p['srclines'])) && !it::match('^(head|meta|title|script|style|link)', $name)) $attr = array('title' => it_debug::backtrace(array('levels' => max(3, $levels), 'skipfiles' => "_html\\.class"))) + $attr; $charset = $GLOBALS['it_html']->p['charset']; |