
david at kineticode
Feb 8, 2008, 8:41 PM
Post #3 of 3
(2495 views)
Permalink
|
|
Re: Check all button on bulk publish section
[In reply to]
|
|
Marshall, did you add something like this to dev_ajax? Best, David On Feb 8, 2008, at 15:52, Iván Chavero wrote: > I don't know if this is the correct list 'cause this is justa quick > and > dirty hack but i feel like sharing it 'cause i think it is useful. > > I'm lazy and i didn't want to manually check every category on the > bulk > publish section so i added a little javascript code to the > comp/admin/control/publish/category.html template (bricolage > 1.10.3) so > i can check or uncheck all the categories at once. > > i hope this is useful to someone and that i have chosen the right > mailing list. > > to apply this patch (don't forget to make backup copy of > category.html): > > cd bricolage/comp/admin/control/publish > patch -u category.html < category_publish_check_all.patch > > > > --------------------------------- Begin patch: > category_publish_check_all.patch > --------------------------------------------------- > > --- category.html.bak 2008-01-15 13:15:02.000000000 -0700 > +++ category.html 2008-02-08 16:59:31.000000000 -0700 > @@ -27,6 +27,47 @@ > disp => 'Publish Time', > &> > > +<!-- BEGIN Check all button --> > +<script language="Javascript"> > +<!-- > +//Checks all the checkboxes on the form called theForm > + > +function CheckAll(){ > + form = document.theForm; > + select_all = document.getElementById('select_all'); > + if(confirm("Do you really want to check all the > categories?")){ > + for(i = 0; i < form.elements.length; i++){ > + if(form.elements[i].type == "checkbox") > + form.elements[i].checked = true; > + } > + } > + select_all.value = 'Uncheck All'; > + select_all.onclick = UncheckAll; > +} > + > +//Checks all the checkboxes on the form called theForm > + > +function UncheckAll(){ > + form = document.theForm; > + select_all = document.getElementById('select_all'); > + if(confirm("Do you really want to uncheck all the > categories?")){ > + for(i = 0; i < form.elements.length; i++){ > + if(form.elements[i].type == "checkbox") > + form.elements[i].checked = false; > + } > + } > + select_all.value = 'Check All'; > + select_all.onclick = CheckAll; > +} > + > + > +--> > +</script> > + > +<br /><br /><input type="button" id="select_all" name="select_all" > value='Check All' OnClick='CheckAll()'><br /><br /> > + > +<!-- END Check all button --> > + > <p> > <& '/widgets/buttons/submit.mc', > disp => 'Publish Checked', > @@ -71,3 +112,4 @@ > return; > }; > </%once> > + > > -------------------------------------------- END patch > -------------------------------------------------
|