You are here

public function PARSEPAGE::init in Bibliography Module 7

Same name and namespace in other branches
  1. 5 bibtexParse/PARSEPAGE.php \PARSEPAGE::init()
  2. 6.2 modules/bibtexParse/PARSEPAGE.php \PARSEPAGE::init()
  3. 6 bibtexParse/PARSEPAGE.php \PARSEPAGE::init()
  4. 7.3 plugins/biblio_style/bibtex/PARSEPAGE.php \PARSEPAGE::init()
  5. 7.2 modules/bibtexParse/PARSEPAGE.php \PARSEPAGE::init()

The first valid number it finds from the left as page_start setting page_end to NULL.

File

modules/bibtexParse/PARSEPAGE.php, line 32

Class

PARSEPAGE
PARSEPAGE: BibTeX PAGES import class.

Code

public function init($item) {
  $item = trim($item);
  if ($this
    ->type1($item)) {
    return $this->return;
  }

  // else, return first number we can find.
  if (preg_match("/(\\d+|[ivx]+)/i", $item, $array)) {
    return array(
      $array[1],
      FALSE,
    );
  }

  // No valid page numbers found.
  return array(
    FALSE,
    FALSE,
  );
}