Commit 139b6849 authored by icc's avatar icc

Added hook for sorting content fields via cck.

Imported some minor design changes from h5peditor.
parent 8f3715af
......@@ -3,3 +3,4 @@ nbproject/project.properties
nbproject/project.xml
library/.gitignore
modules/h5peditor/h5peditor/.gitignore
*~
......@@ -116,6 +116,7 @@ function h5p_form(&$node, $form_state) {
'#type' => 'file',
'#title' => t('HTML 5 Package'),
'#description' => t('Select a .h5p file to upload and create interactive content from.'),
'#weight' => 2,
);
$form['json_content'] = array(
......@@ -603,3 +604,18 @@ function theme_h5p_export_button($path) {
drupal_add_css($module_path . '/styles/h5p.css');
return '<a class="h5p-export" href="' . $path . '">' . t('Download') . '</a>';
}
/**
* Implementation of hook_content_extra_fields().
*/
function h5p_content_extra_fields($type_name) {
$extra = array();
if ($type_name == 'h5p_content') {
$extra['h5p'] = array(
'label' => t('H5P Upload'),
'description' => t('Upload interactive content.'),
'weight' => 0,
);
}
return $extra;
}
......@@ -69,17 +69,14 @@ function h5peditor_form_h5p_content_node_form_alter(&$form, &$form_state) {
'create' => isset($node->nid) ? t('Edit') : t('Create'),
),
'#default_value' => 'upload',
'#weight' => 10,
'#weight' => $form['h5p']['#weight'] - 1,
);
$form['h5p']['#title'] = t('HTML5 Package Upload');
$form['h5p']['#weight'] = 11;
$form['h5p_editor'] = array(
'#type' => 'item',
'#title' => t('Content type'),
'#value' => '<div class="h5p-editor">' . t('Waiting for javascript...') . '</div>',
'#weight' => 12,
'#weight' => $form['h5p']['#weight'],
);
$form['#after_build'][] = 'h5peditor_h5p_content_node_form_after_build';
......@@ -349,4 +346,24 @@ function h5peditor_get_source_node($node) {
$node = node_load($node->clone_from_original_nid);
}
return $node;
}
\ No newline at end of file
}
/**
* Implementation of hook_content_extra_fields().
*/
function h5peditor_content_extra_fields($type_name) {
$extra = array();
if ($type_name == 'h5p_content') {
$extra['h5p_type'] = array(
'label' => t('H5P Action'),
'description' => t('Choose whether to upload or create/edit content.'),
'weight' => 0,
);
$extra['h5p_editor'] = array(
'label' => t('H5P Editor'),
'description' => t('Create or edit interactive content.'),
'weight' => 0,
);
}
return $extra;
}
@import "compass/css3/border-radius";
@import "compass/css3/box-shadow";
@import "compass/css3/opacity";
@import "compass/css3/text-shadow";
$fa: H5PFontAwesome4;
......@@ -96,6 +97,8 @@ $fa: H5PFontAwesome4;
font-family: $fa;
content: "\f057";
color: #666;
}
& > .remove:hover:after {
......@@ -109,6 +112,7 @@ $fa: H5PFontAwesome4;
font-family: $fa;
content: "\f0dc";
color: #666;
}
&:hover:after {
......@@ -212,8 +216,12 @@ $fa: H5PFontAwesome4;
float: left;
margin: 7px 8px 0 0;
}
.h5p-errors {
clear: both;
}
.file {
position: relative;
float: left;
.thumbnail {
display: inline-block;
......@@ -234,11 +242,24 @@ $fa: H5PFontAwesome4;
width: 14px;
height: 14px;
position: absolute;
top: 10px;
left: 10px;
top: 13px;
right: 16px;
cursor: pointer;
border: 1px solid #fff;
background: inline-image("remove.png");
}
.remove:before {
font-family: $fa;
font-size: 1.2em;
color: #fff;
content: "\f057";
@include opacity(0.8);
@include text-shadow(rgba(black, 0.4) 0 0 4px, rgba(black, 0.4) 0 0 4px, rgba(black, 0.4) 0 0 4px);
}
.remove:hover {
text-decoration: none;
}
.remove:hover:before {
@include opacity(1);
color: #c33f62;
}
img {
vertical-align: bottom;
......@@ -258,8 +279,8 @@ $fa: H5PFontAwesome4;
cursor: auto;
}
.remove {
top: -1px;
left: -1px;
top: 2px;
right: 5px;
}
.type {
padding: 16px 8px 4px;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment