Menu

[r4]: / src / screens / screen.cs  Maximize  Restore  History

Download this file

161 lines (156 with data), 6.4 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#function generate_screen dbase_id screen_id
#query select ApplicationName, OutputLocation from `database` where DatabaseID=?dbase_id?
#query select title, name as screen_name, `class` as classname from screen where screen=?screen_id?
#do system_log 1 ('Generate screen: ' ^ screen_name)
#if classname<>'menu'
#print page_header 'screen' dbase_id screen_id
#print '<html>\n'
#print '<head>\n'
#print ' <link href=\"list.css\" type=\"text/css\" rel=stylesheet>\n'
#print ' <meta content=\"text/css\" http-equiv=\"Content-Style-Type\">\n'
#print ' <title>' ^ ApplicationName ^ ' Scherm: ' ^ title ^ '</title>\n'
#print '</head>\n'
#print '<script type=\"text/javascript\" src=\"handlers.js\" language=\"JavaScript\">\n'
#print ' alert (\"no code\");\n'
#print '</script>\n'
#print '<body>\n'
#print '<table id=main><tr><td id=menu>'
#print '<?php\n'
#print 'include \'menu.php\';\n'
#print '?>\n'
#print '</td><td id=workarea>'
#end
#set first=true
#record select part.part, part.`type`, part.`title`, `table`, screen.name as link, `code` from part left join screen on part.link=screen.screen where part.screen=?screen_id? order by `order`, `part`
#if title<>'' and type<>'icon' and type<>'link'
#if not first
#print '<br><br><br>'
#end
#print '<table class=ruler><tr><td>' ^ title ^ '</td></tr></table>\n'
#end
#if type='link'
#set ScreenWidth='500'
#set ScreenHeight='500'
#query select Subject, IDfield, ScreenWidth, ScreenHeight from `tables` where `tableID`=?table?
#if code='edit'
#if IDfield<>'$'
#print '<input type=button value=\"' ^ title ^ '\" onClick=\"javascript: window.open(\'edit' ^ Subject ^ '.php?' ^ IDfield ^ '=<?php echo \"$' ^IDfield ^ '\"; ?>\',\'\',\'width=' ^ ScreenWidth ^ ',height=' ^ ScreenHeight ^ ',location=no,menubar=no,scrollbars=yes,status=no,resizable=yes\'); return false;\">\n'
#else
#print '<input type=button value=\"' ^ title ^ '\" onClick=\"javascript: window.open(\'edit' ^ Subject ^ '.php\',\'\',\'width=' ^ ScreenWidth ^ ',height=' ^ ScreenHeight ^ ',location=no,menubar=no,scrollbars=yes,status=no,resizable=yes\'); return false;\">\n'
#end
#else
#if code='screen'
#print '<input type=button value=\"' ^ title ^ '\" onClick=\"javascript: location=\'' ^ link ^'\'; return false;\">\n'
#else
#if code=''
#print '<input type=button value=\"' ^ title ^ '\" onClick=\"javascript: window.open(\'' ^ link ^ '\',\'\',\'width=' ^ ScreenWidth ^ ',height=' ^ ScreenHeight ^ ',location=no,menubar=no,scrollbars=yes,status=no,resizable=yes\'); return false;\">\n'
#else
#print '<a href=\"' ^ code ^ '\">' ^ title ^ '</a>'
#end
#end
#end
#end
#if type='icon'
#print '<?php\n'
#if table<>'0'
#print 'if (true'
#record select SessionVar from `fields` where `TableId`=?table? and SessionVar<>''
#print ' and $_SESSION[var_' ^ SessionVar ^ ']<>\'\''
#end
#print ') {\n'
#end
#print ' echo \'<table class=icon><tr><td><p><a href=\"' ^ link ^ '\">\';\n'
#print ' echo \'<img src=\"' ^ code ^ '\"><br>' ^ title ^ '</a></p></td></tr></table>\';\n'
#if table<>'0'
#print '}\n'
#end
#print '?>\n'
#end
#if type='script'
#print '<input type=button value=\"' ^ title ^ '\" onClick=\"javascript: window.open(\'script_' ^ title ^ '.php\',\'' ^ title
#print '\',\'width=660,height=680,location=no,menubar=no,scrollbars=yes,status=no,resizable=yes\'); return false;\">\n'
#set sf=open_out (OutputLocation ^ '/script_' ^ title ^ '.php')
#do output_string sf ('<?php system(\"' ^ code ^ '\") ?>')
#do close_out sf
#end
#if type='record'
#print generate_record dbase_id table
#end
#if type='edit'
#print generate_edit dbase_id table
#end
#if type='list'
#print generate_list dbase_id table (if link=screen_name then '' else link) part
#end
#if type='html'
#set str=replace '\"' '\\\"' (fieldreplace code '0')
#print '<?php\n'
#print 'echo \"' ^ str ^ '\";\n'
#print '?>\n'
#end
#set first=false
#end
#if classname<>'menu'
#print '</td></tr></table>'
#print '</body>\n'
#print '</html>\n'
#end
#end
#function rights_screen dbase_id screen_id
#query select ApplicationName from `database` where DatabaseID=?dbase_id?
#query select title, name as screen_name, `class` as classname from screen where screen=?screen_id?
#do system_log 1 ('Generate rights screen: ' ^ screen_name)
#print page_header 'screen' dbase_id screen_id
#print '<html>\n'
#print '<head>\n'
#print ' <link href=\"list.css\" type=\"text/css\" rel=stylesheet>\n'
#print ' <meta content=\"text/css\" http-equiv=\"Content-Style-Type\">\n'
#print ' <title>' ^ ApplicationName ^ ' Scherm: ' ^ title ^ '</title>\n'
#print '</head>\n'
#print '<script type=\"text/javascript\" src=\"handlers.js\" language=\"JavaScript\">\n'
#print ' alert (\"no code\");\n'
#print '</script>\n'
#if classname<>''
#print '<body class=\"' ^ classname ^ '\">\n'
#else
#print '<body>\n'
#end
#set first=true
#record select part.`part`, part.`type`, part.`title`, `table`, screen.name as link, `code` from part left join screen on part.link=screen.screen where part.screen=?screen_id?
#if title<>'' and type<>'icon' and type<>'link'
#if not first
#print '<br><br><br>'
#end
#print '<table class=ruler><tr><td>' ^ title ^ '</td></tr></table>\n'
#end
#if type='link'
#print '<input type=button value=\"' ^ title ^ '\" onClick=\"location=\'rights_' ^ link ^ '\'\">\n'
#print part_rights_link part 'hide'
#end
#if type='icon'
#print '<table class=menu><tr><td><p><a href=\"rights_' ^ link ^ '\" target=main>'
#print '<img src=\"' ^ code ^ '\"><br>' ^ title ^ '</a></p></td></tr></table>\n'
#print part_rights_link part 'show'
#end
#if type='script'
#print '<input type=button value=\"' ^ title ^ '\" onClick=\"javascript: window.open(\'rights_' ^ title ^ '.php\',\'' ^ title
#print '\',\'width=660,height=680,location=no,menubar=no,scrollbars=yes,status=no,resizable=yes\'); return false;\">\n'
#print part_rights_link part 'show'
#end
#if type='record'
#print rights_record dbase_id table
#end
#if type='list'
#print rights_list dbase_id table (if link=screen_name then '' else link) part
#end
#if type='html'
#set str=replace '\"' '\\\"' (fieldreplace code '0')
#print '<?php\n'
#print 'echo \"' ^ str ^ '\";\n'
#print '?>\n'
#end
#set first=false
#end
#print '</body>\n'
#print '</html>\n'
#end
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.