ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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, data, getLanguageAdapter(), and getSourceDirectories().

Referenced by getList().

98  {
99  $i = 0;
100  foreach($this->getLanguageAdapter()->getInstalledLanguages() as $iso2_language_code)
101  {
102  $this->data['items'][$i]['language'] = $iso2_language_code;
103  $this->data['items'][$i]['agreement'] = false;
104  $this->data['items'][$i]['agreement_document'] = null;
105  $this->data['items'][$i]['agreement_document_modification_ts'] = null;
106 
107  foreach($this->getSourceDirectories() as $directory)
108  {
109  $file = $directory . '/agreement_' . $iso2_language_code . '.html';
110  if(is_file($file) && is_readable($file))
111  {
112  $this->data['items'][$i]['agreement_document'] = $file;
113  $this->data['items'][$i]['agreement_document_modification_ts'] = filemtime($file);
114  $this->data['items'][$i]['agreement'] = true;
115  break;
116  }
117  }
118 
119  ++$i;
120  }
121 
122  $this->data['cnt'] = $i;
123  }
Add some data
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: