To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

root/plugins/apostrophePlugin/trunk/modules/aSlideshowSlot/templates/_normalView.php @ 829

Revision 829, 2.2 KB (checked in by johnnyoffline, 3 years ago)

Moved Area Delete Buttons to the top right away from the other a-controls. I turned the button into the flagging button so conserve on space. I created a really awesome placeholder div for slideshow slots. The width and the height degrade gracefully. If W and H are set in the template, it creates a placeholder that same size. If only a W is set, it creates a 16:9 box because that's a typical image size, if for some insane reason there are no W or H parameters, it sets the W to 100% (of its parent container) and the H to 100px so there is atleast SOMETHING output. I used a label for it that is already translated but the text could change to be anything really

Line 
1<?php use_helper('I18N') ?>
2<?php if ($editable): ?>
3  <?php // Normally we have an editor inline in the page, but in this ?>
4  <?php // case we'd rather use the picker built into the media plugin. ?>
5  <?php // So we link to the media picker and specify an 'after' URL that ?>
6  <?php // points to our slot's edit action. Setting the ajax parameter ?>
7  <?php // to false causes the edit action to redirect to the newly ?>
8  <?php // updated page. ?>
9
10  <?php slot("a-slot-controls-$pageid-$name-$permid") ?>
11    <li class="a-controls-item choose-images">
12    <?php echo link_to(__('Choose images', null, 'apostrophe'),
13      'aMedia/select',
14      array(
15        'query_string' => 
16          http_build_query(
17            array_merge(
18              $options['constraints'],
19              array("multiple" => true,
20              "aMediaIds" => implode(",", $itemIds),
21              "type" => "image",
22              "label" => __("Create a Slideshow", null, 'apostrophe'),
23              "after" => url_for("aSlideshowSlot/edit") . "?" . 
24                http_build_query(
25                  array(
26                    "slot" => $name, 
27                    "slug" => $slug, 
28                    "permid" => $permid,
29                    "actual_slug" => aTools::getRealPage()->getSlug(),
30                    "noajax" => 1))))),
31        'class' => 'a-btn icon a-media')) ?>
32    </li>
33
34                <?php include_partial('a/variant', array('pageid' => $pageid, 'name' => $name, 'permid' => $permid, 'slot' => $slot)) ?>
35               
36  <?php end_slot() ?>
37
38<?php endif ?>
39
40<?php if (count($items)): ?>
41        <?php include_component('aSlideshowSlot', 'slideshow', array('items' => $items, 'id' => $id, 'options' => $options)) ?>
42<?php else: ?>
43
44        <?php (isset($options['width']))?  $style = 'width:' .  $options['width'] .'px;': $style = 'width:100%;'; ?>
45        <?php (isset($options['height']))? $height = $options['height'] : $height = (($options['width'])? floor($options['width']*.56):'100'); ?>               
46        <?php $style .= 'height:'.$height.'px;' ?>
47       
48        <div class="a-slideshow-placeholder" style="<?php echo $style ?>">
49                <span style="line-height:<?php echo $height ?>px;"><?php echo __("Create a Slideshow", null, 'apostrophe') ?></span>
50        </div>
51<?php endif ?>
52
Note: See TracBrowser for help on using the browser.