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

56    *   group => (none|firstauthor|entrytype|$field)
86 * - only => array([$field => $regexp], ...)
87 * - group => (none|year|firstauthor|entrytype|$field)
88 * - order_groups => (asc|desc)
89 * - sort_by => (DATE|$field)
90 * - order => (asc|desc)
91 * - lang => any string as long as proper lang/$s.php exists
99 $this->options = array(
101 'group' => 'year',
108 // lame replacement for non-constant default parameter
110 $this->sanitise = $sanitise;
113 $this->sanitise = create_function('$i', 'return $i;');
117 foreach ( $this->options as $key => $value ) {
119 $this->options[$key] = $options[$key];
126 if ( is_readable(dirname(__FILE__).'/lang/'.$this->options['lang'].'.php') ) {
127 require('lang/'.$this->options['lang'].'.php');
132 $this->options['lang'] = $translations;
134 $this->helper = new Helper($this->options);
150 self::$parser->loadString($bibtex);
151 $stat = self::$parser->parse();
157 $parsed = self::$parser->data;
181 if ( preg_match('/@\{group@/s', $template) + preg_match('/@\}group@/s', $template) < 2 ) {
182 $groupingDisabled = $this->options['group'];
183 $this->options['group'] = 'none';
187 if ( $this->options['group'] === 'none' ) {
188 $template = preg_replace(array('/@\{group@/s', '/@\}group@/s'), '', $template);
199 $data = $this->filter($data, $replacementKeys);
200 $data = $this->group($data);
201 $data = $this->sort($data);
202 $result = $this->translate($data, $template);
207 $this->options['group'] = $groupingDisabled;
218 * language file are put into a distinct group.
233 if ( empty($this->options['lang']['entrytypes'][$entry['entrytype']]) ) {
234 $entry['entrytype'] = $this->options['lang']['entrytypes']['unknown'];
239 foreach ( $this->options['only'] as $field => $regexp ) {
274 private function group(&$data) { function in BibtexConverter
277 if ( $this->options['group'] !== 'none' ) {
279 … if ( !empty($entry[$this->options['group']]) || $this->options['group'] === 'firstauthor' ) {
280 if ( $this->options['group'] === 'firstauthor' ) {
283 elseif ( $this->options['group'] === 'author' ) {
287 $target = $entry[$this->options['group']];
291 $target = $this->options['lang']['rest'];
302 $result[$this->options['lang']['all']] = $data;
309 * This function sorts the passed group of entries and the individual
318 if ( $this->options['group'] !== 'none' ) {
319 uksort($data, array($this->helper, 'group_cmp'));
323 foreach ( $data as &$group ) {
324 uasort($group, array($this->helper, 'entry_cmp'));
347 if ( $this->options['group'] !== 'none' ) {
348 $pattern = '/@\{group@(.*?)@\}group@/s';
350 // Extract group templates
354 // For all occurrences of an group template
359 foreach ( $data as $groupkey => $group ) {
360 $groups .= $this->translate_group($groupkey, $id++, $group, $group_tpl[1]);
371 foreach ( $data as $groupkey => $group ) { // loop will only be run once
372 $groups .= $this->translate_group($groupkey, 0, $group, $template);
379 * This function translates one entry group
382 * @param string key The rendered group's key
383 * @param int id A unique ID for this group
384 * @param array data Array of entries in this group
385 * @param string template The group part of the template
386 * @return string String representing the passed group wrt template
391 // Replace group values
392 if ( $this->options['group'] === 'entrytype' ) {
393 $key = $this->options['lang']['entrytypes'][$key];
410 $entries .= $this->translate_entry($entry, $entry_tpl[1]);
432 $result = $this->resolve_conditions($entry, $result);
444 $replacements []= call_user_func($this->sanitise, $value);
464 * Group 1 field field \w+
465 * Group 2 then operator .*? / <=|>=|==|!=|~
466 * Group 3 [else] value .*?
467 * Group 4 --- then .*?
468 * Group 5 --- [else] .*?
518 $resolved = $this->resolve_conditions($entry, $resolved);