| 5 |
$form = array( |
$form = array( |
| 6 |
'#tree' => TRUE, |
'#tree' => TRUE, |
| 7 |
); |
); |
|
|
|
| 8 |
// We'll manually set the #parents property of these fields so that |
// We'll manually set the #parents property of these fields so that |
| 9 |
// their values appear in the $form_state['values']['choice'] array. |
// their values appear in the $form_state['values']['choice'] array. |
| 10 |
$form['chid'] = array( |
$form['chid'] = array( |
| 91 |
|
|
| 92 |
// We name our button 'poll_more' to avoid conflicts with other modules using |
// We name our button 'poll_more' to avoid conflicts with other modules using |
| 93 |
// AJAX-enabled buttons with the id 'more'. |
// AJAX-enabled buttons with the id 'more'. |
| 94 |
$form['gallery_wrapper']['fg_more'] = array( |
//TODO: this still needs some work.... |
| 95 |
|
/*$form['gallery_wrapper']['fg_more'] = array( |
| 96 |
'#type' => 'submit', |
'#type' => 'submit', |
| 97 |
'#value' => t('Add gallery'), |
'#value' => t('Add gallery'), |
| 98 |
'#description' => t("If the amount of boxes above isn't enough, click here to add more choices."), |
'#description' => t("If the amount of boxes above isn't enough, click here to add more choices."), |
| 104 |
'method' => 'replace', |
'method' => 'replace', |
| 105 |
'effect' => 'fade', |
'effect' => 'fade', |
| 106 |
), |
), |
| 107 |
); |
);*/ |
| 108 |
|
|
| 109 |
$form['fg_setup'] = array( |
$form['fg_setup'] = array( |
| 110 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 116 |
$engines = module_invoke_all('fast_gallery_info'); |
$engines = module_invoke_all('fast_gallery_info'); |
| 117 |
|
|
| 118 |
$ar_engines = array(); |
$ar_engines = array(); |
| 119 |
foreach ($engines['storageengine'] as $key => $engine) { |
foreach ($engines['storageengine'] as $engine) { |
| 120 |
$ar_engines[$key] = $engine['name']; |
$ar_engines[$engine['key']] = $engine['name']; |
| 121 |
} |
} |
| 122 |
|
|
| 123 |
$form['fg_setup']['fg_storage_engine'] = array( |
$form['fg_setup']['fg_storage_engine'] = array( |
| 252 |
$ar_galleries[$gallery['fg_path']] = $gallery; |
$ar_galleries[$gallery['fg_path']] = $gallery; |
| 253 |
} |
} |
| 254 |
} |
} |
| 255 |
variable_set('fg_galleries', $ar_galleries); |
variable_set('fg_galleries', $ar_galleries); //save the galleries |
| 256 |
|
|
| 257 |
menu_rebuild(); |
$engines = module_invoke_all('fast_gallery_info'); |
| 258 |
|
variable_set('fg_storage_engine', $engines['storageengine'][$form_state['values']['fg_storage_engine']]); //save the storageengine |
| 259 |
|
|
| 260 |
|
menu_rebuild();//prepare the paths for newly built galleries |
| 261 |
} |
} |
| 262 |
|
|
| 263 |
|
/** |
| 264 |
|
* Ajax handler when hitting some of the buttons |
| 265 |
|
* @param $form |
| 266 |
|
* @param $form_state |
| 267 |
|
*/ |
| 268 |
function fast_gallery_ajax_handler($form, $form_state) { |
function fast_gallery_ajax_handler($form, $form_state) { |
| 269 |
$fg = fast_gallery_get_FastGallery(); |
$fg = fast_gallery_get_FastGallery(); |
| 270 |
|
|