Ejemplo n.º 1
0
 public static function isEmpty($fld, &$videolist_row, &$theme_row, $gallery_list, $videoid, $AllowPagination, $total_number_of_rows)
 {
     $fields_theme = array('bgcolor', 'cssstyle', 'navbarstyle', 'thumbnailstyle', 'linestyle', 'listnamestyle', 'activevideotitlestyle', 'color1', 'color2', 'descr_style', 'rel', 'hrefaddon');
     if (in_array($fld, $fields_theme)) {
         $theme_row_array = get_object_vars($theme_row);
         if ($theme_row_array[$fld] == '') {
             return true;
         } else {
             return false;
         }
     }
     switch ($fld) {
         case 'cols':
             return false;
         case 'social':
             return false;
             break;
         case 'link':
             return false;
         case 'video':
             return false;
             break;
         case 'videolist':
             if ($videolist_row->listname == '') {
                 return true;
             } else {
                 return false;
             }
             break;
         case 'listname':
             if ($videolist_row->listname == '') {
                 return true;
             } else {
                 return false;
             }
             break;
         case 'videotitle':
             if ($theme_row->openinnewwindow == 4 or $theme_row->openinnewwindow == 5) {
                 return false;
             }
             $title = YoutubeGalleryLayoutRenderer::getTitleByVideoID($videoid, $gallery_list);
             if ($title == '') {
                 return true;
             } else {
                 return false;
             }
             break;
         case 'videodescription':
             if ($theme_row->openinnewwindow == 4 or $theme_row->openinnewwindow == 5) {
                 return false;
             }
             $description = YoutubeGalleryLayoutRenderer::getDescriptionByVideoID($videoid, $gallery_list);
             if ($description == '') {
                 return true;
             } else {
                 return false;
             }
             break;
         case 'videoplayer':
             return !$videoid;
             break;
         case 'navigationbar':
             if ($total_number_of_rows == 0) {
                 return true;
             } elseif ($total_number_of_rows > 0) {
                 return false;
             }
             break;
         case 'thumbnails':
             if ($total_number_of_rows == 0) {
                 return true;
             } elseif ($total_number_of_rows > 0) {
                 return false;
             }
             break;
         case 'mediafolder':
             if ($theme_row->mediafolder == '') {
                 return true;
             } else {
                 return false;
             }
             break;
         case 'count':
             return $total_number_of_rows > 0 ? false : true;
             break;
         case 'pagination':
             return $total_number_of_rows > 5 and $AllowPagination ? false : true;
             break;
         case 'width':
             return false;
             break;
         case 'height':
             return false;
             break;
         case 'instanceid':
             return false;
         case 'videoid':
             return false;
             break;
     }
     return true;
 }