Text Formatted Code
function plugin_initconfig_jquery()
{
global $_CONF, $_JQ_DEFAULT;
$c = config::get_instance();
if (!$c->group_exists('jquery')) {
//This is main subgroup #0
$c->add('sg_0', NULL, 'subgroup', 0, 0, NULL, 0, true, 'jquery');
//This is fieldset #1 in subgroup #0
$c->add('fs_02', NULL, 'fieldset', 0, 1, NULL, 0, true, 'jquery');
$c->add('use_lightbox', $_JQ_DEFAULT['use_lightbox'],
'select', 0, 1, 3, 10, true, 'jquery');
$c->add('use_feedback', $_JQ_DEFAULT['use_feedback'],
'select', 0, 1, 3, 20, true, 'jquery');
$c->add('use_codehighlighter', $_JQ_DEFAULT['use_codehighlighter'],
'select', 0, 1, 3, 30, true, 'jquery');
$c->add('use_ckeditor', $_JQ_DEFAULT['use_ckeditor'],
'select', 0, 1, 3, 40, true, 'jquery');
//This is fieldset #2 in subgroup #0
$c->add('fs_03', NULL, 'fieldset', 0, 2, NULL, 100, true, 'jquery');
$c->add('lightbox_width', $_JQ_DEFAULT['lightbox_width'],
'text', 0, 2, 0, 110, true, 'jquery');
$c->add('lightbox_height', $_JQ_DEFAULT['lightbox_height'],
'text', 0, 2, 0, 120, true, 'jquery');
}
return true;
}
This works like it is suppose to: 2 fieldsets are created with configuration variables in each one.
Now if I want to update the jquery plugin I use in plugin_upgrade_jquery function:
Text Formatted Code
case '1.2':
$c = config::get_instance();
$c->add('fs_03', NULL, 'fieldset', 0, 2, NULL, 100, true, 'jquery');
$c->add('lightbox_width', $_JQ_DEFAULT['lightbox_width'],
'text', 0, 2, 0, 110, true, 'jquery');
$c->add('lightbox_height', $_JQ_DEFAULT['lightbox_height'],
'text', 0, 2, 0, 120, true, 'jquery');
and this code insert my configuration variables "lightbox_width" and "lightbox_height" in the fieldset #1 and fieldset#2 is not created :banghead:
Text Formatted Code
case '1.2':
$c = config::get_instance();
$c->add('fs_03', NULL, 'fieldset', 0, 0, NULL, 100, true, 'jquery');
$c->add('lightbox_width', $_JQ_DEFAULT['lightbox_width'],
'text', 0, 0, 0, 110, true, 'jquery');
$c->add('lightbox_height', $_JQ_DEFAULT['lightbox_height'],
'text', 0, 0, 0, 120, true, 'jquery');
The second fieldset is created with the 2 configuration variables but is before the fieldset #1 in the config