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

Public Member Functions

 __construct ()
 
 from_language ($lang, $output)
 

Detailed Description

Definition at line 21 of file Context.php.

Constructor & Destructor Documentation

◆ __construct()

Context::__construct ( )

Definition at line 23 of file Context.php.

24  {
25  }

Member Function Documentation

◆ from_language()

Context::from_language (   $lang,
  $output 
)

Definition at line 27 of file Context.php.

References $i, $key, $lang, $output, and array.

28  {
29  // Current indent level.
30  $this->ind = 0;
31  $this->inquote = 0;
32  $this->incomment = 0;
33  $this->inbcomment = 0;
34  $this->inwhitespace = 1;
35  // Used to ensure quote matching works :-)
36  $this->currquotechar = "";
37  $this->begseen = 0;
38  $this->newline = 0;
39  $this->escaping = 0;
40  // In a line select?
41  $this->lineselect = 0;
42  $this->closingstrings = array();
43 
44  // Used by $this->munge for keyword checking - we only want to make this once.
45  $this->validkeys = array();
46 
47  foreach (array_keys($lang->keywords) as $key) {
48  if ($lang->nocase) {
49  $this->validkeys[strtolower($key)] = $key;
50  } else {
51  $this->validkeys[$key] = $key;
52  }
53  }
54  $this->alldelims = array_merge($lang->delimiters, $lang->stringchars);
55 
56  // Additional caching: First we want to store the strlens of the comments.
57  $this->lcolengths = array();
58  foreach ($lang->linecommenton as $lco) {
59  $this->lcolengths[$lco] = strlen($lco);
60  }
61  foreach ($lang->blockcommenton as $bco) {
62  $this->bcolengths[$bco] = strlen($bco);
63  }
64  foreach ($lang->blockcommentoff as $bcf) {
65  $this->bcflengths[$bcf] = strlen($bcf);
66  }
67 
68  // Build up match arrays for bcos.
69  $this->bcomatches = array();
70  $this->startingbkonchars = array();
71  for ($i=0; $i<sizeof($lang->blockcommenton); $i++) {
72  $bco = $lang->blockcommenton[$i];
73  if (!isset($this->bcomatches[$bco])) {
74  $this->bcomatches[$bco] = array();
75  }
76  array_push($this->bcomatches[$bco], $lang->blockcommentoff[$i]);
77  array_push($this->startingbkonchars, $bco[0]);
78  }
79 
80 
81  $preprolength = 0;
82  $this->prepro = 0;
83  if (isset($lang->prepro)) {
84  $this->preprolength = strlen($lang->prepro);
85  }
86 
87  // Output module handling
88 
89  $this->code_parts = explode("_WORD_", $output->code);
90  $this->linecomment_parts = explode("_WORD_", $output->linecomment);
91  $this->blockcomment_parts = explode("_WORD_", $output->blockcomment);
92  $this->prepro_parts = explode("_WORD_", $output->prepro);
93  $this->select_parts = explode("_WORD_", $output->select);
94  $this->quote_parts = explode("_WORD_", $output->quote);
95  $currcat = 1;
96  do {
97  $varname = "category_" . $currcat;
98  if (isset($output->{$varname})) {
99  $this->category_parts[$currcat] = explode("_WORD_", $output->{$varname});
100  }
101  $currcat++;
102  } while (isset($output->{$varname}));
103  }
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
Create styles array
The data for the language used.
$i
Definition: disco.tpl.php:19
$key
Definition: croninfo.php:18

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