Sorry to bring up a three year old thread.
I'm now on Links v.3.2.0 and love the new Ajax method of selecting the categories when adding a link i.e. I have db_gen_category_list set to generate the fancy Ajax category tree.
I already have in each of the 4,000 categories the variable: 'Can_add' with Yes or No to restrict users from adding their link (legacy from Links v.2.2)
I have added these tags into two places (at a guess) to restrict the categories shown into the template 'include_form.html', but this has no affect on the Ajax tree. Could anybody help? Below is a cut from the relevant part of the 'include_form.html';
Code:
<div class="row<%unless category_loop_selected%> required<%endunless%> clear">
<label for="CatLinks.CategoryID" class="name">Category:<%unless category_loop_selected%> <span>*</span><%endunless%></label>
<div class="value wrappedtext">
<%~if config.db_gen_category_list == 2%>
<script type="text/javascript" src="<%config.build_static_url%>/treecats.js"></script>
<%~set selected_cats = Links::Tools::category_list_selected%>
<%~loop selected_cats%>
<input type="hidden" name="CatLinks.CategoryID" value="<%escape_html ID%>" />
<%~endloop%>
<noscript>
<ul class="categories">
<%~loop selected_cats%>
<li><%Full_Name%></li>
<%~endloop%>
<%~if not selected_cats.length%>
<li><%Links::language('ADD_SELCAT')%></li>
<%~endif%>
</ul>
</noscript>
<div id="treecats"></div>
<script type="text/javascript">
var tc = new treecats({ <%-- selectionMode : 'multiple', --%> cgiURL : '<%config.db_cgi_url%>', imageURL : '<%config.build_static_url%>/<%t%>/images' });
tc.load();
</script>
<%~elsif category_loop_selected%>
<%~if category_loop.length > 1%>
<ul class="categories"><%loop category_loop%><li><%Full_Name%><input type="hidden" name="CatLinks.CategoryID" value="<%escape_html ID%>" /></li><%endloop%></ul>
<%~else%>
<%if Can_add eq 'Yes'%> <%loop category_loop%><%Full_Name%><input type="hidden" name="CatLinks.CategoryID" value="<%escape_html ID%>" /><%endloop%>
<%endif%> <%~endif%>
<%~else%>
<select id="CatLinks.CategoryID" name="CatLinks.CategoryID">
<%~loop category_loop%>
<%if Can_add eq 'Yes'%> <option value="<%escape_html ID%>"<%if selected%> selected="selected"<%endif%>><%' ' x $CatDepth%><%Name%></option>
<%endif%> <%~endloop%>
</select>
<%~endif%>
</div>
</div>