[ PHPXref.com ] [ Generated: Sun Jul 20 19:56:02 2008 ] [ phpSQLView 2.4 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> model_config.php (source)

   1  <?php
   2  /*#################################################################
   3  #
   4  # Name:    local_config.php
   5  #
   6  # Description:
   7  #   Use this to provide global flags to control options for your
   8  #   local installation.
   9  #
  10  # Copyright (C) 2001-2005 Dmitriy Katsman, Terry Gliedt, University of Michigan
  11  # This is free software; you can redistribute it and/or modify it under the
  12  # terms of the GNU General Public License as published by the Free Software
  13  # Foundation; See http://www.gnu.org/copyleft/gpl.html
  14  #################################################################*/
  15  $VERSION = '2.4';                  // This changes with each public release
  16  
  17  /*---------------------------------------------------------------
  18  #   Local options are controlled by the array LOCALOPT.
  19  #
  20  #   You can override the default tables etc by providing an optional
  21  #   field when invoking index.php. For instance:
  22  #
  23  #       .../sqlview/index.php?what2show=test
  24  #
  25  #       Set the default $LDB[] fields and then
  26  #       if ($what2show == 'test') {
  27  #           $LDB[defaultdb] = 'testmysql';
  28  #           $LDB[defaultuser] = 'tester';
  29  #           $LDB[defaultpass] = 'gofast';
  30  #       }
  31  #
  32  #   You can also set values based on some sort of logic
  33  #       //  Update allowed only on one table
  34  #       if ($LDB[defaulttable] == 'test_table') {
  35  #           $LOCALOPT[updaterecord] = TRUE;
  36  #       }
  37  #       else { $LOCALOPT[updaterecord] = FALSE; }
  38  #
  39  #   Additionally this code could read values from some
  40  #   file in the system to set the proper variables.
  41  #   It's only limited by your cleverness. :-)
  42  #----------------------------------------------------------------*/
  43  //  Be sure I can see syntax errors
  44  ini_set('error_reporting', E_ALL ^ E_NOTICE);
  45  
  46  //  Default database connection details
  47  $LDB['defaulttype'] = 'mysql';
  48  $LDB['defaulthost'] = 'localhost';
  49  $LDB['defaultdb'] = '';
  50  $LDB['defaultuser'] = '';
  51  $LDB['defaultpass'] = '';
  52  $LDB['defaulttable'] = '';
  53  
  54  //  Optional path to the directory containing project includes
  55  //  If relative path, this is relative to DOCUMENT_ROOT
  56  //  Can be absolute path (better if it is outside of htdocs tree)
  57  //  This cannot be usefully changed in a project file.
  58  $LDB['projects_dir'] = 'sqlview/projects';
  59  
  60  //  Array of users allowed to use this project
  61  //  If open access is wanted, make this an empty array
  62  //  e.g.  $CFG['allow_list'] = array();
  63  $LDB['allow_list'] = array();
  64  
  65  //  What fields should the first page prompt for?
  66  //  Choices are: 'type', 'host', 'db', 'user', 'pass', 'table'
  67  $LOCALOPT['promptfor'] = array('db', 'user', 'pass', 'table');
  68  
  69  //  Set the main header on the first page, or leave as '' for the default
  70  $LOCALOPT['title'] = "Welcome to SqlView";
  71  
  72  //  Add these links at the top of each page
  73  $LOCALOPT['toplinks'] = array();
  74  
  75  //  Add these links at the bottom of first page
  76  $LOCALOPT['bottomlinks'] = array();   // array('SQLDiff' => '/sqldiff/',);
  77  
  78  //  Specify URL to CSS file. Project could override this.
  79  $LOCALOPT['stylesheet'] = 'stylesheet.css';
  80  
  81  //  Should header contain 'Add Record' or not?
  82  $LOCALOPT['addrecord'] = FALSE;
  83  
  84  //  Provide link to Copy a record and allow update
  85  $LOCALOPT['copyrecord'] = FALSE;
  86  
  87  //  Provide link to Delete a record
  88  $LOCALOPT['delrecord'] = FALSE;
  89  
  90  //  Provide link to Update based on primary key
  91  $LOCALOPT['updaterecord'] = FALSE;
  92  
  93  //  Do not let the user change the table name - keep them here
  94  $LOCALOPT['donotwander'] = FALSE;
  95  
  96  //  Allow user to export data or not
  97  $LOCALOPT['export'] = TRUE;
  98  //  Optionally define an export filter to be called.
  99  //  If $CFG['export_filter'] is defined, the keyword is a string to be
 100  //  shown on the export.php page and it's value is the filter to be invoked.
 101  //  For example if you code:
 102  //      $CFG['export_filter'] = array('Translate' =>
 103  //           "tr '[a-z]' '[A-Z] < %IN% > %OUT%");
 104  //  The HTML export page will contain a checkbox with a label of 'Translate'
 105  //  The exported data will be written to a file. Your filter is invoked
 106  //  where the input file is %IN%. Your filter is expected to create the
 107  //  the output file %OUT%.  Export will read the output of your filter
 108  //  and display it as the result of the export step.
 109  //
 110  //  Do not define export_filter unless you have a filter.
 111  //  Only define one filter.
 112  //$CFG['export_filter'] = array('Words to see' => "tr '[a-z]' '[A-Z] < %IN% > %OUT%");
 113  //$CFG['export_where'] = 'activerecord=1';      // Default where clause
 114  //$CFG['export_delimiter'] = 'tab';             // Default delimiter
 115  
 116  //  If he wants to see details, here's a way to show even more
 117  //  Set $showdetails to higher values to see even more or not offer this
 118  $LOCALOPT['showdetails'] = FALSE;         // Do not show checkbox for this
 119  
 120  
 121  /*---------------------------------------------------------------
 122  #   Add local subroutines here that SQLView will call
 123  #   to allow you to change some things. 
 124  #----------------------------------------------------------------*/
 125  
 126  //---------------------------------------------------------------
 127  // OVERRIDE_info - Local version of info
 128  //  Print body of HTML page to show table details.
 129  //
 130  // Parameters:
 131  //  tbl - name of table
 132  //  desctbl - array of descibe information
 133  //
 134  // Returns:
 135  //  HTML for page or empty string saying we did not handle this
 136  //---------------------------------------------------------------
 137  //function OVERRIDE_info($tbl, $desctbl) {
 138  //}
 139  
 140  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]