version 1.3, 2010/03/21 18:06:04
|
version 1.4, 2010/04/24 21:45:51
|
Line 1
|
Line 1
|
<?php |
<?php |
|
|
class DbPackageChamp extends DbPackage { |
class DbPackageChamp extends DbPackage { |
private $tours; |
private $tours = FALSE; |
|
|
protected function setId() { |
protected function setId() { |
$this->id = str_replace('.txt', '', $this->tour->FileName); |
$this->id = str_replace('.txt', '', $this->tour->FileName); |
Line 11 class DbPackageChamp extends DbPackage {
|
Line 11 class DbPackageChamp extends DbPackage {
|
$this->loadTours(); |
$this->loadTours(); |
} |
} |
|
|
private function loadTours() { |
private function loadTours() { |
$res = $this->db->getToursRes($this->getDbId()); |
if ($this->tours !== FALSE) { |
|
return $this->tours; |
|
} |
|
$res = $this->db->getChildrenRes($this->getDbId()); |
while ($row = $this->db->fetch_row($res)) { |
while ($row = $this->db->fetch_row($res)) { |
$this->tours[$row->Number] = new DbPackageTour($row, $this); |
$this->tours[$row->Number] = new DbPackageTour($row, $this); |
$this->tours[$row->Number] -> loadQuestions(); |
$this->tours[$row->Number] -> loadQuestions(); |
} |
} |
} |
} |
public function getPrintVersion() { |
/* public function getPrintVersion() { |
$this->loadTours(); |
$this->loadTours(); |
$content = theme('chgk_db_champ_full', $this); |
$content = theme('chgk_db_champ_full', $this); |
return theme('chgk_db_print', $this->getTitle(), $content); |
return theme('chgk_db_print', $this->getTitle(), $content); |
|
} |
|
*/ |
|
|
|
public function loadChildren() { |
|
$this->children = array(); |
} |
} |
|
|
public function getTours() { |
public function getTours() { |
Line 38 class DbPackageChamp extends DbPackage {
|
Line 46 class DbPackageChamp extends DbPackage {
|
} |
} |
return $this->images; |
return $this->images; |
} |
} |
public function getImagesBinaries() { |
|
$images=$this->getImages(); |
public function getFb2MainPart() { |
$result = ''; |
return theme('chgk_db_tours_fb2', $this); |
foreach ($images as $i) { |
} |
$name = file_directory_path()."/$i"; |
|
$result.="<binary content-type='image/jpeg' id='$i'>"; |
public function getHtmlContent() { |
$file = fopen($name,'rb'); |
$this->loadTours(); |
$str_file=fread($file,filesize($name)); |
return theme('chgk_db_champ_full', $this); |
$result.=base64_encode($str_file); |
} |
$result.="</binary>"; |
|
fclose($file); |
public function hasPrintVersion() { |
} |
return TRUE; |
return $result; |
} |
|
|
|
public function hasFb2() { |
|
return TRUE; |
} |
} |
|
|
} |
} |