Basic view.php
From CONTENTdm Users Wiki
- The title of this article should be basic_view.php. The initial letter is capitalized and an underscore is substituted or omitted because of technical restrictions.
basic_view.php controls the display of items that are not basic images (jpeg, tiff, jp2, etc. TODO: find the real definition). Basic images get the pan and zoom controls and are handled in pan_view.php basic_view.php is in the includes file and is called by compare_viewer.php, item_viewer.php, slideshow_viewer.php and viewer.php.
[edit] Basic structure
The basics of editing basic_view.php to allow a new special type are as follows: (This applies to version 4.2, I recall it being slightly different in 4.1, but not greatly so.) Find the line that says "switch($thisfile)" There are three cases to this switch statement. In other words basic_view.php behaves differently based on which file included it.
case "slideshow_viewer.php":
So far I have ignored this. I think the slide show is part of the my favorites feature.
case "doc_viewer.php":
This case applies to compound objects. In version 4.1 the compound object case referred to viewer.php
default: In version 4.2 the default case handles individual items. In version 4.1 individual items are handled by case "item_viewer.php": and there is no default case.
Inside each case there is an if else statement that differentiates the different types of items. You can make your differentiation based on the name of the file, stored in $filename, based on some item metadata, or anything else.
You can see that pdf files are already handled differently than other types of items.
In order to have a new special type of item you probably want to make changes in both the compound object case, and the individual item case.

