Lines Matching refs:entry
277 $entry = false;
295 $entry = true;
296 …} elseif ($entry && ('{' == $char) && ('\\' != $lastchar)) { //Inside an entry and non quoted brac…
303 …} elseif ($entry && ('}' == $char) && ('\\' != $lastchar)) { //Inside an entry and non quoted brac…
315 $entry = false;
325 if ($entry) { //Inside entry
357 foreach ($this->data as $entry) {
358 $cites[] = $entry['cite'];
393 $entry = false;
408 $entry = true;
409 …} elseif ($entry && ('{' == $char) && ('\\' != $lastchar)) { //Inside an entry and non quoted brac…
411 …} elseif ($entry && ('}' == $char) && ('\\' != $lastchar)) { //Inside an entry and non quoted brac…
417 $entry = false;
429 if ($entry) { //Inside entry
453 foreach ($this->data as $entry) {
454 $cites[] = $entry['cite'];
478 …* @param string $entry BibTeX entry, starting with @ and ending BEFORE the closing brace of the en…
482 private function _storeBibTeXEntry($entry, $stringCallback, $bibItemCallback) argument
484 if ('@string' == strtolower(substr($entry, 0, 7))) {
486 preg_match('/^@\w+\{(.+)/', $entry, $matches);
490 $entry = substr(trim($m[1]), 1, -1);
491 call_user_func($stringCallback, $string, $entry);
495 $entry = $entry.'}';
498 preg_match('/^@(\w+)\{(.+),/', $entry, $matches);
502 call_user_func($bibItemCallback, $key, $entry);
506 throw new InvalidArgumentException('Could not parse entry "'.$entry.'"');
512 …* @param string $entry BibTeX entry, starting with @ and ending BEFORE the closing brace of the en…
514 private function _storeEntryInClass($entry) argument
518 $this->_storeBibTeXEntry($entry, $stringCallback, $bibItemCallback);
524 private function _addEntryToSQLiteDB($entry) argument
528 $this->_storeBibTeXEntry($entry, $stringCallback, $bibItemCallback);
534 private function _prepareSqlStatement($entry) argument
538 $this->_storeBibTeXEntry($entry, $stringCallback, $bibItemCallback);
587 * @param string $entry The entry
590 private function _parseEntry($entry) argument
594 $entrycopy = $entry; //We need a copy for printing the warnings
596 $ret = array('bibtex' => $entry.'}');
597 if ('@string' == strtolower(substr($entry, 0, 7))) {
599 preg_match('/^@\w+\{(.+)/' ,$entry, $matches);
605 } elseif ('@preamble' == strtolower(substr($entry, 0, 9))) {
608 $this->_generateWarning('PREAMBLE_ENTRY_NOT_YET_SUPPORTED', '', $entry.'}');
613 preg_match('/^@\w+\{([\w\d]+),/' ,$entry, $matches);
620 while (strrpos($entry,'=') !== false) {
621 $position = strrpos($entry, '=');
624 if (substr($entry, $position-1, 1) == '\\') {
628 $proceed = $this->_checkEqualSign($entry, $position);
631 $substring = substr($entry, 0, $position);
634 if (substr($entry, $position-1, 1) == '\\') {
638 $proceed = $this->_checkEqualSign($entry, $position);
642 $value = trim(substr($entry, $position+1));
643 $entry = substr($entry, 0, $position);
679 $position = strrpos($entry, ',');
680 $field = strtolower(trim(substr($entry, $position+1)));
682 $entry = substr($entry, 0, $position);
685 $arr = explode('{', $entry);
693 … $this->_generateWarning('WARNING_NOT_ALLOWED_ENTRY_TYPE', $ret['entrytype'], $entry.'}');
736 private function _replaceLatex($entry) { argument
738 $entry = preg_replace('/\\\emph\{([^\}]+)\}/', '<em>$1</em>', $entry);
740 $entry = preg_replace('/\\\textbf\{([^\}]+)\}/', '<strong>$1</strong>', $entry);
742 $entry = str_replace("``",""",$entry);
743 $entry = str_replace("''",""",$entry);
745 $entry = str_replace("\&","&",$entry);
747 $entry = str_replace("\%","%;",$entry);
749 $entry = str_replace("\ "," ",$entry);
751 $entry = str_replace("---","—",$entry);
753 $entry = str_replace("--","-",$entry);
755 $entry = preg_replace("/\\\url\{([^\}]+)\}/",'<a href="\\1">\\1</a>',$entry);
757 $entry = preg_replace('/\\\"\{([aeiouyAEIOU])\}/',"&\\1uml;",$entry);
758 $entry = preg_replace('/\\\"([aeiouyAEIOU])/',"&\\1uml;",$entry);
759 $entry = str_replace("\ss","ß",$entry);
760 $entry = str_replace('"s',"ß",$entry);
763 $entry = str_replace("\'c","ć",$entry);
764 $entry = preg_replace("/\\\'(.?)/","&\\1acute;",$entry);
766 $entry = preg_replace("/\\\`(.?)/","&\\1grave;",$entry);
768 $entry = preg_replace("/\\\(\^)(.?)/","&\\2circ;",$entry);
770 $entry = str_replace('\v{z}',"ž",$entry);
771 $entry = str_replace('\v{c}',"č",$entry);
773 $entry = preg_replace("/\\\c\{(.?)\}/","\\1̧",$entry);
775 $entry = preg_replace("/\\\~(.?)/","&\\1tilde;",$entry);
777 $entry = preg_replace('/\\\([aoAO]{1}[eE]{1})/',"&\\1lig;",$entry);
779 $entry = str_replace("\i","ı",$entry);
781 $entry = str_replace("\={u}","ū",$entry);
783 $entry = str_replace("\l","ł",$entry);
784 $entry = str_replace("\L","Ł",$entry);
787 $entry = preg_replace('/\\\([oO]{1})/',"&\\1slash;",$entry);
789 $entry = preg_replace('/\\\([aA]{1})([aA]{1})/',"&\\1ring;",$entry);
791 $entry = str_replace("~"," ",$entry);
793 preg_match('/\$([^$]+)\$/' ,$entry, $matches);
797 $entry = preg_replace("/\^\{([^\}]+)\}/","<sup>\\1</sup>",$entry);
798 $entry = preg_replace("/_\{([^\}]+)\}/","<sub>\\1</sub>",$entry);
799 $entry = preg_replace("/\^([\\\]{1}\w+)/","<sup>\\1</sup>",$entry);
800 $entry = preg_replace("/_([\\\]{1}\w+)/","<sub>\\1</sub>",$entry);
801 $entry = preg_replace("/\^([^\\\]{1})/","<sup>\\1</sup>",$entry);
802 $entry = preg_replace("/_([^\\\]{1})/","<sub>\\1</sub>",$entry);
805 $entry = str_replace($orig,$repl,$entry);
813 $entry = str_replace($upLatex,$upHtml,$entry);
814 $entry = str_replace($loLatex,$loHtml,$entry);
818 $entry = str_replace("$","",$entry);
820 return $entry;
831 * @param string $entry The text of the whole remaining entry
835 private function _checkEqualSign($entry, $position) argument
841 $length = strlen($entry);
844 $precedingchar = substr($entry, $i-1, 1);
845 $char = substr($entry, $i, 1);
859 $entrycopy = trim($entry);
871 $precedingchar = substr($entry, $i-1, 1);
872 $char = substr($entry, $i, 1);
890 * @param string $entry The entry to check
893 private function _checkAllowedEntryType($entry) argument
895 return in_array($entry, $this->allowedEntryTypes);
906 * @param string $entry The text of the entry until the at
909 private function _checkAt($entry) argument
915 if (strrpos($entry,'=') !== false) {
916 $position = strrpos($entry, '=');
918 if (substr($entry, $position-1, 1) == '\\') {
922 $substring = substr($entry, 0, $position);
925 if (substr($entry, $position-1, 1) == '\\') {
929 $value = trim(substr($entry, $position+1));
954 * @param string $entry The entry where the Delimiter should be stripped from
957 private function _stripDelimiter($entry) argument
960 $length = strlen($entry);
961 $firstchar = substr($entry, 0, 1);
962 $lastchar = substr($entry, -1, 1);
965 $entry = substr($entry, 1, -1);
969 $firstchar = substr($entry, 0, 1);
970 $lastchar = substr($entry, -1, 1);
972 return $entry;
979 * @param string $entry The entry to unwrap
982 private function _unwrap($entry) argument
984 $entry = preg_replace('/\s+/', ' ', $entry);
985 return trim($entry);
992 * @param string $entry The entry to wrap
995 private function _wordwrap($entry) argument
997 if ( (''!=$entry) && (is_string($entry)) ) {
998 …$entry = wordwrap($entry, $this->_options['wordWrapWidth'], $this->_options['wordWrapBreak'], $thi…
1000 return $entry;
1007 * @param string $entry The entry with the authors
1010 private function _extractAuthors($entry) { argument
1011 $entry = $this->_unwrap($entry);
1013 $entry = str_replace(' AND ',' and ',$entry);
1015 $authorarray = explode(' and ', $entry);
1183 * @param string $entry The entry aka one line which which should be validated
1187 private function _validateValue($entry, $wholeentry) argument
1190 if (preg_match('/^{.*@.*}$/', $entry)) {
1191 $this->_generateWarning('WARNING_AT_IN_BRACES', $entry, $wholeentry);
1194 if (preg_match('/^\".*\\".*\"$/', $entry)) {
1195 … $this->_generateWarning('WARNING_ESCAPED_DOUBLE_QUOTE_INSIDE_DOUBLE_QUOTES', $entry, $wholeentry);
1201 for ($i = 0; $i < strlen($entry); $i++) {
1202 $char = substr($entry, $i, 1);
1212 $this->_generateWarning('WARNING_UNBALANCED_AMOUNT_OF_BRACES', $entry, $wholeentry);
1254 * @param string $entry The line of the entry where the warning occurred
1257 private function _generateWarning($type, $entry, $wholeentry='') argument
1260 $warning['entry'] = $entry;