Révision ed9a13f1
Ajouté par Assos Assos il y a presque 4 ans
drupal7/sites/all/modules/feeds/feeds.pages.inc | ||
---|---|---|
89 | 89 |
if ($source->importer->config['import_on_create']) { |
90 | 90 |
$submit = t('Import'); |
91 | 91 |
if ($source->importer->config['process_in_background']) { |
92 |
// When processing the import in background, the import job is put in the queue. |
|
92 |
// When processing the import in background, the import job is put in the |
|
93 |
// queue. |
|
93 | 94 |
$submit = t('Schedule import'); |
94 | 95 |
} |
95 | 96 |
} |
... | ... | |
105 | 106 |
$submit = t('Save'); |
106 | 107 |
} |
107 | 108 |
|
108 |
$form['submit'] = array( |
|
109 |
$form['actions'] = array('#type' => 'actions'); |
|
110 |
$form['actions']['submit'] = array( |
|
109 | 111 |
'#type' => 'submit', |
110 | 112 |
'#value' => $submit, |
111 | 113 |
); |
... | ... | |
113 | 115 |
// Disable submit button if import is initiated. |
114 | 116 |
$progress = $source->progressImporting(); |
115 | 117 |
if ($progress !== FEEDS_BATCH_COMPLETE) { |
116 |
$form['submit']['#disabled'] = TRUE; |
|
117 |
$form['submit']['#value'] = |
|
118 |
t('Importing (@progress %)', array('@progress' => number_format(100 * $progress, 0))); |
|
118 |
$form['actions']['submit']['#disabled'] = TRUE; |
|
119 |
$form['actions']['submit']['#value'] = t('Importing (@progress %)', array( |
|
120 |
'@progress' => number_format(100 * $progress, 0), |
|
121 |
)); |
|
119 | 122 |
|
120 | 123 |
// Check if import task is queued. |
121 | 124 |
if ($source->isQueued()) { |
... | ... | |
196 | 199 |
$progress = $source->progressImporting(); |
197 | 200 |
if ($progress !== FEEDS_BATCH_COMPLETE) { |
198 | 201 |
$form['actions']['submit']['#disabled'] = TRUE; |
199 |
$form['actions']['submit']['#value'] = |
|
200 |
t('Importing (@progress %)', array('@progress' => number_format(100 * $progress, 0))); |
|
202 |
$form['actions']['submit']['#value'] = t('Importing (@progress %)', array( |
|
203 |
'@progress' => number_format(100 * $progress, 0), |
|
204 |
)); |
|
201 | 205 |
|
202 | 206 |
// Check if import task is queued. |
203 | 207 |
if ($source->isQueued()) { |
... | ... | |
258 | 262 |
$progress = $source->progressClearing(); |
259 | 263 |
if ($progress !== FEEDS_BATCH_COMPLETE) { |
260 | 264 |
$form['actions']['submit']['#disabled'] = TRUE; |
261 |
$form['actions']['submit']['#value'] = |
|
262 |
t('Deleting (@progress %)', array('@progress' => number_format(100 * $progress, 0))); |
|
265 |
$form['actions']['submit']['#value'] = t('Deleting (@progress %)', array( |
|
266 |
'@progress' => number_format(100 * $progress, 0), |
|
267 |
)); |
|
263 | 268 |
$form['source_status']['#value'] .= t('Run cron to continue the deletion of items.'); |
264 | 269 |
} |
265 | 270 |
|
... | ... | |
352 | 357 |
} |
353 | 358 |
|
354 | 359 |
/** |
355 |
* Template generation |
|
360 |
* Template generation.
|
|
356 | 361 |
*/ |
357 | 362 |
function feeds_importer_template(FeedsImporter $importer) { |
358 | 363 |
if ($importer->parser instanceof FeedsCSVParser) { |
... | ... | |
390 | 395 |
$items = array(); |
391 | 396 |
if ($v['progress_importing']) { |
392 | 397 |
$progress = number_format(100.0 * $v['progress_importing'], 0); |
393 |
$items[] = t('Importing - @progress % complete.', array('@progress' => $progress)); |
|
398 |
$items[] = t('Importing - @progress % complete.', array( |
|
399 |
'@progress' => $progress, |
|
400 |
)); |
|
394 | 401 |
} |
395 | 402 |
if ($v['progress_clearing']) { |
396 | 403 |
$progress = number_format(100.0 * $v['progress_clearing'], 0); |
397 |
$items[] = t('Deleting items - @progress % complete.', array('@progress' => $progress)); |
|
404 |
$items[] = t('Deleting items - @progress % complete.', array( |
|
405 |
'@progress' => $progress, |
|
406 |
)); |
|
398 | 407 |
} |
399 | 408 |
if (!count($items)) { |
400 | 409 |
if ($v['count']) { |
401 | 410 |
if ($v['imported']) { |
402 |
$items[] = t('Last import: @ago ago.', array('@ago' => format_interval(REQUEST_TIME - $v['imported'], 1))); |
|
411 |
$items[] = t('Last import: @ago ago.', array( |
|
412 |
'@ago' => format_interval(REQUEST_TIME - $v['imported'], 1), |
|
413 |
)); |
|
403 | 414 |
} |
404 |
$items[] = t('@count imported items total.', array('@count' => $v['count'])); |
|
415 |
$items[] = t('@count imported items total.', array( |
|
416 |
'@count' => $v['count'], |
|
417 |
)); |
|
405 | 418 |
} |
406 | 419 |
else { |
407 | 420 |
$items[] = t('No imported items.'); |
... | ... | |
455 | 468 |
$summary .= l($file->filename, $wrapper->getExternalUrl()); |
456 | 469 |
} |
457 | 470 |
else { |
458 |
$summary .= t('URI scheme %scheme not available.', array('%scheme' => file_uri_scheme($uri))); |
|
471 |
$summary .= t('URI scheme %scheme not available.', array( |
|
472 |
'%scheme' => file_uri_scheme($uri), |
|
473 |
)); |
|
459 | 474 |
} |
460 | 475 |
$summary .= '</div>'; |
461 | 476 |
$summary .= '<div class="file-size">'; |
Formats disponibles : Unified diff
Weekly update of contrib modules