ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDidacticTemplateIncludeFilterPattern Class Reference

Implementation of an include filter pattern for didactic template actions. More...

+ Inheritance diagram for ilDidacticTemplateIncludeFilterPattern:
+ Collaboration diagram for ilDidacticTemplateIncludeFilterPattern:

Public Member Functions

 __construct ($a_pattern_id=0)
 Constructor.
 valid ($a_source)
 Check if patttern matches.
 toXml (ilXmlWriter $writer)
 Write xml.
- Public Member Functions inherited from ilDidacticTemplateFilterPattern
 setPatternId ($a_id)
 set pattern id
 getPatternId ()
 Get pattern id.
 setParentId ($a_id)
 Set parent id.
 getParentId ()
 Get parent id.
 setParentType ($a_type)
 Set parent type.
 getParentType ()
 Get parent type.
 setPatternType ($a_type)
 Set pattern type.
 getPatterType ()
 Get pattern type.
 setPatternSubType ($a_subtype)
 Set pattern sub type.
 getPatternSubType ()
 Get pattern sub type.
 setPattern ($a_pattern)
 Set pattern.
 getPattern ()
 Get pattern.
 update ()
 Update pattern definition.
 save ()
 Create new pattern ilDB $ilDB.
 delete ()
 Delete pattern ilDB $ilDB.
 __clone ()
 Magic clone method.

Additional Inherited Members

- Data Fields inherited from ilDidacticTemplateFilterPattern
const PATTERN_INCLUDE = 1
const PATTERN_EXCLUDE = 2
const PATTERN_SUBTYPE_REGEX = 1
- Protected Member Functions inherited from ilDidacticTemplateFilterPattern
 read ()
 Read pattern definition from db.

Detailed Description

Implementation of an include filter pattern for didactic template actions.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 13 of file class.ilDidacticTemplateIncludeFilterPattern.php.

Constructor & Destructor Documentation

ilDidacticTemplateIncludeFilterPattern::__construct (   $a_pattern_id = 0)

Constructor.

Parameters
int$a_pattern_id

Reimplemented from ilDidacticTemplateFilterPattern.

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

References ilDidacticTemplateFilterPattern\setPatternType().

{
parent::__construct($a_pattern_id);
$this->setPatternType(self::PATTERN_INCLUDE);
}

+ Here is the call graph for this function:

Member Function Documentation

ilDidacticTemplateIncludeFilterPattern::toXml ( ilXmlWriter  $writer)

Write xml.

Parameters
ilXmlWriter$writer

Reimplemented from ilDidacticTemplateFilterPattern.

Definition at line 46 of file class.ilDidacticTemplateIncludeFilterPattern.php.

References ilDidacticTemplateFilterPattern\getPattern(), ilDidacticTemplateFilterPattern\getPatternSubType(), ilDidacticTemplateFilterPattern\PATTERN_SUBTYPE_REGEX, and ilXmlWriter\xmlElement().

{
switch($this->getPatternSubType())
{
default:
$writer->xmlElement(
'includePattern',
array(
'preg' => $this->getPattern()
)
);
}
}

+ Here is the call graph for this function:

ilDidacticTemplateIncludeFilterPattern::valid (   $a_source)

Check if patttern matches.

Reimplemented from ilDidacticTemplateFilterPattern.

Definition at line 29 of file class.ilDidacticTemplateIncludeFilterPattern.php.

References $GLOBALS, ilDidacticTemplateFilterPattern\getPattern(), and ilDidacticTemplateFilterPattern\getPatternSubType().

{
$a_source = trim($a_source);
switch($this->getPatternSubType())
{
case self::PATTERN_SUBTYPE_REGEX:
$GLOBALS['ilLog']->write(__METHOD__.': Checking include pattern with '.$a_source.' against '.$this->getPattern());
return preg_match('/'.$this->getPattern().'/',$a_source) === 1;
}
return false;
}

+ Here is the call graph for this function:


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