You are here

function PARSEPAGE::type1 in Bibliography Module 5

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

File

bibtexParse/PARSEPAGE.php, line 43

Class

PARSEPAGE

Code

function type1($item) {
  $start = $end = FALSE;
  $array = preg_split("/--|-/", $item);
  if (sizeof($array) > 1) {
    if (is_numeric(trim($array[0]))) {
      $start = trim($array[0]);
    }
    else {
      $start = strtolower(trim($array[0]));
    }
    if (is_numeric(trim($array[1]))) {
      $end = trim($array[1]);
    }
    else {
      $end = strtolower(trim($array[1]));
    }
    if ($end && !$start) {
      $this->return = array(
        $end,
        $start,
      );
    }
    else {
      $this->return = array(
        $start,
        $end,
      );
    }
    return TRUE;
  }
  return FALSE;
}