Subversion Repositories computer_asset_manager_v1

Rev

Rev 48 | Rev 63 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 48 Rev 62
Line 168... Line 168...
168
            include_once( $_SESSION['file system root'] . "/$directory/database.php" );
168
            include_once( $_SESSION['file system root'] . "/$directory/database.php" );
169
         }
169
         }
170
      }
170
      }
171
   }
171
   }
172
 
172
 
-
 
173
   /* 
-
 
174
    * finds out if there is a callable script for this screen in the various modules.
-
 
175
    * if so, will call the script and return the output
-
 
176
    * index is an array of the form 'device_id' => $device_id
-
 
177
    * call this as
-
 
178
    * print callableOutput( 'device view', array( 'device_id' => $device_id );
-
 
179
    */
-
 
180
   function callableOutput( $screen, $index ) {
-
 
181
      $sql = insertValuesIntoQuery(SQL_GET_MODULES,array( 'screen' => $screen ));
-
 
182
      $modules = queryDatabaseExtended( $sql );
-
 
183
      if ( $modules ) {
-
 
184
         $modules = $modules['data'];
-
 
185
         $parameters = $index;
-
 
186
         foreach ( $modules as $report ) {
-
 
187
            $module = $report['module'];
-
 
188
            list($library, $function ) = explode (':', $report['path'] . $report['script']);
-
 
189
            //print "$library - $function<br />\n";
-
 
190
            require_once "$library";
-
 
191
            if ( is_callable( $function ) ) {
-
 
192
               $content = call_user_func( $function, $parameters );
-
 
193
               if ( $content )
-
 
194
                  return "<div><h4>$module</h4>$content</div>\n";
-
 
195
            }
-
 
196
         }
-
 
197
      }
-
 
198
   } // callableOutput
-
 
199
      
-
 
200
 
173
?>
201
?>