Lines Matching refs:this

39         $this->page = array();
40 $this->namespace = array();
41 $this->enabled = true;
48 $this->loadNotesFromConfiguration();
51 $this->loadKeys();
52 $this->loadPages();
53 $this->loadNamespaces();
64 $this->note[$name] = new refnotes_reference_database_note('{configuration}', $data);
74 $this->key[$this->normalizeKeyText($text)] = $key;
83 $text = $this->normalizeKeyText($text);
85 if (in_array($text, $this->key)) {
88 elseif (array_key_exists($text, $this->key)) {
89 $result = $this->key[$text];
120 $this->enabled = false;
121 $this->page[$pageId] = new refnotes_reference_database_page($this, $cache, $pageId);
122 $this->enabled = true;
134 foreach ($this->page as $pageId => $page) {
136 $this->namespace[$ns][] = $pageId;
145 if (!$this->enabled) {
149 $found = array_key_exists($name, $this->note);
154 if (array_key_exists($namespace, $this->namespace)) {
155 $this->loadNamespaceNotes($namespace);
157 $found = array_key_exists($name, $this->note);
161 return $found ? $this->note[$name] : NULL;
168 foreach ($this->namespace[$namespace] as $pageId) {
169 if (array_key_exists($pageId, $this->page)) {
170 $this->enabled = false;
171 $this->note = array_merge($this->note, $this->page[$pageId]->getNotes());
172 $this->enabled = true;
174 unset($this->page[$pageId]);
178 unset($this->namespace[$namespace]);
195 $this->database = $database;
196 $this->id = $id;
197 $this->fileName = wikiFN($id);
198 $this->namespace = array();
199 $this->note = array();
201 if ($cache->isCached($this->fileName)) {
202 $this->namespace = $cache->getNamespaces($this->fileName);
205 $this->parse();
207 $cache->update($this->fileName, $this->namespace);
215 $text = io_readWikiPage($this->fileName, $this->id);
216 $call = p_cached_instructions($this->fileName);
221 $c = $this->parseTable($call, $calls, $c, $text);
224 $this->parseCode($call[$c]);
227 $this->parseDataEntry($call[$c][1][1]);
277 $this->handleTable($table, $columns, $row);
289 $key[$c] = $this->database->getKey($table[0][$c]);
293 $this->handleDataSheet($table, $columns, $rows, $key);
299 $key[$r] = $this->database->getKey($table[$r][0]);
303 $this->handleDataCard($table, $rows, $key);
320 $this->handleNote($data);
335 $this->handleNote($data);
344 $this->parseBibtex($call[1][0]);
354 $this->handleNote($data);
374 $this->handleNote($data);
382 $note = new refnotes_reference_database_note($this->id, $data);
387 if (!in_array($namespace, $this->namespace)) {
388 $this->namespace[] = $namespace;
391 $this->note[$namespace . $name] = $note;
399 return $this->namespace;
406 if (empty($this->note)) {
407 $this->parse();
410 return $this->note;
425 $this->nameParts = array('', '');
428 $this->initializeConfigNote($data);
431 $this->initializePageNote($data);
434 $this->attributes['source'] = $source;
441 $this->data['note-text'] = $data['text'];
445 $this->attributes = $data;
454 $this->nameParts = refnotes_namespace::parseName($data['note-name']);
460 $this->data = $data;
467 return $this->nameParts;
485 $this->fileName = $conf['cachedir'] . '/refnotes.database.dat';
487 $this->load();
494 $this->cache = array();
495 $this->requested = array();
497 if (file_exists($this->fileName)) {
498 $this->cache = unserialize(io_readFile($this->fileName, false));
501 foreach (array_keys($this->cache) as $fileName) {
502 $this->requested[$fileName] = false;
505 $this->updated = false;
514 if (array_key_exists($fileName, $this->cache)) {
515 if ($this->cache[$fileName]['time'] == @filemtime($fileName)) {
520 $this->requested[$fileName] = true;
529 return $this->cache[$fileName]['ns'];
536 $this->cache[$fileName] = array('ns' => $namespace, 'time' => @filemtime($fileName));
537 $this->updated = true;
544 $this->removeOldPages();
546 if ($this->updated) {
547 io_saveFile($this->fileName, serialize($this->cache));
555 foreach ($this->requested as $fileName => $requested) {
556 if (!$requested && array_key_exists($fileName, $this->cache)) {
557 unset($this->cache[$fileName]);
559 $this->updated = true;