mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-07 09:13:02 +02:00
feature 408: ability to automatically sort sub-categories. The number of SQL
queries is constant, no matter the deepth of your tree. + refactor to avoid duplicate code (ascending/desceding should be only a single parameter in a function, not 20 lines of duplicated code) git-svn-id: http://piwigo.org/svn/trunk@6698 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -69,6 +69,11 @@ TABLE.plugins ul.pluginsActions {
|
||||
TABLE.plugins ul.pluginsActions li { display: inline; }
|
||||
|
||||
/* categoryOrdering */
|
||||
FORM#categoryOrdering .orderParams {
|
||||
line-height:30px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
|
||||
SELECT.categoryList {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
document.getElementsByName('catOrd[' + cat[1] + ']')[0].value = i;
|
||||
}
|
||||
});
|
||||
|
||||
jQuery("input[name=order_type]").click(function () {ldelim}
|
||||
jQuery("#automatic_order_params").hide();
|
||||
if (jQuery("input[name=order_type]:checked").val() == "automatic") {ldelim}
|
||||
jQuery("#automatic_order_params").show();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -39,12 +46,21 @@
|
||||
|
||||
{if count($categories) }
|
||||
<form id="categoryOrdering" action="{$F_ACTION}" method="post">
|
||||
<p>
|
||||
<input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
|
||||
<input type="hidden" name="pwg_token" value="{$PWG_TOKEN}">
|
||||
|
||||
<div class="orderParams">
|
||||
<input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED}>
|
||||
<input class="submit" name="submitOrderAlphaNum" type="submit" value="{'Order alphanumerically'|@translate}" {$TAG_INPUT_ENABLED}>
|
||||
<input class="submit" name="submitOrderAlphaNumReverse" type="submit" value="{'Order alphanumerically reverse'|@translate}" {$TAG_INPUT_ENABLED}>
|
||||
</p>
|
||||
<label><input type="radio" name="order_type" value="manual" checked="checked"> {'manual order'|@translate}</label>
|
||||
<label><input type="radio" name="order_type" value="automatic"> {'automatic order'|@translate}</label>
|
||||
<span id="automatic_order_params" style="display:none">
|
||||
<select name="ascdesc">
|
||||
<option value="asc">{'ascending'|@translate}</option>
|
||||
<option value="desc">{'descending'|@translate}</option>
|
||||
</select>
|
||||
<label><input type="checkbox" name="recursive"> {'apply to sub-categories'|@translate}</label>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ul class="categoryUl">
|
||||
|
||||
{foreach from=$categories item=category}
|
||||
@@ -85,11 +101,5 @@
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
<p>
|
||||
<input class="submit" name="submitOrder" type="submit" value="{'Save order'|@translate}" {$TAG_INPUT_ENABLED}>
|
||||
<input class="submit" name="submitOrderAlphaNum" type="submit" value="{'Order alphanumerically'|@translate}" {$TAG_INPUT_ENABLED}>
|
||||
<input class="submit" name="submitOrderAlphaNumReverse" type="submit" value="{'Order alphanumerically reverse'|@translate}" {$TAG_INPUT_ENABLED}>
|
||||
</p>
|
||||
|
||||
</form>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user