function tripal_stock_sync_form
1.x tripal_stock.sync_stocks.inc | tripal_stock_sync_form() |
1 string reference to 'tripal_stock_sync_form'
- tripal_stock_menu in tripal_stock/
tripal_stock.module - Implements hook_menu(): Adds menu items for the tripal_stock
File
- tripal_stock/
includes/ tripal_stock.sync_stocks.inc, line 38 - @todo Add file header description
Code
function tripal_stock_sync_form() {
$form['description'] = array(
'#type' => 'item',
'#value' => t("Stocks of the types listed " .
"below in the Stock Types box will be synced (leave blank to sync all types). You may limit the " .
"stocks to be synced by a specific organism. Depending on the " .
"number of stocks in the chado database this may take a long " .
"time to complete. "),
);
$form['stock_types'] = array(
'#title' => t('Stock Types'),
'#type' => 'textarea',
'#description' => t("Enter the names of the stock types to sync. " .
"Leave blank to sync all stocks. Pages for these stock " .
"types will be created automatically for stocks that exist in the " .
"chado database. The names listed here should be spearated by " .
"spaces or entered separately on new lines. The names must match " .
"exactly (spelling and case) with terms in the sequence ontology"),
'#default_value' => variable_get('chado_sync_stock_types', ''),
);
// get the list of organisms
$sql = "SELECT * FROM {organism} ORDER BY genus, species";
$orgs = tripal_organism_get_synced();
$organisms[] = '';
foreach ($orgs as $organism) {
$organisms[$organism->organism_id] = "$organism->genus $organism->species ($organism->common_name)";
}
$form['organism_id'] = array(
'#title' => t('Organism'),
'#type' => t('select'),
'#description' => t("Choose the organism for which stocks types set above will be synced. Only organisms which also have been synced will appear in this list."),
'#options' => $organisms,
);
$form['button'] = array(
'#type' => 'submit',
'#value' => t('Sync all Stocks'),
'#weight' => 3,
);
return $form;
}