IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 8984


Ignore:
Timestamp:
Sep 26, 2006, 10:40:55 AM (20 years ago)
Author:
eugene
Message:

adding menu hierarchy

Location:
trunk/ippMonitor
Files:
8 added
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/Makefile

    r8980 r8984  
    88DESTBIN =       /var/www/kiawe/phpipp
    99
    10 INSTALL = \
     10RAWSRC = \
    1111$(DESTBIN)/ipp.css \
    1212$(DESTBIN)/ipp.php \
    1313$(DESTBIN)/ipp.menu.dat \
     14$(DESTBIN)/ipp.copy.dat \
     15$(DESTBIN)/ipp.science.dat \
     16$(DESTBIN)/ipp.detrend.dat \
     17$(DESTBIN)/ipp.imfiles.dat \
    1418$(DESTBIN)/Login.php \
    1519$(DESTBIN)/SelectProject.php \
    16 $(DESTBIN)/phptest.php \
     20$(DESTBIN)/LoadSetup.php \
     21$(DESTBIN)/ScienceSteps.php \
     22$(DESTBIN)/DetrendSteps.php \
     23$(DESTBIN)/ImfileTables.php \
     24$(DESTBIN)/phptest.php
     25
     26DEFSRC = \
    1727$(DESTBIN)/detInputExp.php \
    1828$(DESTBIN)/detMasterFrame.php \
     
    4454$(DESTBIN)/PScolorlogo2.jpg
    4555
    46 php: $(INSTALL) $(PICTURES)
     56php: $(RAWSRC) $(DEFSRC) $(PICTURES)
    4757
    4858# dependancy rules for binary code #########################
  • trunk/ippMonitor/def/autocode.php

    r8980 r8984  
    55$ID = checkID ();
    66
    7 menu('Login', 'ipp.css', $ID['link']);
     7menu('$MENU', '$TITLE', '$STYLE', $ID['link']);
    88
    99echo "<p> $TITLE </p>";
  • trunk/ippMonitor/def/detInputExp.d

    r8980 r8984  
    22TITLE detInputExp
    33FILE  detInputExp.php
     4MENU  ipp.detrend.dat
    45
    56#     field     name     link to     extras
  • trunk/ippMonitor/def/detMasterFrame.d

    r8980 r8984  
    22TITLE detMasterFrame
    33FILE  detMasterFrame.php
     4MENU  ipp.detrend.dat
    45
    56#     field     name     link to     extras
  • trunk/ippMonitor/def/detMasterImfile.d

    r8980 r8984  
    22TITLE detMasterImfile
    33FILE  detMasterImfile.php
     4MENU  ipp.imfiles.dat
    45
    56#     field     name     link to     extras
  • trunk/ippMonitor/def/detNormalizedImfile.d

    r8980 r8984  
    22TITLE detNormalizedImfile
    33FILE  detNormalizedImfile.php
     4MENU  ipp.imfiles.dat
    45
    56#     field     name     link to     extras
  • trunk/ippMonitor/def/detNormalizedStatImfile.d

    r8980 r8984  
    22TITLE detNormalizedStatImfile
    33FILE  detNormalizedStatImfile.php
     4MENU  ipp.imfiles.dat
    45
    56#     field     name     link to     extras
  • trunk/ippMonitor/def/detProcessedImfile.d

    r8980 r8984  
    22TITLE detProcessedImfile
    33FILE  detProcessedImfile.php
     4MENU  ipp.imfiles.dat
    45
    56#     field     name     link to     extras
  • trunk/ippMonitor/def/detResidExp.d

    r8980 r8984  
    22TITLE detResidExp
    33FILE  detResidExp.php
     4MENU  ipp.detrend.dat
    45
    56#     field     name     link to     extras
  • trunk/ippMonitor/def/detResidImfile.d

    r8980 r8984  
    22TITLE detResidImfile
    33FILE  detResidImfile.php
     4MENU  ipp.imfiles.dat
    45
    56#     field     name     link to     extras
  • trunk/ippMonitor/def/detRun.d

    r8980 r8984  
    22TITLE detRun
    33FILE  detRun.php
     4MENU  ipp.detrend.dat
    45
    56#     field     name     link to     extras
  • trunk/ippMonitor/def/detRunSummary.d

    r8980 r8984  
    22TITLE detRunSummary
    33FILE  detRunSummary.php
     4MENU  ipp.detrend.dat
    45
    56#     field    name    link to     extras
  • trunk/ippMonitor/def/detStackedImfile.d

    r8980 r8984  
    22TITLE detStackedImfile
    33FILE  detStackedImfile.php
     4MENU  ipp.imfiles.dat
    45
    56#     field     name     link to     extras
  • trunk/ippMonitor/def/newExp.d

    r8980 r8984  
    22TITLE Raw Science Exposures
    33FILE  newExp.php
     4MENU  ipp.copy.dat
    45
    56#        field          name           link to         extras
  • trunk/ippMonitor/def/newImfile.d

    r8980 r8984  
    22TITLE Raw Science Exposures
    33FILE  newImfile.php
     4MENU  ipp.imfiles.dat
    45
    56#        field          name           link to         extras
  • trunk/ippMonitor/def/p1PendingExp.d

    r8982 r8984  
    22TITLE p1PendingExp
    33FILE  p1PendingExp.php
     4MENU  ipp.science.dat
    45
    56#     field       name         link to         extras
  • trunk/ippMonitor/def/p2PendingExp.d

    r8982 r8984  
    22TITLE p2PendingExp
    33FILE  p2PendingExp.php
     4MENU  ipp.science.dat
    45
    56#     field       name         link to         extras
  • trunk/ippMonitor/def/p2PendingImfile.d

    r8980 r8984  
    22TITLE p2PendingImfile
    33FILE  p2PendingImfile.php
     4MENU  ipp.imfiles.dat
    45
    56#     field     name     link to     extras
  • trunk/ippMonitor/def/p2ProcessedExp.d

    r8982 r8984  
    22TITLE p2ProcessedExp
    33FILE  p2ProcessedExp.php
     4MENU  ipp.science.dat
    45
    56#     field       name         link to                 extras
  • trunk/ippMonitor/def/p2ProcessedImfile.d

    r8980 r8984  
    22TITLE p2ProcessedImfile
    33FILE  p2ProcessedImfile.php
     4MENU  ipp.imfiles.dat
    45
    56#     field          name         link to     extras
  • trunk/ippMonitor/def/p3PendingExp.d

    r8982 r8984  
    22TITLE p3PendingExp
    33FILE  p3PendingExp.php
     4MENU  ipp.science.dat
    45
    56#     field       name          link to                extras
  • trunk/ippMonitor/def/pzPendingExp.d

    r8980 r8984  
    22TITLE pending exposures
    33FILE  pzPendingExp.php
     4MENU  ipp.copy.dat
    45
    56#        field        name           link to         extras
  • trunk/ippMonitor/def/pzPendingImfile.d

    r8980 r8984  
    22TITLE Pending Image Files
    33FILE  pzPendingImfile.php
     4MENU  ipp.imfiles.dat
    45
    56#        field        name           link to         extras
  • trunk/ippMonitor/def/rawDetrendExp.d

    r8982 r8984  
    22TITLE Raw Detrend Exposures
    33FILE  rawDetrendExp.php
     4MENU  ipp.copy.dat
    45
    56#        field        name           link to         extras
  • trunk/ippMonitor/def/rawImfile.d

    r8980 r8984  
    22TITLE Raw Image File
    33FILE  rawImfile.php
     4MENU  ipp.imfiles.dat
    45
    56RESTRICT exp_id
  • trunk/ippMonitor/def/rawScienceExp.d

    r8980 r8984  
    22TITLE Raw Science Exposures
    33FILE  rawScienceExp.php
     4MENU  ipp.copy.dat
    45
    56#        field        name           link to         extras
  • trunk/ippMonitor/def/summitExp.d

    r8980 r8984  
    22TITLE Summit Exposures
    33FILE  summitExp.php
     4MENU  ipp.copy.dat
    45
    56#        field        name           link to         extras
  • trunk/ippMonitor/generate

    r8980 r8984  
    22
    33$VERBOSE = 0;
     4
    45if ($ARGV[0] eq "-v") { $VERBOSE = 1; shift @ARGV; }
    56if (@ARGV != 3) { die "generate (schema) (template) (output)\n"; }
     
    1819    close (FILE);
    1920
     21    &init_key ("MENU");
     22    &init_key ("STYLE");
    2023    &init_key ("TABLE");
    2124    &init_key ("TITLE");
    2225    &init_key ("FILE");
     26
    2327    &init_key ("FIELDS");
    2428
     
    5458        }
    5559    }
     60
     61    # check on keys
     62    &check_key ("MENU", "ipp.menu.dat");
     63    &check_key ("STYLE", "ipp.css");
     64    &check_key ("TABLE", "");
     65    &check_key ("TITLE", "");
     66    &check_key ("FILE", "");
     67
    5668    # define query string, add to keypairs
    5769    &define_query_fields;
     
    192204            if ($value[$i] ne "") { die "key is multiply defined\n"; }
    193205            $value[$i] = $value;
     206            if ($VERBOSE) { print STDERR "setting $key = $value\n"; }
    194207            return;
    195208        }
    196209    }
     210}
     211
     212sub check_key {
     213    my ($i);
     214    my ($key)     = $_[0];
     215    my ($default) = $_[1];
     216
     217    for ($i = 0; $i < @key; $i++) {
     218        if ($key eq $key[$i]) {
     219            if ($VERBOSE) { print "found $key: $key[$i]  -- $value[$i] (def: $default)\n"; }
     220            if (($default eq "") && ($value[$i] eq "")) { die "missing value for required key $key[$i]\n"; }
     221            if ($value[$i] eq "") { $value[$i] = $default; }
     222            return;
     223        }
     224    }
     225    die "unknown key $key\n";
    197226}
    198227
     
    200229    my ($i);
    201230    for ($i = 0; $i < @key; $i++) {
    202         # if ($VERBOSE) { print "$key[$i]  -- $value[$i]\n"; }
     231        if ($VERBOSE) { print "$key[$i]  -- $value[$i]\n"; }
    203232        if ($line =~ m|\$$key[$i]|) {
    204233            if ($value[$i] eq "") { die "missing value for required key $key[$i]\n"; }
  • trunk/ippMonitor/raw/Login.php

    r8980 r8984  
    44
    55if (($_SERVER[REQUEST_METHOD] != 'POST') && ($_SERVER[REQUEST_METHOD] != 'GET')) {
    6   menu ('Login', 'ipp.css', '');
     6  menu ('ipp.menu.dat', 'Login', 'ipp.css', '');
    77  echo "Invalid Client Request<br>\n";
    88  menu_end ();
     
    1414  $ID = checkID ();
    1515
    16   menu ('Login', 'ipp.css', $ID['link']);
     16  menu ('ipp.menu.dat', 'Login', 'ipp.css', $ID['link']);
    1717
    1818  $pass = $ID['pass'];
     
    3434    $ID = checkLogin ();
    3535
    36     menu ('Login', 'ipp.css', $ID['link']);
     36    menu ('ipp.menu.dat', 'Login', 'ipp.css', $ID['link']);
    3737    echo "Login Accepted\n";
    3838    menu_end();
     
    4141
    4242  if (key_exists (logout, $_POST)) {
    43     menu ('Login', 'ipp.css', '');
     43    menu ('ipp.menu.dat', 'Login', 'ipp.css', '');
    4444    echo "You are now logged out<br>\n";
    4545    logintext ();
     
    5050
    5151  // missing a valid POST state (login or logout)
    52   menu ('Login', 'ipp.css', '');
     52  menu ('ipp.menu.dat', 'Login', 'ipp.css', '');
    5353  echo "Invalid Client Post Request<br>\n";
    5454  foreach ($_POST as $key => $value) {
  • trunk/ippMonitor/raw/SelectProject.php

    r8980 r8984  
    1 
    2 <? function projectform () { ?>
    3   <p>
    4   Select the project of interest
    5   </p>
    6   <form action="<? $myPage ?>" method="POST">
    7   Project: <input type="text" name="proj"><br>
    8   <input type="submit" name="project">
    9   </form>
    10 <? } ?>
    11 
    121<?php
    132
    14 include 'menu.php';
     3include 'ipp.php';
    154
    165checkID ();
    176
    187if ($_SERVER[REQUEST_METHOD] == 'GET') {
    19     menu ('Project', 'ipp.css');
    20     projectform ();
     8    menu ('ipp.menu.dat', 'Project', 'ipp.css', '');
     9    echo "<p> Select the project of interest </p>\n";
     10    echo "<form action=\"$myPage\" method=\"POST\">\n";
     11    echo "Project: <input type=\"text\" name=\"proj\"><br>\n";
     12    echo "<input type=\"submit\" name=\"project\">\n";
     13    echo "</form>\n";
     14
    2115    menu_end ();
    2216}
    2317
    2418if ($_SERVER[REQUEST_METHOD] != 'POST') {
    25   menu ('Project', 'ipp.css');
     19  menu ('ipp.menu.dat', 'Project', 'ipp.css', '');
    2620  echo "Invalid Client Request<br>\n";
    2721  menu_end ();
     
    3226  # validate the existence of the project
    3327  $_GET[proj] = $myProj;
    34   menu ('Project', 'ipp.css');
     28  menu ('ipp.menu.dat', 'Project', 'ipp.css', '');
    3529  echo "New project is : $myProj\n";
    3630  menu_end();
    3731}
    3832 
    39 menu ('Project', 'ipp.css');
     33menu ('ipp.menu.dat', 'Project', 'ipp.css', '');
    4034echo "Invalid Client Post Request<br>\n";
    4135foreach ($_POST as $key => $value) {
  • trunk/ippMonitor/raw/ipp.menu.dat

    r8982 r8984  
    1717
    1818menutop   | menutop      | plain   | &nbsp;                       |
    19 menutop   | menutop      | plain   | Load and Setup               |
    20 menulink  | menuselect   | link    | Summit Exp                   | summitExp.php                         
    21 menulink  | menuselect   | link    | New Exp                      | newExp.php                   
    22 menulink  | menuselect   | link    | Copy Pending Exp             | pzPendingExp.php             
    23 menulink  | menuselect   | link    | Raw Detrend Exp              | rawDetrendExp.php             
    24 menulink  | menuselect   | link    | Raw Science Exp              | rawScienceExp.php             
     19menutop   | menutop      | link    | Load and Setup               | LoadSetup.php
     20menutop   | menutop      | link    | Science Steps                | ScienceSteps.php
     21menutop   | menutop      | link    | Detrend Steps                | DetrendSteps.php
     22menutop   | menutop      | link    | Imfile Tables                | ImfileTables.php
    2523
    2624menutop   | menutop      | plain   | &nbsp;                       |
    27 menutop   | menutop      | plain   | Science Steps                |
    28 menulink  | menuselect   | link    | P1 Pending Exp               | p1PendingExp.php             
    29 menulink  | menuselect   | link    | P2 Pending Exp               | p2PendingExp.php             
    30 menulink  | menuselect   | link    | P2 Processed Exp             | p2ProcessedExp.php           
    31 menulink  | menuselect   | link    | P3 Pending Exp               | p3PendingExp.php             
    3225
    33 menutop   | menutop      | plain   | &nbsp;                       |
    34 menutop   | menutop      | plain   | Detrend Steps                |
    35 menulink  | menuselect   | link    | Det Run                      | detRun.php                   
    36 menulink  | menuselect   | link    | Det Run Summary              | detRunSummary.php             
    37 menulink  | menuselect   | link    | Det Master Frame             | detMasterFrame.php           
    38 menulink  | menuselect   | link    | Det Input Exp                | detInputExp.php                   
    39 menulink  | menuselect   | link    | Det Resid Exp                | detResidExp.php                       
    40 
    41 menutop   | menutop      | plain   | &nbsp;                       |
    42 menutop   | menutop      | plain   | Imfile Tables                | none           
    43 menulink  | menuselect   | link    | detMasterImfile              | detMasterImfile.php                   
    44 menulink  | menuselect   | link    | detNormalizedImfile          | detNormalizedImfile.php               
    45 menulink  | menuselect   | link    | detNormalizedStatImfile      | detNormalizedStatImfile.php           
    46 menulink  | menuselect   | link    | detProcessedImfile           | detProcessedImfile.php               
    47 menulink  | menuselect   | link    | detResidImfile               | detResidImfile.php           
    48 menulink  | menuselect   | link    | detStackedImfile             | detStackedImfile.php                 
    49 menulink  | menuselect   | link    | newImfile                    | newImfile.php                         
    50 menulink  | menuselect   | link    | p2PendingImfile              | p2PendingImfile.php                   
    51 menulink  | menuselect   | link    | p2ProcessedImfile            | p2ProcessedImfile.php                 
    52 menulink  | menuselect   | link    | pzPendingImfile              | pzPendingImfile.php                   
    53 menulink  | menuselect   | link    | rawImfile                    | rawImfile.php                         
    54 
    55 menutop   | menutop      | plain   | &nbsp;                       |
    5626menutop   | menutop      | plain   | External Links               | none           
    5727menutop   | menutop      | link    | test page                    | phptest.php     
  • trunk/ippMonitor/raw/ipp.php

    r8980 r8984  
    3333// - pass (NOT the same as the user password: randomly generated for the session and given a timeout)
    3434
     35// have this function take the current menu and style?
    3536function checkLogin () {
    3637
     
    4243
    4344  if (!$success) { 
    44     menu ('Login', 'ipp.css', '');
     45    menu ('ipp.menu.dat', 'Login', 'ipp.css', '');
    4546    echo "Login Failed, please try again<br>\n";
    4647    loginform ();
     
    6768  // check for valid server method
    6869  if (($_SERVER[REQUEST_METHOD] != 'POST') && ($_SERVER[REQUEST_METHOD] != 'GET')) {
    69     menu ('Login', 'ipp.css', '');
     70    menu ('ipp.menu.dat', 'Login', 'ipp.css', '');
    7071    echo "Invalid Client Request<br>\n";
    7172    menu_end ();
     
    7778    $ID['pass'] = $_GET[pass];
    7879    $ID['proj'] = $_GET[proj];
    79     echo "using GET: ", $ID['pass'], $ID['proj'];
     80    // echo "using GET: ", $ID['pass'], $ID['proj'];
    8081  }
    8182  if ($_SERVER[REQUEST_METHOD] == 'POST') {
    8283    $ID['pass'] = $_POST[pass];
    8384    $ID['proj'] = $_POST[proj];
    84     echo "using POST: ", $ID['pass'], $ID['proj'];
     85    // echo "using POST: ", $ID['pass'], $ID['proj'];
    8586  }
    8687
    8788  // user is not logged in at all
    8889  if ($ID['pass'] == "") {
    89     menu('Login', 'ipp.css', '');
     90    menu('ipp.menu.dat', 'Login', 'ipp.css', '');
    9091    logintext ();   
    9192    loginform ();
     
    9596  // user supplied an invalid pass
    9697  if ($ID['pass'] != "foobar") {
    97     menu('Login', 'ipp.css', '');
     98    menu('ipp.menu.dat', 'Login', 'ipp.css', '');
    9899    echo "unknown user, please login again<br>\n";
    99100    loginform ();
     
    113114}
    114115
    115 function menu ($title, $sheet, $append) {
     116function menu ($source, $title, $sheet, $append) {
    116117
    117118  echo "<html><head><title> $title </title></head>\n\n";
     
    121122  $root = "/phpipp";
    122123
    123   $file = fopen ("ipp.menu.dat", "r");
     124  $file = fopen ($source, "r");
    124125
    125126  echo "<table class=page cellspacing=10px><tr><td valign=top>\n";
  • trunk/ippMonitor/raw/phptest.php

    r8980 r8984  
    1 <?php include 'ipp.php'; ?>
     1<?php
    22
    3 <?php menu('test.page', 'ipp.css', ''); ?>
     3include 'ipp.php';
    44
    5 <?
     5menu('ipp.menu.dat', 'test.page', 'ipp.css', '');
    66
    77$varlist = array ('SERVER_NAME', 'GATEWAY_INTERFACE', 'SERVER_PROTOCOL',
     
    1919}
    2020
     21menu_end();
    2122?>
    22 
    23 <?php menu_end(); ?>
    24 
    25 </body>
    26 </html>
Note: See TracChangeset for help on using the changeset viewer.