Diff for /db/prgsrc/drupal/modules/chgk_db/classes/DbPackage/DbPackageTour.class.php between versions 1.4 and 1.5

version 1.4, 2010/03/21 18:06:04 version 1.5, 2010/04/24 21:45:51
Line 3  require_once(dirname(__FILE__)."/../DbQu Line 3  require_once(dirname(__FILE__)."/../DbQu
   
 class DbPackageTour extends DbPackage {  class DbPackageTour extends DbPackage {
   public $questions;    public $questions;
   private $parent;  
   
   public function __construct($row, $parent = FALSE) {  
       parent::__construct($row);  
       $this->setParent($parent);  
   }  
   
   public function getAll() {    public function getAll() {
     $this->loadQuestions();      $this->loadQuestions();
     return $this;      return $this;
   }    }
   
   public function getPrintVersion() {  /*  public function getPrintVersion() {
     $this->loadQuestions();       $this->loadQuestions();
      $content = theme('chgk_db_tour', $this);       $content = theme('chgk_db_tour', $this);
      return theme('chgk_db_print', $this->getLongTitle(), $content);       return theme('chgk_db_print', $this->getLongTitle(), $content);
   }    }
     */
     
     public function getHtmlContent() {
       $this->loadQuestions();
       return theme('chgk_db_tour', $this);
     }
       
   public function loadQuestions() {    public function loadQuestions() {
     if (isset($this->questions)) return;      if (isset($this->questions)) return;
Line 32  class DbPackageTour extends DbPackage { Line 33  class DbPackageTour extends DbPackage {
       $this->questions[$row->Number] = $factory->getQuestion($row);        $this->questions[$row->Number] = $factory->getQuestion($row);
     }      }
   }    }
      
   public function setParent($parent = FALSE) {  
     if ($parent) {  
         $this->parent = $parent;  
     } else {  
         $this->parent = new DbPackageChamp($this->tour->ParentId);  
     }  
   }  
   
   
   public function getParent() {  
     if ($this->parent) {  
       return $this->parent;  
     }  
     return FALSE;  
   }  
       
   public function getLongTitle() {    public function getLongTitle() {
     return $this-> getParent()->getTitle(). '  '. $this->getTitle();      return $this-> getParent()->getTitle(). '  '. $this->getTitle();
   }    }
     
   public function getParentInfo() {    public function getParentInfo() {
     return $this->parent->getInfo();      return $this->parent->getInfo();
   }    }
Line 66  class DbPackageTour extends DbPackage { Line 53  class DbPackageTour extends DbPackage {
       }        }
       return $this->images;        return $this->images;
   }    }
     public function isSingleTour() {
         return true;
     }
     public function getFb2MainPart() {
         return theme('chgk_db_tour_fb2', $this);
     }
   
     public function hasOwnInfo() {
         return
            preg_replace('/\s/sm', '', $this->getParentInfo())
                    !=
            preg_replace('/\s/sm', '', $this->getInfo());
     }
   
      public function getFullTitle() {
        $result=  $this->getParent()->getTitle();
        if (!preg_match('/\.\s*$/', $result)) {
                $result .= ". ";
        }
        $result.=" ".$this->getTitle() ;
        return $result;
     }
     public function loadChildren() {
        $this->children = array();
     }
     
     public function hasPrintVersion() {
       return TRUE;
     }
   
     public function hasFb2() {
       return TRUE;
     }
     
 }  }

Removed from v.1.4  
changed lines
  Added in v.1.5


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