BASE 1.2.16 Code Documentation

Introduction

No formal documentation of the code was provided with BASE 1.2.16. I have read some of the code in BASE in order to understand how to add new functionality. While reading the code, I compiled these notes.

It is possible to format comments in PHP so that they can be processed using phpDocumentor. There are at least two good web tutorials on phpDocumentor, “Writing Self-Documenting PHP Code” and “Documenting PHP Code with PHPDocumentor”. It would be a big job to reformat the comments in all of the BASE code for processing with phpDocumentor, but new code should contain comments that can be processed by phpDocumentor.

These notes assume that BASE was installed into the directory /usr/local/base and that the domain of the webserver is "localhost".

Quoted comments were copied directly from the source code.

Interacting with the Database

How BASE Scripts Connect to the Database

At the lowest level, BASE connects to the database using the function db_connect(), which is defined in mysql.inc.php or in pgsql.inc.php, depending on the database management system being used. The db_connect() function creates a new BaseDatabase object, which is stored in a static array that is managed by the BaseDatabase class. Then the db_connect() function calls the PHP function mysql_pconnect() to obtain the database server connection, which is saved as the serv attribute of the BaseDatabase object. Then the db_connect() function calls the PHP function mysql_select_db() to set the current active database on the server; this is saved as the db attribute of the BaseDatabase object. Subsequent queries of the database by the PHP function mysql_query() will be made on the active database.

By default, db_connect() calls the PHP function mysql_pconnect(), which establishes a persistent connection to the database. This connection is managed by the Apache web server and the PHP module. A persistent connection increases efficiency by eliminating the need to connect to the database each time a script is run.

The db_connect() function is called by the tryDbConnect() method of a BaseControl object.

The tryDbConnect() method is called from the startScript() method of a BaseControl object, only if the BaseControl object is not already connected to the database.

The startScript() method is called by many scripts. Files in /usr/local/base/www require init.inc.php, which in turn requires newinit.inc.php. newinit.inc.php defines a function, checkLogin(), which among other things creates a global BaseControl object, $BC, and calls the startScript() method of that object to get the connection to the database that is stored in the BaseDatabase object.

Any script that needs to use the database can obtain the server connection by calling BaseDatabase::instanceN() to get the latest BaseDatabase object that was created; the serv attribute of that object is the server connection that is passed to the functions that call the database (e.g., mysql_query()).

Database Queries

In practice, it is not necessary to call BaseDatabase::instanceN(). Instead, database query strings are passed directly to the query() function, which is defined in mysql.inc.php or in pgsql.inc.php. query() obtains the database connection by calling the class method BaseDatabase::instanceN(), then passes the query string to the PHP function mysql_query().

Contents

/usr/local/base/

config.inc.php

Path: /usr/local/base/config.inc.php

config.inc.php is required by the following files:

config.inc.php performs the following tasks:

/usr/local/base/bin/

/usr/local/base/include/classes/

array.inc.php

Path: /usr/local/base/include/classes/array.inc.php

array.inc.php is required by the following files:

array.inc.php performs the following tasks:

Class ArrayBatch

Class ArrayBatch extends class Item.

Attributes
Methods

Class ArraySlide

Class ArraySlide extends class Item.

Attributes
Methods

Class ArrayType

Class ArrayType extends class Item.

Attributes
Methods

Class Feature

Attributes
Methods

basecontrol.inc.php

Path: /usr/local/base/include/classes/basecontrol.inc.php

basecontrol.inc.php is required by the following files:

basecontrol.inc.php performs the following tasks:

Class BaseControl

"This class provides a way to shut down BASE gracefully. If the file $config[tempDir]/shutdown exists, BASE should not attempt to connect to the database. Because some operations need to be atomic (for instance when something in the database describes something in the file system), this class provides a simple transaction mechanism. Calls to beginTransaction and endTransaction should surround any block of do-or-die nature. The BaseControl table stores the number of pending transactions, as well as whether the shutdown file exists or not. The latter is needed to avoid race conditions. For scripts that spend a long time away from the database (such as jobController.php), there is a function awaitUp() which will wait the specified amount of time for the system to come back online."

Attributes
Methods

dataimport.inc.php

Path: /usr/local/base/include/classes/dataimport.inc.php

dataimport.inc.php is required by the following file:

An object of this class can call the globalRead(), the globalEdit(), and the write() method for any object of these classes: Sample, Extract, Label, LabeledExtract, Hybridization, ImageAcquisition, and RawBioAssay.

dataimport.inc.php performs the following tasks:

Class DataImporter

Attributes
Methods

display.inc.php

Path: /usr/local/base/include/classes/display.inc.php

display.inc.php is required by the following files:

display.inc.php performs the following tasks:

Class Display

display.inc.php defines class Display. "This class just keeps track of some text sizes and boolean variables that have to do with logos. It contains functions to serialize and unserialize itself to/from cookies."

Attributes
Methods

eventlog.inc.php

Path: /usr/local/base/include/classes/eventlog.inc.php

eventlog.inc.php is required by the following files:

eventlog.inc.php performs the following tasks:

Class EventLog

Class EventLog extends class Item.

Attributes
Methods

item.inc.php

Path: /usr/local/base/include/classes/item.inc.php

item.inc.php is required by the following files:

item.inc.php performs the following tasks:

Class Item

"This class is rather central to large parts of BASE, and should be documented."

Attributes
Methods

protocol.inc.php

Path: /usr/local/base/include/classes/protocol.inc.php

protocol.inc.php is required by the following files:

protocol.inc.php performs the following tasks:

Class Protocol

Class Protocol extends class Item.

Attributes
Methods

Class ProtocolType

Attributes

There are no attributes.

Methods

The methods query the database and return data.

reporterlist.inc.php

Path: /usr/local/base/include/classes/reporterlist.inc.php

reporterlist.inc.php is required by the following files:

reporterlist.inc.php performs the following tasks:

Class ReporterList

Class ReporterList extends class Item.

"The creation of a ReporterList must be within BaseControl transaction until the list has been populated."

Attributes
Methods

search.inc.php

Path: /usr/local/base/include/classes/search.inc.php

search.inc.php is required by the following files:

search.inc.php performs the following tasks:

Comments

"> Could I also have a description of how the search objects (eg as generated in Sample) work?

"Let's see... A Search is referenced in one of UserSearch, BioAssaySetSearch, Preset, and TransformationSearch. The first 3 are for searches that exist only to improve the user interface. That is, they don't affect anything other than how things are shown and they can be changed at any time. TransformationSearches hold information about filterings that have been done, and can not be changed.

"The search object holds information about the sorting of the search results in ($sortField, $sortDesc). $sortField is a number or string, the key of an SQL expression to sort by in the array passed to makeOrderBy(&$fields). $sortDesc is just a boolean variable. The makeOrderBy function returns something like "ORDER BY $fields[$sortField]".

"$currentPage is a member variable used together with $hitsPerPage to determine what LIMIT to use in the SQL query. $hitsPerPage is typically set by one of the functions in searchhtml.inc.php. In that file there are mainly 2 functions: one that generates the form where you enter search criteria and manipulate presets, and another which generates the header row of the tables usually used to present search results.

"Search criteria are attached to the Search object as an array of SearchCriterion objects. Each criterion has $field, $op, $searchString, where $field identifies an expression (from a list of expressions, for instance "id", "name", "spots"), $op is the number of the operator to use (from a fixed list, defined at the top of search.inc.php), and $searchString is the string entered by the user.

"In $extraTables, $extraWhere the search object keeps track of tables and join conditions that are introduced by criteria, sorting, or just the caller asking for them to be included. The makeWhere function, which sets up $where, accepts two arrays. The first is the list of expressions that criterion->field refers to, and the second maps those fields' keys to up to three strings or arrays, which are sent to addExtraTable(), addExtraWhere(), addLeftJoin() if there are any criteria with the corresponding field number. This way it's possible to have criteria which refer to tables which are not usually included in the search, but are only included if needed.

"Additionally, criteria keep track of both their raw string values and translated values which are actually used in the search. There's also some code dealing with special types of search fields: gene lists and enumerations (which turn into select boxes with predefined values). Gene lists are linked to the presentation of search results through $extraColumns, which makes it possible to include the value from a reporter list so that it is sortable."

Class Preset

Attributes
Methods

Class Search

Attributes
Methods

Class SearchCriterion

Attributes
Methods

session.inc.php

Path: /usr/local/base/include/classes/session.inc.php

session.inc.php is required by the following files:

session.inc.php performs the following tasks:

Class Cookie

Attributes
Methods

Class Session

Attributes
Methods

upload.inc.php

Path: /usr/local/base/include/classes/upload.inc.php

upload.inc.php is required by the following files:

upload.inc.php performs the following tasks:

Class Upload

This class extends class Item.

Attributes
Methods

user.inc.php

Path: /usr/local/base/include/classes/user.inc.php

user.inc.php is required by the following files:

user.inc.php performs the following tasks:

Class UserAccount

This class extends class UserGroup.

Attributes
Methods

Class UserGroup

This class extends class Item.

Attributes
Methods

/usr/local/base/include/common/

common.inc.php

Path: /usr/local/base/include/common/common.inc.php

common.inc.php is required by the following files:

common.inc.php performs the following tasks:

db.inc.php

Path: /usr/local/base/include/common/db.inc.php

db.inc.php is required by the following files:

db.inc.php is a wrapper file that requires $config[rootDir]/include/drivers/$config[RDBMS].inc.php, which for my installation is /usr/local/base/include/drivers/mysql.inc.php (mysql.inc.php).

db.inc.php performs the following tasks:

misc.inc.php

Path: /usr/local/base/include/common/misc.inc.php

misc.inc.php is required by the following files:

misc.inc.php performs the following tasks:

Functions

Function Comments
acc
accessName "Returns the name of an access level (BUA_...)."
atoiSuffix "Converts string like "120M" or "56 kB" to an integer."
encodeForPathInfo "The point of this function is that Apache seriously dislikes getting urlencoded slashes in the path info."
errorImage
extendedHtml
getPathInfo
html
htmldate
htmldatetime
href "Returns 'href="$url"'. If $mode is 1 then the page will be called with the current value of $location as its $location, which means that the current page will not be returned to from the called page. If $mode is 2 then the parameters will be passed in such a way that when returning from the called page to this page, we will have the same value of $location as we do now. Thus, use mode 1 to go to the next page in a flow, and mode 2 to take a detour from wich you want to be able to return. Mode 2 the default. The new mode 3 will, if possible, make a link from a flow to the flow that called it. That is, it will be as if the latest mode 2 link had in fact been mode 1."
logForDebugging "This function creates a file and logs an error in it. The file's name will include $errtype, and the contents of $var will be included in the file. The return value is a message which may include the name of the file."
makeName
maxlen
maxlenPopup
mydie
myflush
now
oneLineDecode
oneLineEncode
printable
ratioColor
readableBytes "Converts a number (of bytes) to a string with suffix."
redirect
removeDirectory
returnLink "Returns a "return" link."
secstotime
setLocation "How $location works:
After a call to setLocation(), $location should contain the name of the page that we should return to. This page name includes variables passed by GET.
When going from page A to page B, the default will be to return to A from B. If we want to go on to page C from page B, there are several possibilties:
we may wish to return to A from C, or to B with information to make it possible to return to A from there.
If page B was arrived at with the URL of page A in $location passed by GET, there is no problem since the http_referer of page C will be page B with enough info to return to page A.
If page B was arrived at without a $location, it needs to pass this information along to page C in such a way that page C can include the $location of page B into its own $location. This is done with $oldlocation: when page C gets $oldlocation and no $location it creates $location from its http_referer and $oldlocation in such a way that http_referer will be called with the value of $oldlocation in $location.
If page B was arrived at with $location passed by POST it also has to incorporate this information in $oldlocation when calling page C.
In short, the only time that $oldlocation needn't be passed to a page is when that information is already in the URL of the calling page. If $oldlocation is passed when the calling page has $location in its URL, $oldlocation will be discarded."
str_a_an
strtodate
strtodatetime
subarrChop "Returns an array constructed from two 'columns' of the subarrays of the input array."
tempFilename "Generates a file name which is bloody well near unique."
textImage
today
timetosecs
verifyAccess checks that the user has the correct BASE User Access; displays an access denied page if not, and exits

/usr/local/base/include/drivers/

mysql.inc.php

Path: /usr/local/base/include/drivers/mysql.inc.php

mysql.inc.php is required by the following files:

"This is the MySQL driver for BASE. It's the most tested RDBMS driver, and it should be considered as a reference implementation, and all database drivers for BASE should implement all functions that are implemented here. The BaseDatabase class is not part of this reference, nor is the multiple connection capability (Everything the has to do with arguments called $link)."

mysql.inc.php performs the following tasks:

Functions

Function Comments
db_affected_rows "The number of rows affected by an UPDATE/INSERT/etc."
db_cast_boolean_float "Conversion from a boolean expression to 0.0 or 1.0. MySQL can do this cast itself."
db_cast_boolean_int "Conversion from a boolean expression to 0 or 1. MySQL can do this cast itself."
db_cast_float "Generic number-to-float cast."
db_connect "Connect to a database and return a database identifier, or false on failure. An empty password is interpreted as there being no password at all."
db_func_div "Division, or NULL if it makes no sense to divide. The +0 is required to turn the result into a float."
db_func_gmean "Geometric mean, or NULL if undefined."
db_func_log "Logarithm, natural or base $base. The generated expression should evaluate to NULL to indicate not-a-number."
db_func_round "Rounds to a resolution of $res (not to $res decimals!)."
db_date_future "A date very far into the future."
db_date_never "The way to represent an invalid date."
db_disconnect "Disconnect from the database. This requires that db_connect was called with $persistent = false."
db_dup_key "Returns true if the last query failed because of a duplicate key (i.e. attempting to violate a uniqueness constraint)."
db_dynamic_db_prepare "Prepare the name of the dynamic database so that it can be prepended to the table names. In the case of RDBMSs that don't support working with more than one database at a time, this should generate a prefix."
db_fetch_assoc "Fetch one row from a result set, indexed by name Note that the function returns by reference."
db_fetch_row "Fetch one row from a result set, indexed from 0 and up. Note that the function returns by reference."
db_has_multitabledelete "This returns true if the database allows multi-table deletes, e.g. DELETE FROM foo USING bar WHERE foo.a = bar.b".
db_has_subselects "Some pieces of BASE need to know if they can do a subselect, and if not it is assumed that GROUP BY behaves like in MySQL, where you can "SELECT a, b GROUP BY a" even if b is not COUNT() etc."
db_insert "This function inserts a row in a table. The table is supposed to have a column called 'id' as its primary key. The id of the newly inserted row is returned. $columns and $values must have the same number of values, and their order must correspond, but their keys don't matter."
db_insert_ignore "This function does an INSERT IGNORE, under the assumption that there's a unique index on all columns. That is, it inserts a row unless there is already a similar row, and if such a row exists or is successfully created, true is returned."
db_insert_multicol "This function inserts a row into a table where the primary key is on multiple columns. When a new row is inserted the value in the last of those columns is to be one more than the previously highest value in rows that have the same value in the rest of the primary key columns. In the case that there are no such rows, 1 should be used. This is the behavior you get with auto_increment on a non-first column of a primary key in MySQL. The last value in $keycolumns is the auto_increment column, and there should be one value less in $keyvalues than in $keycolumns. $columns and $values hold the names and values for the rest of the columns. As with db_insert(), keys in the arrays aren't used."
db_interval "Returns a representation of a time interval for use in comparisons."
db_interval_secs "Returns an expression for the number of seconds between $time1 (start) and $time2 (end)."
db_limit "Returns an SQL clause that can be appended to a SELECT to limit the set of returned rows."
db_multiinsert_begin "Begin multi-row insert. $columns is an array of column names. The return value is a black-box multiinsert identifier, to be used with calls to db_multiinsert_row() and db_multiinsert_finish(), or false for failure."
db_multiinsert_finish "Finish up a multi-row insert. Returns the total number of inserted rows, or -1 if there was some kind of error, in which case the number of added rows is unknown."
db_multiinsert_row "Adds a row to a multiinsert. The order in $data should correspond to the column order for db_multiinsert_begin. It's important to check the return value of this function. If it's false, the entire multiinsert has failed, and an undefined set of rows may have been added. The mysql version of this function uses INSERT with multiple sets of values ("INSERT INTO foo (bar) VALUES (baz), (quux), ..."), and it will do an insert every few hundred values or so."
db_num_rows "Returns the number of rows in a result set."
db_oper_like "The name of a preferably case-insensitive LIKE operator."
db_select_nocache
db_server_version
db_server_version_num
db_straight_join "This function exists only to help the MySQL optimizer in the case that it decides on a very bad join order. Other RDBMSs should probably just ignore it."
db_string_concat "The string concatenation function."
db_tabfile_load "Loads a table with data from a tab-delimited file. For compatibility with pgsql all columns must be included and in the same order as in the table definition. The number of affected rows will be returned, or -1 for failure. If you really want to, you can change to 'LOAD DATA INFILE' if you have given the MySQL user the global file privilege, and if BASE's temp directory is available to mysqld. For security reasons, I strongly suggest that you consider using LOCAL INFILE instead, or just set $config["mysql.localinfile"] to 0 so that INSERTs are used."
db_table_copy "This function copies the table structure from table $from to table $to. $duplication is an optional array which describes how columns of the $from table are to be duplicated in the $to table. It's on the form "source" => array("dest1", "dest2", ...), e.g. "intensity1" => array("intensity2") to create 2 intensity columns from a template with only one. This is likely to be the function which will require the most work if you write a driver for a different RDBMS."
db_table_diskusage "Return an array of (usedspace, wastedbytes) for a given table. The used space is the total amount of disk space used, including wasted space."
db_table_drop "This function drops a table, or does nothing if the table doesn't exist."
db_table_optimize
db_true "Something that can be used as "SELECT ... WHERE ".db_true()."
db_update_or_insert "This function updates or inserts a new row, using $keys to determine what row to update. Unlike for db_insert(), the array keys in $keys are used to find the values in $keyvalues. The task of this function should be as simple as doing an update and then an insert if nothing was affected, but as MySQL doesn't report the number of matching rows in mysql_affected_rows(), this isn't possible. INSERT IGNORE can't be used as there's no way to distinguish between a failure due to the row existing and one due to a row with the same value for some unique key. The ugly solution is to extract the primary key and use that in the insert."
db_verify_connection "Returns true if the database connection seems to be alive."
query "Execute an SQL query."

Class BaseDatabase

"This class is a helper for the MySQL db_... functions. It allows the creation of multiple database connection, but BASE doesn't actually use that functionality."

Attributes
Methods

/usr/local/base/include/local/

/usr/local/base/include/web/

help.inc.php

Path: /usr/local/base/include/web/help.inc.php

help.inc.php is required by the following files:

help.inc.php performs the following tasks:

Function

Function Comments
webHelp

help_short.inc.php

Path: /usr/local/base/include/web/help_short.inc.php

"File created from webhelp.txt."

help_short.inc.php is required by the following files:

help_short.inc.php performs the following tasks:

htmlinit.inc.php

Path: /usr/local/base/include/web/htmlinit.inc.php

htmlinit.inc.php is required by the following files:

htmlinit.inc.php performs the following tasks:

Functions

Function Comments
htmlBegin
htmlEnd

init.inc.php

Path: /usr/local/base/include/web/init.inc.php

init.inc.php is required by the following files:

init.inc.php performs the following tasks:

item_common.inc.php

Path: /usr/local/base/include/web/item_common.inc.php

item_common.inc.php is required by the following files:

item_common.inc.php performs the following task:

Functions

"Functions that have to do with group/world privileges."

Function Comments
attemptDelete
dateAndOwnerInputHandle
dateAndOwnerInputHandleNoAccess
dateAndOwnerTable
dateAndOwnerTableNoAccess "The same as dateAndOwnerTable, but for items which down't have the group/world stuff and for which 'owner' means 'person who created'."
dateInput
getPrivilegeNames
groupAccessCheckbox
groupAccessFooter
groupAccessHandle "Handles user input concerning group/world privileges."
groupAccessScripts
groupInfo "Returns a string with the name and access level for the group associated with an item. $arr is an array with "gid" and "groupAccess", or an Item.
$users is an array as returned by UserGroup::getBrief(). If the group isn't found in $users, it'll be read from the database."
handleDelete
massDeleteHandle "Handles user input concerning mass delete."
massDeleteInput
remMark
showDelLinks
showDelPrep
showDelSubList
showDelValue
userInfo "Returns the name of the owner of an item."
worldInfo Returns a string describing the world's access to an item. $arr is an array with "worldAccess", or an Item.

Path: /usr/local/base/include/web/links_common.inc.php

links_common.inc.php is required by the following files:

"Files that include this file have to include the files for the required classes. To include all classes from this file would be too costly."

links_common.inc.php performs the following tasks:

Function Comments
arrayBatchArrLink
arrayBatchIdLink
arraySlideArrLink
arraySlideIdLink
arrayTypeArrLink
arrayTypeIdLink
computationServerArrLink
experimentArrLink
extractArrLink
extractIdLink
hardwareIdLink
hybridizationArrLink
hybridizationIdLink
hybridizationObjLink
imageAcquisitionArrLink
imageAcquisitionIdLink
labelArrLink
labeledExtractArrLink
labeledExtractArrLinkOther
labeledExtractIdLink
labelIdLink
plateArrLink
plateTypeArrLink
plateWellArrLink
programArrLink
programIdLink
programObjLink
protocolArrLink
protocolIdLink
rawBioAssayArrLink
sampleArrLink
sampleChannelArrLink
sampleIdLink
userAccountArrLink
userGroupArrLink
wareArrLink
wizzzardIdLink
wizzzardNewLink

login.inc.php

Path: /usr/local/base/include/web/login.inc.php

login.inc.php is required by the following files:

login.inc.php requires the following file:

Function

Function Comments
tryLogin "return codes: 0-ok, 1-expired, 2-badname, 3-noname."

newinit.inc.php

Path: /usr/local/base/include/web/newinit.inc.php

newinit.inc.php is required by the following files:

newinit.inc.php performs the following tasks:

Function

Function Comments
checkLogin

searchhtml.inc.php

Path: /usr/local/base/include/web/searchhtml.inc.php

searchhtml.inc.php is required by the following files:

searchhtml.inc.php performs the following tasks:

Functions

Function Comments
headerfieldColumnCount
makeSearchHeader "Arguments: A Search object, an array of strings, an array of numbers where {0->sort, 1->asc, (-1)->desc}, the index of the default sort field."
makeSearchHeader1 "Arguments: A Search object, an array of strings, an array of numbers where {0->sort, 1->asc, (-1)->desc}, the index of the default sort field.
$search - a search object
$headerfields - array from column handle to header text. These column handles must be the same as the ones passed to the SomeClass::search() functions. The header text may be an array of 2 elements where the second is the (total) colspan. An optional third element of that array is an array on the form (colspan,header,colspan[,...]) where the colspans add up to the total colspan.
$sortorder - how to sort when a header is clicked. An array with key->value for each key in $headerfields. The values are 0 for 'unsortable', +1 / -1 for ascending/descending.
$defsort - default column to sort by, a valid key in $headerfields
$listnum - in case there are many tables, this number keeps their input variables apart.
$useExtraCols - set to true if you want the extra column feature. This is used for e.g. reporter lists, where it introduces an extra column for each IN reporter list in the search criteria."
makeSearchHeader2 "Elements of $headerfields may be array(0=>columnname,1=>colspan [,2=>array(colspan0,subhead1,colspan1,...)]), or just columnname."
makeSearchTable "This function updates search criteria and shows a table with saved searches and current criteria.
It returns a Search object which represents the current search after conversion of non-string values.
Defined fieldtypes: 0 = string, 1 = date, 2 = int, 3 = float, 4 = boolean, 5 = string%(OBS), 6 = %string%(OBS), 7 = reporter list, 8 = 2^float, 9 = cloneId(OBS), array(0, ... ) = enum
$userid - ID of the user for which the table is shown
$presetType - a string, the name of the preset type that is relevant for this search form. (from database enum Preset.searchType)
$searchItemType - 'User', 'BioAssaySet' or 'Transformation' depending on the search scope. The search scope is 'User' for things like Samples, so there's one Sample search form per user.
$searchRef - the ID of the $searchItemType, i.e. the user id for 'User' etc.
$searchType - a string describing a type of search, from UserSearch.searchType (or BioAssaySetSearch etc. depending on $searchItemType).
$searchfields - reference to array of id => name for the things you can search for. The names are shown on the page and the ids are used in SearchCriterion objects. As of 20021004 the id can be a string.
$fieldType - ref to array from id_number to type, where the types are as above.
$defOper - default operator, a number indicating index in the operator list.
$title - optional title for the table, can start with _ for smaller font.
$output - if this is false, actions will be taken (presets saved, etc), but there will be no output.
$repListExp - experiment from which to take reporter lists if there are search fields of the SEARCH_REPORTERLIST type, or -1 for all experiments the user has read access to.
$tableId - If there's more than one search table on a page, these must differ, and preferably be an integer."
pageLink
printExtraColumnCells
printExtraColumnCellsText

upload_common.inc.php

Path: /usr/local/base/include/web/upload_common.inc.php

upload_common.inc.php is required by the following files:

upload_common.inc.php performs the following tasks:

Functions

Function Comments
handleUpload "Returns error message or ""."
shouldDeleteUpload
uploadInput "This function displays a file input/selection thingy, in the context of a 2-column table. Use $inputid if you need more than one instance in a form. Input will be passed in $i_file, $i_fileid, $i_filedel, $i_filedescr If $filterFunc is specified, this function will be called for every upload with one arg: one sub-array from Upload::getBrief(). Also, $filterFunc() should return a short description when called with an arg of false."
uploadSizeLimit "Returns the maximum upload file size. Guaranteed to be non-negative."

/usr/local/base/www/

arraytype_list.phtml

Path: /usr/local/base/www/arraytype_list.phtml

arraytype_list.phtml displays a list of Array Designs to which the current user has access.

Form elements are provided for:

Links are provided for:

arraytype_list.phtml performs the following tasks:

getconfig.inc.php

Path: /usr/local/base/www/getconfig.inc.php

getconfig.inc.php is required by every .phtml file in /usr/local/base/www/. These include:

The require_once() control structure looks in the directories defined by the include_path parameter defined in the /etc/php.ini configuration file. (See Chapter 16, Control Structures, of the PHP HTML manual.) It also looks in the current script directory. In general, this means that PHP can find getconfig.inc.php only if it's in the same directory as the file calling it, which explains its location in the www directory.

getconfig.inc.php performs the following task:

index.phtml

Path: /usr/local/base/www/index.phtml

index.phtml requires the following files:

index.phtml loads the required files in the following order, where redundant require_once() directives are indicated in gray:

index.phtml is first page of the BASE user interface. index.phtml performs the following tasks:

  1. loads the required files
  2. calls checkLogin() from newinit.inc.php
  3. calls tryLogin() from login.inc.php
  4. restores previously saved display settings (if they exist)
  5. determines which pages to display in the left frame ("l") and in the main frame ("m") of the HTML page
  6. sets up the HTML frameset for the BASE user inferface, designating the appropriate dynamic pages to load into the left frame and the main frame

If the user is not logged in, the URL for the left frame is
http://localhost/base/left.phtml?l=main_main&i_err=3&i_un=
and the URL for the main frame is
http://localhost/base/main_main.phtml.

After the user is logged in, the URL for the left frame is
http://localhost/base/left.phtml?l=main_main&i_err=0&i_un=
and the URL for the main frame is
http://localhost/base/main_main.phtml.

The links provided by the menu in the left frame contain two parameters. The "l" parameter defines what is to appear in the left frame after selection, and the "m" parameter defines what is to appear in the main frame after selection. It appears that left.phtml is always used to generate the dynamic HTML in the left frame, since this frame contains just the menu of choices for the user. Different .phtml files are used to generate the HTML in the main frame.

left.phtml

Path: /usr/local/base/www/left.phtml

left.phtml performs the following tasks:

reporter_update.phtml

Path: /usr/local/base/www/reporter_update.phtml

reporter_update.phtml displays a form for selecting an uploaded file or a file browse interface for selecting a file to use. The Continue button is an input element of type submit that calls reporter_update.phtml.

reporter_update.phtml performs the following tasks:

Functions

Function Comments
updateReporters
updRepCallback "The array which is passed to this function has numeric indices which correspond to those given by $wiz->getColumns(). We know what that function does (for reporter file formats), so we can work directly with the integer indices to speed up execution somewhat."

upload_list.phtml

Path: /usr/local/base/www/upload_list.phtml

upload_list.phtml displays a form for uploading a new file, a filter form for filtering the list of displayed uploaded files, a table of uploaded files, and a form for updating the group and world permissions of the uploaded files. The forms on the page call upload_list.phtml itself (using POST) to delete uploaded files, to upload a new file, and to change permissions on an already uploaded file. Links to download.phtml allow downloading or viewing uploaded files.

upload_list.phtml performs the following tasks: