| 1 |
<?php |
<?php |
| 2 |
// $Id: index.admin.inc,v 1.1.2.1 2009/11/17 17:46:41 xano Exp $ |
// $Id: index.admin.inc,v 1.1.2.2 2009/11/17 19:23:38 xano Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 287 |
$lineages[] = $clicked_lineage . '-' . $count_children; |
$lineages[] = $clicked_lineage . '-' . $count_children; |
| 288 |
} |
} |
| 289 |
} |
} |
| 290 |
|
// Create layers for every known lineage, either existing or new. |
| 291 |
foreach ($lineages as $lineage) { |
foreach ($lineages as $lineage) { |
| 292 |
$lineage = (string) $lineage; |
$lineage = (string) $lineage; |
| 293 |
// Don't save this layer and its children into the index if it has been |
// Don't save this layer and its children into the index if it has been |
| 352 |
$form['layer_type_' . $layer['lineage']] = array( |
$form['layer_type_' . $layer['lineage']] = array( |
| 353 |
'#type' => 'select', |
'#type' => 'select', |
| 354 |
'#options' => $layer_entity_types_options, |
'#options' => $layer_entity_types_options, |
| 355 |
// Unconfigured elements get the first of the available values as their |
// Unconfigured layers get the first of the available values as their |
| 356 |
// default value. |
// default value. |
| 357 |
'#default_value' => !is_null($layer['entity_type']) ? $layer['entity_type'] : array_shift(array_keys($layer_entity_types_options)), |
'#default_value' => !is_null($layer['entity_type']) ? $layer['entity_type'] : array_shift(array_keys($layer_entity_types_options)), |
| 358 |
); |
); |
| 370 |
'class' => 'index-form-add-layer-child-add', |
'class' => 'index-form-add-layer-child-add', |
| 371 |
'title' => t('Add item'), |
'title' => t('Add item'), |
| 372 |
), |
), |
| 373 |
|
// By default FAPI gives every button name="op", which makes it |
| 374 |
|
// impossible to detect the clicked button if multiple buttons have the |
| 375 |
|
// same value. To fix this we configure a custom and unique name |
| 376 |
|
// (undocumented feature). |
| 377 |
'#name' => 'layer_child_add_' . $layer['lineage'], |
'#name' => 'layer_child_add_' . $layer['lineage'], |
| 378 |
); |
); |
| 379 |
$form['layer_remove_' . $layer['lineage']] = array( |
$form['layer_remove_' . $layer['lineage']] = array( |
| 384 |
'class' => 'index-form-add-layer-remove', |
'class' => 'index-form-add-layer-remove', |
| 385 |
'title' => t('Remove this item and its children'), |
'title' => t('Remove this item and its children'), |
| 386 |
), |
), |
| 387 |
|
// By default FAPI gives every button name="op", which makes it |
| 388 |
|
// impossible to detect the clicked button if multiple buttons have the |
| 389 |
|
// same value. To fix this we configure a custom and unique name |
| 390 |
|
// (undocumented feature). |
| 391 |
'#name' => 'layer_remove_' . $layer['lineage'], |
'#name' => 'layer_remove_' . $layer['lineage'], |
| 392 |
); |
); |
| 393 |
|
|