- yWeb: use styles in override directory too

This commit is contained in:
svenhoefer
2015-03-04 23:26:57 +01:00
parent 9b042be177
commit 2fa1a82c26
2 changed files with 28 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
version=2.9.0.10
date=02.03.2015
version=2.9.0.11
date=04.03.2015
type=Release
info=Port CST

View File

@@ -15,20 +15,33 @@
style_get()
{
check_Y_Web_conf
active_style=`config_get_value_direct $y_config_Y_Web 'style'`
active_style=$(config_get_value_direct $y_config_Y_Web 'style')
y_path_directory=$(config_get_value_direct $y_config_nhttpd 'WebsiteMain.directory')
y_path_override_directory=$(config_get_value_direct $y_config_nhttpd 'WebsiteMain.override_directory')
style_list=""
style_list="$style_list $(find $y_path_override_directory/styles -name 'Y_Dist-*')"
style_list="$style_list $(find $y_path_directory/styles -name 'Y_Dist-*')"
f_list=""
html_option_list=""
style_list=`find $y_path_httpd/styles -name 'Y_Dist-*'`
for f in $style_list
do
echo $f_list | grep ${f##*/}
if [ $? == 0 ]; then
continue
fi
f_list="$f_list ${f##*/}"
style=$(echo "$f" | sed -e s/^.*Y_Dist-//g | sed -e s/.css//g)
sname=${style//_/ } # replace '_' with ' '
if [ "$style" = "$active_style" ]
then
sel="selected='selected'"
else
sel=""
fi
opt="<option value='$style' $sel>$sname</option>"
opt="<option value='$style' $sel>${style//_/ }</option>"
html_option_list="$html_option_list $opt"
done
echo "$html_option_list"
@@ -38,8 +51,15 @@ style_get()
# -----------------------------------------------------------
style_set()
{
cd $y_path_httpd
cp styles/Y_Dist-$1.css Y_Dist.css
y_path_directory=$(config_get_value_direct $y_config_nhttpd 'WebsiteMain.directory')
y_path_override_directory=$(config_get_value_direct $y_config_nhttpd 'WebsiteMain.override_directory')
cd $y_path_directory
if [ -e $y_path_override_directory/styles/Y_Dist-$1.css ]; then
cp $y_path_override_directory/styles/Y_Dist-$1.css Y_Dist.css
else
cp $y_path_directory/styles/Y_Dist-$1.css Y_Dist.css
fi
#config_set_value_direct $y_config_Y_Web 'style' $1
}
# -----------------------------------------------------------