Add download param to exaple links

pull/2778/head
Angel Fernando Quiroz Campos 7 years ago
parent b9a23a307f
commit adadcb50e9
  1. 2
      main/admin/skills_import.php
  2. 4
      main/admin/user_import.php
  3. 2
      main/admin/usergroup_import.php
  4. 12
      main/gradebook/lib/fe/dataform.class.php
  5. 3
      main/group/import.php
  6. 16
      main/mySpace/user_import.php
  7. 4
      main/session/session_import.php

@ -196,7 +196,7 @@ $group[] = $form->createElement(
'radio',
'file_type',
'',
'CSV (<a href="skill_example.csv" target="_blank">'.get_lang('ExampleCSVFile').'</a>)',
'CSV (<a href="skill_example.csv" target="_blank" download>'.get_lang('ExampleCSVFile').'</a>)',
'csv'
);
$form->addGroup($group, '', get_lang('FileType'));

@ -467,14 +467,14 @@ $group = [
'radio',
'file_type',
'',
'CSV (<a href="example.csv" target="_blank">'.get_lang('ExampleCSVFile').'</a>)',
'CSV (<a href="example.csv" target="_blank" download>'.get_lang('ExampleCSVFile').'</a>)',
'csv'
),
$form->createElement(
'radio',
'file_type',
null,
'XML (<a href="example.xml" target="_blank">'.get_lang('ExampleXMLFile').'</a>)',
'XML (<a href="example.xml" target="_blank" download>'.get_lang('ExampleXMLFile').'</a>)',
'xml'
),
];

@ -100,7 +100,7 @@ $group[] = $form->createElement(
'radio',
'file_type',
'',
'CSV (<a href="example_class.csv" target="_blank">'.get_lang('ExampleCSVFile').'</a>)',
'CSV (<a href="example_class.csv" target="_blank" download>'.get_lang('ExampleCSVFile').'</a>)',
'csv'
);
$form->addGroup($group, '', get_lang('FileType'), null);

@ -107,8 +107,16 @@ class DataForm extends FormValidator
$this->addElement('hidden', 'formSent');
$this->addElement('header', get_lang('ImportFileLocation'));
$this->addElement('file', 'import_file', get_lang('Location'));
$this->addElement('radio', 'file_type', get_lang('FileType'), 'CSV (<a href="docs/example_csv.html" target="_blank">'.get_lang('ExampleCSVFile').'</a>)', 'csv');
//$this->addElement('radio', 'file_type', null, 'XML (<a href="docs/example_xml.html" target="_blank">'.get_lang('ExampleXMLFile').'</a>)', 'xml');
$this->addElement(
'radio',
'file_type',
get_lang('FileType'),
'CSV (<a href="docs/example_csv.html" target="_blank" download>'
.get_lang('ExampleCSVFile')
.'</a>)',
'csv'
);
//$this->addElement('radio', 'file_type', null, 'XML (<a href="docs/example_xml.html" target="_blank" download>'.get_lang('ExampleXMLFile').'</a>)', 'xml');
$this->addElement('checkbox', 'overwrite', null, get_lang('OverwriteScores'));
$this->addElement('checkbox', 'ignoreerrors', null, get_lang('IgnoreErrors'));
$this->addButtonImport(get_lang('Ok'));

@ -38,7 +38,8 @@ $form->addElement(
null,
Display::url(
get_lang('ExampleCSVFile'),
api_get_path(WEB_CODE_PATH).'group/example.csv'
api_get_path(WEB_CODE_PATH).'group/example.csv',
['download' => true]
)
);
$form->addButtonImport(get_lang('Import'));

@ -112,8 +112,20 @@ $form->addElement('file', 'import_file', get_lang('ImportFileLocation'));
$form->addRule('import_file', get_lang('ThisFieldIsRequired'), 'required');
$allowed_file_types = ['xml', 'csv'];
$form->addRule('import_file', get_lang('InvalidExtension').' ('.implode(',', $allowed_file_types).')', 'filetype', $allowed_file_types);
$form->addElement('radio', 'file_type', get_lang('FileType'), 'XML (<a href="../admin/example.xml" target="_blank">'.get_lang('ExampleXMLFile').'</a>)', 'xml');
$form->addElement('radio', 'file_type', null, 'CSV (<a href="../admin/example.csv" target="_blank">'.get_lang('ExampleCSVFile').'</a>)', 'csv');
$form->addElement(
'radio',
'file_type',
get_lang('FileType'),
'XML (<a href="../admin/example.xml" target="_blank" download>'.get_lang('ExampleXMLFile').'</a>)',
'xml'
);
$form->addElement(
'radio',
'file_type',
null,
'CSV (<a href="../admin/example.csv" target="_blank" download>'.get_lang('ExampleCSVFile').'</a>)',
'csv'
);
$form->addElement('radio', 'sendMail', get_lang('SendMailToUsers'), get_lang('Yes'), 1);
$form->addElement('radio', 'sendMail', null, get_lang('No'), 0);
$form->addElement('submit', 'submit', get_lang('Ok'));

@ -482,7 +482,7 @@ $form->addElement(
Display::url(
get_lang('ExampleCSVFile'),
api_get_path(WEB_CODE_PATH).'admin/example_session.csv',
['target' => '_blank']
['target' => '_blank', 'download' => null]
),
],
'CSV',
@ -496,7 +496,7 @@ $form->addElement(
Display::url(
get_lang('ExampleXMLFile'),
api_get_path(WEB_CODE_PATH).'admin/example_session.xml',
['target' => '_blank']
['target' => '_blank', 'download' => null]
),
],
'XML',

Loading…
Cancel
Save