From 70aac8e5f51c8044fb670874ac1004d92a516f4f Mon Sep 17 00:00:00 2001 From: nachoparker Date: Sun, 10 Sep 2017 13:51:20 +0200 Subject: ncp-web: display info for each option --- ncp-web/index.php | 33 +++++++++++++++++++-------------- ncp-web/ncp.css | 6 +++++- ncp-web/ncp.js | 5 +++-- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/ncp-web/index.php b/ncp-web/index.php index 05fa694a..988f64e1 100644 --- a/ncp-web/index.php +++ b/ncp-web/index.php @@ -88,21 +88,25 @@ foreach($files as $file) { $script = pathinfo( $file , PATHINFO_FILENAME ); - $fh = fopen( $path . $file ,'r'); + $txt = file_get_contents( $path . $file ); + $active = ""; - while ($line = fgets($fh)) - { - if ( $line == "ACTIVE_=yes\n" ) - $active = " ✓"; - if ( preg_match('/^DESCRIPTION="(.*)"$/', $line, $matches) ) - { - echo "
  • "; - echo " $script$active "; - echo ""; - echo "
  • "; - } - } - fclose($fh); + if ( preg_match('/^ACTIVE_=yes$/m', $txt, $matches) ) + $active = " ✓"; + + echo "
  • "; + echo " $script$active "; + + if ( preg_match('/^DESCRIPTION="(.*)"$/m', $txt, $matches) ) + echo ""; + + if ( preg_match('/^INFO="(.*)"/msU', $txt, $matches) ) + echo ""; + + if ( preg_match('/^INFOTITLE="(.*)"/msU', $txt, $matches) ) + echo ""; + + echo "
  • "; } ?> @@ -110,6 +114,7 @@

    Configure NextCloudPi features

    +