Esempio n. 1
0
 function getAlbumArray(&$album_array, $access = 1, $hide = 0, $level = 0)
 {
     $mgadmin = SEC_hasRights('mediagallery.admin');
     $count = 0;
     $indent = '';
     $z = 0;
     while ($z < $level) {
         $indent .= "&nbsp;&nbsp;&nbsp;&nbsp;";
         $z++;
     }
     if ($this->access >= $access || $this->id == 0) {
         if ($this->id != $hide) {
             if (!$this->hidden || $this->hidden && $mgadmin) {
                 $tatitle = strip_tags($this->title);
                 if (strlen($tatitle) > 50) {
                     $aTitle = COM_truncate($tatitle, 50) . '...';
                 } else {
                     $aTitle = $tatitle;
                 }
                 $album_array[$indent . $aTitle] = $this->id;
                 $count++;
             }
         }
         $children = $this->getChildren();
         foreach ($children as $child) {
             $child_album = new mgAlbum($child);
             $count += $child_album->getAlbumArray($album_array, $access, $hide, $level + 1);
         }
     }
     return $count;
 }