$array = array_fill(0,100000,"a");
#if (function_exists('__f1')) { function _f1() { __f1($array); } nb::benchmark('_f1'); }
#if (function_exists('__f2')) { function _f2() { __f2($array); } nb::benchmark('_f2'); }
-function _f1() { $html = ''; } nb::benchmark('_f1');
+function _f1() { echo null; } nb::benchmark('_f1');
function _f2() { echo ''; } nb::benchmark('_f2');
nb::benchmark(); exit;
.rtrim(':'.ini_get('include_path'),':')
);
+#define('NB_EOL','');
+#define('NB_PROD',true);
require_once('nb.php');
if (nb::php_cli()) argv2request();
?>
function html_menu($table=null) {
- $r = '<form class="db menu" method="get" action="?">'.PHP_EOL;
+ $r = '<form class="db menu" method="get" action="?">'.NB_EOL;
// Criterias
if (!empty($table)) {
///
// Bye
///
- $r .= '</form>'.PHP_EOL;
+ $r .= '</form>'.NB_EOL;
return $r;
}
#if (preg_match('/yaml|yml/',$f)) bye($this->yaml_encode($this->object2array($this->fields())));
$mime = $this->print_header($f);
- #echo $row.PHP_EOL;
+ #echo $row.NB_EOL;
#bye($f); return true;
- if ($f == 'json') { echo json_encode($row).PHP_EOL; }
+ if ($f == 'json') { echo json_encode($row).NB_EOL; }
#elseif ($f == 'csv' and is_array($row)) { echo join("\n",$row)."\n"; }
#elseif ($f == 'csv') { echo join("\t",nb::ar_map('json_encode($a)',$row))."\n"; }
- #elseif ($f == 'csv') { echo json_encode($row).PHP_EOL; }
+ #elseif ($f == 'csv') { echo json_encode($row).NB_EOL; }
elseif ($f == 'csv') {
#if (is_object($data)) echo "$data\n";
#$isHash = array_values($row) !== $row;
# NB 06.03.16 }
#else echo join("\t",array_values($v))."\n";
}
- #echo json_encode($row).PHP_EOL;
+ #echo json_encode($row).NB_EOL;
if ($type === 2) {
echo "\n";
}
elseif (preg_match('/yaml|yml/',$f)) { echo $this->yaml_encode($row); }
elseif (preg_match('/php|var_export/',$f)) { echo var_export($row,true); }
elseif (preg_match('/var_dump/',$f)) { echo var_dump($row,true); }
- elseif (is_scalar($row)) { echo($row.PHP_EOL); }
- //else { echo($row.PHP_EOL); }
+ elseif (is_scalar($row)) { echo($row.NB_EOL); }
+ //else { echo($row.NB_EOL); }
else{ echo var_export($row,true); }
return true;
? '<span class="extra" id="'.$this->name.'">'.$this->out($value).'</span>'
: '<input name="'.$this->name.'" id="'.$this->name.'" value="'.$value.'" type="text"/>'
)
- .'</div>'.PHP_EOL;
+ .'</div>'.NB_EOL;
}
#print_r($Table->sql());
}
-define('TABLE_EOL',defined(NB_EOL) ? NB_EOL : PHP_EOL);
-define('TABLE_INDENT',TABLE_EOL ? "\t" : "");
+define('TABLE_INDENT',NB_EOL ? "\t" : "");
define('TABLE_CSV_SEP',nb::p('sep') ? nb::p('sep') : "\t");
if (!defined('DB_HTML_EDIT')) define('DB_HTML_EDIT','Edit');
if (!defined('DB_HTML_DELETE')) define('DB_HTML_DELETE','Delete');
$st = $this->db->conn->prepare($sql);
$st->execute();
- echo '<form class="db edit" method="post" action="?">'.TABLE_EOL;
- echo '<div class="fields">'.TABLE_EOL;
+ echo '<form class="db edit" method="post" action="?">'.NB_EOL;
+ echo '<div class="fields">'.NB_EOL;
$count = 0;
if ( $add or ($row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT))) {
$count ++;
}
}
- echo '</div>'.TABLE_EOL;
+ echo '</div>'.NB_EOL;
echo ''
.'<div class="db buttons">'
.( empty($_SERVER['HTTP_REFERER']) ? '' : '<input type="button" onclick="document.location=document.referrer" value="Cancel" />')
.'<input type="reset" />'
.'<input type="submit"/>'
- .'</div>'.TABLE_EOL
+ .'</div>'.NB_EOL
.'<input type="hidden" name="table" value="'.$this->name.'"/>'
.'<input type="hidden" name="action" value="update"/>'
.'<input type="hidden" name="db" value="'.$this->p('db').'"/>'
.'<input type="hidden" name="debug" value="'.$this->p('debug').'"/>'
.'<input type="hidden" name="referer" value="'.urlencode(@$_SERVER['HTTP_REFERER']).'"/>'
- .'</form>'.TABLE_EOL;
+ .'</form>'.NB_EOL;
}
echo '<div class="nav bottom">'
.$this->nav($opt['count'],$opt['tot'],$opt['limit'])
- .'</div>'.TABLE_EOL
+ .'</div>'.NB_EOL
;
}
}
-----------------------------------------------------------------*/
public function rows_begin_json() {
$this->_row_json = null;
- return '['.TABLE_EOL;
+ return '['.NB_EOL;
return ''
#."// database: ".$this->db->name."\n"
#."// table: $this->name\n"
- .'['.TABLE_EOL;
+ .'['.NB_EOL;
}
public function rows_rec_json(&$row) {
$json = '';
$this->_row_json = true;
} else {
- $json = ','.TABLE_EOL;
+ $json = ','.NB_EOL;
}
return $json . json_encode($row);
}
public function rows_end_json() {
unset($this->_row_json);
- return TABLE_EOL.']'.TABLE_EOL;
+ return NB_EOL.']'.NB_EOL;
}
/*-----------------------------------------------------------------
-----------------------------------------------------------------*/
public function rows_begin_xml() {
return ''
- .'<?xml version="1.0" encoding="utf-8"?>'.TABLE_EOL #<?
- #.'<database name="'.$this->db->name.'" table="'.$this->name.'" type="'.$this->db->type.'">'.TABLE_EOL
- .'<rows name="'.$this->name.'" database="'.$this->db->name.'" database-type="'.$this->db->type.'">'.TABLE_EOL
+ .'<?xml version="1.0" encoding="utf-8"?>'.NB_EOL #<?
+ #.'<database name="'.$this->db->name.'" table="'.$this->name.'" type="'.$this->db->type.'">'.NB_EOL
+ .'<rows name="'.$this->name.'" database="'.$this->db->name.'" database-type="'.$this->db->type.'">'.NB_EOL
;
}
public function rows_rec_xml(&$row) {
$xml = '';
- $xml .= TABLE_INDENT."<row>".TABLE_EOL;
+ $xml .= TABLE_INDENT."<row>".NB_EOL;
foreach ($row as $k=>$v) {
if ($v !== '') $xml .= ''
. TABLE_INDENT.TABLE_INDENT."<".$k.">"
.'<![CDATA['.$v.']]>'
. '</'.$k.'>'
- . TABLE_EOL;
+ . NB_EOL;
}
- $xml .= TABLE_INDENT."</row>".TABLE_EOL;
+ $xml .= TABLE_INDENT."</row>".NB_EOL;
return $xml;
}
public function rows_end_xml() {
- return '</rows>'.TABLE_EOL;
+ return '</rows>'.NB_EOL;
}
/*-----------------------------------------------------------------
$html = '';
- #$html .= '<table data-role="table" class="ui-responsive rows '.$this->name.'">'.TABLE_EOL;
- $html .= '<table class="rows '.$this->name.'">'.TABLE_EOL;
- #if (!empty($opt)) $html .= '<caption>' . $this->nav($opt['count'],$opt['tot'],$opt['limit']) . '</caption>' .TABLE_EOL;
+ #$html .= '<table data-role="table" class="ui-responsive rows '.$this->name.'">'.NB_EOL;
+ $html .= '<table class="rows '.$this->name.'">'.NB_EOL;
+ #if (!empty($opt)) $html .= '<caption>' . $this->nav($opt['count'],$opt['tot'],$opt['limit']) . '</caption>' .NB_EOL;
if ($this->p('header')!=="0") {
- $html .= '<thead>'.TABLE_EOL.'<tr class="head">'.TABLE_EOL;
+ $html .= '<thead>'.NB_EOL.'<tr class="head">'.NB_EOL;
- if ($this->p('buttons')!=='0' and DB_HTML_EDIT) $html .= '<th class="edit"></th>'.TABLE_EOL;
+ if ($this->p('buttons')!=='0' and DB_HTML_EDIT) $html .= '<th class="edit"></th>'.NB_EOL;
foreach (array_keys($fields) as $f) {
- #$html .= '<th class="'.$f.'">'.($this->p('buttons')==='0' ? $f : $this->url_sort($f)).'</th>'.TABLE_EOL;
- $html .= '<th class="'.$f.'">'.($this->p('buttons')==='0' ? $this->prettyText($f) : $this->url_sort($f)).'</th>'.TABLE_EOL;
+ #$html .= '<th class="'.$f.'">'.($this->p('buttons')==='0' ? $f : $this->url_sort($f)).'</th>'.NB_EOL;
+ $html .= '<th class="'.$f.'">'.($this->p('buttons')==='0' ? $this->prettyText($f) : $this->url_sort($f)).'</th>'.NB_EOL;
}
- if ($this->p('buttons')!=='0' and DB_HTML_DELETE) $html .= '<th class="delete"></th>'.TABLE_EOL;
- $html .= '</tr>'.TABLE_EOL.'</thead>'.TABLE_EOL;
+ if ($this->p('buttons')!=='0' and DB_HTML_DELETE) $html .= '<th class="delete"></th>'.NB_EOL;
+ $html .= '</tr>'.NB_EOL.'</thead>'.NB_EOL;
}
- $html .= '<tbody>'.TABLE_EOL;
+ $html .= '<tbody>'.NB_EOL;
return $html;
}
public function rows_rec_table(&$row) {
- $html = '<tr class="row">'.TABLE_EOL;
+ $html = '<tr class="row">'.NB_EOL;
if ($this->p('buttons')!=='0') $html .=
'<td class="action"><a class="edit button" href="'
.$this->url_keys($row,'action=edit')
- .'">'.DB_HTML_EDIT.'</a></td>'.TABLE_EOL;
+ .'">'.DB_HTML_EDIT.'</a></td>'.NB_EOL;
foreach ($row as $k => $v) {
if (isset($this->extras[$k])) $k .= " extra";
- $html .= '<td class="'.$k.'">'.$v.'</td>'.TABLE_EOL;
+ $html .= '<td class="'.$k.'">'.$v.'</td>'.NB_EOL;
}
if ($this->p('buttons')!=='0') $html .=
'<td class="action"><a class="delete button" href="'
.$this->url_keys($row,'action=delete')
- .'">'.DB_HTML_DELETE.'</a></td>'.TABLE_EOL;
+ .'">'.DB_HTML_DELETE.'</a></td>'.NB_EOL;
- $html .= '</tr>'.TABLE_EOL;
+ $html .= '</tr>'.NB_EOL;
return $html;
}
public function rows_end_table($opt=array()) {
$html = '';
- $html .= '</tbody>'.TABLE_EOL;
- $html .= '</table>'.TABLE_EOL;
+ $html .= '</tbody>'.NB_EOL;
+ $html .= '</table>'.NB_EOL;
return $html;
}
Html Div
-----------------------------------------------------------------*/
public function rows_begin_div() {
- return '<div class="rows '.$this->name.'">'.TABLE_EOL;
+ return '<div class="rows '.$this->name.'">'.NB_EOL;
}
public function rows_rec_div(&$row) {
$html = '';
- $html .= '<ul class="row">'.TABLE_EOL;
+ $html .= '<ul class="row">'.NB_EOL;
if ($this->p('buttons')!=='0') {
- $html .= '<li class="buttons">'.TABLE_EOL;
- $html .= '<a class="edit button" href="'.$this->url_keys($row,'action=edit').'">'.DB_HTML_EDIT.'</a>'.TABLE_EOL;
- $html .= '<a class="delete button" href="'.$this->url_keys($row,'action=delete').'">'.DB_HTML_DELETE.'</a>'.TABLE_EOL;
- $html .= '</li>'.TABLE_EOL;
+ $html .= '<li class="buttons">'.NB_EOL;
+ $html .= '<a class="edit button" href="'.$this->url_keys($row,'action=edit').'">'.DB_HTML_EDIT.'</a>'.NB_EOL;
+ $html .= '<a class="delete button" href="'.$this->url_keys($row,'action=delete').'">'.DB_HTML_DELETE.'</a>'.NB_EOL;
+ $html .= '</li>'.NB_EOL;
}
foreach ($row as $k => $v) {
$html .= '<li>'
.( $k == '0' ? '' : '<label>'.prettyText($k).'</label>')
.'<span class="'.$k.'">'.$v.'</span>'
- .'</li>'.TABLE_EOL;
+ .'</li>'.NB_EOL;
}
- $html .= '</ul>'.TABLE_EOL;
+ $html .= '</ul>'.NB_EOL;
return $html;
}
;
if (!($query = $this->db->conn->prepare($sql))) {
- err('PDO::errorInfo(): ' .join(' ', $this->db->conn->errorInfo()) .TABLE_EOL);
+ err('PDO::errorInfo(): ' .join(' ', $this->db->conn->errorInfo()) .NB_EOL);
return false;
}
#debug(array($sql,$values));
if (!($execute = $query->execute())) {
- err('PDO::errorInfo(): ' .join(' ', $this->db->conn->errorInfo()) .TABLE_EOL);
+ err('PDO::errorInfo(): ' .join(' ', $this->db->conn->errorInfo()) .NB_EOL);
return false;
}
$this->debug($sql,1);
if (!($query = $this->db->conn->prepare($sql))) {
- err('PDO::errorInfo(): ' .join(' ', $this->db->conn->errorInfo()) .TABLE_EOL);
+ err('PDO::errorInfo(): ' .join(' ', $this->db->conn->errorInfo()) .NB_EOL);
return false;
}
#return $sql;
#bye($sql);
if (!($execute = $query->execute())) {
- err('PDO::errorInfo(): ' .join(' ', $this->db->conn->errorInfo()) .TABLE_EOL);
+ err('PDO::errorInfo(): ' .join(' ', $this->db->conn->errorInfo()) .NB_EOL);
return false;
}
$replace = array();
foreach ($this->replace as $k=>$v) { $replace[] = "$k.$v"; }
- $html .= '<span id="db-table-replace" style="display:none">'.join(' ',$replace).'</span>'.TABLE_EOL;
+ $html .= '<span id="db-table-replace" style="display:none">'.join(' ',$replace).'</span>'.NB_EOL;
}
nb::msg( preg_match('/ml/i',nb::get_header('Content-type'))
? '<pre class="'.($preff and $preff!='err' ? 'err ': '').$preff.'">'.$msg.'</pre>'
: strtoupper($preff).": $msg"
- ).PHP_EOL;
+ ).NB_EOL;
return false;
}
$msg = '<pre class="debug">'
.(isset($_SERVER['HTTP_HOST']) ? htmlentities($msg) : $msg)
# NB 16.12.15 .(isset($_SERVER['HTTP_HOST']) ? htmlspecialchars($msg) : $msg)
- .'</pre>'.PHP_EOL;
+ .'</pre>'.NB_EOL;
} else {
$msg = "DEBUG: $msg\n";
$html = '<select';
if (!empty($opt['html'])) $html .= ' '.preg_replace('/^\s+/','',$opt['html']);
if (!empty($opt['readonly'])) $html.=' disabled="disabled"';
- $html .= '>'.PHP_EOL;
+ $html .= '>'.NB_EOL;
if (!empty($opt['blank'])) {
if (empty($opt['blank_lib'])) $opt['blank_lib'] = $opt['blank'];
$html .= '<option value="'.$opt['blank_val'].'"'.(strcmp((string)$opt['selected'],$opt['blank_val']) == 0 ?' selected="selected"':'').'>';
$html .= $opt['blank_lib'];
- $html .= '</option>'.PHP_EOL;
+ $html .= '</option>'.NB_EOL;
}
foreach ($data as $d) {
$html .= '<option value="'.$val.'"'
.( ($opt['selected']!==NULL and strcmp((string)$opt['selected'],$val)===0) ?' selected="selected"':'')
- .'>'.$lib.'</option>'.PHP_EOL;
+ .'>'.$lib.'</option>'.NB_EOL;
}
- $html .= '</select>'.PHP_EOL;
+ $html .= '</select>'.NB_EOL;
return $html;
<?php
-define('NB_ROOT',realpath(dirname(__FILE__).'/../..'));
-define('NB_EOL',"\n");
+if (!defined('NB_ROOT')) define('NB_ROOT',realpath(dirname(__FILE__).'/../..'));
+#die($_REQUEST['prod']);
+#if (!defined('NB_EOL')) define('NB_EOL',empty($_REQUEST['prod']) ? "\n" : '');
+if (!defined('NB_EOL')) define('NB_EOL',defined('NB_PROD') ? '' : "\n");
+#if (!defined('NB_EOL')) define('NB_EOL',"\n");
+if (!defined('EOL')) define('EOL',NB_EOL);
require_once(dirname(__FILE__).'/functions.php');
#print_r(self::p());
class nb {
<?php
require_once('nb.php');
-#define('OUT_EOL','');
-define('OUT_EOL',defined('NB_EOL') ? NB_EOL : "\n");
-# NB 07.03.16 define('OUT_BRACKET1','['.OUT_EOL);
+# NB 07.03.16 define('OUT_BRACKET1','['.NB_EOL);
# NB 07.03.16 define('OUT_BRACKET2',']');
-# NB 07.03.16 define('OUT_BRACE1','{'.OUT_EOL);
+# NB 07.03.16 define('OUT_BRACE1','{'.NB_EOL);
# NB 07.03.16 define('OUT_BRACE2','}');
-# NB 07.03.16 define('OUT_COMA',','.OUT_EOL);
+# NB 07.03.16 define('OUT_COMA',','.NB_EOL);
class Out extends Nb {
'function' => 'out_csv',
),
'center' => array(
- 'enclose' => array("<center>".OUT_EOL,"</center>".PHP_EOL),
+ 'enclose' => array("<center>".NB_EOL,"</center>".NB_EOL),
'tag_enclose' => 'div',
'tag' => 'label',
'function' => 'out_tag',
'head' => 'out_tag_head',
),
'table' => array(
- 'enclose' => array("<table>".OUT_EOL,"</table>".PHP_EOL),
+ 'enclose' => array("<table>".NB_EOL,"</table>".NB_EOL),
'tag_enclose' => 'tr',
'tag_head' => 'th',
'tag' => 'td',
'head' => 'out_tag_head',
),
'xml' => array(
- 'enclose' => array('<?xml version="1.0" encoding="utf-8"?>'.OUT_EOL."<rows>".OUT_EOL,"</rows>".PHP_EOL),
+ 'enclose' => array('<?xml version="1.0" encoding="utf-8"?>'.NB_EOL."<rows>".NB_EOL,"</rows>".NB_EOL),
'function' => 'out_xml',
),
'yaml' => array(
'function' => 'out_yaml',
),
'json' => array(
- 'enclose' => array('['.OUT_EOL,OUT_EOL.']'),
+ 'enclose' => array('['.NB_EOL,NB_EOL.']'),
'function.ext' => 'json_encode',
- 'eol' => OUT_EOL,
+ 'eol' => NB_EOL,
'rec' => ',',
),
);
function out_tag(&$row,$o) {
#var_dump($row); return '';
- if (isset($o['tag_enclose'])) echo (OUT_EOL ? ' ' : '').'<'.$o['tag_enclose'].'>'.PHP_EOL;
+ if (isset($o['tag_enclose'])) echo (NB_EOL ? ' ' : '').'<'.$o['tag_enclose'].'>'.NB_EOL;
foreach ($row as $k => $v) {
#if (!is_scalar($v)) continue;
$class = '';
}
echo ''
- .(OUT_EOL ? ' ' : '')
+ .(NB_EOL ? ' ' : '')
#.(isset($o['tag_enclose']) ? '<'.$o['tag_enclose'].'>' : '')
."<$k$class>$v</$k>"
#.(isset($o['tag_enclose']) ? '</'.$o['tag_enclose'].'>' : '')
- .OUT_EOL
+ .NB_EOL
;
}
- if (isset($o['tag_enclose'])) echo (OUT_EOL ? ' ' : '').'</'.$o['tag_enclose'].'>'.PHP_EOL;
+ if (isset($o['tag_enclose'])) echo (NB_EOL ? ' ' : '').'</'.$o['tag_enclose'].'>'.NB_EOL;
}
function out_xml(&$row,$o) {
- echo (OUT_EOL ? ' ' : '')."<row>".OUT_EOL;
+ echo (NB_EOL ? ' ' : '')."<row>".NB_EOL;
foreach ($row as $k => $v) {
- echo (OUT_EOL ? ' ' : '')."<$k><![CDATA[$v]]></$k>".OUT_EOL;
+ echo (NB_EOL ? ' ' : '')."<$k><![CDATA[$v]]></$k>".NB_EOL;
}
- echo (OUT_EOL ? ' ' : '')."</row>".OUT_EOL;
+ echo (NB_EOL ? ' ' : '')."</row>".NB_EOL;
}
# < Functions
/****************************************************************************/
-#die("A OUT_EOL B \n");
+#die("A NB_EOL B \n");
if (empty($argv) or $argv[1] != 'test') return true;
$data = array(
'a' => 1,
. "</$tag>"
;
}
- return join(PHP_EOL,$tags);
+ return join(NB_EOL,$tags);
return ''
. '<' . $tag
. ($attrs ? " $attrs" : "")
if (is_array($debug) or is_object($debug)) $debug = print_r($debug,true);
if (preg_match('/ml$/',$this->content_type)) {
#echo "<!-- $debug -->";
- echo "<pre class=\"ui-state-highlight debug\">".htmlentities($debug)."</pre>".PHP_EOL;
+ echo "<pre class=\"ui-state-highlight debug\">".htmlentities($debug)."</pre>".NB_EOL;
} else {
echo "DEBUG: $debug\n";
echo $this->doctype();
if (!$this->lang) {
- echo '<html> '.PHP_EOL;
+ echo '<html> '.NB_EOL;
} elseif ($this->html5) {
- echo '<html lang="'.$this->lang.'"> '.PHP_EOL;
+ echo '<html lang="'.$this->lang.'"> '.NB_EOL;
} else {
- echo '<html xmlns="http://www.w3.org/1999/xhtml" lang="'.$this->lang.'" xml:lang="'.$this->lang.'">'.PHP_EOL;
+ echo '<html xmlns="http://www.w3.org/1999/xhtml" lang="'.$this->lang.'" xml:lang="'.$this->lang.'">'.NB_EOL;
}
}
echo '<body'
.(empty($this->body_class) ? '' : ' class="'.trim($this->body_class).'"')
.(empty($this->body_id) ? '' : ' id="'.trim($this->body_id).'"')
- .'>' . PHP_EOL;
+ .'>' . NB_EOL;
- if ($this->h1) echo $this->tag('h1',$this->h1).PHP_EOL;
- elseif ($this->title) echo $this->tag('h1',$this->title).PHP_EOL;
+ if ($this->h1) echo $this->tag('h1',$this->h1).NB_EOL;
+ elseif ($this->title) echo $this->tag('h1',$this->title).NB_EOL;
}
return true;
function end() {
if (preg_match('/ml$/',$this->content_type)) {
- echo '</body>' . PHP_EOL;
- echo '</html>' . PHP_EOL;
+ echo '</body>' . NB_EOL;
+ echo '</html>' . NB_EOL;
}
}
$doctype = '';
if (preg_match('/frame/',$content_type)) {
- $doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'.PHP_EOL;
+ $doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'.NB_EOL;
} elseif (preg_match('/xhtml/',$content_type)) {
- $doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'.PHP_EOL;
+ $doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'.NB_EOL;
} elseif (preg_match('/xml/',$content_type)) {
- $doctype = '<?xml version="1.0" encoding="'.strtoupper($this->charset).'"?>'.PHP_EOL; //<?
+ $doctype = '<?xml version="1.0" encoding="'.strtoupper($this->charset).'"?>'.NB_EOL; //<?
} elseif ($this->html5) {
# See: http://www.w3.org/TR/html-markup/elements.html
$doctype = '<!DOCTYPE html>';
} else {
- $doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'.PHP_EOL;
+ $doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'.NB_EOL;
}
return $doctype;
function head() {
$head = '';
- #$head .= '</head>'.PHP_EOL; return $head;
+ #$head .= '</head>'.NB_EOL; return $head;
- if ($this->title) $head .= $this->tag('title',$this->title) . PHP_EOL;
+ if ($this->title) $head .= $this->tag('title',$this->title) . NB_EOL;
if (preg_match('/tml$/',$this->content_type)) {
- if ($this->charset) $head .= '<meta http-equiv="Content-Type" content="text/html; charset='.$this->charset.'" />'.PHP_EOL;
+ if ($this->charset) $head .= '<meta http-equiv="Content-Type" content="text/html; charset='.$this->charset.'" />'.NB_EOL;
- $head .= '<meta name="viewport" content="width=device-width, initial-scale=1" />'.PHP_EOL;
+ $head .= '<meta name="viewport" content="width=device-width, initial-scale=1" />'.NB_EOL;
foreach ($this->to_array($this->css) as $v) {
- $head .= '<link type="text/css" rel="stylesheet" href="' . $v . '" />'.PHP_EOL;
+ $head .= '<link type="text/css" rel="stylesheet" href="' . $v . '" />'.NB_EOL;
}
if ($this->css_code) $head .= ''
- . '<style type="text/css"><!-- ' . PHP_EOL
+ . '<style type="text/css"><!-- ' . NB_EOL
. $this->css_code
- . ' --></style>' . PHP_EOL
+ . ' --></style>' . NB_EOL
;
foreach ($this->to_array($this->js) as $v) {
- $head .= '<script src="' . $v . '" type="text/javascript"></script>' . PHP_EOL;
+ $head .= '<script src="' . $v . '" type="text/javascript"></script>' . NB_EOL;
}
if ($this->js_code) $head .= ''
- . '<script type="text/javascript"><!-- ' . PHP_EOL
+ . '<script type="text/javascript"><!-- ' . NB_EOL
. trim($this->js_code)."\n"
- . ' --></script>' . PHP_EOL
+ . ' --></script>' . NB_EOL
;
}
- foreach ($this->to_array($this->head) as $h) $head .= $h.PHP_EOL;
+ foreach ($this->to_array($this->head) as $h) $head .= $h.NB_EOL;
if ($head) {
- $head = '<head>'.PHP_EOL.$head.'</head>'.PHP_EOL;
+ $head = '<head>'.NB_EOL.$head.'</head>'.NB_EOL;
}
return $head;