-if [[ $GENERATEPAGESFORFULLSIZE != 0 ]]; then
- if declare -F "bpgallery_${BPGALLERY_THEME}_page" > /dev/null ; then
- BPGALLERY_PAGE_FUNCTION="bpgallery_${BPGALLERY_THEME}_page"
- else
- BPGALLERY_PAGE_FUNCTION="bpgallery_default_page"
- fi
+if [[ -z $GENERATEPAGESFORMEDIUMSIZE ]]; then
+ GENERATEPAGESFORMEDIUMSIZE=1
+fi
+
+if [[ -z $PAGESDIRECTORY ]]; then
+ PAGESDIRECTORY=""
+else
+ removetrailingslashes=${PAGESDIRECTORY%/}
+ temp=$removetrailingslashes
+ while [[ $removetrailingslashes != $temp ]]; do
+ temp=$removetrailingslashes
+ removetrailingslashes=${temp%/}
+ done
+ PAGESDIRECTORY=$(bpgallery_escape_url "${PAGESDIRECTORY}")
+fi
+
+if [[ -z $MEDIUMWIDTH ]]; then
+ MEDIUMWIDTH=400
+fi
+
+if [[ -z $INDEXDOCUMENT ]]; then
+ INDEXDOCUMENT=index.html
+fi
+
+if [[ -z $MEDIUMDIRECTORY ]]; then
+ MEDIUMDIRECTORY=medium
+else
+ # Strip out anything that might be broken
+ MEDIUMDIRECTORY=$(bpgallery_cleanup_directory_name "$MEDIUMDIRECTORY")
+fi
+
+if [[ -z $ICONSDIRECTORY ]]; then
+ ICONSDIRECTORY=icons
+else
+ # Strip out anything that might be broken
+ ICONSDIRECTORY=$(bpgallery_cleanup_directory_name "$ICONSDIRECTORY")
+fi
+
+if declare -F "bpgallery_${BPGALLERY_THEME}_page" > /dev/null ; then
+ BPGALLERY_PAGE_FUNCTION="bpgallery_${BPGALLERY_THEME}_page"
+else
+ BPGALLERY_PAGE_FUNCTION="bpgallery_default_page"