Skip to content

Commit f66aa6b

Browse files
committed
Merge github.com:omeka/plugin-ExhibitBuilder into upgrade_3.0
2 parents d04ddd3 + 2a8762b commit f66aa6b

5 files changed

Lines changed: 143 additions & 2 deletions

File tree

models/ExhibitLayout.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @license http://www.gnu.org/licenses/gpl-3.0.txt
55
* @package ExhibitBuilder
66
*/
7-
7+
88
/**
99
* Exhibit layout model.
1010
*
@@ -137,7 +137,7 @@ public static function getLayoutArray()
137137
if (self::$layouts) {
138138
return self::$layouts;
139139
}
140-
140+
141141
$defaultLayouts = array(
142142
'file-text' => array(
143143
'name' => __('File with Text'),
@@ -150,6 +150,10 @@ public static function getLayoutArray()
150150
'text' => array(
151151
'name' => __('Text'),
152152
'description' => __('Layout featuring a block of text without files')
153+
),
154+
'file' => array(
155+
'name' => __('File'),
156+
'description' => __('Layout featuring a standalone file')
153157
)
154158
);
155159

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
$formStem = $block->getFormStem();
3+
$options = $block->getOptions();
4+
?>
5+
<div class="selected-items">
6+
<h4><?php echo __('Items'); ?></h4>
7+
<?php echo $this->exhibitFormAttachments($block); ?>
8+
</div>
9+
10+
<div class="layout-options">
11+
<div class="block-header">
12+
<h4><?php echo __('Layout Options'); ?></h4>
13+
<div class="drawer"></div>
14+
</div>
15+
16+
<div class="file-position">
17+
<?php echo $this->formLabel($formStem . '[options][file-position]', __('File position')); ?>
18+
<?php
19+
echo $this->formSelect($formStem . '[options][file-position]',
20+
@$options['file-position'], array(),
21+
array('left' => __('Left'), 'right' => __('Right'), 'center' => __('Center')));
22+
?>
23+
</div>
24+
25+
<div class="file-size">
26+
<?php echo $this->formLabel($formStem . '[options][file-size]', __('File size')); ?>
27+
<?php
28+
echo $this->formSelect($formStem . '[options][file-size]',
29+
@$options['file-size'], array(),
30+
array(
31+
'fullsize' => __('Fullsize'),
32+
'thumbnail' => __('Thumbnail'),
33+
'square_thumbnail' => __('Square Thumbnail')
34+
));
35+
?>
36+
</div>
37+
38+
<div class="captions-position">
39+
<?php echo $this->formLabel($formStem . '[options][captions-position]', __('Captions position')); ?>
40+
<?php
41+
echo $this->formSelect($formStem . '[options][captions-position]',
42+
@$options['captions-position'], array(),
43+
array(
44+
'center' => __('Center'),
45+
'left' => __('Left'),
46+
'right' => __('Right')
47+
));
48+
?>
49+
</div>
50+
51+
</div>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
.layout-file .exhibit-items {
2+
width: -moz-max-content;
3+
width: -webkit-min-content;
4+
max-width: min-content;
5+
}
6+
7+
.layout-file .exhibit-items img {
8+
max-width: -moz-max-content;
9+
max-width: -webkit-max-content;
10+
max-width: max-content;
11+
}
12+
13+
.layout-file .exhibit-items > * {
14+
max-width: none;
15+
margin-bottom: 1em;
16+
}
17+
18+
.layout-file .exhibit-items > *:last-child {
19+
margin-bottom: 0;
20+
}
21+
22+
.layout-file .exhibit-items .download-file {
23+
clear: both;
24+
border-bottom: 0;
25+
overflow: visible;
26+
}
27+
28+
.layout-file .exhibit-items.left {
29+
float: left;
30+
margin-right: 2%;
31+
margin-left: 0;
32+
text-align: left;
33+
}
34+
35+
.layout-file .exhibit-items.right {
36+
float: right;
37+
margin-left: 2%;
38+
margin-right: 0;
39+
text-align: right;
40+
}
41+
42+
.layout-file .exhibit-items.center {
43+
clear: both;
44+
margin-left: auto;
45+
margin-right: auto;
46+
text-align: center;
47+
}
48+
49+
.layout-file .exhibit-items .fullsize img {
50+
max-width: 100%;
51+
margin-bottom: 1em;
52+
}
53+
54+
.layout-file .exhibit-item-caption p {
55+
margin: 0;
56+
clear: both;
57+
}
58+
59+
.layout-file .captions-center .exhibit-item-caption {
60+
text-align: center;
61+
}
62+
63+
.layout-file .captions-left .exhibit-item-caption {
64+
text-align: left;
65+
}
66+
67+
.layout-file .captions-right .exhibit-item-caption {
68+
text-align: right;
69+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
$position = isset($options['file-position'])
3+
? html_escape($options['file-position'])
4+
: 'left';
5+
$size = isset($options['file-size'])
6+
? html_escape($options['file-size'])
7+
: 'fullsize';
8+
$captionPosition = isset($options['captions-position'])
9+
? html_escape($options['captions-position'])
10+
: 'center';
11+
?>
12+
<div class="exhibit-items <?php echo $position; ?> <?php echo $size; ?> captions-<?php echo $captionPosition; ?>">
13+
<?php foreach ($attachments as $attachment): ?>
14+
<?php echo $this->exhibitAttachment($attachment, array('imageSize' => $size)); ?>
15+
<?php endforeach; ?>
16+
</div>
17+
<?php echo $text; ?>
2.48 KB
Loading

0 commit comments

Comments
 (0)