ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTermsOfServiceFileSystemDocument Class Reference
+ Inheritance diagram for ilTermsOfServiceFileSystemDocument:
+ Collaboration diagram for ilTermsOfServiceFileSystemDocument:

Public Member Functions

 __construct (ilLanguage $lng)
 determine ()
 setLanguageAdapter ($lng)
 getLanguageAdapter ()
 setSourceFiles ($source_directories)
 getSourceFiles ()
 hasContent ()
 getContent ()
 getSource ()
 getSourceType ()
 getIso2LanguageCode ()

Protected Member Functions

 initSourceFiles ()

Protected Attributes

 $lng
 $has_content = false
 $content = ''
 $iso2_language_code = ''
 $source = ''
 $source_files = array()

Additional Inherited Members

- Data Fields inherited from ilTermsOfServiceSignableDocument
const SRC_TYPE_FILE_SYSTEM_PATH = 0
const SRC_TYPE_OBJECT = 1

Detailed Description

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 10 of file class.ilTermsOfServiceFileSystemDocument.php.

Constructor & Destructor Documentation

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

Definition at line 45 of file class.ilTermsOfServiceFileSystemDocument.php.

References initSourceFiles(), and setLanguageAdapter().

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

+ Here is the call graph for this function:

Member Function Documentation

ilTermsOfServiceFileSystemDocument::determine ( )
Exceptions
ilTermsOfServiceNoSignableDocumentFoundException

Implements ilTermsOfServiceSignableDocument.

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

References $file, $iso2_language_code, and getSourceFiles().

Referenced by ilTermsOfServiceFileSystemDocumentTest\testClientDocumentCouldBeRetrievedByCurrentLanguage(), ilTermsOfServiceFileSystemDocumentTest\testClientDocumentCouldBeRetrievedByDefaultLanguage(), ilTermsOfServiceFileSystemDocumentTest\testClientDocumentCouldBeRetrievedByEnglishLanguage(), ilTermsOfServiceFileSystemDocumentTest\testGlobalDocumentCouldBeRetrievedByCurrentLanguage(), ilTermsOfServiceFileSystemDocumentTest\testGlobalDocumentCouldBeRetrievedByDefaultLanguage(), and ilTermsOfServiceFileSystemDocumentTest\testGlobalDocumentCouldBeRetrievedByEnglishLanguage().

{
foreach($this->getSourceFiles() as $file => $iso2_language_code)
{
if(is_file($file) && is_readable($file))
{
$lines = file($file);
$this->content = '';
foreach($lines as $line)
{
$this->content .= trim(nl2br($line));
}
$this->source = $file;
$this->has_content = (bool)strlen($this->content);
$this->iso2_language_code = $iso2_language_code;
return;
}
}
require_once 'Services/TermsOfService/exceptions/class.ilTermsOfServiceNoSignableDocumentFoundException.php';
throw new ilTermsOfServiceNoSignableDocumentFoundException('Could not find any terms of service document for the passed language object');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTermsOfServiceFileSystemDocument::getLanguageAdapter ( )
Returns
ilLanguage

Definition at line 103 of file class.ilTermsOfServiceFileSystemDocument.php.

References $lng.

Referenced by initSourceFiles().

{
return $this->lng;
}

+ Here is the caller graph for this function:

ilTermsOfServiceFileSystemDocument::getSourceFiles ( )
Returns
array

Definition at line 119 of file class.ilTermsOfServiceFileSystemDocument.php.

References $source_files.

Referenced by determine().

{
}

+ Here is the caller graph for this function:

ilTermsOfServiceFileSystemDocument::initSourceFiles ( )
protected

Definition at line 80 of file class.ilTermsOfServiceFileSystemDocument.php.

References getLanguageAdapter().

Referenced by __construct().

{
$this->source_files = array(
implode('/', array('.', 'Customizing', 'clients', CLIENT_ID, 'agreement', 'agreement_' . $this->getLanguageAdapter()->getLangKey() . '.html')) => $this->getLanguageAdapter()->getLangKey(),
implode('/', array('.', 'Customizing', 'clients', CLIENT_ID, 'agreement', 'agreement_' . $this->getLanguageAdapter()->getDefaultLanguage() . '.html')) => $this->getLanguageAdapter()->getDefaultLanguage(),
implode('/', array('.', 'Customizing', 'clients', CLIENT_ID, 'agreement', 'agreement_en.html')) => 'en',
implode('/', array('.', 'Customizing', 'global', 'agreement', 'agreement_' . $this->getLanguageAdapter()->getLangKey() . '.html')) => $this->getLanguageAdapter()->getLangKey(),
implode('/', array('.', 'Customizing', 'global', 'agreement', 'agreement_' . $this->getLanguageAdapter()->getDefaultLanguage() . '.html')) => $this->getLanguageAdapter()->getDefaultLanguage(),
implode('/', array('.', 'Customizing', 'global', 'agreement', 'agreement_en.html')) => 'en'
);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTermsOfServiceFileSystemDocument::setLanguageAdapter (   $lng)
Parameters
ilLanguage$lng

Definition at line 95 of file class.ilTermsOfServiceFileSystemDocument.php.

References $lng.

Referenced by __construct().

{
$this->lng = $lng;
}

+ Here is the caller graph for this function:

ilTermsOfServiceFileSystemDocument::setSourceFiles (   $source_directories)
Parameters
array$source_directories

Definition at line 111 of file class.ilTermsOfServiceFileSystemDocument.php.

{
$this->source_files = $source_directories;
}

Field Documentation

ilTermsOfServiceFileSystemDocument::$content = ''
protected

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

Referenced by getContent().

ilTermsOfServiceFileSystemDocument::$has_content = false
protected

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

Referenced by hasContent().

ilTermsOfServiceFileSystemDocument::$iso2_language_code = ''
protected

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

Referenced by determine(), and getIso2LanguageCode().

ilTermsOfServiceFileSystemDocument::$lng
protected
ilTermsOfServiceFileSystemDocument::$source = ''
protected

Definition at line 35 of file class.ilTermsOfServiceFileSystemDocument.php.

Referenced by getSource().

ilTermsOfServiceFileSystemDocument::$source_files = array()
protected

Definition at line 40 of file class.ilTermsOfServiceFileSystemDocument.php.

Referenced by getSourceFiles().


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