Diff for /db/prgsrc/drupal/modules/chgk_db/classes/DbEditor.class.php between versions 1.1 and 1.2

version 1.1, 2010/04/24 21:45:50 version 1.2, 2010/05/23 09:31:39
Line 14  class DbEditor { Line 14  class DbEditor {
       $this->loadFromDatabase();        $this->loadFromDatabase();
     }      }
   }    }
   public function getHtmlPage() {  
     private function loadTours() {
     $res = $this->db->editorToursRes($this->id);      $res = $this->db->editorToursRes($this->id);
     $this->tours = array();      $this->tours = array();
     while ( $tourRow = db_fetch_object($res) ) {      while ( $tourRow = db_fetch_object($res) ) {
       $this->tours[] =DbPackage::newFromRow($tourRow);        $this->tours[] =DbPackage::newFromRow($tourRow);
     }      }
     }
   
       private function sortByYear() {
         foreach ($this->tours as $tour) {
           $this->years[$tour->getYear()][] = $tour;
         }
       }
   
     public function getHtmlPage() {
       $this->loadTours();
       $this->sortByYear();
     $output = '';      $output = '';
     $output .= '<ul>';      foreach ($this->years as $year=>$tours) {
     foreach ($this->tours as $t) {        $output .= "<h3>".$year."</h3>\n";
       $output.="<li>".l($t->getFullTitle(),$t->getLink())."</li>\n";        $output .= '<ul>';
         foreach ($tours as $t) {
           $output.="<li>".l($t->getFullTitle(),$t->getLink())."</li>\n";
         }
         $output .= '</ul>';
     }      }
     $output .= '</ul>';  
   
     return $output;      return $output;
   }    }

Removed from v.1.1  
changed lines
  Added in v.1.2


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