ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilCSVWriter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilCSVWriter:

Public Member Functions

 setSeparator (string $a_sep)
 
 setDelimiter (string $a_del)
 
 addRow ()
 
 addColumn (string $a_col)
 
 getCSVString ()
 

Private Member Functions

 quote (string $a_str)
 

Private Attributes

string $csv = ''
 
string $separator = ','
 
string $delimiter = '"'
 
string $new_line = "\n"
 
bool $first_entry = true
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 of file class.ilCSVWriter.php.

Member Function Documentation

◆ addColumn()

ilCSVWriter::addColumn ( string  $a_col)

Definition at line 43 of file class.ilCSVWriter.php.

References $delimiter, $separator, and quote().

Referenced by ilSumScoreTableGUI\fillHeaderCSV(), ilSCORMTrackingItemsTableGUI\fillHeaderCSV(), ilSCORM2004TrackingItemsTableGUI\fillHeaderCSV(), ilLPProgressTableGUI\fillHeaderCSV(), ilTrObjectUsersPropsTableGUI\fillHeaderCSV(), ilTrUserObjectsPropsTableGUI\fillHeaderCSV(), ilTrMatrixTableGUI\fillHeaderCSV(), ilBookingReservationsTableGUI\fillHeaderCSV(), ilTrSummaryTableGUI\fillHeaderCSV(), ilTable2GUI\fillHeaderCSV(), ilLPTableBaseGUI\fillMetaCSV(), ilSumScoreTableGUI\fillRowCSV(), ilPollAnswerTableGUI\fillRowCSV(), ilPollUserTableGUI\fillRowCSV(), ilSCORMTrackingItemsTableGUI\fillRowCSV(), ilSCORM2004TrackingItemsTableGUI\fillRowCSV(), ILIAS\MyStaff\ListCompetences\Skills\ilMStListCompetencesSkillsTableGUI\fillRowCSV(), ILIAS\MyStaff\ListCertificates\ilMStListCertificatesTableGUI\fillRowCSV(), ilMStShowUserCoursesTableGUI\fillRowCSV(), ilLPObjectStatisticsTypesTableGUI\fillRowCSV(), ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\fillRowCSV(), ilMStListCoursesTableGUI\fillRowCSV(), ilLPObjectStatisticsDailyTableGUI\fillRowCSV(), ilLPObjectStatisticsTableGUI\fillRowCSV(), ilLPProgressTableGUI\fillRowCSV(), ilTrObjectUsersPropsTableGUI\fillRowCSV(), ilTrUserObjectsPropsTableGUI\fillRowCSV(), ilTrMatrixTableGUI\fillRowCSV(), ilBookingReservationsTableGUI\fillRowCSV(), ilTrSummaryTableGUI\fillRowCSV(), and ilTable2GUI\fillRowCSV().

43  : void
44  {
45  if (!$this->first_entry) {
46  $this->csv .= $this->separator;
47  }
48  $this->csv .= $this->delimiter;
49  $this->csv .= $this->quote($a_col);
50  $this->csv .= $this->delimiter;
51  $this->first_entry = false;
52  }
quote(string $a_str)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addRow()

ilCSVWriter::addRow ( )

Definition at line 37 of file class.ilCSVWriter.php.

References $new_line.

Referenced by ilSCORMTrackingItemsTableGUI\fillHeaderCSV(), ilSCORM2004TrackingItemsTableGUI\fillHeaderCSV(), ilLPProgressTableGUI\fillHeaderCSV(), ilTrObjectUsersPropsTableGUI\fillHeaderCSV(), ilTrUserObjectsPropsTableGUI\fillHeaderCSV(), ilTrMatrixTableGUI\fillHeaderCSV(), ilBookingReservationsTableGUI\fillHeaderCSV(), ilTrSummaryTableGUI\fillHeaderCSV(), ilTable2GUI\fillHeaderCSV(), ilLPTableBaseGUI\fillMetaCSV(), ilPollAnswerTableGUI\fillRowCSV(), ilPollUserTableGUI\fillRowCSV(), ilSCORMTrackingItemsTableGUI\fillRowCSV(), ilSCORM2004TrackingItemsTableGUI\fillRowCSV(), ILIAS\MyStaff\ListCompetences\Skills\ilMStListCompetencesSkillsTableGUI\fillRowCSV(), ILIAS\MyStaff\ListCertificates\ilMStListCertificatesTableGUI\fillRowCSV(), ilMStShowUserCoursesTableGUI\fillRowCSV(), ilLPObjectStatisticsTypesTableGUI\fillRowCSV(), ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\fillRowCSV(), ilMStListCoursesTableGUI\fillRowCSV(), ilLPObjectStatisticsDailyTableGUI\fillRowCSV(), ilLPObjectStatisticsTableGUI\fillRowCSV(), ilLPProgressTableGUI\fillRowCSV(), ilTrObjectUsersPropsTableGUI\fillRowCSV(), ilTrUserObjectsPropsTableGUI\fillRowCSV(), ilTrMatrixTableGUI\fillRowCSV(), ilBookingReservationsTableGUI\fillRowCSV(), ilTrSummaryTableGUI\fillRowCSV(), and ilTable2GUI\fillRowCSV().

37  : void
38  {
39  $this->csv .= $this->new_line;
40  $this->first_entry = true;
41  }
+ Here is the caller graph for this function:

◆ getCSVString()

ilCSVWriter::getCSVString ( )

Definition at line 54 of file class.ilCSVWriter.php.

References $csv.

54  : string
55  {
56  return $this->csv;
57  }

◆ quote()

ilCSVWriter::quote ( string  $a_str)
private

Definition at line 59 of file class.ilCSVWriter.php.

Referenced by addColumn().

59  : string
60  {
61  return str_replace(
62  $this->delimiter,
63  $this->delimiter . $this->delimiter,
64  $a_str
65  );
66  }
+ Here is the caller graph for this function:

◆ setDelimiter()

ilCSVWriter::setDelimiter ( string  $a_del)

Definition at line 32 of file class.ilCSVWriter.php.

32  : void
33  {
34  $this->delimiter = $a_del;
35  }

◆ setSeparator()

ilCSVWriter::setSeparator ( string  $a_sep)

Definition at line 27 of file class.ilCSVWriter.php.

27  : void
28  {
29  $this->separator = $a_sep;
30  }

Field Documentation

◆ $csv

string ilCSVWriter::$csv = ''
private

Definition at line 21 of file class.ilCSVWriter.php.

Referenced by getCSVString().

◆ $delimiter

string ilCSVWriter::$delimiter = '"'
private

Definition at line 23 of file class.ilCSVWriter.php.

Referenced by addColumn().

◆ $first_entry

bool ilCSVWriter::$first_entry = true
private

Definition at line 25 of file class.ilCSVWriter.php.

◆ $new_line

string ilCSVWriter::$new_line = "\n"
private

Definition at line 24 of file class.ilCSVWriter.php.

Referenced by addRow().

◆ $separator

string ilCSVWriter::$separator = ','
private

Definition at line 22 of file class.ilCSVWriter.php.

Referenced by addColumn().


The documentation for this class was generated from the following file: