mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 01:41:23 +02:00
- yWeb: use styles in override directory too
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
version=2.9.0.10
|
version=2.9.0.11
|
||||||
date=02.03.2015
|
date=04.03.2015
|
||||||
type=Release
|
type=Release
|
||||||
info=Port CST
|
info=Port CST
|
||||||
|
@@ -15,20 +15,33 @@
|
|||||||
style_get()
|
style_get()
|
||||||
{
|
{
|
||||||
check_Y_Web_conf
|
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=""
|
html_option_list=""
|
||||||
style_list=`find $y_path_httpd/styles -name 'Y_Dist-*'`
|
|
||||||
for f in $style_list
|
for f in $style_list
|
||||||
do
|
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)
|
style=$(echo "$f" | sed -e s/^.*Y_Dist-//g | sed -e s/.css//g)
|
||||||
sname=${style//_/ } # replace '_' with ' '
|
|
||||||
if [ "$style" = "$active_style" ]
|
if [ "$style" = "$active_style" ]
|
||||||
then
|
then
|
||||||
sel="selected='selected'"
|
sel="selected='selected'"
|
||||||
else
|
else
|
||||||
sel=""
|
sel=""
|
||||||
fi
|
fi
|
||||||
opt="<option value='$style' $sel>$sname</option>"
|
opt="<option value='$style' $sel>${style//_/ }</option>"
|
||||||
html_option_list="$html_option_list $opt"
|
html_option_list="$html_option_list $opt"
|
||||||
done
|
done
|
||||||
echo "$html_option_list"
|
echo "$html_option_list"
|
||||||
@@ -38,8 +51,15 @@ style_get()
|
|||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
style_set()
|
style_set()
|
||||||
{
|
{
|
||||||
cd $y_path_httpd
|
y_path_directory=$(config_get_value_direct $y_config_nhttpd 'WebsiteMain.directory')
|
||||||
cp styles/Y_Dist-$1.css Y_Dist.css
|
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
|
#config_set_value_direct $y_config_Y_Web 'style' $1
|
||||||
}
|
}
|
||||||
# -----------------------------------------------------------
|
# -----------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user