]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Changes to indentation in php-admin and php-user
authorBen Schmidt <none@none>
Fri, 29 Oct 2010 11:25:56 +0000 (22:25 +1100)
committerBen Schmidt <none@none>
Fri, 29 Oct 2010 11:25:56 +0000 (22:25 +1100)
contrib/web/php-admin/htdocs/edit.php
contrib/web/php-admin/htdocs/save.php

index 2fc4641168f9fcd8045a4e2965b3678e40d6d033..7787146828a69e5e88afc38fe43d0f2df8b25e8b 100644 (file)
@@ -34,9 +34,9 @@ function mlmmj_boolean($name, $nicename, $text)
     global $tpl, $topdir, $list;
 
     if(is_file($topdir."/".$list."/control/".$name))
-       $checked = TRUE;
+       $checked = TRUE;
     else
-       $checked = FALSE;
+       $checked = FALSE;
 
     $tpl->assign(array("NAME" => htmlentities($name),
                       "NICENAME" => htmlentities($nicename),
@@ -54,8 +54,8 @@ function mlmmj_string($name, $nicename, $text)
     $value = "";
 
     if(is_file($file)) {
-       $lines = file($file);
-       $value = $lines[0];
+       $lines = file($file);
+       $value = $lines[0];
     }
     
     $tpl->assign(array("NAME" => htmlentities($name),
@@ -74,7 +74,7 @@ function mlmmj_list($name, $nicename, $text)
     $value = "";
 
     if(is_file($file))
-       $value = file_get_contents($file);
+       $value = file_get_contents($file);
 
     $tpl->assign(array("NAME" => htmlentities($name),
                       "NICENAME" => htmlentities($nicename),
index 47a6f13009a40bb5951eecde8e9f28cb75eb238e..2867eea14ae17692239af4e3d66e9c486d34235e 100644 (file)
@@ -37,13 +37,14 @@ function mlmmj_boolean($name, $nicename, $text)
     
     if(isset($_POST[$name]) && !empty($_POST[$name]))
     {
-       if(!touch($file))
-           die("Couldn't open ".$file." for writing");
-       if (!chmod($file, 0644))
-           die("Couldn't chmod ".$file);
+       if(!touch($file))
+          die("Couldn't open ".$file." for writing");
+       if (!chmod($file, 0644))
+          die("Couldn't chmod ".$file);
+    }
+    else {
+       @unlink($file);
     }
-    else
-       @unlink($file);
 }
 
 function mlmmj_string ($name, $nicename, $text) 
@@ -59,17 +60,18 @@ function mlmmj_list($name, $nicename, $text)
     
     if(isset($_POST[$name]) && !empty($_POST[$name]))
     {
-       if (!$fp = fopen($file, "w"))
-           die("Couldn't open ".$file." for writing");
+       if (!$fp = fopen($file, "w"))
+          die("Couldn't open ".$file." for writing");
 
        fwrite($fp, preg_replace('/\\r/',"",$_POST[$name]));
-       fclose($fp);
+       fclose($fp);
 
-       if (!chmod($file, 0644))
-           die("Couldn't chmod ".$file);
+       if (!chmod($file, 0644))
+          die("Couldn't chmod ".$file);
+    }
+    else {
+       @unlink($file);
     }
-    else
-       @unlink($file);
     
 }