*/sh) SHELL_NAME=sh ;;
*/bash) SHELL_NAME=bash ;;
*)
- if ls --help 2>&1 | grep -qm1 ^BusyBox; then
+ if ls --help 2>&1 | /bin/grep -qm1 ^BusyBox; then
SHELL_NAME="busybox"
elif [ -n "$ZSH_NAME" ]; then
SHELL_NAME=zsh
ls_opt=' -F'
ll_opt=' -alh'
-if [ "$SHELL_NAME" != "busybox" ]; then
+#if [ "$SHELL_NAME" != "busybox" ]; then
+if ! ls --help 2>&1 | grep -qm1 ^BusyBox; then
if [ -n "$DARWIN" ]; then
[ "$color_prompt" = yes ] && ls_opt="$ls_opt -G"
#
# Alias grep
#
-[ "$SHELL_NAME" = "busybox" ] || alias grep='grep --color=auto'
+if ! grep --help 2>&1 | grep -qm1 ^BusyBox; then
+ alias grep='grep --color=auto'
+fi
#
# bye
#
#################################################################################
nb_repo() {
-# NB 24.11.16: TODEL
-if false && which perl &> /dev/null; then
- nb-repo-dirs $@
-else
-
[ -z "$FUNCNAME" ] && local FUNCNAME='nb_repo'
if [ -z "$*" ]; then
# Find repos
fi
-fi
}
timeout() {
$args = urlencode($args);
$base = $this->table->base;
- $r = ['@' => join(' ',[
- '<a class="button select" href="'.$base.'vi/'.$args.'">View</a>'
- ]) ] + $r;
-
$rm = $base.'rm/'.$args;
$r['-'] = ''
#'<a class="button delete" href="'.$this->table->name.'/rm/'.$args.'">Delete</a>'
.'<form action="'.$rm.'" method="post">'
.'<a class="button" href="'.$rm.'" onclick="parentNode.submit();return false;">Delete</a>'
+ .$this->form_hidden($r)
.'</form>'
;
+ $r = ['@' => join(' ',[
+ '<a class="button select" href="'.$base.'vi/'.$args.'">View</a>'
+ ]) ] + $r;
+
},
] : [];
}
+ public static function form_hidden($r) {
+ $h = '';
+ foreach ($r as $k => $v) {
+ $h .= '<input type="hidden" name="'.htmlentities($k).'" value="'.htmlentities($v).'"/>';
+ }
+ return $h;
+ }
+
public function table() {
if (!in_array($this->params['table'],array_keys($this->db->tables()))) {