Commits

Jay Lonnquist committed 34dbda2

xml settings page cleanup additions.

  • Participants
  • Parent commits daeb9aa

Comments (0)

Files changed (11)

-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-    Document   : afsettings.xml
-    Description: Custom adminFlow settings file.
--->
-
-<root>
-    <!-- Login page. URL/Path -->
-    <login>login.php</login>
-
-    <!-- Login destination page. URL/Path -->
-    <dest>destination.php</dest>
-
-    <!-- Enable login box dragging. 'true' or 'false' -->
-    <drag>true</drag>
-
-    <!-- Custom background image. URL/Path or 'none' -->
-    <bg>/~broken/adminflow/images/adminFlowBgAlt.png</bg>
-    <!-- <bg>none</bg>-->
-
-    <!-- Custom background image positioning. -->
-    <bgxpos>65</bgxpos>
-    <bgypos>130</bgypos>
-
-    <!-- Custom text field positioning. -->
-    <logintxt_x>200</logintxt_x>
-    <logintxt_y>163</logintxt_y>
-    
-    <passtxt_x>200</passtxt_x>
-    <passtxt_y>230</passtxt_y>
-    
-    <!-- Custom text field text color. -->
-    <txtcolor>0xffffff</txtcolor>
-    
-    <!-- Custom login button positioning. -->
-    <loginbtnxpos>338</loginbtnxpos>
-    <loginbtnypos>255</loginbtnypos>
-    
-    <!-- Login animation. 'none', 'fade', 'blur' or 'slide' -->
-    <bganim>blur</bganim>
-
-    <!-- Custom throbber/loader image. URL/Path or 'none' -->
-    <!-- Animated gif sample. -->
-    <!-- <throbber>/adminflow/images/altThrobber.gif</throbber> -->
-    <!-- External swf sample. -->
-    <throbber>/~broken/adminflow/flash/altThrobber.swf</throbber>
-    <!-- <throbber>none</throbber> -->
-
-    <!-- Custom throbber positioning. -->
-    <throbberxpos>265</throbberxpos>
-    <throbberypos>110</throbberypos>
-</root>
+<?xml version="1.0"?>
+<root>
+  <login>login.php</login>
+  <dest>destination.php</dest>
+  <drag>true</drag>
+  <bg>none</bg>
+  <bgxpos>8</bgxpos>
+  <bgypos>20</bgypos>
+  <logintxt_x>200</logintxt_x>
+  <logintxt_y>163</logintxt_y>
+  <passtxt_x>200</passtxt_x>
+  <passtxt_y>230</passtxt_y>
+  <txtcolor>0x000000</txtcolor>
+  <loginbtnxpos>338</loginbtnxpos>
+  <loginbtnypos>265</loginbtnypos>
+  <bganim>blur</bganim>
+  <throbber>/~broken/adminflow/flash/altThrobber.swf</throbber>
+  <throbberxpos>265</throbberxpos>
+  <throbberypos>110</throbberypos>
+</root>

afsettings_bak.xml

+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+    Document   : afsettings.xml
+    Description: Custom adminFlow settings file.
+-->
+
+<root>
+    <!-- Login page. URL/Path -->
+    <login>login.php</login>
+
+    <!-- Login destination page. URL/Path -->
+    <dest>destination.php</dest>
+
+    <!-- Enable login box dragging. 'true' or 'false' -->
+    <drag>true</drag>
+
+    <!-- Custom background image. URL/Path or 'none' -->
+    <bg>/~broken/adminflow/images/adminFlowBgAlt.png</bg>
+    <!-- <bg>none</bg>-->
+
+    <!-- Custom background image positioning. -->
+    <bgxpos>65</bgxpos>
+    <bgypos>130</bgypos>
+
+    <!-- Custom text field positioning. -->
+    <logintxt_x>200</logintxt_x>
+    <logintxt_y>163</logintxt_y>
+    
+    <passtxt_x>200</passtxt_x>
+    <passtxt_y>230</passtxt_y>
+    
+    <!-- Custom text field text color. -->
+    <txtcolor>0xffffff</txtcolor>
+    
+    <!-- Custom login button positioning. -->
+    <loginbtnxpos>338</loginbtnxpos>
+    <loginbtnypos>255</loginbtnypos>
+    
+    <!-- Login animation. 'none', 'fade', 'blur' or 'slide' -->
+    <bganim>blur</bganim>
+
+    <!-- Custom throbber/loader image. URL/Path or 'none' -->
+    <!-- Animated gif sample. -->
+    <!-- <throbber>/adminflow/images/altThrobber.gif</throbber> -->
+    <!-- External swf sample. -->
+    <throbber>/~broken/adminflow/flash/altThrobber.swf</throbber>
+    <!-- <throbber>none</throbber> -->
+
+    <!-- Custom throbber positioning. -->
+    <throbberxpos>265</throbberxpos>
+    <throbberypos>110</throbberypos>
+</root>
     padding: 0.5em;
     margin: 1em auto 2em auto;
     border: #fcecec 1px dotted;
-    width: 50%;
+    width: 58em;
 }
 
+div#flashbox {
+    height: 44em;
+}
 
 /* Settings */
 

images/adminFlowBgMain.png

Added
New image

includes/swfobject.class.php

     ////////////////////////////
     //Constructor.
     ////////////////////////////
-    public function __construct ($path, $width, $height, $wmode, $scale, $quality, $salign) {
+    public function __construct ($path, $width, $height, $wmode, $scale, $quality) {
         $this -> func_swfobject_container ();
-        $this -> func_swfjs ($path, $width, $height, $wmode, $scale, $quality, $salign);
+        $this -> func_swfjs ($path, $width, $height, $wmode, $scale, $quality);
     }
 
     ////////////////////////////
             var attributes = {};
             attributes.id = "flashinputframe";
             attributes.align = "middle";
-            swfobject.embedSWF("' . $path . '", "flashinputframe", "'.$width.'", "'.$height.'", "10.0.0", "flash/expressInstall.swf", flashvars, params, attributes);
+            swfobject.embedSWF("' . $path . '", "flashinputframe", "'.$width.'", "'.$height.'", "11.1.0", "flash/expressInstall.swf", flashvars, params, attributes);
         </script>
         ';
     }

includes/xmlhandler.class.php

     //Public class methods.
     ////////////////////////////
     //XML writer.
-    public function func_xmlwriter ($xmldatarray) {
+    public function func_xmlwriter ($xmldatarray, $output) {
         if ($xmldatarray != null) {
             //PHP SimpleXML object. 
             $xmlwriter = new SimpleXMLElement ("<root></root>");
             $dom -> preserveWhiteSpace = false;
             $dom -> formatOutput = true;
             $dom -> loadXML ($xmlwriter -> asXML ());
-            //Echo to browser.
-            //echo $dom -> saveXML ();
-            //Save to file.
-            $dom -> save ($this -> xmluri);
+            //Output.
+            //$dom -> save ($this -> xmluri);
+            switch ($output) {
+                case 'file':
+                    //Save to file.
+                    $dom -> save ($this -> xmluri);
+                    break;
+                case 'browser':
+                    //Echo to browser.
+                    echo $dom -> saveXML ();
+                    break;
+            }
             return true;
         }
     }
     </head>
     <body>
         <div class="container">
+            <div id="login_box">
             <?php
         ////////////////////////////
         //Embed login box.
         ////////////////////////////
         //Set selected SWFObject parameters here:
         //Path, width, height, wmode, scale, quality.
-        $loginbox = new swfobject ('flash/adminFlow/bin/adminFlow.swf', '605', '480', 'transparent', 'exactfit', 'best');
+        new swfobject ('flash/adminFlow/bin/adminFlow.swf', '640', '480', 'transparent', 'exactfit', 'best');
         ////////////////////////////
-        ?>
+      ?>
+            </div>
             <h4>Session Data</h4>
             <br />            
             <?php
-        ////////////////////////////
-        //Debug.
-        //Remark out or remove when deploying!
-        ////////////////////////////
-        echo '<pre>';
-        print_r ($_SESSION);
-        echo '</pre>';
-        ////////////////////////////
-        ?>
+            ////////////////////////////
+            //Debug.
+            //Remark out or remove when deploying!
+            ////////////////////////////
+            echo '<pre>';
+            print_r ($_SESSION);
+            echo '</pre>';
+            ////////////////////////////
+            ?>
         </div>
         <div class="settings">
             <?php
-            include_once('pagestruct/settings.php');
-        ?>
+        include_once('pagestruct/settings.php');
+      ?>
         </div>
     </body>
 </html>
     //Submit form data.
     //Write XML to file, return results.
     ///////////////////////////
-    $('#writexml').submit(function(e) {
+    $('form#writexml').submit(function(e) {
         e.preventDefault();
-        var jqxhr = $.post('xmldata.php', $('#writexml').serialize(), function(data) {
+        var jqxhr = $.post('xmldata.php', $('form#writexml').serialize(), function(data) {
+            //Fill inputs.
             $('input#login_input_now').val(data.login);
             $('input#dest_input_now').val(data.dest);
+            $('input#drag_input_now').val(data.drag);
+            $('input#bg_input_now').val(data.bg);
+            $('input#bgxpos_input_now').val(data.bgxpos);
+            $('input#bgypos_input_now').val(data.bgypos);
+            $('input#logintxt_x_input_now').val(data.logintxt_x);
+            $('input#logintxt_y_input_now').val(data.logintxt_y);
+            $('input#passtxt_x_input_now').val(data.passtxt_x);
+            $('input#passtxt_y_input_now').val(data.passtxt_y);
+            $('input#txtcolor_input_now').val(data.txtcolor);
+            $('input#loginbtnxpos_input_now').val(data.loginbtnxpos);
+            $('input#loginbtnypos_input_now').val(data.loginbtnypos);
+            $('input#bganim_input_now').val(data.bganim);
+            $('input#throbber_input_now').val(data.throbber);
+            $('input#throbberxpos_input_now').val(data.throbberxpos);
+            $('input#throbberypos_input_now').val(data.throbberypos);
+            //Reload login box.
+            $('div#login_box').load('pagestruct/loginbox.php');
         }, 'json')
         .error(function(error) {
             alert('Error: ' + error);
-        })
+        });
     });
 ///////////////////////////
 });

pagestruct/loginbox.php

+<div id="flashbox">
+    <div id="flashinputframe">
+        <a href="http://www.adobe.com/go/getflashplayer">
+            <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
+        </a>
+    </div>
+</div>
+
+<script type="text/javascript">
+    var flashvars = {};
+    var params = {};
+    params.wmode = "transparent";
+    params.scale = "exactfit";
+    params.quality = "best";
+    var attributes = {};
+    attributes.id = "flashinputframe";
+    attributes.align = "middle";
+    swfobject.embedSWF("flash/adminFlow/bin/adminFlow.swf", "flashinputframe", "640", "480", "11.1.0", "flash/expressInstall.swf", flashvars, params, attributes);
+</script>

pagestruct/settings.php

                 <td><input type="text" name="drag_now" id="drag_input_now" value="" readonly="readonly" /></td>
             </tr>
             <tr>
-                <td><label for="bg_input">Background Image</label></td>
+                <td><label for="bg_input">Alternate Background Image</label></td>
                 <td><input type="text" name="bg" id="bg_input" value="" /></td>
                 <td><input type="text" name="bg_now" id="bg_input_now" value="" readonly="readonly" /></td>
             </tr>
                 <td><input type="text" name="txtcolor_now" id="txtcolor_input_now" value="" readonly="readonly" /></td>
             </tr>
             <tr>
+                <td><label for="loginbtnxpos_input">Login Button / X Position</label></td>
+                <td><input type="text" name="loginbtnxpos" id="loginbtnxpos_input" value="" /></td>
+                <td><input type="text" name="loginbtnxpos_now" id="loginbtnxpos_input_now" value="" readonly="readonly" /></td>
+            </tr>
+            <tr>
+                <td><label for="loginbtnypos_input">Login Button / Y Position</label></td>
+                <td><input type="text" name="loginbtnypos" id="loginbtnypos_input" value="" /></td>
+                <td><input type="text" name="loginbtnypos_now" id="loginbtnypos_input_now" value="" readonly="readonly" /></td>
+            </tr>
+            <tr>
+                <td><label for="bganim_input">Background Transition Animation</label></td>
+                <td><input type="text" name="bganim" id="bganim_input" value="" /></td>
+                <td><input type="text" name="bganim_now" id="bganim_input_now" value="" readonly="readonly" /></td>
+            </tr>
+            <tr>
+                <td><label for="throbber_input">Throbber</label></td>
+                <td><input type="text" name="throbber" id="throbber_input" value="" /></td>
+                <td><input type="text" name="throbber_now" id="throbber_input_now" value="" readonly="readonly" /></td>
+            </tr>
+            <tr>
+                <td><label for="throbberxpos_input">Throbber / X Position</label></td>
+                <td><input type="text" name="throbberxpos" id="throbberxpos_input" value="" /></td>
+                <td><input type="text" name="throbberxpos_now" id="throbberxpos_input_now" value="" readonly="readonly" /></td>
+            </tr>
+            <tr>
+                <td><label for="throbberypos_input">Throbber / Y Position</label></td>
+                <td><input type="text" name="throbberypos" id="throbberypos_input" value="" /></td>
+                <td><input type="text" name="throbberypos_now" id="throbberypos_input_now" value="" readonly="readonly" /></td>
+            </tr>
+            <tr>
                 <td rowspan="2">
                     <input type="submit" value="Submit" />
                 </td>
             </tr>
         </tbody>
     </table>
-</form>
-
-<!--
-    'loginbtnxpos' => $loginbtnxpos,
-    'loginbtnypos' => $loginbtnypos,
-    'bganim' => $bganim,
-    'throbber' => $throbber,
-    'throbberxpos' => $throbberxpos,
-    'throbberypos' => $throbberypos
--->
+</form>
 (string) $loginbtnxpos = ($_POST['loginbtnxpos']) ? $_POST['loginbtnxpos'] : "338";
 (string) $loginbtnypos = ($_POST['loginbtnypos']) ? $_POST['loginbtnypos'] : "265";
 (string) $bganim = ($_POST['bganim']) ? $_POST['bganim'] : "blur";
-(string) $throbber = ($_POST['throbber']) ? $_POST['throbber'] : "http://192.168.0.4/adminflow/flash/altThrobber.swf";
+(string) $throbber = ($_POST['throbber']) ? $_POST['throbber'] : "/~broken/adminflow/flash/altThrobber.swf";
 (string) $throbberxpos = ($_POST['throbberxpos']) ? $_POST['throbberxpos'] : "265";
 (string) $throbberypos = ($_POST['throbberypos']) ? $_POST['throbberypos'] : "110";
 ////////////////////////////
 );
 $xmldata = new xmlhandler ('afsettings.xml');
 //Writer.
-$xmlwriter = $xmldata -> func_xmlwriter ($xmldatarray);
+$xmlwriter = $xmldata -> func_xmlwriter ($xmldatarray, 'file');
 if ($xmlwriter) {
     //Reader.
     echo $xmlreader = $xmldata -> func_xmlreader ();