ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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
}

Protected Member Functions

 initSourceDirectories ()
 collectData ()

Protected Attributes

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

Detailed Description

Constructor & Destructor Documentation

ilTermsOfServiceAgreementByLanguageProvider::__construct ( ilLanguage  $lng)
Parameters
ilLanguage$lng

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

References initSourceDirectories(), and setLanguageAdapter().

{
$this->setLanguageAdapter($lng);
}

+ Here is the call graph for this function:

Member Function Documentation

ilTermsOfServiceAgreementByLanguageProvider::collectData ( )
protected

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

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

Referenced by getList().

{
$i = 0;
foreach($this->getLanguageAdapter()->getInstalledLanguages() as $iso2_language_code)
{
$this->data['items'][$i]['language'] = $iso2_language_code;
$this->data['items'][$i]['agreement'] = false;
$this->data['items'][$i]['agreement_document'] = null;
$this->data['items'][$i]['agreement_document_modification_ts'] = null;
foreach($this->getSourceDirectories() as $directory)
{
$file = $directory . '/agreement_' . $iso2_language_code . '.html';
if(is_file($file) && is_readable($file))
{
$this->data['items'][$i]['agreement_document'] = $file;
$this->data['items'][$i]['agreement_document_modification_ts'] = filemtime($file);
$this->data['items'][$i]['agreement'] = true;
break;
}
}
++$i;
}
$this->data['cnt'] = $i;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTermsOfServiceAgreementByLanguageProvider::getLanguageAdapter ( )
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, and collectData().

Referenced by ilTermsOfServiceAgreementsByLanguageTableDataProviderTest\testProviderReturnsAResultForEveryInstalledLanguage().

{
$this->data = array(
'items' => array(),
'cnt' => 0
);
$this->collectData();
return $this->data;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTermsOfServiceAgreementByLanguageProvider::getSourceDirectories ( )
ilTermsOfServiceAgreementByLanguageProvider::initSourceDirectories ( )
protected

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

Referenced by __construct().

{
$this->source_directories = array(
implode('/', array('.', 'Customizing', 'clients', CLIENT_ID, 'agreement')),
implode('/', array('.', 'Customizing', 'global', 'agreement'))
);
}

+ Here is the caller graph for this function:

ilTermsOfServiceAgreementByLanguageProvider::setLanguageAdapter (   $lng)
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().

{
$this->source_directories = $terms_of_service_source_directories;
}

+ Here is the caller graph for this function:

Field Documentation

ilTermsOfServiceAgreementByLanguageProvider::$data = array()
protected

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

Referenced by getList().

ilTermsOfServiceAgreementByLanguageProvider::$lng
protected
ilTermsOfServiceAgreementByLanguageProvider::$source_directories = array()
protected

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