File:  [Local Repository] / db / prgsrc / drupal / modules / chgk_db / classes / DbPackage / DbPackageChamp.class.php
Revision 1.4: download - view: text, annotated - select for diffs - revision graph
Sat Apr 24 21:45:51 2010 UTC (14 years ago) by roma7
Branches: MAIN
CVS tags: HEAD
Version 2 big update

<?php

class DbPackageChamp extends DbPackage {
  private $tours = FALSE;
  
  protected function setId() {
    $this->id = str_replace('.txt', '', $this->tour->FileName);
  }
  
  public function getAll() {
    $this->loadTours();
  }
  
  private function loadTours()  {
    if ($this->tours !== FALSE) {
        return $this->tours;
    }
    $res = $this->db->getChildrenRes($this->getDbId());
    while ($row = $this->db->fetch_row($res)) {
      $this->tours[$row->Number] = new DbPackageTour($row, $this);
      $this->tours[$row->Number] -> loadQuestions();
    }      
  }
/*  public function getPrintVersion() {
    $this->loadTours();
    $content = theme('chgk_db_champ_full', $this);
    return theme('chgk_db_print', $this->getTitle(), $content);
  }
*/

  public function loadChildren() {
     $this->children = array();
  }
  
  public function getTours() {
      return $this->tours;
  }
  public function isSingleTour() {
      return sizeof($this->tours)==1;
  }

  public function getImages() {
    $this->images = array();
    foreach ($this->tours as $t) {
        $this->images = array_merge($this->images, $t->getImages());
    }
    return $this->images;
  }

  public function getFb2MainPart() {
      return theme('chgk_db_tours_fb2', $this);
  }
  
  public function getHtmlContent() {
    $this->loadTours();
    return theme('chgk_db_champ_full', $this);  
  }

  public function hasPrintVersion() {
    return TRUE;
  }

  public function hasFb2() {
    return TRUE;
  }
    
}

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>