Minerva
Linux Home Automation for the Masses

Webface is an underlying technology that abstracts the control and visual aspects of a web page, away from the control logic.

It comprises of four components:

  • Web_View
  • Web_Auth
  • Web_Ctrl
  • Web_Dbug

Covering them individually...

  • Web_View
  • This covers all the visual aspects.
    • htmlStart & htmlEnd
    • borders
    • splitting into panes
    Important points:
    • Everything uses strings, not print
    • Default implementation based around tables, not CSS
  • Web_Auth
  • Determines whether a user is carry out a particular task. Since these tasks are application-specific, most developers will create their own implementation of this class' single method:
        function isUserValidFor($purpose, $access = "w")
    
  • Web_Ctrl
  • This builds control code to pass parameters between one invocation of the script, and the subsequent one.
    The default uses the GET message.
    • getParameterValue
    • createAnchor
    • createAnchorParam
    A typical GET request might look like this:
    http://www.warpdemo.homelinux.net/index.php?WRP001X1_current=0&
      WRP003X3_current=1&MIN004A4_current=0&WRP004X5_sort=11&WRP004X5_mx=10&
      WRP004X5_opt=&WRP005X6_sort=11&WRP005X6_mx=10&WRP005X6_opt=&
      wintype=main&content=WRP003X&max=WRP003X
    
    WARP, makes this easier.
  • Web_Dbug
  • Essential debug and tracing methods.
    • Error, warning, and info levels
    • Stores multiple errors
    • Defaultly with output in HTML, but can be amended to trace to alert boxes, system logs files, etc, but overriding the methods.
  • Web_Face
  • Everything comes together in this single interface object. Essentially, it's:
        function Web_Face()
        {
            $this->view = new Web_View;
            $this->ctrl = new Web_Ctrl;
            $this->auth = new Web_Auth;
            $this->dbug = new Web_DBug;
        }
    
    If you simply pass a Web_Face reference around your code, and you can do anything!

Valid HTML 4.01 Transitional