Lines Matching refs:this

16      * Array containing all references to objects of this class that already exist.
87 $this->plugin = new syntax_plugin_bibtex4dw_bibtex();
90 // Note: Only those settings that can be changed by this class need to be transferred.
92 $this->_conf['sqlite'] = $this->plugin->getConf('sqlite');
93 $this->_conf['file'] = explode(';',$this->plugin->getConf('file'));
94 $this->_conf['pdfdir'] = explode(';',$this->plugin->getConf('pdfdir'));
95 $this->_conf['citetype'] = $this->plugin->getConf('citetype');
98 if ($this->_conf['sqlite']) {
99 $this->sqlite = plugin_load('helper', 'sqlite');
100 if(!$this->sqlite){
105 if(!$this->sqlite->init('bibtex4dw', DOKU_PLUGIN.'bibtex4dw/db/')){
110 if (array_key_exists('file', $this->_conf)) {
111 $this->_parseBibtexFile();
143 if (isset($this->_bibtex_keysNotCited) && (count($this->_bibtex_keysNotCited))) {
144 $this->_bibtex_keysNotCited = array();
155 $this->_bibtex_keysNotCited[$bibkey] = 0;
158 if (array_key_exists($optkey,$this->_conf)) {
162 $this->_conf[$optkey] = $optval;
164 $this->_conf[$optkey][] = $optval[0];
168 $this->_conf[$optkey] = $optval[count($optval)-1];
175 switch ($this->_conf['citetype']) {
177 $this->_conf['sort'] = 'true';
180 $this->_conf['sort'] = 'true';
183 $this->_conf['sort'] = 'true';
186 $this->_conf['sort'] = 'false';
189 $this->_conf['sort'] = 'false';
199 * The result will be stored in $this->_bibtex_references
204 foreach($this->_conf['file'] as $file) {
205 $bibtex .= $this->_loadBibtexFile($file, 'page');
207 $this->_parser = new bibtexparser_plugin_bibtex4dw();
208 $this->_parser->loadString($bibtex);
209 $stat = $this->_parser->parseBibliography();
213 //$this->_bibtex_references = $this->_parser->data;
214 $this->_bibtex_references = $this->_parser->entries;
216 foreach($this->_bibtex_references as $refno => $ref) {
218 $this->_bibtex_keys[$ref['cite']] = $refno;
227 if (!$this->_conf['sqlite']) {
230 if (!in_array(':'.$ID, $this->_conf['file'])) {
232 Change in config if this is not intended.");
235 $this->_parser = new bibtexparser_plugin_bibtex4dw();
236 $this->_parser->loadString($bibtex);
237 $this->_parser->sqlite = $this->sqlite;
238 $stat = $this->_parser->parseBibliography($sqlite=true);
244 if ( ($this->_parser->warnings['warning']) && (count($this->_parser->warnings['warning']))) {
245 foreach($this->_parser->warnings as $parserWarning) {
246 msg($this->_parser->warnings[$parserWarning]['warning'],'2');
263 if ($this->_conf['sqlite']) {
264 $this->_parser = new bibtexparser_plugin_bibtex4dw();
265 $this->_parser->sqlite = $this->sqlite;
266 $rawBibtexEntry = $this->sqlite->res2arr($this->sqlite->query("SELECT entry FROM bibtex WHERE key=?",$bibtex_key));
267 $this->_parser->loadString($rawBibtexEntry[0]['entry']);
268 $stat = $this->_parser->parse();
272 $ref = $this->_parser->data[0];
274 //$ref = $this->_bibtex_references[$this->_bibtex_keys[$bibtex_key]];
275 $rawBibtexEntry = $this->_bibtex_references[$bibtex_key];
276 $this->_parser->loadString($rawBibtexEntry);
277 $stat = $this->_parser->parse();
281 $ref = $this->_parser->data[0];
292 $formatstring = $this->plugin->getConf('fmtstr_'.$normalizedRef['ENTRYTYPE']);
293 // Replace each language string ($this->_langStrings) pattern '@placeholder@' with respective value
294 foreach ($this->_langStrings as $lang) {
295 $formatstring = str_replace('@'.strtolower($lang).'@', $this->plugin->getLang($lang), $formatstring);
315 if (array_key_exists('pdfdir',$this->_conf)) {
317 if ((auth_quickaclcheck($this->_conf['pdfdir'][0]) >= AUTH_READ) &&
320 $pdffilename = mediaFN($this->_conf['pdfdir'][0]) . "/" . $bibtex_key . ".pdf";
322 resolve_mediaid($this->_conf['pdfdir'][0], $pdflinkname, $exists);
341 if (!isset($this->_bibtex_keysCited) || empty($this->_bibtex_keysCited)) {
345 if (isset($this->_bibtex_keysNotCited) && !empty($this->_bibtex_keysNotCited)) {
346 foreach ($this->_bibtex_keysNotCited as $key => $no) {
347 if (!array_key_exists($key,$this->_bibtex_keysCited)) {
348 $this->_bibtex_keysCited[$key] = ++$this->_currentKeyNumber;
352 if ('true' == $this->_conf['sort'] && 'numeric' != $this->_conf['citetype']) {
354 foreach ($this->_bibtex_keysCited as $key => $no) {
355 if ($this->_conf['sqlite']) {
356 $this->_parser = new bibtexparser_plugin_bibtex4dw();
357 $this->_parser->sqlite = $this->sqlite;
358 $rawBibtexEntry = $this->sqlite->res2arr($this->sqlite->query("SELECT entry FROM bibtex WHERE key=?",$key));
359 $this->_parser->loadString($rawBibtexEntry[0]['entry']);
360 $stat = $this->_parser->parse();
364 $citedKeys[$key] = $this->_parser->data[0]['authoryear'];
366 $citedKeys[$key] = $this->_bibtex_references[$this->_bibtex_keys[$key]]['authoryear'];
371 $citedKeys = $this->_bibtex_keysCited;
373 if ('authordate' == $this->_conf['citetype']) {
374 $html = $this->_printReferencesAsUnorderedList($citedKeys);
376 $html = $this->_printReferencesAsDefinitionlist($citedKeys);
380 if (!isset($this->_bibtex_keysNotCited) || empty($this->_bibtex_keysNotCited)) {
383 $this->_currentKeyNumber = 0;
384 if ('true' == $this->_conf['sort']) {
386 foreach ($this->_bibtex_keysNotCited as $key => $no) {
387 if ($this->_conf['sqlite']) {
388 $this->_parser = new bibtexparser_plugin_bibtex4dw();
389 $this->_parser->sqlite = $this->sqlite;
390 $rawBibtexEntry = $this->sqlite->res2arr($this->sqlite->query("SELECT entry FROM bibtex WHERE key=?",$key));
391 $this->_parser->loadString($rawBibtexEntry[0]['entry']);
392 $stat = $this->_parser->parse();
396 $notcitedKeys[$key] = $this->_parser->data[0]['authoryear'];
398 $notcitedKeys[$key] = $this->_bibtex_references[$this->_bibtex_keys[$key]]['authoryear'];
403 $notcitedKeys = $this->_bibtex_keysNotCited;
405 if ('authordate' == $this->_conf['citetype']) {
406 $html = $this->_printReferencesAsUnorderedList($notcitedKeys);
408 $html = $this->_printReferencesAsDefinitionlist($notcitedKeys);
425 if ($this->keyExists($key)) {
427 $html .= $this->printReference($key);
448 if ($this->keyExists($key)) {
450 $html .= $this->printCitekey($key);
453 $html .= $this->printReference($key);
466 * $this->_conf['citetype']
473 if (!array_key_exists($bibtex_key,$this->_bibtex_keysCited)) {
474 $this->_currentKeyNumber++;
475 $this->_bibtex_keysCited[$bibtex_key] = $this->_currentKeyNumber;
477 if ($this->_conf['sqlite']) {
478 $this->_parser = new bibtexparser_plugin_bibtex4dw();
479 $rawBibtexEntry = $this->sqlite->res2arr($this->sqlite->query("SELECT entry FROM bibtex WHERE key=?",$bibtex_key));
483 $this->_parser->loadString($rawBibtexEntry[0]['entry']);
484 $stat = $this->_parser->parse();
488 $ref = $this->_parser->data[0];
491 if (empty($this->_bibtex_references[$bibtex_key])) {
494 $ref = $this->_bibtex_references[$this->_bibtex_keys[$bibtex_key]];
496 switch ($this->_conf['citetype']) {
519 $bibtex_key = $this->_bibtex_keysCited[$bibtex_key];
523 $bibtex_key = $this->_bibtex_keysCited[$bibtex_key];
536 if ($this->_conf['sqlite']) {
537 $rawBibtexEntry = $this->sqlite->res2arr($this->sqlite->query("SELECT entry FROM bibtex WHERE key=?",$bibkey));
540 return (!empty($this->_bibtex_references[$bibkey]));
552 foreach($this->_conf['file'] as $file) {
553 $bibtex .= $this->_loadBibtexFile($file, 'page');