| 1 | <?php // For backwards compatibility reasons it is best to implement these as before and after partials ?> |
|---|
| 2 | <?php // rather than a wrapper partial. If we use a wrapper that passes on each variable individually to an inner partial, ?> |
|---|
| 3 | <?php // it will break as new variables are added. If we had used a single $params array as the only variable ?> |
|---|
| 4 | <?php // in the first place, we could have avoided this, but we didn't, so let's be backwards compatible with all ?> |
|---|
| 5 | <?php // of the existing overrides of _browser in our sites and those of others. ?> |
|---|
| 6 | |
|---|
| 7 | <?php include_partial('aMedia/browserBefore') ?> |
|---|
| 8 | |
|---|
| 9 | <?php use_helper('Url') ?> |
|---|
| 10 | |
|---|
| 11 | <div id="a-subnav" class="a-media-subnav subnav"> |
|---|
| 12 | <div class="subnav-wrapper"> |
|---|
| 13 | |
|---|
| 14 | <h3>Find in Media</h3> |
|---|
| 15 | |
|---|
| 16 | <form method="POST" action="<?php echo url_for(aUrl::addParams($current, array("search" => false))) ?>" class="a-search-form media" id="a-search-form-sidebar"> |
|---|
| 17 | <?php echo isset($search) ? link_to('Clear Search', aUrl::addParams($current, array('search' => '')), array('id' => 'a-media-search-remove', 'title' => 'Clear Search', )) : '' ?> |
|---|
| 18 | <?php echo $searchForm['search']->render() ?> |
|---|
| 19 | <input width="29" type="image" height="20" title="Click to Search" alt="Search" src="/apostrophePlugin/images/a-special-blank.gif" value="Submit" class="a-search-submit submit" id="a-media-search-submit" /> |
|---|
| 20 | </form> |
|---|
| 21 | |
|---|
| 22 | <div class="a-media-filters"> |
|---|
| 23 | |
|---|
| 24 | <h3>Media Types</h3> |
|---|
| 25 | |
|---|
| 26 | <ul class="a-media-filter-options"> |
|---|
| 27 | <?php $type = isset($type) ? $type : '' ?> |
|---|
| 28 | <li class="a-media-filter-option"> |
|---|
| 29 | <?php echo link_to('Image', aUrl::addParams($current, array('type' => ($type == 'image') ? '' : 'image')), array('class' => ($type=='image') ? 'selected' : '', )) ?> |
|---|
| 30 | </li> |
|---|
| 31 | <li class="a-media-filter-option"> |
|---|
| 32 | <?php echo link_to('Video', aUrl::addParams($current, array('type' => ($type == 'video') ? '' : 'video')), array('class' => ($type=='video') ? 'selected' : '', )) ?> |
|---|
| 33 | </li> |
|---|
| 34 | <li class="a-media-filter-option"> |
|---|
| 35 | <?php echo link_to('PDF', aUrl::addParams($current, array('type' => ($type == 'pdf') ? '' : 'pdf')), array('class' => ($type=='pdf') ? 'selected' : '', )) ?> |
|---|
| 36 | </li> |
|---|
| 37 | </ul> |
|---|
| 38 | |
|---|
| 39 | <div class="a-tag-sidebar"> |
|---|
| 40 | |
|---|
| 41 | <?php if (isset($selectedTag)): ?> |
|---|
| 42 | <h4 class="a-tag-sidebar-title selected-tag">Selected Tag</h4> |
|---|
| 43 | <ul class="a-tag-sidebar-selected-tags"> |
|---|
| 44 | <li class="selected"> |
|---|
| 45 | <?php echo link_to(htmlspecialchars($selectedTag), aUrl::addParams($current, array("tag" => false)), array('class' => 'selected',)) ?> |
|---|
| 46 | </li> |
|---|
| 47 | </ul> |
|---|
| 48 | <?php endif ?> |
|---|
| 49 | |
|---|
| 50 | <h3 class="a-tag-sidebar-title popular">Popular Tags</h3> |
|---|
| 51 | <ul class="a-tag-sidebar-list popular"> |
|---|
| 52 | <?php foreach ($popularTags as $tag => $count): ?> |
|---|
| 53 | <li><a href="<?php echo url_for(aUrl::addParams($current, array("tag" => $tag))) ?>"><span class="a-tag-sidebar-tag"><?php echo htmlspecialchars($tag) ?></span> <span class="a-tag-sidebar-tag-count"><?php echo $count ?></span></a></li> |
|---|
| 54 | <?php endforeach ?> |
|---|
| 55 | </ul> |
|---|
| 56 | |
|---|
| 57 | <h3 class="a-tag-sidebar-title all-tags">All Tags</h3> |
|---|
| 58 | <ul class="a-tag-sidebar-list all-tags"> |
|---|
| 59 | <?php foreach ($allTags as $tag => $count): ?> |
|---|
| 60 | <li><a href="<?php echo url_for(aUrl::addParams($current, array("tag" => $tag))) ?>"><span class="a-tag-sidebar-tag"><?php echo htmlspecialchars($tag) ?></span> <span class="a-tag-sidebar-tag-count"><?php echo $count ?></span></a></li> |
|---|
| 61 | <?php endforeach ?> |
|---|
| 62 | </ul> |
|---|
| 63 | |
|---|
| 64 | </div> |
|---|
| 65 | |
|---|
| 66 | </div> |
|---|
| 67 | |
|---|
| 68 | </div> |
|---|
| 69 | </div> |
|---|
| 70 | |
|---|
| 71 | <script type="text/javascript" charset="utf-8"> |
|---|
| 72 | |
|---|
| 73 | aInputSelfLabel('#a-media-search', <?php echo json_encode(isset($search) ? $search : 'Search') ?>); |
|---|
| 74 | |
|---|
| 75 | <?php if (isset($search)): ?> |
|---|
| 76 | $('#a-media-search-remove').show(); |
|---|
| 77 | $('#a-media-search-submit').hide(); |
|---|
| 78 | var search = <?php echo json_encode($search) ?>; |
|---|
| 79 | $('#a-media-search').bind("keyup blur", function(e) |
|---|
| 80 | { |
|---|
| 81 | if ($(this).val() === search) |
|---|
| 82 | { |
|---|
| 83 | $('#a-media-search-remove').show(); |
|---|
| 84 | $('#a-media-search-submit').hide(); |
|---|
| 85 | } |
|---|
| 86 | else |
|---|
| 87 | { |
|---|
| 88 | $('#a-media-search-remove').hide(); |
|---|
| 89 | $('#a-media-search-submit').show(); |
|---|
| 90 | } |
|---|
| 91 | }); |
|---|
| 92 | |
|---|
| 93 | $('#a-media-search').bind('aInputSelfLabelClear', function(e) { |
|---|
| 94 | $('#a-media-search-remove').show(); |
|---|
| 95 | $('#a-media-search-submit').hide(); |
|---|
| 96 | }); |
|---|
| 97 | <?php endif ?> |
|---|
| 98 | |
|---|
| 99 | var allTags = $('.a-tag-sidebar-title.all-tags'); |
|---|
| 100 | |
|---|
| 101 | allTags.hover(function(){ |
|---|
| 102 | allTags.addClass('over'); |
|---|
| 103 | },function(){ |
|---|
| 104 | allTags.removeClass('over'); |
|---|
| 105 | }); |
|---|
| 106 | |
|---|
| 107 | allTags.click(function(){ |
|---|
| 108 | allTags.toggleClass('open'); |
|---|
| 109 | allTags.next().toggle(); |
|---|
| 110 | }) |
|---|
| 111 | |
|---|
| 112 | </script> |
|---|
| 113 | |
|---|
| 114 | <?php include_partial('aMedia/browserAfter') ?> |
|---|