Skip to content

Commit

Permalink
ncp-web: active mark
Browse files Browse the repository at this point in the history
  • Loading branch information
nacho committed Aug 10, 2017
1 parent f0138c4 commit 8db180e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ncp-web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,19 @@
{
$script = pathinfo( $file , PATHINFO_FILENAME );
$fh = fopen( $path . $file ,'r');
$active = "";
while ($line = fgets($fh))
{
if ( $line == "ACTIVE_=yes\n" )
$active = "";
if ( preg_match('/^DESCRIPTION="(.*)"$/', $line, $matches) )
{
echo "<li id=\"$script\" class=\"nav-recent\">";
echo "<a href=\"#\"> $script </a>";
echo "<a href=\"#\"> $script$active </a>";
echo "<input type=\"hidden\" value=\"$matches[1]\" />";
echo "</li>";
}
}
fclose($fh);
}
?>
Expand Down
3 changes: 3 additions & 0 deletions ncp-web/ncp-launcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

while ( $line = fgets($fh) )
{
// checkbox (yes/no) field
if ( preg_match('/^(\w+)_=(yes|no)$/', $line, $matches) )
{
if ( $matches[2] == "yes" )
Expand All @@ -44,6 +45,8 @@
$output = $output . "<td><input type=\"checkbox\" id=\"$matches[1]\" name=\"$matches[1]\" value=\"$matches[2]\" $checked></td>";
$output = $output . "</tr>";
}

// text field
else if ( preg_match('/^(\w+)_=(.*)$/', $line, $matches) )
{
$output = $output . "<tr>";
Expand Down

0 comments on commit 8db180e

Please sign in to comment.