/** * Display List of Video Type * @param int ID of type selected * @return string the selecbox contains list types */ public static function tntDisplayListType($typeID = 0) { $listType = TNT_VideoType::tntGetTypes(); $view = ""; $view .= '<select name="vLinkType">'; foreach ($listType as $type) { if ($typeID == $type->video_type_id) { $view .= '<option value="' . $type->video_type_id . '" selected>' . $type->video_type_title . '</option>'; } else { $view .= '<option value="' . $type->video_type_id . '">' . $type->video_type_title . '</option>'; } } $view .= '</select>'; return $view; }
/** * Function to display the "video type manage" page */ function tnt_video_type_manager() { ?> <div class="wrap"> <?php screen_icon('upload'); ?> <h2>Video Type Manage</h2> <hr /> <table class="tntTable widefat"> <thead> <tr> <th>Type</th> <th>Action</th> </tr> </thead> <tfoot> <tr> <th>Type</th> <th>Action</th> </tr> </tfoot> <tbody> <?php $tntVideoTypes = TNT_VideoType::tntGetTypes(); foreach ($tntVideoTypes as $tntT) { ?> <tr> <td><?php echo $tntT->video_type_title; ?> </td> <td> <a href="<?php echo admin_url(); ?> admin.php?page=tnt_video_type_edit_page&typeID=<?php echo $tntT->video_type_id; ?> " class="button-secondary">Edit</a> <a href="<?php echo admin_url(); ?> admin.php?page=tnt_video_type_del_page&typeID=<?php echo $tntT->video_type_id; ?> " class="button-secondary">Delete</a> </td> </tr> <?php } ?> </tbody> </table> </div> <?php }