当前位置: 首页>>代码示例>>PHP>>正文


PHP csv_import_reader::get_delimiter_list方法代码示例

本文整理汇总了PHP中csv_import_reader::get_delimiter_list方法的典型用法代码示例。如果您正苦于以下问题:PHP csv_import_reader::get_delimiter_list方法的具体用法?PHP csv_import_reader::get_delimiter_list怎么用?PHP csv_import_reader::get_delimiter_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在csv_import_reader的用法示例。


在下文中一共展示了csv_import_reader::get_delimiter_list方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: definition

 function definition()
 {
     global $DB, $CFG;
     $mform = $this->_form;
     $instance = $this->_customdata;
     $cmid = $instance['cmid'];
     // Course module id goes hidden as well
     $mform->addElement('hidden', 'cmid', $cmid);
     $mform->setType('cmid', PARAM_INT);
     // Course module id goes hidden as well
     $mform->addElement('hidden', 'upload', true);
     $mform->setType('upload', PARAM_BOOL);
     $choices = csv_import_reader::get_delimiter_list();
     $mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'mod_emarking'), $choices);
     if (array_key_exists('cfg', $choices)) {
         $mform->setDefault('delimiter_name', 'cfg');
     } else {
         if (get_string('listsep', 'langconfig') == ';') {
             $mform->setDefault('delimiter_name', 'semicolon');
         } else {
             $mform->setDefault('delimiter_name', 'comma');
         }
     }
     $mform->addHelpButton('delimiter_name', 'csvdelimiter', 'mod_emarking');
     // Archivo de respuestas a procesar CSV
     $mform->addElement('filepicker', 'answersfile', get_string('answersfile', 'mod_emarking'), null, array('subdirs' => 0, 'maxbytes' => 0, 'maxfiles' => 10, 'accepted_types' => array('.csv'), 'return_types' => FILE_INTERNAL));
     $mform->addRule('answersfile', get_string('answersfileisrequired', 'mod_emarking'), 'required', null, 'client');
     $mform->setType('answersfile', PARAM_FILE);
     $mform->addHelpButton('answersfile', 'answersfile', 'mod_emarking');
     $this->add_action_buttons(true, get_string('submit'));
 }
开发者ID:hansnok,项目名称:emarking,代码行数:31,代码来源:upload_answers_form.php

示例2: definition

 /**
  * Defines the form, which will have:
  *  - Input for courses csv.
  *  - Input for users csv.
  *  - Input for logs csv.
  *  - Select for csv delimiter.
  *  - Select for files encoding.
  */
 public function definition()
 {
     $mform = $this->_form;
     $mform->addElement('header', 'settingsheader', get_string('upload', 'block_mycourse_recommendations'));
     $mform->addElement('static', 'description', '', get_string('upload_desc', 'block_mycourse_recommendations'));
     $mform->addElement('static', 'description', get_string('coursefile', 'block_mycourse_recommendations'), get_string('coursefile_desc', 'block_mycourse_recommendations'));
     $mform->addElement('filepicker', 'courses', '');
     $mform->addRule('courses', null, 'required');
     $mform->addElement('static', 'description', get_string('usersfile', 'block_mycourse_recommendations'), get_string('usersfile_desc', 'block_mycourse_recommendations'));
     $mform->addElement('filepicker', 'users', '');
     $mform->addRule('users', null, 'required');
     $mform->addElement('static', 'description', get_string('logsfile', 'block_mycourse_recommendations'), get_string('logsfile_desc', 'block_mycourse_recommendations'));
     $mform->addElement('filepicker', 'logs', '');
     $mform->addRule('logs', null, 'required');
     $choices = \csv_import_reader::get_delimiter_list();
     $mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'tool_uploaduser'), $choices);
     if (array_key_exists('cfg', $choices)) {
         $mform->setDefault('delimiter_name', 'cfg');
     } else {
         if (get_string('listsep', 'langconfig') == ';') {
             $mform->setDefault('delimiter_name', 'semicolon');
         } else {
             $mform->setDefault('delimiter_name', 'comma');
         }
     }
     $choices = \core_text::get_encodings();
     $mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
     $mform->setDefault('encoding', 'UTF-8');
     $this->add_action_buttons(false, get_string('uploaddata', 'block_mycourse_recommendations'));
 }
开发者ID:julenpardo,项目名称:moodle-block_mycourse_recommendations,代码行数:38,代码来源:import_form.php

示例3: definition

	function definition() {
		global $CFG;
		$mform = & $this->_form;
		$course = $this->_customdata['course'];
		$context = $this->_customdata['context'];

		// the upload manager is used directly in post precessing, moodleform::save_files() is not used yet
		//$this->set_upload_manager(new upload_manager('attachment'));

		$mform->addElement('header', 'general', ''); //fill in the data depending on page params
		//later using set_data
		$mform->addElement('filepicker', 'attachment', get_string('location', 'enrol_flatfile'));

		$mform->addRule('attachment', null, 'required');
		
		$choices = csv_import_reader::get_delimiter_list();
        $mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'tool_uploaduser'), $choices);
        if (array_key_exists('cfg', $choices)) {
            $mform->setDefault('delimiter_name', 'cfg');
        } else if (get_string('listsep', 'langconfig') == ';') {
            $mform->setDefault('delimiter_name', 'semicolon');
        } else {
            $mform->setDefault('delimiter_name', 'comma');
        }

        $choices = textlib::get_encodings();
        $mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
        $mform->setDefault('encoding', 'UTF-8');
		
		
        $roles = get_assignable_roles($context);
		$mform->addElement('select', 'roleassign', get_string('roleassign', 'local_mass_enroll'), $roles);
		$mform->setDefault('roleassign', 5); //student

		$ids = array (
			'idnumber' => get_string('idnumber', 'local_mass_enroll'),
			'username' => get_string('username', 'local_mass_enroll'),
			'email' => get_string('email')
		);
		$mform->addElement('select', 'firstcolumn', get_string('firstcolumn', 'local_mass_enroll'), $ids);
		$mform->setDefault('firstcolumn', 'idnumber');

		$mform->addElement('selectyesno', 'creategroups', get_string('creategroups', 'local_mass_enroll'));
		$mform->setDefault('creategroups', 1);

			$mform->addElement('selectyesno', 'creategroupings', get_string('creategroupings', 'local_mass_enroll'));
			$mform->setDefault('creategroupings', 1);


		$mform->addElement('selectyesno', 'mailreport', get_string('mailreport', 'local_mass_enroll'));
		$mform->setDefault('mailreport', 1);

		//-------------------------------------------------------------------------------
		// buttons

		$this->add_action_buttons(true, get_string('enroll', 'local_mass_enroll'));

		$mform->addElement('hidden', 'id', $course->id);
		$mform->setType('id', PARAM_INT);
	}
开发者ID:narasimhaeabyas,项目名称:tataaiapro,代码行数:60,代码来源:mass_enroll_form.php

示例4: definition

 /**
  * Form definition
  */
 public function definition()
 {
     $mform =& $this->_form;
     $course = $this->_customdata['course'];
     $config = get_config('local_mass_enroll');
     $mform->addElement('header', 'general', '');
     // Fill in the data depending on page params.
     // Later using set_data.
     $mform->addElement('filepicker', 'attachment', get_string('location', 'enrol_flatfile'));
     $mform->addRule('attachment', null, 'required');
     $choices = csv_import_reader::get_delimiter_list();
     $mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'tool_uploaduser'), $choices);
     if (array_key_exists('cfg', $choices)) {
         $mform->setDefault('delimiter_name', 'cfg');
     } else {
         if (get_string('listsep', 'langconfig') == ';') {
             $mform->setDefault('delimiter_name', 'semicolon');
         } else {
             $mform->setDefault('delimiter_name', 'comma');
         }
     }
     $choices = \core_text::get_encodings();
     $mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
     $mform->setDefault('encoding', 'UTF-8');
     $ids = array('idnumber' => get_string('idnumber', 'local_mass_enroll'), 'username' => get_string('username', 'local_mass_enroll'), 'email' => get_string('email'));
     $mform->addElement('select', 'firstcolumn', get_string('firstcolumn', 'local_mass_enroll'), $ids);
     $mform->setDefault('firstcolumn', 'idnumber');
     $mform->addElement('selectyesno', 'mailreport', get_string('mailreport', 'local_mass_enroll'));
     $mform->setDefault('mailreport', (int) $config->mailreportdefault);
     // Buttons.
     $this->add_action_buttons(true, get_string('unenroll', 'local_mass_enroll'));
     $mform->addElement('hidden', 'id', $course->id);
     $mform->setType('id', PARAM_INT);
 }
开发者ID:rogiervandongen,项目名称:moodle-local_mass_enroll,代码行数:37,代码来源:mass_unenroll_form.php

示例5: definition

 /**
  * The form's definition.
  */
 public function definition()
 {
     $mform =& $this->_form;
     $data = $this->_customdata;
     $mform->addElement('hidden', 'action', 'upload_group_data');
     $mform->setType('action', PARAM_ALPHA);
     $mform->addElement('hidden', 'id', $data['id']);
     $mform->setType('id', PARAM_INT);
     $mform->addElement('html', get_string('upload_help', 'block_upload_group'));
     $mform->addElement('header', 'upload_group_data', get_string('upload_group_data', 'block_upload_group'));
     // Add a file manager.
     $mform->addElement('filepicker', 'group_data', '');
     // Add the encoding option.
     $choices = core_text::get_encodings();
     $mform->addElement('select', 'encoding', get_string('encoding', 'block_upload_group'), $choices);
     $mform->setDefault('encoding', 'UTF-8');
     // Add the delimiter option.
     $choices = csv_import_reader::get_delimiter_list();
     $mform->addElement('select', 'delimiter', get_string('delimiter', 'block_upload_group'), $choices);
     if (array_key_exists('cfg', $choices)) {
         $mform->setDefault('delimiter_name', 'cfg');
     } else {
         if (get_string('listsep', 'langconfig') == ';') {
             $mform->setDefault('delimiter_name', 'semicolon');
         } else {
             $mform->setDefault('delimiter_name', 'comma');
         }
     }
     $choices = array('10' => 10, '20' => 20, '100' => 100, '1000' => 1000, '100000' => 100000);
     $mform->addElement('select', 'preview_num', get_string('row_preview_num', 'block_upload_group'), $choices);
     $mform->setType('preview_num', PARAM_INT);
     $this->add_action_buttons(true, get_string('submit_group_data', 'block_upload_group'));
 }
开发者ID:at-tools,项目名称:moodle-block_uploadgroups,代码行数:36,代码来源:forms.php

示例6: definition

 /**
  * The standard form definiton.
  */
 public function definition()
 {
     $mform = $this->_form;
     $selectedfields = $this->_customdata['selectedfields'];
     $overrides = $this->_customdata['overrides'];
     $fields = tool_downloaddata_processor::get_valid_course_fields();
     if (empty($selectedfields)) {
         $selectedfields = array(get_string('noselectedfields', 'tool_downloaddata'));
     }
     $mform->addElement('header', 'generalhdr', get_string('downloadcourses', 'tool_downloaddata'));
     $formatchoices = array(tool_downloaddata_processor::FORMAT_CSV => get_string('formatcsv', 'tool_downloaddata'), tool_downloaddata_processor::FORMAT_XLS => get_string('formatxls', 'tool_downloaddata'));
     $mform->addElement('select', 'format', get_string('format', 'tool_downloaddata'), $formatchoices);
     $mform->setDefault('format', $this->_customdata['format']);
     $encodings = core_text::get_encodings();
     $mform->addElement('select', 'encoding', get_string('encoding', 'tool_downloaddata'), $encodings);
     $mform->setDefault('encoding', $this->_customdata['encoding']);
     $mform->disabledIf('encoding', 'format', 'noteq', tool_downloaddata_processor::FORMAT_CSV);
     $delimiters = csv_import_reader::get_delimiter_list();
     $mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'tool_downloaddata'), $delimiters);
     $mform->setDefault('delimiter_name', $this->_customdata['delimiter_name']);
     $mform->disabledIf('delimiter_name', 'format', 'noteq', tool_downloaddata_processor::FORMAT_CSV);
     $useoverrides = array('true' => 'Yes', 'false' => 'No');
     $mform->addElement('select', 'useoverrides', get_string('useoverrides', 'tool_downloaddata'), $useoverrides);
     $mform->setDefault('useoverrides', $this->_customdata['useoverrides']);
     $mform->addHelpButton('useoverrides', 'useoverrides', 'tool_downloaddata');
     $sortbycategorypath = array('true' => 'Yes', 'false' => 'No');
     $mform->addElement('select', 'sortbycategorypath', get_string('sortbycategorypath', 'tool_downloaddata'), $sortbycategorypath);
     $mform->setDefault('sortbycategorypath', $this->_customdata['sortbycategorypath']);
     $mform->addHelpButton('sortbycategorypath', 'sortbycategorypath', 'tool_downloaddata');
     $mform->addElement('header', 'fieldshdr', get_string('fields', 'tool_downloaddata'));
     $mform->setExpanded('fieldshdr', true);
     // Creating the field selection elements.
     $objs = array();
     $objs[0] = $mform->createElement('select', 'availablefields', get_string('available', 'tool_downloaddata'), $fields, 'size="10"');
     $objs[0]->setMultiple(true);
     $objs[1] = $mform->createElement('select', 'selectedfields', get_string('selected', 'tool_downloaddata'), $selectedfields, 'size="10"');
     $objs[1]->setMultiple(true);
     $group = $mform->addElement('group', 'fieldsgroup', get_string('fields', 'tool_downloaddata'), $objs, '  ', false);
     $mform->addHelpButton('fieldsgroup', 'fields', 'tool_downloaddata');
     // Creating the buttons for the field selection elements.
     $objs = array();
     $objs[] = $mform->createElement('submit', 'addfieldselection', get_string('addfieldselection', 'tool_downloaddata'));
     $objs[] = $mform->createElement('submit', 'removefieldselection', get_string('removefieldselection', 'tool_downloaddata'));
     $objs[] = $mform->createElement('submit', 'addallfields', get_string('addallfields', 'tool_downloaddata'));
     $objs[] = $mform->createElement('submit', 'removeallfields', get_string('removeallfields', 'tool_downloaddata'));
     $group = $mform->addElement('group', 'buttonsgroup', '', $objs, array(' ', '<br/>'), false);
     $mform->addElement('header', 'overrideshdr', get_string('overrides', 'tool_downloaddata'));
     $mform->addElement('textarea', 'overrides', get_string('overrides', 'tool_downloaddata'), 'wrap="virtual" rows="3" cols="45"');
     $mform->setType('overrides', PARAM_RAW);
     $mform->setDefault('overrides', $overrides);
     $mform->addHelpButton('overrides', 'overrides', 'tool_downloaddata');
     if (empty($overrides)) {
         $mform->setExpanded('overrideshdr', false);
     } else {
         $mform->setExpanded('overrideshdr', true);
     }
     $this->add_action_buttons(false, get_string('download', 'tool_downloaddata'));
     $template = '<label class="qflabel" style="vertical-align:top">{label}</label> {element}';
     $mform->defaultRenderer()->setGroupElementTemplate($template, 'fieldsgroup');
 }
开发者ID:alexandru-elisei,项目名称:moodle-tool_downloaddata,代码行数:63,代码来源:courses_form.php

示例7: definition

 /**
  * Form definition
  */
 public function definition()
 {
     $mform = $this->_form;
     $data = (object) $this->_customdata;
     $mform->addElement('hidden', 'returnurl');
     $mform->setType('returnurl', PARAM_URL);
     $mform->addElement('header', 'cohortfileuploadform', get_string('uploadafile'));
     $filepickeroptions = array();
     $filepickeroptions['filetypes'] = '*';
     $filepickeroptions['maxbytes'] = get_max_upload_file_size();
     $mform->addElement('filepicker', 'cohortfile', get_string('file'), null, $filepickeroptions);
     $choices = csv_import_reader::get_delimiter_list();
     $mform->addElement('select', 'delimiter', get_string('csvdelimiter', 'tool_uploadcourse'), $choices);
     if (array_key_exists('cfg', $choices)) {
         $mform->setDefault('delimiter', 'cfg');
     } else {
         if (get_string('listsep', 'langconfig') == ';') {
             $mform->setDefault('delimiter', 'semicolon');
         } else {
             $mform->setDefault('delimiter', 'comma');
         }
     }
     $mform->addHelpButton('delimiter', 'csvdelimiter', 'tool_uploadcourse');
     $choices = core_text::get_encodings();
     $mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploadcourse'), $choices);
     $mform->setDefault('encoding', 'UTF-8');
     $mform->addHelpButton('encoding', 'encoding', 'tool_uploadcourse');
     $options = $this->get_context_options();
     $mform->addElement('select', 'contextid', get_string('defaultcontext', 'cohort'), $options);
     $this->add_cohort_upload_buttons(true);
     $this->set_data($data);
 }
开发者ID:evltuma,项目名称:moodle,代码行数:35,代码来源:upload_form.php

示例8: definition_expimp_settings

 /**
  *
  */
 protected function definition_expimp_settings()
 {
     $mform =& $this->_form;
     $mform->addElement('header', 'expimpsettingshdr', get_string('expimpsettings', 'dataformview_csv'));
     // Enable import  (param4).
     $mform->addElement('advcheckbox', 'param4', get_string('export', 'grades'), get_string('enable'), null, array(0, 1));
     $mform->setDefault('param4', 1);
     // Enable import  (param4).
     $mform->addElement('advcheckbox', 'param5', get_string('import'), get_string('enable'), null, array(0, 1));
     $mform->setDefault('param5', 1);
     // Allow update existing entries  (param4)
     // $mform->addElement('advcheckbox', 'updateexisting',  null, get_string('allowupdateexisting', 'dataformview_csv'), null, array(0, 1));
     // $mform->disabledIf('updateexisting', 'importenable', 'eq', 0);.
     // Delimiter.
     $delimiters = csv_import_reader::get_delimiter_list();
     $mform->addElement('select', 'delimiter', get_string('csvdelimiter', 'dataform'), $delimiters);
     $mform->setDefault('delimiter', 'comma');
     // Enclosure.
     $mform->addElement('text', 'enclosure', get_string('csvenclosure', 'dataform'), array('size' => '10'));
     $mform->setType('enclosure', PARAM_NOTAGS);
     $mform->setDefault('enclosure', '');
     // Encoding.
     $choices = core_text::get_encodings();
     $mform->addElement('select', 'encoding', get_string('encoding', 'grades'), $choices);
     $mform->setDefault('encoding', 'UTF-8');
 }
开发者ID:parksandwildlife,项目名称:learning,代码行数:29,代码来源:form.php

示例9: definition

 public function definition()
 {
     global $CFG, $USER;
     $mform =& $this->_form;
     $mform->addElement('header', 'settingsheader', get_string('upload'));
     $mform->addElement('filepicker', 'userfile', get_string('file'));
     $mform->addRule('userfile', null, 'required');
     $choices = csv_import_reader::get_delimiter_list();
     $mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'tool_uploaduser'), $choices);
     if (array_key_exists('cfg', $choices)) {
         $mform->setDefault('delimiter_name', 'cfg');
     } else {
         if (get_string('listsep', 'langconfig') == ';') {
             $mform->setDefault('delimiter_name', 'semicolon');
         } else {
             $mform->setDefault('delimiter_name', 'comma');
         }
     }
     $choices = textlib::get_encodings();
     $mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
     $mform->setDefault('encoding', 'UTF-8');
     $choices = array('10' => 10, '20' => 20, '100' => 100, '1000' => 1000, '100000' => 100000);
     $mform->addElement('select', 'previewrows', get_string('rowpreviewnum', 'tool_uploaduser'), $choices);
     $mform->setType('previewrows', PARAM_INT);
     $choices = array(UU_ADDNEW => get_string('uuoptype_addnew', 'tool_uploaduser'), UU_ADDINC => get_string('uuoptype_addinc', 'tool_uploaduser'), UU_ADD_UPDATE => get_string('uuoptype_addupdate', 'tool_uploaduser'), UU_UPDATE => get_string('uuoptype_update', 'tool_uploaduser'));
     $mform->addElement('select', 'uutype', get_string('uuoptype', 'tool_uploaduser'), $choices);
     $this->add_action_buttons(false, get_string('uploadusers', 'tool_uploaduser'));
 }
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:28,代码来源:uploaduser_form.php

示例10: definition

 function definition()
 {
     $mform = $this->_form;
     $mform->addElement('header', 'settingsheader', get_string('upload'));
     $mform->addElement('filepicker', 'userfile', get_string('file'));
     $mform->addRule('userfile', null, 'required');
     $choices = csv_import_reader::get_delimiter_list();
     $mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'tool_uploaduser'), $choices);
     if (array_key_exists('cfg', $choices)) {
         $mform->setDefault('delimiter_name', 'cfg');
     } else {
         if (get_string('listsep', 'langconfig') == ';') {
             $mform->setDefault('delimiter_name', 'semicolon');
         } else {
             $mform->setDefault('delimiter_name', 'comma');
         }
     }
     $choices = core_text::get_encodings();
     $mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
     $mform->setDefault('encoding', 'UTF-8');
     $choices = array('10' => 10, '20' => 20, '100' => 100, '1000' => 1000, '100000' => 100000);
     $mform->addElement('select', 'previewrows', get_string('rowpreviewnum', 'tool_uploaduser'), $choices);
     $mform->setType('previewrows', PARAM_INT);
     $this->add_action_buttons(false, get_string('uploadusers', 'tool_uploaduser'));
 }
开发者ID:janeklb,项目名称:moodle,代码行数:25,代码来源:user_form.php

示例11: definition

 function definition() {
     global $CFG;
     $mform =& $this->_form;
     $mform->addElement('header', 'notice', get_string('chooseexportformat', 'data'));
     $choices = csv_import_reader::get_delimiter_list();
     $key = array_search(';', $choices);
     if (! $key === FALSE) {
         // array $choices contains the semicolon -> drop it (because its encrypted form also contains a semicolon):
         unset($choices[$key]);
     }
     $typesarray = array();
     $str = get_string('csvwithselecteddelimiter', 'data');
     $typesarray[] = $mform->createElement('radio', 'exporttype', null, $str . '&nbsp;', 'csv');
     $typesarray[] = $mform->createElement('select', 'delimiter_name', null, $choices);
     //temporarily commenting out Excel export option. See MDL-19864
     //$typesarray[] = $mform->createElement('radio', 'exporttype', null, get_string('excel', 'data'), 'xls');
     $typesarray[] = $mform->createElement('radio', 'exporttype', null, get_string('ods', 'data'), 'ods');
     $mform->addGroup($typesarray, 'exportar', '', array(''), false);
     $mform->addRule('exportar', null, 'required');
     $mform->setDefault('exporttype', 'csv');
     if (array_key_exists('cfg', $choices)) {
         $mform->setDefault('delimiter_name', 'cfg');
     } else if (get_string('listsep', 'langconfig') == ';') {
         $mform->setDefault('delimiter_name', 'semicolon');
     } else {
         $mform->setDefault('delimiter_name', 'comma');
     }
     $mform->addElement('header', 'notice', get_string('chooseexportfields', 'data'));
     foreach($this->_datafields as $field) {
         if($field->text_export_supported()) {
             $html = '<div title="' . s($field->field->description) . '" ' .
                     'class="d-inline-block">' . $field->field->name . '</div>';
             $name = ' (' . $field->name() . ')';
             $mform->addElement('advcheckbox', 'field_' . $field->field->id, $html, $name, array('group' => 1));
             $mform->setDefault('field_' . $field->field->id, 1);
         } else {
             $a = new stdClass();
             $a->fieldtype = $field->name();
             $str = get_string('unsupportedexport', 'data', $a);
             $mform->addElement('static', 'unsupported' . $field->field->id, $field->field->name, $str);
         }
     }
     $this->add_checkbox_controller(1, null, null, 1);
     $context = context_module::instance($this->_cm->id);
     if (has_capability('mod/data:exportuserinfo', $context)) {
         $mform->addElement('checkbox', 'exportuser', get_string('includeuserdetails', 'data'));
     }
     $mform->addElement('checkbox', 'exporttime', get_string('includetime', 'data'));
     if ($this->_data->approval) {
         $mform->addElement('checkbox', 'exportapproval', get_string('includeapproval', 'data'));
     }
     $this->add_action_buttons(true, get_string('exportentries', 'data'));
 }
开发者ID:EsdrasCaleb,项目名称:moodle,代码行数:53,代码来源:export_form.php

示例12: definition

 function definition()
 {
     global $CFG;
     $mform =& $this->_form;
     $mform->addElement('header', 'notice', get_string('chooseexportformat', 'data'));
     $choices = csv_import_reader::get_delimiter_list();
     $key = array_search(';', $choices);
     if (!$key === FALSE) {
         // array $choices contains the semicolon -> drop it (because its encrypted form also contains a semicolon):
         unset($choices[$key]);
     }
     $typesarray = array();
     $typesarray[] =& MoodleQuickForm::createElement('radio', 'exporttype', null, get_string('csvwithselecteddelimiter', 'data') . '&nbsp;', 'csv');
     $typesarray[] =& MoodleQuickForm::createElement('select', 'delimiter_name', null, $choices);
     $typesarray[] =& MoodleQuickForm::createElement('radio', 'exporttype', null, get_string('excel', 'data'), 'xls');
     $typesarray[] =& MoodleQuickForm::createElement('radio', 'exporttype', null, get_string('ods', 'data'), 'ods');
     $mform->addGroup($typesarray, 'exportar', '', array(''), false);
     $mform->addRule('exportar', null, 'required');
     $mform->setDefault('exporttype', 'csv');
     if (array_key_exists('cfg', $choices)) {
         $mform->setDefault('delimiter_name', 'cfg');
     } else {
         if (get_string('listsep') == ';') {
             $mform->setDefault('delimiter_name', 'semicolon');
         } else {
             $mform->setDefault('delimiter_name', 'comma');
         }
     }
     $mform->addElement('header', 'notice', get_string('chooseexportfields', 'data'));
     foreach ($this->_datafields as $field) {
         if ($field->text_export_supported()) {
             $mform->addElement('advcheckbox', 'field_' . $field->field->id, '<div title="' . s($field->field->description) . '">' . $field->field->name . '</div>', ' (' . $field->name() . ')', array('group' => 1));
             $mform->setDefault('field_' . $field->field->id, 1);
         } else {
             $a = new object();
             $a->fieldtype = $field->name();
             $mform->addElement('static', 'unsupported' . $field->field->id, $field->field->name, get_string('unsupportedexport', 'data', $a));
         }
     }
     $this->add_checkbox_controller(1, null, null, 1);
     require_once $CFG->libdir . '/portfoliolib.php';
     if (has_capability('mod/data:exportallentries', get_context_instance(CONTEXT_MODULE, $this->_cm->id))) {
         if ($portfoliooptions = portfolio_instance_select(portfolio_instances(), call_user_func(array('data_portfolio_caller', 'supported_formats')), 'data_portfolio_caller', '', true, true)) {
             $mform->addElement('header', 'notice', get_string('portfolionotfile', 'data') . ':');
             $portfoliooptions[0] = get_string('none');
             ksort($portfoliooptions);
             $mform->addElement('select', 'portfolio', get_string('portfolio', 'portfolio'), $portfoliooptions);
         }
     }
     $this->add_action_buttons(true, get_string('exportdatabaserecords', 'data'));
 }
开发者ID:ajv,项目名称:Offline-Caching,代码行数:51,代码来源:export_form.php

示例13: definition

 function definition()
 {
     global $CFG;
     $mform =& $this->_form;
     $mform->addElement('header', 'notice', get_string('chooseexportformat', 'data'));
     $choices = csv_import_reader::get_delimiter_list();
     $key = array_search(';', $choices);
     if (!$key === FALSE) {
         // array $choices contains the semicolon -> drop it (because its encrypted form also contains a semicolon):
         unset($choices[$key]);
     }
     $typesarray = array();
     $typesarray[] =& MoodleQuickForm::createElement('radio', 'exporttype', null, get_string('csvwithselecteddelimiter', 'data') . '&nbsp;', 'csv');
     $typesarray[] =& MoodleQuickForm::createElement('select', 'delimiter_name', null, $choices);
     $typesarray[] =& MoodleQuickForm::createElement('radio', 'exporttype', null, get_string('excel', 'data'), 'xls');
     $typesarray[] =& MoodleQuickForm::createElement('radio', 'exporttype', null, get_string('ods', 'data'), 'ods');
     $mform->addGroup($typesarray, 'exportar', '', array(''), false);
     $mform->addRule('exportar', null, 'required');
     $mform->setDefault('exporttype', 'csv');
     if (array_key_exists('cfg', $choices)) {
         $mform->setDefault('delimiter_name', 'cfg');
     } else {
         if (get_string('listsep', 'langconfig') == ';') {
             $mform->setDefault('delimiter_name', 'semicolon');
         } else {
             $mform->setDefault('delimiter_name', 'comma');
         }
     }
     $mform->addElement('header', 'notice', get_string('chooseexportfields', 'data'));
     foreach ($this->_datafields as $field) {
         if ($field->text_export_supported()) {
             $mform->addElement('advcheckbox', 'field_' . $field->field->id, '<div title="' . s($field->field->description) . '">' . $field->field->name . '</div>', ' (' . $field->name() . ')', array('group' => 1));
             $mform->setDefault('field_' . $field->field->id, 1);
         } else {
             $a = new stdClass();
             $a->fieldtype = $field->name();
             $mform->addElement('static', 'unsupported' . $field->field->id, $field->field->name, get_string('unsupportedexport', 'data', $a));
         }
     }
     $this->add_checkbox_controller(1, null, null, 1);
     $this->add_action_buttons(true, get_string('exportentries', 'data'));
 }
开发者ID:esyacelga,项目名称:sisadmaca,代码行数:42,代码来源:export_form.php

示例14: definition

 function definition()
 {
     global $CFG;
     $mform =& $this->_form;
     $cmid = $this->_customdata['id'];
     $mform->addElement('filepicker', 'recordsfile', get_string('csvfile', 'data'));
     $delimiters = csv_import_reader::get_delimiter_list();
     $mform->addElement('select', 'fielddelimiter', get_string('fielddelimiter', 'data'), $delimiters);
     $mform->setDefault('fielddelimiter', 'comma');
     $mform->addElement('text', 'fieldenclosure', get_string('fieldenclosure', 'data'));
     $textlib = textlib_get_instance();
     $choices = $textlib->get_encodings();
     $mform->addElement('select', 'encoding', get_string('encoding', 'admin'), $choices);
     $mform->setDefault('encoding', 'UTF-8');
     $submit_string = get_string('submit');
     // data id
     $mform->addElement('hidden', 'd');
     $mform->setType('d', PARAM_INT);
     $this->add_action_buttons(false, $submit_string);
 }
开发者ID:vuchannguyen,项目名称:web,代码行数:20,代码来源:import_form.php

示例15: definition

	function definition() {
		global $CFG;
		$mform = & $this->_form;

		//$mform->addElement('header', 'general', get_string('bulkenrol','block_learning_plan')); //fill in the data depending on page params
		//later using set_data
		$mform->addElement('filepicker', 'attachment', get_string('location', 'enrol_flatfile'));

		$mform->addRule('attachment', null, 'required');
		
		$choices = csv_import_reader::get_delimiter_list();
        $mform->addElement('select', 'delimiter_name', get_string('csvdelimiter', 'tool_uploaduser'), $choices);
        if (array_key_exists('cfg', $choices)) {
            $mform->setDefault('delimiter_name', 'cfg');
        } else if (get_string('listsep', 'langconfig') == ';') {
            $mform->setDefault('delimiter_name', 'semicolon');
        } else {
            $mform->setDefault('delimiter_name', 'comma');
        }

        $choices = textlib::get_encodings();
        $mform->addElement('select', 'encoding', get_string('encoding', 'tool_uploaduser'), $choices);
        $mform->setDefault('encoding', 'UTF-8');

         $mform->addElement('hidden','roleassign');
		$mform->setDefault('roleassign', 5); //student
		$mform->setType('roleassign','int');
		$ids = array (
			'username' => get_string('username', 'local_mass_enroll'),
			'idnumber' => get_string('idnumber', 'local_mass_enroll'),
			'email' => get_string('email')
		);
		$mform->addElement('select', 'firstcolumn', get_string('firstcolumn', 'block_learning_plan'), $ids);
		$mform->setDefault('firstcolumn', 'username');

		//$mform->addElement('selectyesno', 'mailreport', get_string('mailreport', 'local_mass_enroll'));
		//$mform->setDefault('mailreport', 1);

		$this->add_action_buttons(true, get_string('enroll_lp', 'block_learning_plan'));
	}
开发者ID:narasimhaeabyas,项目名称:tataaiapro,代码行数:40,代码来源:bulk_enroll_form.php


注:本文中的csv_import_reader::get_delimiter_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。