Skip to content

Commit e05a189

Browse files
author
danh
committedOct 10, 2012
Enabled collection reordering by default, as it is 'generally useful'.
$collection_reorder_caption is now deprecated and $collection_commenting should be used to enabled commenting (the old config option will contiue to work for legacy config support). Disabled the infobox while reordering, as it looked a bit strange. git-svn-id: http://svn.resourcespace.org/svn/resourcespace@3810 c08608d7-6e46-0410-86ca-f2a6f1370df5
1 parent 0b07057 commit e05a189

File tree

3 files changed

+49
-37
lines changed

3 files changed

+49
-37
lines changed
 

‎include/config.default.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,7 @@
579579
# An alternative mode for the InfoBox, that displays the preview image instead of any metadata.
580580
$infobox_image_mode=false;
581581

582-
583-
# Reordering, captioning and ranking of collections (deprecated)
582+
# Enable captioning and ranking of collections (deprecated - use $collection_commenting instead)
584583
$collection_reorder_caption=false;
585584

586585
# Enable new-style collection sorting

‎lib/js/infobox_collection.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*
66
*--------------------------------------------------------------------------*/
77

8+
var InfoBoxEnabled=true;
89
var InfoBoxWaiting=false;
910
var InfoBoxVisible=false;
1011
var InfoBoxRef=0;
@@ -14,6 +15,7 @@ var InfoBoxTimer=false;
1415

1516
function InfoBoxMM(event)
1617
{
18+
if (!InfoBoxEnabled) {return false;}
1719
var i=document.getElementById('InfoBoxCollection');
1820
if (!i) {return false;} // no object? ignore for now
1921

@@ -63,7 +65,7 @@ function InfoBoxMM(event)
6365
if ((InfoBoxRef!=0) && (InfoBoxWaiting==false) && (InfoBoxVisible==false))
6466
{
6567
if (InfoBoxTimer) {window.clearTimeout(InfoBoxTimer);}
66-
window.setTimeout('InfoBoxAppear()',1200);
68+
InfoBoxTimer=window.setTimeout('InfoBoxAppear()',1200);
6769
InfoBoxWaiting=true;
6870
}
6971
}
@@ -75,6 +77,7 @@ function InfoBoxSetResource(ref)
7577

7678
function InfoBoxAppear()
7779
{
80+
if (!InfoBoxEnabled) {return false;}
7881
// Make sure we are still waiting for a box to appear and that the mouse has not yet moved.
7982
if ((InfoBoxWaiting) && (InfoBoxRef!=0))
8083
{

‎pages/collections.php

+44-34
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
$allow_reorder=true;
5454
}
5555

56-
# Include function for reordering / infobox
57-
if (($allow_reorder && $collection_reorder_caption) || $infobox || $use_checkboxes_for_selection || $collections_compact_style)
56+
# Reordering capability
57+
if ($allow_reorder)
5858
{
5959
# Also check for the parameter and reorder as necessary.
6060
$reorder=getvalescaped("reorder",false);
@@ -133,19 +133,25 @@
133133
hook("postchangecollection");
134134
}
135135

136+
?>
137+
<script src="<?php echo $baseurl?>/lib/js/jquery-1.7.2.min.js?css_reload_key=<?php echo $css_reload_key?>" type="text/javascript"></script>
138+
<script src="<?php echo $baseurl?>/lib/js/jquery-ui-1.8.20.custom.min.js?css_reload_key=<?php echo $css_reload_key?>" type="text/javascript"></script>
139+
<!--[if lte IE 7]><script src="<?php echo $baseurl?>/lib/js/json2.js?css_reload_key=<?php echo $css_reload_key?>" type="text/javascript"></script><![endif]-->
140+
<script type="text/javascript">
141+
jQuery.noConflict();
142+
</script>
143+
144+
<?php if ($infobox)
145+
{
146+
?>
147+
<script src="../lib/js/infobox_collection.js" type="text/javascript"></script>
148+
<?php
149+
}
136150

137151
# Include function for reordering / infobox
138-
if (($allow_reorder && $collection_reorder_caption) || $infobox || $use_checkboxes_for_selection || $collections_compact_style)
152+
if ($allow_reorder)
139153
{
140154
?>
141-
<script src="<?php echo $baseurl?>/lib/js/jquery-1.7.2.min.js?css_reload_key=<?php echo $css_reload_key?>" type="text/javascript"></script>
142-
<script src="<?php echo $baseurl?>/lib/js/jquery-ui-1.8.20.custom.min.js?css_reload_key=<?php echo $css_reload_key?>" type="text/javascript"></script>
143-
<!--[if lte IE 7]><script src="<?php echo $baseurl?>/lib/js/json2.js?css_reload_key=<?php echo $css_reload_key?>" type="text/javascript"></script><![endif]-->
144-
<script type="text/javascript">
145-
jQuery.noConflict();
146-
</script>
147-
148-
<script src="../lib/js/infobox_collection.js" type="text/javascript"></script>
149155
<script type="text/javascript">
150156
function ReorderResources(idsInOrder)
151157
{
@@ -164,8 +170,16 @@ function ReorderResources(idsInOrder)
164170
jQuery(document).ready(function() {
165171
jQuery('#CollectionSpace').sortable({
166172
items: ".CollectionPanelShell",
167-
handle: ".IconReorder",
168-
stop: function(event, ui) {
173+
174+
start: function (event, ui)
175+
{
176+
InfoBoxEnabled=false;
177+
if (jQuery('#InfoBoxCollection')) {jQuery('#InfoBoxCollection').hide();}
178+
},
179+
180+
stop: function(event, ui)
181+
{
182+
InfoBoxEnabled=true;
169183
var idsInOrder = jQuery('#CollectionSpace').sortable("toArray");
170184
ReorderResources(idsInOrder);
171185
}
@@ -673,37 +687,33 @@ function ToggleThumbs()
673687
<?php } ?>
674688

675689
<?php if ($k=="") { ?><div class="CollectionPanelInfo">
676-
<?php if (($feedback) || (($collection_reorder_caption || $collection_commenting) && $allow_reorder)) { ?>
690+
<?php if (($feedback) || (($collection_reorder_caption || $collection_commenting))) { ?>
677691
<span class="IconComment <?php if ($result[$n]["commentset"]>0) { ?>IconCommentAnim<?php } ?>"><a target="main" href="collection_comment.php?ref=<?php echo $ref?>&collection=<?php echo $usercollection?>"><img src="../gfx/interface/sp.gif" alt="" width="14" height="12" /></a></span>
678692
<?php } ?>
679693

680-
<?php if ($collection_reorder_caption && $allow_reorder) { ?>
681-
<div class="IconReorder" onMouseDown="InfoBoxWaiting=false;"> </div>
682-
<?php if (!hook("replaceremovelink")){?>
683-
<span class="IconRemove"><a href="collections.php?remove=<?php echo $ref?>&nc=<?php echo time()?>"><img src="../gfx/interface/sp.gif" alt="" width="14" height="12" /></a></span>
684-
<?php } //end hook replaceremovelink ?>
685-
<?php } else {
686-
if (!isset($cinfo['savedsearch'])||(isset($cinfo['savedsearch'])&&$cinfo['savedsearch']==null)){ // add 'remove' link only if this is not a smart collection
694+
<?php if (!isset($cinfo['savedsearch'])||(isset($cinfo['savedsearch'])&&$cinfo['savedsearch']==null)){ // add 'remove' link only if this is not a smart collection
687695
?>
688696
<?php if (!hook("replaceremovelink")){?>
689697
<a href="collections.php?remove=<?php echo $ref?>&nc=<?php echo time()?>">x <?php echo $lang["action-remove"]?></a>
690-
<?php } //end hook replaceremovelink ?>
691-
<?php } ?>
692-
<?php } ?>
693-
</div><?php } ?>
698+
<?php
699+
} //end hook replaceremovelink
700+
} # End of remove link condition
701+
} # End of k="" condition
702+
?>
703+
</div>
694704
</div>
695-
<?php } ?>
696705
<?php
697-
}
698-
}
706+
} # End of ResourceView hook
707+
} # End of loop through resources
708+
} # End of results condition
699709

700-
# Plugin for additional collection listings (deprecated)
701-
if (file_exists("plugins/collection_listing.php")) {include "plugins/collection_listing.php";}
710+
# Plugin for additional collection listings (deprecated)
711+
if (file_exists("plugins/collection_listing.php")) {include "plugins/collection_listing.php";}
702712

703-
hook("thumblistextra");
704-
?>
705-
</div>
706-
<?php
713+
hook("thumblistextra");
714+
?>
715+
</div>
716+
<?php
707717

708718
# Add the infobox.
709719
?>

0 commit comments

Comments
 (0)