}
foreach (self::$params as $p) if ($v=self::p($p)) $url[] = $p.'='.urlencode($v);
- return $url ? '?'.$sep.join($sep,$url) : '';
+ return $url ? '?'.join($sep,$url) : '';
}
public function fields_keys(&$others=array()) {
public function rows_rec_table(&$row) {
+ $buttons = $this->html_row_buttons($row);
+
$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>'.NB_EOL;
+ if ($this->p('buttons')!=='0') $html .= '<td class="action">'.$buttons[0].'</a></td>'.NB_EOL;
foreach ($row as $k => $v) {
if (isset($this->extras[$k])) $k .= " extra";
$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>'.NB_EOL;
+ if ($this->p('buttons')!=='0') $html .= '<td class="action">'.$buttons[1].'</a></td>'.NB_EOL;
$html .= '</tr>'.NB_EOL;
if ($this->p('buttons')!=='0') {
$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 .= join('',$this->html_row_buttons($row));
$html .= '</li>'.NB_EOL;
}
return false;
}
+ public function html_row_buttons(&$row) {
+ return array(
+ '<a class="edit button" href="'.$this->url_keys($row,'action=edit').'">'.DB_HTML_EDIT.'</a>'.NB_EOL,
+ '<a class="delete button" href="'.$this->url_keys($row,'action=delete').'">'.DB_HTML_DELETE.'</a>'.NB_EOL,
+ );
+ }
+
public function html_rows_top() {
if (self::p('replace') === '0') return '';
$html = '';
}
public function count() {
-
+
if (isset($this->count)) return $this->count;
$sql_count = $this->name;