IRIS Data Retrieval
Contents
- Introduction
- Overview
- Installation
- Customising Display Options
- Filtering the Departmental Staff List
- Alternatives: Using staffprofile.php Without An Automatic Staff List
- Advanced: Using CSS for Further Customisation
- Advanced: Using PHP and the Class Methods to Display IRIS Data
1. Introduction
IRIS is a one stop shop for information on UCL staff and their research. The data it contains can be accessed via a XML feed.
This page provides instructions that allow the use of IRIS data to generate automatic departmental staff lists and staff profiles. It requires access to a UCL or departmental server running PHP 5.0 or greater with the PHP extension 'OpenSSL' enabled.
2. Overview
The basic setup described below requires two PHP pages to obtain and display data from the IRIS database. The first displays either a departmental or research group staff index and the second displays a staff profile. Both pages contain an array of options to allow further customisation and the staff list can also be filtered by staff category.
Alternative setups can access the staff profile page from a manually generated list, or use multiple pages to be display a single staff profile each.
3. Installation
- Download the latest version of the IRIS_php zip file and unzip to a folder
- In the same folder create two PHP files.
- One will display the staff list and can have any name.
- The second will will display the staff profile and MUST be named 'staffprofile.php'.
- Copy the HTML code of your site template to both pages
3.1 Creating a Staff List Page
Staff lists can be automatically generated to display members of staff belonging to either a specific department or research group. Instructions for both lists are provided below:
3.1.1 Departmental Index Page
- Copy the following code to the end of the header of the staff list page i.e. paste just before the </head> tag
<?php
//For more information on this code, please visit http://www.ucl.ac.uk/chem-database/staff_intranet/IRIS/version1_0/
require('profileInclude.php');
$options = array (
'list' => 'ME', // Enter a departmental code between quotations
// e.g. Chemistry = 'ME',
'picture' => 'side', // Display option for departmental staff photos
// Three options:
// 1) Leave blank for no image
// 2) Enter 'hover' for image to appear when
// mouse hovers over staff name.
// 3) Enter 'side' to show the photo on the right of the staff name
'tabs' => 'l,t', // Split list into tabs based on these letters
// Letters determine end of range of tab
// i.e. 'L,T' gives tabs A-L,M-T,U-Z
// Leave blank for a non-tabbed list
'filter' => '', // Enter staff category codes to use as a custom filter
// and call using getStaffList('custom')
// Input is a string of comma separated values e.g. 'HOCPRO, RESSRF,'
// Occupation codes can be found here
// http://www.ucl.ac.uk/hr/salary_scales/staff_categories.php
'keyword' => '' // Integer ID of keyword used to filter list
);
$staffList = new deptListObject($options);
?>
- To the same page, copy the following code where the list is to be displayed i.e. somewhere between the <body> tags.
<?php
$staffList->getStaffList('');
?>
3.1.2 Creating a Research Group Index Page
- Copy the following code to the end of the header of the staff list page i.e. paste just before the </head> tag
<?php
//For more information on this code, please visit http://www.ucl.ac.uk/chem-database/staff_intranet/IRIS/version1_0/
require('profileInclude.php');
$options = array (
'list' => '02', // Enter a research group code between quotations
// e.g. Astrophysics = '63',
'picture' => 'side', // Display option for departmental staff photos
// Three options:
// 1) Leave blank for no image
// 2) Enter 'hover' for image to appear when
// mouse hovers over staff name.
// 3) Enter 'side' to show the photo on the right of the staff name
'tabs' => '', // Split list into tabs based on these letters
// Letters determine end of range of tab
// i.e. 'L,T' gives tabs A-L,M-T,U-Z
// Leave blank for a non-tabbed list
'filter' => '', // Enter staff category codes to use as a custom filter
// and call using getStaffList('custom')
// Input is a string of comma separated values e.g. 'HOCPRO, RESSRF,'
// Occupation codes can be found here
// http://www.ucl.ac.uk/hr/salary_scales/staff_categories.php
'groupInfo' => 1, // Display group details at top of page
// 1 = display, 0 = do not display
'students' => 1 // Display list of students attached to research group
// 1 = display, 0 = do not display
);
$staffList = new groupListObject
($options);
?>
- To the same page, copy the following code where the list is to be displayed i.e. somewhere between the <body> tags.
<?php
$staffList->getStaffList('');
?>
3.2 Creating the Staff Profile Page
- Copy the following code to the end of the header of 'staffprofile.php' i.e. just before the </head> tag
<?php
//For more information on this code, please visit http://www.ucl.ac.uk/chem-database/staff_intranet/IRIS/version1_0/
require('profileInclude.php');
$options = array (
'display' => 'tabbed', // Display profile as tabbed table ('tabbed') or as a linear list ('')
'photo' => 1, // Display staff photo (1) or no photo (0)
'blankPhoto' => 'blank.jpg',// Image to display if no photo is available in IRIS
'title' => 1, // Generate Page title. Three options:
// 1) 1 generates automatic page title (e.g. <title>Staff Name</title>)
// 2) Any string will appear at end of automatic title
// e.g. '| Custom' generates <title>Staff Name | Custom</title>
// 3) Leave blank if you want to add your own <title> tags manually
'summary' => 'research', // Display a summary on the 'contact' tab. Leave blank for no summary,
// or enter 'biography', or 'research' to display associated summaries.
'publications' => 10 , // Maximum number of publications to display in the publications tab
'staffUPI' => '' // Leave blank if using automatic staff lists
// If require separate PHP page for a staff profile then enter relevant UPI
//(see instructions for more details)
);
//List of tabs to display in profile. Enter 1 to display, or 0 to hide.
$include = array (
'contact' => 1,
'research' => 1,
'publications' => 1,
'biography' => 1,
'additional' => 1
);
$profile = new staffObject
($options,$include);
?>
- To the same page, add the following code where the list is to be displayed i.e. somewhere between the <body> tags.
<?php $profile->getProfile();?>
3.3 Customise and Upload Files
- Use the option arrays in both files to customise the page display
- Upload the folder to your web server
- To see the finished list and profiles, navigate to the staff index page using a web browser
4. Customising Display Options
4.1 General Staff List Options
These options are set in the array at the end of the page <head> called $options. The options are as follows:
'list'
Code of department or research group whose members are to be displayed in the staff list. Please contact the IRIS helpdesk to obtain the relevant codes.
'picture'
Determines how to display staff photos. Three options:
- ' ' (i.e. leave blank) for no image
- 'hover' for the image to appear when the mouse hovers over the staff name
- 'side' shows the photo to the right of the staff name
'tabs'
A comma separated list of letters determining how to group staff names. For example, entering 'E,M,U' gives a table with the tabs A-E, F-M, N-U, and V-Z.
'filter'
4.2 Departmental List Options
These options are specific to departmenal staff lists and are also set in the $options array.
'keyword'
This option allows the staff list to be filtered by a keyword associated with staff profiles. The input is the keyword ID; for further details on how to obtain this, please contact the IRIS helpdesk.
4.3 Research Group List Options
These options are specific to research group staff lists and are also set in the $options array.
'groupInfo'
Enter 1 to display the group details above the member list, or 0 to hide this information
'students'
Enter 1 to display a list of students or 0 to hide this information
4.4 Staff Profile Display Options
The staff profile has two option arrays. The first, called $options, controls a variety of display options:
'display'
'tabbed' displays the staff profile as a tabbed table. If left blank, profile is displayed as a simple list
'photo'
1 displays a staff photo. For no photo put 0
'blankPhoto'
If no photo is available in IRIS, then this image file will be displayed instead
'title'
Generates a page title. There are three options:
- 1 generates automatic an page title (e.g. <title> Staff Name </title>)
- A string will generate an automatic title, with the string at the end (e.g. '| Custom String' generates <title> Staff Name | Custom String </title>)
- If left blank no title will be generated and <title> tags must be manually added to the page
'summary'
Display a summary on the first tab. Leave blank for no summary, or enter 'biography', or 'research' to display the associated summaries.
'publications'
Integer value of maximum number of publications to display in the publications tab
'staffUPI'
Leave blank if using the automatic, or a manually generated staff list. Enter a UPI if only a single staff profile is to be displayed on this page
The second array, called $tabs, determines which tabs are display in the tabbed table. To display a tab, enter 1 next to the relevant option. To hide a tab enter 0.
5. Filtering the Departmental Staff List
The departmental staff lists can be filtered by staff category such that only members of staff with specific occupation codes are displayed. This filter is applied when the getStaffList method is called (as shown below)
$staffList->getStaffList('filter');
The available filters are as follows:
- () i.e. blank - No filter, display all records
- ('academic') - Display all academic staff (clinical and non-clinical)
- ('clinical') - Display just clinical academic staff
- ('non-clinical') - Display just non-clinical academic staff
- ('honorary') - Display all honorary staff
- ('nhs') - Display all NHS staff
- ('researcher') - Display all researchers
- ('custom') - Display staff whose occupation codes match those listed under 'filter' in the options array
6. Using staffprofile.php Without Automatic Staff Lists
The default setup leaves $options['staffUPI'] blank so that 'staffprofile.php' reads in the UPI via the URL, and displays the associated staff profile. With the automatic staff list, this URL is generated automatically. If a manual staff list is used then the link to the staff profile must be in the following format:
<a href='staffprofile.php?ref=*UPI*'>*Link Text*</a>
where *UPI* is the UPI of a member of staff, and *Link Text* is the text linking to their profile.
In certain circumstances, it may be necessary to have a single PHP file for each member of staff. If this is required then a UPI can be entered into the 'staffUPI' option in the $options array. The profile associated with that UPI will then be displayed regardless of the UPI passed by the URL.
7. Advanced: Using CSS for Further Customisation
The CSS files provided in the ZIP file are designed to contain just the basic styles required, so that your own site style will control the page appearance. The files provided are:
- iris_ucl_list_basic.css : Styles common to all staff lists
- iris_ucl_list_simple.css : Styles for the non-tabbed staff list
- iris_ucl_list_tab.css : Styles for the tabbed staff list
- iris_ucl_profile_basic.css : All styles associated with the staff profile
It is possible to further customise the pages by hiding unwanted information. For example, the research themes associated with a research group can be hidden by adding the following CSS statement:
#groupThemes {display:none}
The relevant CSS selector (in this example #groupThemes) can be found by examing the page source code. For more information see the W3C CSS tutorials.
8. Advanced: Using PHP and the Class Methods to Display IRIS Data
The classes provided contain a number of public methods that can be called once the staff profile and staff list objects have been created. More details on these methods can be found in the class documentation. The majority of these methods return a string of HTML code, and so to display them to the page they must be called in the following way:
<?php
print $staffProfile->getBiogSummary();
?>
Documentation is also available for the entire project (i.e. details on all public and private methods and variables).