}
function pset($name,$value) {
- return $_REQUEST[$name] = $value;
+ if ($value === null) {
+ unset ($_REQUEST[$name]);
+ return null;
+ }
+ return ($_REQUEST[$name] = $value);
}
/*
return $this->fields();
}
- /*
- * Function db.page
- *
- * print any pages according to params
- *
- * @param (array)
- */
- function page($Page,$param=null) {
- if ($param === null) $param = $this->p();
- elseif (!is_array($param)) $param = array('name' => $param);
-
- foreach (array(
- 'action' => 'list',
- ) as $k => $v) {
- }
-
- $Page->title = prettyText($this->name);
-
- #if ($Page->is('html')) $this->form_criterias();
-
- if ($this->p('format')) $this->print_header($this->p('format'));
- if ($this->p('format')) {
- $this->rows(array('format' => $this->p('format')));
- return 0;
- }
-
- #die($Page->content_type);
- $Page->begin();
- echo '<div id="msg"></div>'.PHP_EOL;
- echo '<div id="db">'.PHP_EOL;
- #$Page->debug($this->tables());
-
-
- echo $this->html_menu();
-
- /*
- Rows
- */
- if (@$this) $this->rows(array(
- 'format' => $this->p('format'),
- ));
-
- // END
- echo '</div>'.PHP_EOL;
- #$Page->out($Db->query2v("SELECT 1"));
- $Page->end();
- return 0;
- }
-
/*
* Function db.fields
*
$st = $this->db->conn->prepare($sql);
$st->execute();
- $format = ''.(isset($opt['format']) ? $opt['format'] : 'table');
+ $format = (!empty($opt['format']) ? $opt['format'] : 'table');
if (!@$opt['is_html']) $opt['is_html'] = preg_match('/^(table)$/',$format) ? true : false;
if ($opt['is_html']) echo '<div align="center" class="nav" id="nav_top"></div>'.PHP_EOL;
}
function filename2title() {
- $str = preg_replace(',^.*?([^/]+)(\/?.*)?$,','\1',$_SERVER['REQUEST_URI']);
- if ($str == '/') $str = preg_replace('@^.*?([^/\.]+)(/index)?(\..*?)$@','\1',$_SERVER['SCRIPT_NAME']);
+ $str = '';
+ if (isset($_SERVER['REQUEST_URI'])) $str = preg_replace(',^.*?([^/]+)(\/?.*)?$,','\1',$_SERVER['REQUEST_URI']);
+ if ($str == '' or $str == '/') $str = preg_replace('@^.*?([^/\.]+)(/index)?(\..*?)$@','\1',$_SERVER['SCRIPT_NAME']);
$str = preg_replace('@[\'_-]+$@',' ',$str);
return mb_strtoupper(mb_substr($str,0,1)).mb_strtolower(mb_substr($str,1,mb_strlen($str)));
}