ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTermsOfServiceAgreementByLanguageProvider Class Reference
+ Inheritance diagram for ilTermsOfServiceAgreementByLanguageProvider:
+ Collaboration diagram for ilTermsOfServiceAgreementByLanguageProvider:

Public Member Functions

 __construct (ilLanguage $lng)
 
 setSourceDirectories ($terms_of_service_source_directories)
 
 getSourceDirectories ()
 
 setLanguageAdapter ($lng)
 
 getLanguageAdapter ()
 
 getList (array $params, array $filter)
 {
Parameters
array$paramsTable paramaters like limit or order
array$filterFilter settings
Returns
array
} More...
 

Protected Member Functions

 initSourceDirectories ()
 
 collectData ()
 

Protected Attributes

 $lng
 
 $data = array()
 
 $source_directories = array()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTermsOfServiceAgreementByLanguageProvider::__construct ( ilLanguage  $lng)

Member Function Documentation

◆ collectData()

ilTermsOfServiceAgreementByLanguageProvider::collectData ( )
protected

Definition at line 97 of file class.ilTermsOfServiceAgreementByLanguageProvider.php.

References $file, $i, data, getLanguageAdapter(), and getSourceDirectories().

Referenced by getList().

98  {
99  $i = 0;
100  foreach ($this->getLanguageAdapter()->getInstalledLanguages() as $iso2_language_code) {
101  $this->data['items'][$i]['language'] = $iso2_language_code;
102  $this->data['items'][$i]['agreement'] = false;
103  $this->data['items'][$i]['agreement_document'] = null;
104  $this->data['items'][$i]['agreement_document_modification_ts'] = null;
105 
106  foreach ($this->getSourceDirectories() as $directory) {
107  $file = $directory . '/agreement_' . $iso2_language_code . '.html';
108  if (is_file($file) && is_readable($file)) {
109  $this->data['items'][$i]['agreement_document'] = $file;
110  $this->data['items'][$i]['agreement_document_modification_ts'] = filemtime($file);
111  $this->data['items'][$i]['agreement'] = true;
112  break;
113  }
114  }
115 
116  ++$i;
117  }
118 
119  $this->data['cnt'] = $i;
120  }
Add some data
$i
Definition: disco.tpl.php:19
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLanguageAdapter()

ilTermsOfServiceAgreementByLanguageProvider::getLanguageAdapter ( )

◆ getList()

ilTermsOfServiceAgreementByLanguageProvider::getList ( array  $params,
array  $filter 
)

{

Parameters
array$paramsTable paramaters like limit or order
array$filterFilter settings
Returns
array
}

Implements ilTermsOfServiceTableDataProvider.

Definition at line 82 of file class.ilTermsOfServiceAgreementByLanguageProvider.php.

References $data, array, collectData(), and data.

Referenced by ilTermsOfServiceAgreementsByLanguageTableDataProviderTest\testProviderReturnsAResultForEveryInstalledLanguage().

83  {
84  $this->data = array(
85  'items' => array(),
86  'cnt' => 0
87  );
88 
89  $this->collectData();
90 
91  return $this->data;
92  }
Add some data
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSourceDirectories()

ilTermsOfServiceAgreementByLanguageProvider::getSourceDirectories ( )

◆ initSourceDirectories()

ilTermsOfServiceAgreementByLanguageProvider::initSourceDirectories ( )
protected

Definition at line 71 of file class.ilTermsOfServiceAgreementByLanguageProvider.php.

References array.

Referenced by __construct().

72  {
73  $this->source_directories = array(
74  implode('/', array('.', 'Customizing', 'clients', CLIENT_ID, 'agreement')),
75  implode('/', array('.', 'Customizing', 'global', 'agreement'))
76  );
77  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ setLanguageAdapter()

◆ setSourceDirectories()

ilTermsOfServiceAgreementByLanguageProvider::setSourceDirectories (   $terms_of_service_source_directories)
Parameters
array$terms_of_service_source_directories

Definition at line 39 of file class.ilTermsOfServiceAgreementByLanguageProvider.php.

Referenced by ilTermsOfServiceAgreementsByLanguageTableDataProviderTest\testProviderReturnsAResultForEveryInstalledLanguage(), and ilTermsOfServiceAgreementsByLanguageTableDataProviderTest\testProviderShouldReturnSourceDirectoriesWhenSourceDirectoriesAreSet().

40  {
41  $this->source_directories = $terms_of_service_source_directories;
42  }
+ Here is the caller graph for this function:

Field Documentation

◆ $data

ilTermsOfServiceAgreementByLanguageProvider::$data = array()
protected

Definition at line 20 of file class.ilTermsOfServiceAgreementByLanguageProvider.php.

Referenced by getList().

◆ $lng

ilTermsOfServiceAgreementByLanguageProvider::$lng
protected

◆ $source_directories

ilTermsOfServiceAgreementByLanguageProvider::$source_directories = array()
protected

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