3 [ -n "$include_widgets" ] && return 0
6 . "$_EXEC/cgilite/storage.sh"
8 w_refuri="$(HTML "$REQUEST_URI")"
9 w_tags="$(find "$_DATA/" -path '*/.index/meta' -print0 \
11 | cut -d= -f2- |tr , '\n' | sort -u)"
12 w_tags="$(UNSTRING "$w_tags")"
16 [form #search method=GET action=?
18 [option disabled=disabled Order By]
19 [option value=Name Name]
20 [option value=Date Date]
21 [option value=Length Length]
23 [input name=s placeholder=Search value="%s"]
31 fakemp4="$(COOKIE fakemp4)"
34 [form #prefs method="POST" action="?a=setprefs"
37 [label for=prefs_ps Pagesize]
38 [input #prefs_ps type=number name=pagesize value="%s"][br]
39 [radio "mode" "browse" %s #prefs_modebrowse] [label for=prefs_modebrowse Browse Folders][br]
40 [radio "mode" "index" %s #prefs_modeindex ] [label for=prefs_modeindex View Full Index][br]
41 [checkbox "fakemp4" "yes" %s #prefs_fmp4] [label for=prefs_fmp4 Fake .MP4 file ending][br]
42 [submit "store" "store" Set Cookie]
45 "$w_refuri" "$LISTSIZE" \
46 "$([ "$mode" = index ] || printf checked)" \
47 "$([ "$mode" = index ] && printf checked)" \
48 "$([ "$fakemp4" = yes ] && printf checked)"
52 [ -d "$_DATA/$ITEM/.index" ] || printf '
53 [form #index method="POST" action="?a=spawnindex"
55 [label Set up for Index view: ]
56 [checkbox "recursive" "yes" #spawn_recursive] [label for=spawn_recursive Include subdirectories]
57 [submit "spawn" "spawn" Set up]
63 local n lbid tag category tn filter f
66 printf '[form #advsearch action=?a=advsearch method=POST
68 [p .help Select multiple tags from each category by holding down the [strong Ctrl] key on your keyboard.[br]
69 Refine the search further by setting additional search tags using the [strong "+and"] button.]
73 for n in 1 2 3 4 5 6 7 8 9 10; do
74 f="${filter%%^*}"; filter="${filter#*^}"
76 lbid="$(HTML "cat_${n}_(none)")"
77 printf '[input .and type=checkbox name=and id="and_%i" %s][label for="and_%i" +and
79 [input .pol type="radio" name=pol_%i %s id="pol_pos_%i"][label for=pol_pos_%i Any]
80 [input .pol type="radio" name=pol_%i %s id="pol_neg_%i"][label for=pol_neg_%i None]
81 [label .head Category:]
82 [input .cat type=radio name="cat_%i" %s id="%s" ][label for="%s" %s]
83 [select name=tag_%s size=10 multiple="multiple"' \
84 $n "$([ "$f" ] && printf 'checked="checked"')" $n \
85 $n "$([ "$f" -a \! "${f%%~*}" ] || printf 'checked="checked"')" $n $n \
86 $n "$([ "$f" -a \! "${f%%~*}" ] && printf 'checked="checked"')" $n $n \
87 $n "$([ "$f" = "${f%:*}" ] && printf 'checked="checked"')" "$lbid" "$lbid" "(none)" \
91 printf %s "$w_tags" |grep -vF ":" \
92 | while read -r tag; do
93 [ ! "$tag" ] && continue
95 printf '[option %s value="%s" %s]' \
96 "$([ "$f" != "${f%|${tag}|*}" ] && printf 'selected="selected"')" \
100 printf %s "$w_tags" |cut -sd: -f1 |sort -u \
101 | while read -r category; do
102 lbid="$(HTML "cat_${n}_${category}")"
103 printf '[input .cat type=radio name="cat_%i" %s id="%s"][label for="%s" %s]
104 [select name=tag_%s size=10 multiple="multiple"' \
105 $n "$([ "$f" != "${f%|${category}:*}" ] && printf 'checked="checked"')" \
106 "$lbid" "$lbid" "$(HTML "$category")" $n
107 printf %s "$w_tags" |grep -wF "${category}" \
108 | while read -r tag; do
109 tg="$(HTML "$tag")"; tn="${tg#*:}"
110 printf '[option %s value="%s" %s]' \
111 "$([ "$f" != "${f%|${tag}|*}" ] && printf 'selected="selected"')" \
124 printf '[div #multitag [input type="hidden" name="ref" value="%s"]' "$w_refuri"
125 printf '[a href="#" Hide][br]'
127 printf '[fieldset [legend %s:][select name=tag size=4 multiple' "Tags"
128 printf %s "$w_tags" |grep -vF ":" \
129 | while read -r tag; do
130 [ ! "$tag" ] && continue
131 printf '[option value="%s" %s]' "$(HTML "$tag")" "$(HTML "$tag")"
135 printf %s "$w_tags" |cut -sd: -f1 |sort -u \
136 | while read -r category; do
137 printf '[fieldset [legend %s:][select name=tag size=4 multiple' "$(HTML "$category")"
138 printf %s "$w_tags" |grep -wF "${category}" \
139 | while read -r tag; do
140 tag="$(HTML "$tag")"; tn="${tag#*:}"
141 printf '[option value="%s" %s]' "$tag" "$tn"
146 printf '[fieldset [legend New:][textarea name=newtag\n][button type=Submit Add Tags]]]'