#!/bin/bash

section_message () {

	if [[ ! $QUIET ]]; then
		case $1 in

			APP )
				echo -e "\n${RED}Required ${WHITE}Applications:\n"
			;;

			OPT_APP )
				echo -e "\n${MAGENTA}Optional ${WHITE}Applications:\n"
			;;

			SBINAPP )
				echo -e "\n${RED}Required ${WHITE}SuperUser Applications:\n"
			;;

			OPT_SBINAPP )
				echo -e "\n${MAGENTA}Optional ${WHITE}SuperUser Applications:\n"
			;;

			PYMOD )
				echo -e "\n${RED}Required ${WHITE}Python Modules:\n"
			;;

			OPT_PYMOD )
				echo -e "\n${MAGENTA}Optional ${WHITE}Python Modules:\n"
			;;

			LIB )
				echo -e "\n${RED}Required ${WHITE}Libraries:\n"
			;;

			OPT_LIB )
				echo -e "\n${MAGENTA}Optional ${WHITE}Libraries:\n"
			;;
		esac
	fi
	tput sgr0

}

start_message () {

	echo -e "\n${GREEN}BashStyle-NG${YELLOW} v${xVERSION} ${CYAN}${CODENAME}"
	tput sgr0

}

ok_message () {

	if [[ ! $QUIET ]]; then
		if [[ $2 != "" ]]; then
			echo -e "${WHITE}\t+ ${CYAN}$1${MAGENTA} >${GREEN} O.K.${SILVER} ( $2 )"
		else 	echo -e "${WHITE}\t+ ${CYAN}$1${MAGENTA} >${GREEN} O.K."
		fi
	fi
	tput sgr0
}

fail_message () {

	if [[ $1 == "m" ]]; then
		echo -e "${WHITE}\t+ ${CYAN}$2${MAGENTA} >${RED} !MISSING!"
	elif [[ $1 == "o" ]]; then
		echo -e "${WHITE}\t+ ${CYAN}$2${MAGENTA} >${RED} !OLDER THAN $3!"
	fi
	tput sgr0

}

warn_message () {

	echo -e "${WHITE}\t+ ${CYAN}$1${MAGENTA} >${YELLOW} Not Available"
	tput sgr0

}

maintainer_message () {

	echo -e "\n${RED}Maintainer Mode ${WHITE}/ ${GREEN}Disabled Checks"
	tput sgr0

}

end_message () {

	export PATH="$OLDPATH"
	echo -e "\n${YELLOW}Prefix:${WHITE} $PREFIX\
		\n${YELLOW}Dirinfo Wrappers:${WHITE} $DIRINFO_ENABLE\n"
	if [[ $ERR_MSG != "" ]]; then
		echo -e "${YELLOW}Notes:\
			\n${WHITE}${ERR_MSG}"
	fi
	tput sgr0

}

help_message () {

	echo -e "\n${GREEN}BashStyle-NG ${YELLOW}(configure 4.0.1) ${CYAN}help"
	echo -e "\n${WHITE}Options:\n"
	echo -e "\n${ORANGE}--help${WHITE} |${GREEN} Display this help message\
	\n${ORANGE}--maintainer${WHITE} |${GREEN} Enter Maintainer Mode (disables checks)\
	\n${ORANGE}--prefix=${WHITE} |${GREEN} Change Installation Prefix (default: /usr)\
	\n${ORANGE}--quiet${WHITE} |${GREEN} Only display warnings, failures and results\
	\n${ORANGE}--dirinfo-disable${WHITE} |${GREEN} Disable Dirinfo Wrappers (default)\
	\n${ORANGE}--dirinfo-enable${WHITE} |${GREEN} Enable Dirinfo Wrappers (RTFM first!)" | column -t
	echo ""
	tput sgr0

}
