Lines Matching +full:- +full:- +full:group

56    *   group => (none|firstauthor|entrytype|$field)
93 * - only => array([$field => $regexp], ...)
94 * - group => (none|year|firstauthor|entrytype|$field)
95 * - order_groups => (asc|desc)
96 * - sort_by => (DATE|$field)
97 * - order => (asc|desc)
98 * - lang => any string as long as proper lang/$s.php exists
106 $this->options = array(
108 'group' => 'year',
115 // lame replacement for non-constant default parameter
117 $this->sanitise = $sanitise;
120 $this->sanitise = create_function('$i', 'return $i;');
124 foreach ( $this->options as $key => $value ) {
126 $this->options[$key] = $options[$key];
133 if ( is_readable(dirname(__FILE__).'/lang/'.$this->options['lang'].'.php') ) {
134 require('lang/'.$this->options['lang'].'.php');
139 $this->options['lang'] = $translations;
141 $this->helper = new Helper($this->options);
144 $this->authorlist = array();
147 $this->authorlist[$tmp[1]] = "[[".$tmp[0]."|".$tmp[1]."]]";
165 self::$parser->loadString($bibtex);
166 $stat = self::$parser->parse();
172 $parsed = self::$parser->data;
196 if ( preg_match('/@\{group@/s', $template) + preg_match('/@\}group@/s', $template) < 2 ) {
197 $groupingDisabled = $this->options['group'];
198 $this->options['group'] = 'none';
202 if ( $this->options['group'] === 'none' ) {
203 $template = preg_replace(array('/@\{group@/s', '/@\}group@/s'), '', $template);
214 $data = $this->filter($data, $replacementKeys);
215 $data = $this->group($data);
216 $data = $this->sort($data);
217 $result = $this->translate($data, $template);
222 $this->options['group'] = $groupingDisabled;
233 * language file are put into a distinct group.
248 if ( empty($this->options['lang']['entrytypes'][$entry['entrytype']]) ) {
249 $entry['entrytype'] = $this->options['lang']['entrytypes']['unknown'];
254 foreach ( $this->options['only'] as $field => $regexp ) {
289 private function group(&$data) { function in BibtexConverter
292 if ( $this->options['group'] !== 'none' ) {
294 … if ( !empty($entry[$this->options['group']]) || $this->options['group'] === 'firstauthor' ) {
295 if ( $this->options['group'] === 'firstauthor' ) {
298 elseif ( $this->options['group'] === 'author' ) {
302 $target = $entry[$this->options['group']];
306 $target = $this->options['lang']['rest'];
317 $result[$this->options['lang']['all']] = $data;
324 * This function sorts the passed group of entries and the individual
333 if ( $this->options['group'] !== 'none' ) {
334 uksort($data, array($this->helper, 'group_cmp'));
338 foreach ( $data as &$group ) {
339 uasort($group, array($this->helper, 'entry_cmp'));
362 if ( $this->options['group'] !== 'none' ) {
363 $pattern = '/@\{group@(.*?)@\}group@/s';
365 // Extract group templates
369 // For all occurrences of an group template
374 foreach ( $data as $groupkey => $group ) {
375 $groups .= $this->translate_group($groupkey, $id++, $group, $group_tpl[1]);
386 foreach ( $data as $groupkey => $group ) { // loop will only be run once
387 $groups .= $this->translate_group($groupkey, 0, $group, $template);
394 * This function translates one entry group
397 * @param string key The rendered group's key
398 * @param int id A unique ID for this group
399 * @param array data Array of entries in this group
400 * @param string template The group part of the template
401 * @return string String representing the passed group wrt template
406 // Replace group values
407 if ( $this->options['group'] === 'entrytype' ) {
408 $key = $this->options['lang']['entrytypes'][$key];
425 $entries .= $this->translate_entry($entry, $entry_tpl[1]);
447 $result = $this->resolve_conditions($entry, $result);
456 $value = $this->authorlink($value);
464 $replacements []= call_user_func($this->sanitise, $value);
485 * Group 1 field field \w+
486 * Group 2 then operator .*? / <=|>=|==|!=|~
487 * Group 3 [else] value .*?
488 * Group 4 --- then .*?
489 * Group 5 --- [else] .*?
539 $resolved = $this->resolve_conditions($entry, $resolved);
548 * This function adds links to co-author websites where available.
555 $data = str_replace(array_keys($this->authorlist),$this->authorlist,$data);