+list_items() {
+ local mode
+ mode="$(COOKIE mode |grep -m1 -xE 'index|browse' || printf browse )"
+
+ [ "$mode" = browse -a "$ITEM" ] && printf '..\n'
+
+ if [ "$mode" = browse -a "$ORDER" = Date ]; then
+ list_directories
+ list_filemeta . |cut -f2- \
+ | xargs -d\n stat -c '%Y %n' \
+ | sort -rn |cut -d/ -f2-
+ elif [ "$mode" = browse -a "$ORDER" = Name ]; then
+ list_directories
+ list_filemeta . \
+ | sort -k 2 |cut -d/ -f2-
+ elif [ "$mode" = index -a "$ORDER" = Date ]; then
+ list_index |cut -f2- \
+ | xargs -d'\n' stat -c '%Y %n' \
+ | sort -rn | cut -d/ -f2-
+ elif [ "$mode" = index -a "$ORDER" = Name ]; then
+ list_index | sort -k 2 | cut -d/ -f2-
+ elif [ "$mode" = browse -a "$ORDER" = Length ]; then
+ list_directories
+ list_filemeta . \
+ | sort -n |cut -d/ -f2-
+ elif [ "$mode" = index -a "$ORDER" = Length ]; then
+ list_index \
+ | sort -n |cut -d/ -f2-
+ fi
+}
+
+list_paginate() {
+ local page i c n