Skip to content

Commit

Permalink
refactor for theming
Browse files Browse the repository at this point in the history
  • Loading branch information
ruebot committed Apr 1, 2013
1 parent 3ecc365 commit e3a5667
Show file tree
Hide file tree
Showing 12 changed files with 329 additions and 114 deletions.
68 changes: 68 additions & 0 deletions css/islandora_video.theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
.islandora-video-content {
background-color: #F2F2F2;
border: 1px solid #ddd;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
padding: 15px;
}

.islandora-video-content img {
margin: 0;
display: block;
}

.islandora-video-metadata {
display: block;
clear: both;
}

dl.islandora-video-fields {
width: 100%;
}

.islandora-video-metadata dt {
font-weight: normal;
text-align: right;
font-weight: bold;
padding-right: 0;
}

.islandora-video-metadata dd {
padding-left: 40px;
}


.islandora-video-metadata dt,
.islandora-video-metadata dd {
border-top: 1px solid #e5e5e5;
}

.islandora-video-metadata dt.first,
.islandora-video-metadata dd.first {
border-top: 0;
}

body.two-sidebars .islandora-video-sidebar {
clear: both;
width: 100%;
}

@media all and (min-width: 768px) {

body.no-sidebars .islandora-video-content {
width: 65%;
float: left; /* LTR */
}

body.no-sidebars .islandora-video-sidebar {
padding-left: 20px;
}

body.no-sidebars .islandora-video-sidebar {
float: right; /* LTR */
width: 35%;
clear: none;
}

}
File renamed without changes
2 changes: 1 addition & 1 deletion includes/derivatives.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @param object $fedora_object
* The Tuque object to make derivatives for.
*/
function islandora_video_make_derivatives($fedora_object) {
function islandora_video_create_all_derivatives($fedora_object) {
if (!isset($fedora_object["OBJ"])) {
drupal_set_message("Could not create derivatives for %s. No file was uploaded.", array("%s" => $fedora_object->id), "error");
return FALSE;
Expand Down
61 changes: 61 additions & 0 deletions includes/video_upload.form.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

/**
* @file
*
* Handles the uploading of the video file.
*/

/**
* Defines a file upload form for uploading the islandora video.
*
* @param array $form
* The drupal form.
* @param array $form_state
* The drupal form state.
*
* @return array
* The drupal form definition.
*/
function islandora_video_upload_form(array $form, array &$form_state) {
$upload_size = min((int)ini_get('post_max_size'), (int)ini_get('upload_max_filesize'));
$extensions = array('ogg mp4 mov qt m4a avi');
return array(
'file' => array(
'#title' => t('Video'),
'#type' => 'managed_file',
'#default_value' => isset($form_state['values']['file']) ? $form_state['values']['file'] : NULL,
'description' => t('Select video to upload.<br/>Files must be less than <b>!size MB.</b><br/>Allowed file types: <b>!ext.</b>', array('!size' => $upload_size, '!ext' => $extensions[0])),
'#required' => TRUE,
'#upload_location' => 'temporary://',
'#upload_validators' => array(
'file_validate_extensions' => $extensions,
'file_validate_size' => array($upload_size * 1024 * 1024), // Assume its specified in MB
),
)
);
}

/**
* Submit handler, adds uploaded file to the video object.
*
* @param array $form
* The drupal form.
* @param array $form_state
* The drupal form state.
*/
function islandora_video_upload_form_submit(array $form, array &$form_state) {
$object = $form_state['islandora']['objects'][0];
if (empty($object['OBJ'])) {
$ds = $object->constructDatastream('OBJ', 'M');
$object->ingestDatastream($ds);
}
else {
$ds = $object['OBJ'];
}
$file = file_load($form_state['values']['file']);
$path = drupal_realpath($file->uri);
$ds->setContentFromFile($path);
$ds->label = $file->filename;
$ds->mimetype = $file->filemime;
}
7 changes: 4 additions & 3 deletions islandora_video.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name = Islandora Video Solution Pack
description = Islandora configurations for persisting and displaying video files
name = "Islandora video"
description = "A default Islandora module to handle video"
dependencies[] = islandora
package = Islandora
configure = admin/islandora/video
version = 7.x-dev
core = 7.x
configure = admin/islandora/video
stylesheets[all][] = css/islandora_video.theme.css
3 changes: 1 addition & 2 deletions islandora_video.install
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
/**
* @file
* Will attempt to ingest or purge Fedora objects when installing
* or uninstalling the module.
* islandora_video.install
*/

/**
Expand Down
Loading

0 comments on commit e3a5667

Please sign in to comment.