tazpanel diff boot.cgi @ rev 523

lib/libtazpanel: add edit_button()
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Aug 08 16:06:55 2015 +0200 (2015-08-08)
parents e87d432b202d
children 1bdec638c408
line diff
     1.1 --- a/boot.cgi	Sun Jul 12 17:53:53 2015 +0200
     1.2 +++ b/boot.cgi	Sat Aug 08 16:06:55 2015 +0200
     1.3 @@ -45,12 +45,7 @@
     1.4  		$(_ 'System logs')
     1.5  EOT
     1.6  
     1.7 -		[ -w /etc/syslog.conf ] && cat <<EOT
     1.8 -		<form action="index.cgi">
     1.9 -			<input type="hidden" name="file" value="/etc/syslog.conf"/>
    1.10 -			<button name="action" value="edit" data-icon="edit">syslog.conf</button>
    1.11 -		</form>
    1.12 -EOT
    1.13 +		edit_button /etc/syslog.conf syslog.conf
    1.14  
    1.15  		cat <<EOT
    1.16  	</header>
    1.17 @@ -518,14 +513,7 @@
    1.18  <section>
    1.19  	<header>
    1.20  		$(_ 'Local startup commands')
    1.21 -		<form action="index.cgi">
    1.22 -			<input type="hidden" name="file" value="/etc/init.d/local.sh"/>
    1.23 -EOT
    1.24 -		[ -w /etc/init.d/local.sh ] && cat <<EOT
    1.25 -			<button name="action" value="edit" data-icon="edit">$(_ 'Edit')</button>
    1.26 -EOT
    1.27 -		cat <<EOT
    1.28 -		</form>
    1.29 +		$(edit_button /etc/init.d/local.sh)
    1.30  	</header>
    1.31  	<pre><code class="language-bash">$(htmlize < /etc/init.d/local.sh)</code></pre>
    1.32  </section>