Difference between revisions of "DMR Upgrade Project 2013 Code Changes"

From Ball State University Libraries Wiki
Jump to: navigation, search
(Custom Pages)
(Custom Pages)
Line 89: Line 89:
 
'''website\public_html\ui\custom\default\collection\default\resources\custompages\home'''
 
'''website\public_html\ui\custom\default\collection\default\resources\custompages\home'''
 
'''website\public_html\ui\custom\default\collection\default\resources\custompages\contact'''
 
'''website\public_html\ui\custom\default\collection\default\resources\custompages\contact'''
'''website\public_html\ui\custom\default\collection\default\resources\custompages\grantprojects'''
 
  
The files in these folders were uploaded either through the Website Configuration Tool or directly in conjunction with the WCT to create the newly designed ''Home Page'', ''Contact page'', and ''Grant Projects page''.
+
The files in these folders were uploaded either through the Website Configuration Tool or directly in conjunction with the WCT to create the newly designed ''Home Page'', ''Contact page''.

Revision as of 11:30, 6 May 2013

This article is meant to track what files on the New Server for the DMR Upgrade Project 2013 have been modified and a brief description of the reason for the modification(s).

Actual code samples won't be listed here, only file names/paths and modification descriptions. This is for future reference when these modifications must be re-implemented the next time we need to upgrade CONTENTdm.

Note: Unless otherwise stated, it is assumed that all file paths are prefixed with OCLC\CONTENTdm\Content6\.



website\public_html\ui\custom\default\collection\default\js\bsu_custom_scripts.js

A custom Javascript file uploaded via the Website Configuration Tool. When uploaded this way, this script will be loaded globally on every page. This is where various custom Javascript goes, such as Google Analytics code, or helper code for sub-collection themes.


website\public_html\ui\custom\default\collection\default\css\custom\bsu_custom_css.css

A custom CSS file uploaded via the Website Configuration Tool. When uploaded this way, this script will be loaded globally on every page. This is where various custom CSS declarations go, such as styles for sub-collection togglers.


website\cdm_common\cdm\controllers\LoginController.php

The authAction() function was modified to include a check for LDAP authentication with the given user credentials. If LDAP authentication fails (or if the LDAP server is unavailable), it rolls back to default CONTENTdm authentication.

If LDAP authentication succeeds, it sets up standard CONTENTdm session variables as if the user was NOT logged in, but sets its own special "auth_by_ldap" session variable so that other files (including LogoutController.php) can treat the user as logged in, but restricted.


website\cdm_common\cdm\controllers\LogoutController.php

The indexAction() function was slightly modified with a single line of code that clears the "auth_by_ldap" session variable mentioned above to log out users, even if they were authenticated via LDAP.


website\cdm_common\cdm\layouts\scripts\default.phtml

The "nav_top_right" section of this page was modified to show the "Logout" link at the top right of every page when a user is logged in, even if they logged in via LDAP.

While users logged in via LDAP don't share the same privileges as those logged in through CONTENTdm, this change at least shows LDAP users that they are, in fact, logged into the site, meaning they can view BSU-restricted collections, among other privileges.

This file was also modified so that the label next to the main search box says "Search all collections" by default, and "Search this collection" when a user is viewing a particular collection.


server\conf\bsupriv.php

Custom file for keeping track of collections that can only be viewed by users logged in via LDAP. It's a simple PHP array of the alias of each collection.


website\cdm_common\cdm\models\CdmApi.php

The api_get_collection_list() function has been modified to hide collections listed in the bsupriv.php file above unless the user has been logged in via LDAP.


website\cdm_common\cdm\views\scripts\cdm\singleitem.phtml

The ITEM_VIEWER section has been altered to display in-line audio and video streamed from Mediasite. It determines if the currently viewed collection is enabled via the bsumediasite.php file below.

Also commented out code relevant to "Text Tab" and the content of that tab.


website\cdm_common\cdm\views\scripts\cdm\compoundobject.phtml

The ITEM_VIEWER section has been altered similarly to the singleitem.phtml file to display in-line media. It determines if the collection is enabled in the same way, however, metadata is stored a bit differently in compound objects, thus the code is slightly different. This only works when showing in-line media associated with the parent item of the compound object (not for each page).

Also commented out code relevant to "Text Tab" and the content of that tab.


server\conf\bsumediasite.php

Custom file for keeping track of collections that have in-line audio and video streamed from Mediasite enabled. It's a simple PHP array of the alias of each collection.


website\cdm_common\cdm\views\scripts\cdm\error.phtml

This file was heavily modified to display collection recommendations when bad collection aliases are used in the URL. The primary purpose of this is to redirect users to the appropriate pages when using outdated sub-collection aliases (such as LSTACivWar12, which used to lead to a sub-collection landing page). The file will also now suggest similarly named collections if the user only enters part of a collection alias, or if the collection aliases are 50% similar using the PHP similar_text function.


website\public_html\index.php

This file was modified to add a redirect for CardCat linking. This was required since we didn't want to mess around with the server rewrite settings, and the cdmlink.php file would no longer work for us. Instead, index.php now checks for users requesting cdmlink.php and uses the parameters in the same fashion to appropriately redirect them.

This customization will (hopefully) eventually go away after we update the links in CardCat.


website\public_html\ui\cdm\default\collection\default\viewers\videoViewer\loader.php

This file was modified to remove the built-in CONTENTdm video player since it wasn't working with most of our non-MediaSite videos. The video player was instead replaced with instructional text on how to use the Download button and special instruction for if downloading a 3D object.


Custom Pages

website\public_html\ui\custom\default\collection\default\resources\custompages\home website\public_html\ui\custom\default\collection\default\resources\custompages\contact

The files in these folders were uploaded either through the Website Configuration Tool or directly in conjunction with the WCT to create the newly designed Home Page, Contact page.