i've been creating an admin panel for the related-items plugin in 1.8 and encountered an issue with storing and retrieving settings which use an array.
i need to list the active subtypes in the system and allow the admins to check one or more of them and for this list of selected subtypes to be stored in the plugin's settings.
i looked at the view-counter plugin as this already contains a solution for this issue and copied the code.. what occurred was that the list of valid subtypes and checkboxes showed correctly but the values are not being stored or retrieved for the plugin (as with the other plugin setting variables).
my present version of this uses the elgg-checkboxes view (which view-counter does not use) and i still have the same problem.
echo elgg_view('input/checkboxes',array(
'name'=>'params[selectfrom_subtypes]',
'value'=>$selectfrom_subtypes,
'options'=>$valid_types ,
'align'=>'horizontal',
'default' => ''));
with this version, the checkboxes are not set for the values that are passed in the array (selectfrom_subtypes) - this part was manually coded in the views-counter plugin..
so i'm looking for people who know how the checkboxes view is intended to be used and/or people who just know what i'm missing to point me in the right direction here.
anyone? thanks
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ura soul@tunist
ura soul - 0 likes
- ura soul@tunist
ura soul - 0 likes
- iionly@iionly
iionly - 0 likes
- ura soul@tunist
ura soul - 0 likes
You must log in to post replies.i notice in the auto-sitemap plugin that this is coded using the elgg checkboxes view.. using a hidden field.. but the comments are in spanish (i believe) and i'm not so sure what is being done or how the variables flow from code area to code area.
ok i've solved this now.. using javascript that appears in the auto-sitemap plugin..
Could you post your solution? It might help others.
the code of the solution is a bit long to post here.. anyone looking to resolve this can see my code in the related-items 1.8 plugin -> the settings.php page is where i used it, there is jquery code at the bottom that processes the checkbox items.