protected function updateTemplate_CollectionPhotos(HTML_Indexer $index = null, Kiwi_Product $product_data = null)
 {
     if ($index === null) {
         $index = $this->_index;
     }
     if ($product_data === null) {
         $product_data = $this->_product_data;
     }
     $vars = array('obrazek_kolekce', 'ma_fotografie_kolekce', 'nema_fotografie_kolekce', 'fotografie_kolekce');
     foreach ($vars as $varname) {
         ${$varname} = $index->{$varname};
     }
     $collection = $product_data->collection;
     foreach ($ma_fotografie_kolekce as $elem) {
         $elem->active = !empty($collection);
     }
     foreach ($nema_fotografie_kolekce as $elem) {
         $elem->active = empty($collection);
     }
     if (!empty($fotografie_kolekce)) {
         if (empty($obrazek_kolekce)) {
             throw new Template_Element_Missing_Exception('obrazek_kolekce');
         }
         if (count($obrazek_kolekce) !== 1) {
             throw new Template_Invalid_Structure_Exception('The "obrazek_kolekce" element duplicity');
         }
         $obrazek_kolekce = $obrazek_kolekce[0];
         if (!empty($collection)) {
             $nav = new Project_Navigator();
             $collection_photos_dir = $nav->get($this->name . '_photos_collection');
             $max_cp = 60;
             foreach ($collection as $citem) {
                 if ($max_cp-- == 0) {
                     break;
                 }
                 $photo_small = $collection_photos_dir . $citem['FileName'];
                 $img = clone $obrazek_kolekce;
                 $img->src = $photo_small;
                 $a = new HTML_A();
                 $qso = new Query_String();
                 if ($citem['URL'] == '') {
                     $qso->set($this->ns . 'p', $citem['ID']);
                     $a->href = $this->_catalog_href . $qso->__toString();
                 } else {
                     $a->href = $this->_catalog_urlbase . $citem['URL'] . $qso->__toString();
                 }
                 $a->title = $citem['Title'];
                 $a->add($img);
                 foreach ($fotografie_kolekce as $elem) {
                     $elem->add($a);
                 }
             }
         }
     }
 }