| 1 |
<?php |
<?php |
| 2 |
// $Id$ |
// $Id: l10n_packager.admin.inc,v 1.1.2.1 2009/11/11 18:21:01 goba Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 108 |
'#title' => t('Project translations'), |
'#title' => t('Project translations'), |
| 109 |
'#description' => t('Repackage all translations of a single project or release.'), |
'#description' => t('Repackage all translations of a single project or release.'), |
| 110 |
); |
); |
| 111 |
|
|
| 112 |
|
$projects = l10n_community_get_projects(); |
| 113 |
$form['projects']['project'] = array( |
$form['projects']['project'] = array( |
| 114 |
'#title' => t('Project'), |
'#title' => t('Project'), |
|
'#type' => 'textfield', |
|
|
'#autocomplete_path' => 'translate/projects/autocomplete', |
|
|
'#description' => t('Type the name of a project, eg. Drupal.'), |
|
| 115 |
'#required' => TRUE, |
'#required' => TRUE, |
| 116 |
); |
); |
| 117 |
|
if (($count = count($projects)) <= 30) { |
| 118 |
|
// Radio box widget for as much as 5 projects, select widget for 5-30 projects. |
| 119 |
|
$form['projects']['project']['#type'] = ($count <= 5 ? 'radios' : 'select'); |
| 120 |
|
$form['projects']['project']['#options'] = array(); |
| 121 |
|
foreach ($projects as $project) { |
| 122 |
|
// Title used to conform to the autocomplete behavior. |
| 123 |
|
$form['projects']['project']['#options'][$project->title] = $project->title; |
| 124 |
|
} |
| 125 |
|
} |
| 126 |
|
else { |
| 127 |
|
// Autocomplete field for more then 30 projects. |
| 128 |
|
$form['projects']['project'] += array( |
| 129 |
|
'#type' => 'textfield', |
| 130 |
|
'#autocomplete_path' => 'translate/projects/autocomplete', |
| 131 |
|
); |
| 132 |
|
} |
| 133 |
|
|
| 134 |
$form['projects']['release'] = array( |
$form['projects']['release'] = array( |
| 135 |
'#title' => t('Release'), |
'#title' => t('Release'), |
| 136 |
'#type' => 'textfield', |
'#type' => 'textfield', |