BLACK HILL SYSTEMS
Published on BLACK HILL SYSTEMS (http://www.blackhillsystems.com)

Home > MOUSE - Application Development Framework > Utilization Samples > General Application Creation

General Application Creation

Steps to create a new page:

1) Insert entry into the lms_app table.

INSERT IGNORE INTO lms_app (NAME, module, constructor, proper_name, GLOBAL)
    VALUES ('url-ref', 'objects/dir/file.php', 'Class', 'Name to Show on Page', 'global_variable');

2) Insert an entry into the lms_menu table.

INSERT IGNORE INTO lms_menu (NAME, url, hierarchy, groups, description, visible)
    VALUES ('Audits', '/cgi-bin/default.php?appname=audit', '90.25',
        (SELECT group_id FROM lms_group WHERE groupname IN ('Master Administrator')),
        'The system audit log menu', 1);

3) Insert an entry into the lms_app_group table (if the page being created is only available to certain groups)

INSERT IGNORE INTO lms_app_group (NAME, group_id)
    VALUES ('audit',
        (SELECT group_id FROM lms_group WHERE groupname IN ('Master Administrator')));

4) Add a root .php file to the objects subdirectory (eg. objects/dir/file.php)

<?php include_once("objects/admin/data/audit.php"); include_once("objects/admin/view/audit.php"); ?>

5) Add a data .php file to the data subdirectory (eg. objects/dir/data/file.php)

<?php class NameDB extends DB {
         function __construct() {
            parent::__construct();
           $this->has(array( ... ));
         }
      }
?>

6) Add a page .php file to the view subdirectory (eg. objects/dir/view/file.php)

<?php class Name extends Page {
         function __construct() {
            parent::__construct("Name");
           $this->data = new NameDB();
         }

         function body() {
             $this->auto_render();
         }
      }
?>

  • Log in [1] to post comments

Source URL: http://www.blackhillsystems.com/?q=node/32

Links
[1] http://www.blackhillsystems.com/?q=user/login&amp;destination=node/32%23comment-form