<?php
defined('_JEXEC') or die;

/**
 *
 * @package  MediaLibrary
 * @copyright 2021 Andrey Kvasnevskiy-OrdaSoft(akbet@mail.ru); Rob de Cleen(rob@decleen.com);
 * Homepage: https://ordasoft.com
 * @version: 4.6 Free
 * @license GNU General Public license version 2 or later; see LICENSE.txt
 *
 */

global $my;
if($option == 'com_simplemembership')
showTabs();
$cat_link_arr = array();
        foreach ($cat as $category) {
            $link = sefRelToAbs('index.php?option=' . $option . '&task=alonecategory&catid='
                . $category->catid . '&Itemid=' . $Itemid);
            $anchor = "<a href='$link'>{$category->name}</a>";
            $cat_link_arr[] = $anchor;
        }
        // --
        ?>

<noscript>
    Javascript is required to use MediaLibrary 
    <a href="https://ordasoft.com/media-library-joomla-extension">
        Media Library Software for create virtual library.
    </a>,
    <a href="https://ordasoft.com/media-library-joomla-extension">
        MediaLibrary this is software for create media store website for rent, sell audio, video, game and other digital product 
    </a>
</noscript>

<div id="medialibrary">

    <div class="ml-row media-tools-container">

        <?php if (!$params->get('printItem')) { ?>
            <div class="componentheading<?php echo $params->get('pageclass_sfx'); ?> ml-collumn-lg-9 ml-collumn-md-9 ml-collumn-sm-12 ml-collumn-xs-12">
              <?php echo $currentcat->header; ?>
            </div>
        <?php } ?>
        </div>


      <div class="container_view_media">
        <table width="100%" cellpadding="4" cellspacing="0" border="0" align="center"  class="basictable ml-basictable-view-media">


             <?php
     JPluginHelper::importPlugin('content');
     $dispatcher = JDispatcher::getInstance();
     ?>

     <tr>
     <td nowrap="nowrap" width="20%" align="right">
     <strong><?php echo _MEDIALIBRARY_LABEL_TITLE; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
     </td>
     <td>
     <?php echo $media_type_class->title; ?>
     </td>
     </tr>
     <tr>
      <td nowrap="nowrap" width="20%" align="right">
        <strong><?php echo _MEDIALIBRARY_LABEL_VIDEOID; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
      </td>
      <td>
        <?php echo $media_type_class->video_id; ?>
      </td>
    </tr>
    <tr>
      <td nowrap="nowrap" align="right">
        <strong><?php echo _MEDIALIBRARY_LABEL_ASIN; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
      </td>
      <td>
        <?php echo $media_type_class->asin; ?>
      </td>
    </tr>
     <?php if(!empty($media_type_class->producers)){

         // print_r($produser);exit;
        ?>
           <tr>
             <td nowrap="nowrap" align="right">
               <strong><?php echo _MEDIALIBRARY_LABEL_PRODUCER; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
             </td>
             <td>
               <?php
               foreach ($media_type_class->producers as $producer) {
                  $link1 = "index.php?option=com_medialibrary&amp;task=view_author&amp;pid=" . $producer->id .
                  "&amp;Itemid=" . $Itemid;
                  echo '<a href="'.sefRelToAbs($link1).'">'.$producer->name.'</a><br>';
                }?>
             </td>
           </tr>
     <?php
    }
     if(!empty($media_type_class->directors)){

         // print_r($produser);exit;
        ?>
       <tr>
       <td nowrap="nowrap" align="right">
       <strong><?php echo _MEDIALIBRARY_LABEL_DIRECTOR; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
       </td>
       <td>
       <?php
       foreach ($media_type_class->directors as $director) {
                  $link1 = "index.php?option=com_medialibrary&amp;task=view_author&amp;pid=" . $director->id .
                  "&amp;Itemid=" . $Itemid;
                  echo '<a href="'.sefRelToAbs($link1).'">'.$director->name.'</a><br>';
       } ?>
       </td>
       </tr>
       <?php
    }
     if(!empty($media_type_class->actors)){
          ?>
         <tr>
         <td nowrap="nowrap" align="right">
         <strong><?php echo _MEDIALIBRARY_LABEL_ACTORS; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
         </td>
         <td>
         <?php
         foreach ($media_type_class->actors as $actor) {
                  $link1 = "index.php?option=com_medialibrary&amp;task=view_author&amp;pid=" . $actor->id .
                  "&amp;Itemid=" . $Itemid;
                  echo '<a href="'.sefRelToAbs($link1).'">'.$actor->name.'</a><br>';
         } ?>
         </td>
         </tr>
         <?php }
         if(trim($media_type_class->release_date)){ ?>

           <tr>
           <td nowrap="nowrap" align="right">
           <strong><?php echo _MEDIALIBRARY_LABEL_PUB_DATE; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
         </td>
         <td>
         <?php
              $date = data_transformer_med($media_type_class->release_date,'from_only_data');
              echo $date;
           ?>
           </td>
           </tr>
             <?php
              }
               if(!empty($media_type_class->studio)){
              ?>

             <tr>
             <td nowrap="nowrap" align="right">
             <strong><?php echo _MEDIALIBRARY_LABEL_STUDIO; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
             </td>
             <td>
             <?php
             foreach ($media_type_class->studio as $studio_id) {
                  $link1 = "index.php?option=com_medialibrary&amp;task=view_author&amp;pid="
                    . $studio_id->id ."&amp;Itemid=" . $Itemid;
                  echo '<a href="'.sefRelToAbs($link1).'">'.$studio_id->name.'</a><br>';
             } ?>
             </td>
             </tr>

             <?php }
             if(trim($media_type_class->region)){ ?>

               <tr>
               <td nowrap="nowrap" align="right">
               <strong><?php echo _MEDIALIBRARY_LABEL_REGION; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
               </td>
               <td>
               <?php echo $media_type_class->region; ?>
               </td>
               </tr>
               <?php }
               if(trim($media_type_class->number_of_discs)){ ?>

                 <tr>
                 <td nowrap="nowrap" align="right">
                 <strong><?php echo _MEDIALIBRARY_LABEL_NUMBER_OF_DISCS;
                  ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
                 </td>
                 <td>
                 <?php echo $media_type_class->number_of_discs; ?>
                 </td>
                 </tr>

                 <?php }
                 if(trim($media_type_class->run_time)){ ?>

                   <tr>
                   <td nowrap="nowrap" align="right">
                   <strong><?php echo _MEDIALIBRARY_LABEL_RUNTIME; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
                   </td>
                   <td>
                   <?php echo $media_type_class->run_time; ?>
                   </td>
                   </tr>

                   <?php }
                   if(trim($media_type_class->format)){ ?>

                     <tr>
                     <td nowrap="nowrap" align="right">
                     <strong><?php echo _MEDIALIBRARY_LABEL_FORMAT; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
                     </td>
                     <td>
                     <?php echo $media_type_class->format; ?>
                     </td>

                     </tr>
                     <?php }  ?>
                    <tr>
                     <td nowrap="nowrap" align="right">
                     <strong><?php echo _MEDIALIBRARY_LABEL_LANGUAGE;
                      ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
                     </td>
                     <td>
                     <?php //echo _MEDIALIBRARY_LANGUAGE_.strtoupper($book->language);
                     echo $media_type_class->language;//old ENGLISH strtoupper($book->language);
                     ?>
                     </td>
                     </tr>
                     <tr>
                       <?php
                     if($params->get( 'show_price' ) !== '0' 
                        && trim($media_type_class->price) != ''){ ?>
                       <td nowrap="nowrap" align="right">
                        <strong><?php echo _MEDIALIBRARY_LABEL_PRICE;
                          ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
                       </td>
                    <?php } ?>
                    <td>
                    <?php
                    if ($medialibrary_configuration['price_unit_show'] == '1'){
                echo  formatMoney($media_type_class->price, true,
                    $medialibrary_configuration['price_format']), ' ',  $media_type_class->priceunit;
              }
                else {
                echo  $media_type_class->priceunit, ' ',formatMoney($media_type_class->price, true,
                    $medialibrary_configuration['price_format']);
                    ?>
                    </td>
                    </tr>
                    <?php }  ?>
                       <tr>
                       <td nowrap="nowrap" align="right">
                       <strong><?php echo _MEDIALIBRARY_LABEL_RATING;
                        ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
                       </td>
                       <td>
                       <img src="<?php echo JURI::root();?>components/com_medialibrary/images/rating-<?php
                          if ($media_type_class->rating == 0) echo $media->rating;
                          else echo $media_type_class->rating;  ?>.gif" alt="<?php
                          if ($media_type_class->rating == 0) echo ($media->rating)/2;
                          else echo ($media_type_class->rating)/2; ?>" border="0" />&nbsp;
                       </td>
                       </tr>
                       <tr>
                       <td nowrap="nowrap" align="right" valign="top">
                       <strong><?php echo _MEDIALIBRARY_LABEL_PICTURE;
                        ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
                       </td>
                       <td>
                       <?php
                       //for local images
                       $imageURL = $media_type_class->imageURL;
                       if($imageURL != '' && substr($imageURL,0,4) != "http")
                       {
                         $imageURL = $mosConfig_live_site .  $media_type_class->imageURL;;
                       }

                       if($imageURL != ''){
                         echo '<img src="'.$imageURL.'" alt="cover" border="0" style="height:'
                          .$medialibrary_configuration['foto']['high'].'px; width:'
                          .$medialibrary_configuration['foto']['width'].'px;" class="view-media-img"/>';
                       } else{
                          echo '<img src="'.$mosConfig_live_site
                            .'/components/com_medialibrary/images/' . _MEDIALIBRARY_NO_PICTURE
                            .'" alt="no-img_eng.gif" border="0" style="height:'
                            .$medialibrary_configuration['foto']['high'].'px; width:'
                            .$medialibrary_configuration['foto']['width'].'px;"/>';
                       }?>

                       <!--************   begin add button 'buy now'   ************************-->

                       <?php //show button 'buy now'
                       if ( $params->get('show_input_buy_now') && $media->informationFrom == 1)
                       {
                         ?>

                         &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                         <a href="<?php echo sefRelToAbs(
                          "index.php?option=com_medialibrary&amp;task=new_url&amp;id=". $media->id);
                          ?>" target="blank">
                         <img src="<?php echo JURI::root();
                          ?>/components/com_medialibrary/images/amazon/buy_now.png"
                          alt="Button Buy now" border="0" height="27" width="82" />
                         </a>

                         <?php
                       }
                       ?>
                       <!--************************   end add button 'buy now'   ******************-->
                       <!--************   begin add button 'buy now vm'   ************************-->
                       <?php //show button 'buy now vm'
                       if ( $params->get('show_input_buy_now_vm') )
                       {
                         ?>
                         <a class="buy_now"  href="<?php echo sefRelToAbs(
                          "index.php?option=com_medialibrary&task=new_url_for_vm&id=".$media->id);
                          ?>" target="blank">
                         <img src="<?php echo $mosConfig_live_site;
                          ?>/components/com_medialibrary/images/amazon/buy_now_vm.png"
                          alt="Button Buy now" border="0" height="65" width="82" />
                         </a>
                         <?php
                       }
                       ?>
                       <!--************************   end add button 'buy now vm'   ******************-->
                       </td>
                       </tr>


    <?php
    if ($params->get('show_emedisrequest') && $media_type_class->emediaURL != null) {
        $session = JFactory::getSession();
        $sid = $session->getId();
        $session->set("ssmid", $sid);
        setcookie('ssd', $sid, time() + 60 * 60 * 24, "/");
    ?>
            <tr>
                <td align="right">
                    <strong><?php echo _MEDIALIBRARY_LABEL_EMEDIA; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
                </td>
                <td align ="left">
                <?php $j = 0;
        $endFile = '';
        foreach($media_type_class->emediaURL as $efile) {

            $endFile = pathinfo($efile->location, PATHINFO_EXTENSION);

            if (strpos($_SERVER["HTTP_REFERER"], $_SERVER['SERVER_NAME']) !== false && 
                    !strstr($efile->location, "http")) {
                $name = explode('/', $efile->location);
                $file_path = $mosConfig_live_site . $medialibrary_configuration['emedias']['location'] 
                    . $name[count($name) - 1];
            } else {
                $file_path = $efile->location;
            }
    ?>
            <a href="<?php echo $file_path  ; ?>" target="blank">
            <?php echo _MEDIALIBRARY_LABEL_EMEDIA_DOWNLOAD . ++$j . '.' . $endFile; ?>
            </a></br>
            <?php
        } 
        ?>
                </td>
            </tr>
            <?php
    }
    ?>

        <?php //lend out??
        if( $params->get('show_lendstatus')) {
          $lend = $media->getAllLends();
		      if ($lend) {
            //$num = count($lend);
            if (!$lend[0]->lend_return) {
                $database = JFactory::getDbo();
                $query = "SELECT owner_ID as owner FROM #__medialibrary
                          WHERE media_type='book' AND media_id =" . $media_type_class->id;
                $database -> setQuery($query);
                $owner = $database -> loadResult();
                $user = JFactory::getUser();
                ?>
                <tr>
                <td align="right" valign="top">

                    <strong><?php if (!$lend[0]->lend_return) { echo  _MEDIALIBRARY_LABEL_LEND_FROM_UNTIL; }
                      ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
                </td>
                <td>
                    <?php
                    $d_format = str_replace("%", '', $medialibrary_configuration["date_format"]);
                    for ($e = 0, $m = count($lend); $e < $m; $e++) {
                        if ($owner == $user->id) {
                            $d1=date(str_replace("%", "", $medialibrary_configuration['date_format']),
                                strtotime($lend[$e]->lend_from));
                            $d2=date(str_replace("%", "", $medialibrary_configuration['date_format']),
                                strtotime($lend[$e]->lend_until));
                            //$date =$e+1 .")     ". substr($d1, 0, 10) . "--" . substr($d2, 0, 10)."<BR />";
                            $date =substr($d1, 0, 11) . "--" . substr($d2, 0, 11)."<BR />";
                            print_r($date);
                        } elseif (($lend[$e]->lend_return == "") || ($lend[$e]->lend_return == NULL) ||
                              ($lend[$e]->lend_return == 0)) {
                            $d1=date(str_replace("%", "", $medialibrary_configuration['date_format']),
                                strtotime($lend[$e]->lend_from));
                            $d2=date(str_replace("%", "", $medialibrary_configuration['date_format']),
                                strtotime($lend[$e]->lend_until));
                            $date =substr($d1, 0, 11) . "--" . substr($d2, 0, 11)."<BR />";
                            print_r($date);
                        }
                    }


                    ?></td>
                </tr><?php
            }
          }
        } ?>
        <?php
          if(trim($media_type_class->comment)){
              ?>
              <tr>
              <td align="right" valign="top">
              <strong><?php echo _MEDIALIBRARY_LABEL_COMMENT; ?>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong>
              </td>
              <td>
              <?php
              $err_state = ini_get('display_errors');
              ini_set('display_errors','Off');
              $idesc = $media_type_class->comment; //load the desc into a variable
              $plug_row->text = $idesc; // load the var into plugin_row object
              $results = $dispatcher->trigger('onPrepareContent', array (&$plug_row, &$plug_params ), true);
              //run mambot onPrepareContent on plug_row object
              $idesc = $plug_row->text; //get new content from plug_row object to value
              echo $idesc; //echo new content out
              ini_set('display_errors',$err_state);
              ?>
              </td>
              </tr>
              <?php } ?>

    </table>
    </div>

      <div class="dispaly_media_player ml-row">

          <?php if (!$params->get('printItem')) {// don't show buttons on print ?>

              <?php
              include_once ($mosConfig_absolute_path
                  . '/components/com_medialibrary/views/view_player/tmpl/player.php');
              play_one_video($media_type_class, $params);
              ?>            

              <?php
              play_one_audio($media_type_class, $params);
              ?>

          <?php }// don't show buttons on print ?>
      </div>
    


        <form action="<?php echo sefRelToAbs("index.php?option=" . $option
          . "&task=lend_request&tab=getmymediasTab&is_show_data=1&Itemid=" . $Itemid); ?>"
              method="post" name="book" class="form_lend_request_btn">
                    <?php
                    if ($params->get('show_lendrequest') && $params->get('show_lendstatus')) {
                          $link_rec = sefRelToAbs("index.php?option=" . $option
                          . "&task=lend_request&tab=getmymediasTab&is_show_data=1&Itemid=" . $Itemid
                          . "&mid[]=".$media_type_class->global_id); ?>
                      <a href="<?php echo $link_rec;?>" >
                        <div class="lend-request-btn">
                          <?php echo _MEDIALIBRARY_LABEL_BUTTON_LEND_REQU;?>
                        </div>
                      </a>
                      <?php
                      }?>
            <input type="hidden" name="mid[]" value="<?php echo $media->id; ?>" />
        </form>
       <?php
        //show the reviews
        if ($params->get('show_reviews')) {
            $reviews = $media->getReviews();
            ?>

            <div class="reviews_list_container">

              <?php
              if ( count($reviews) > 0 ) {
              ?>
                <div class="componentheading<?php echo $params->get('pageclass_sfx'); ?> componentheading_review">
                            <?php echo _MEDIALIBRARY_LABEL_REVIEWS; ?>
                </div>

              <?php
              }
              ?>

                <div class="reviews_list">

                <?php
                if ($reviews != null && count($reviews) > 0) {
                    for ($m = 0, $n = count($reviews); $m < $n; $m++) {
                        $review = $reviews[$m];
                        ?>
                        <div class="review_item ">

                            <div class="ml-row">

                                <div class="ml-collumn-xs-12 ml-collumn-sm-12 ml-collumn-md-12 ml-collumn-lg-9">
                                    <div class="rewiew_title">
                                        <strong>
                                            <?php echo $review->title; ?>
                                        </strong>
                                    </div>
                                </div>

                                <div class="ml-collumn-xs-12 ml-collumn-sm-3 ml-collumn-md-3 ml-collumn-lg-2">
                                    <div class="rewiew_date">
                                        <?php
                                        $date = data_transformer_med($review->date,'from');
                                        echo $date;
                                        ?>
                                    </div>
                                </div>

                                <div class="ml-collumn-xs-12 ml-collumn-sm-3 ml-collumn-md-3 ml-collumn-lg-1">
                                    <div class="rewiew_rating">
                                        <img src="<?php echo JURI::root();
                                        ?>/components/com_medialibrary/images/rating-<?php
                                        echo $review->rating; ?>.gif" alt="<?php
                                        if ($media_type_class->rating == 0) echo $media->rating;
                                        else echo $media_type_class->rating;  ?>.gif" alt="<?php
                                        if ($media_type_class->rating == 0) echo ($media->rating)/2;
                                        else echo ($media_type_class->rating)/2; ?>" border="0" /> 
                                    </div>
                                </div>
                            </div>

                            <div class="review_comment">
                                <?php echo $review->comment; ?>
                            </div>

                        </div>
                        <?php
                        }
                        }
                        ?>
                </div>
            </div>


            <div class="review_form_container">
            <?php
            if ($params->get('show_inputreviews')) {
                ?>
                <!--***********   begin add for show/hiden button "Add review"   ** ******-->
                <div id ="button_hidden_review"
                style="<?php
                if (isset($_REQUEST['err_msg'])) {
                    echo 'display:none';
                }
                ?>"
                >

                    <input type="submit" name="submit" value="<?php
                      echo _MEDIALIBRARY_LABEL_BUTTON_ADD_REVIEW;
                      ?>" class="button" onclick="ml_button_hidden(true)"/>

                </div>
              <?php }// don't show buttons on print ?>
                <!--***********   end add for show/hiden button "Add review"   ************************-->

                <div id="hidden_review" 

               style="<?php
                    if (isset($_REQUEST['err_msg'])) {
                        echo 'display:block';
                    } else {
                        echo 'display:none';
                    }
                ?>" 
                >
                    <div class="componentheading<?php echo $params->get('pageclass_sfx'); ?> componentheading_review">
                                    <?php echo _MEDIALIBRARY_LABEL_ADDREVIEW; ?>
                    </div>
                    <form action="<?php echo sefRelToAbs("index.php?option="
                      . $option . "&task=review&Itemid=" . $Itemid); ?>" method="post" name="review_m">

                      <div class="ml-row">

                        <div class="ml-collumn-xs-12 ml-collumn-sm-8 ml-collumn-md-8 ml-collumn-lg-6">

                            <div>
                                <p>
                                    <?php echo _MEDIALIBRARY_LABEL_REVIEW_TITLE; ?>
                                </p>

                                <div>                                    
                                    <input class="inputbox" type="text" name="title" size="80"
                                    value="<?php
                                    if (isset($_REQUEST["title"])) {
                                    echo $_REQUEST["title"];
                                    }
                                    ?>" placeholder="Your title" />
                                </div>
                            </div>

                            <div>
                                <p>
                                     <?php echo _MEDIALIBRARY_LABEL_REVIEW_COMMENT; ?>
                                </p>

                                <div>                                    
                                    <textarea align= "top" name="comment" id="comment" cols="60"
                                    rows="10"  value="<?php
                                    if (isset($_REQUEST["comment"])) {
                                    echo $_REQUEST["comment"];
                                    }
                                    ?>" placeholder="Your comment"></textarea>
                                </div>
                            </div>


                        </div> 

                        <div class="ml-collumn-xs-12 ml-collumn-sm-4 ml-collumn-md-4 ml-collumn-lg-4">

                            <div>
                                <p>
                                    <?php echo _MEDIALIBRARY_LABEL_REVIEW_RATING; ?>
                                </p>
                                <div>
                                <?php
                                    $k = 0;
                                    while ($k < 11) {
                                        ?>
                                        <div>
                                            <label class="rating_button" for="rating-<?php echo $k; ?>">
                                                <input type="radio" name="rating" value="<?php echo $k; ?>"
                                                <?php
                                                if (isset($_REQUEST["rating"]) && $_REQUEST["rating"] == $k) {
                                                echo "CHECKED";
                                                }
                                                ?>
                                                alt="Rating" id="rating-<?php echo $k; ?>" />
                                                <img src="<?php echo JURI::root();
                                                ?>/components/com_medialibrary/images/rating-<?php echo $k;
                                                ?>.gif" alt="<?php echo ($k) / 2; ?>" border="0" /><br />
                                            </label>
                                        </div>
                                        <?php
                                        $k++;
                                    }
                                    ?>
                                </div>
                            </div>
                        </div>

                        <div class="ml-collumn-xs-12 ml-collumn-sm-12 ml-collumn-md-12 ml-collumn-lg-12">
                            <div>
                                <!-- save review button-->
                                <input class="button" type="button"
                                value="<?php echo _MEDIALIBRARY_LABEL_BUTTON_SAVE; ?>"
                                onclick="ml_review_submitbutton(
                                '<?php echo _MEDIALIBRARY_INFOTEXT_JS_REVIEW_TITLE; ?>',
                                '<?php echo _MEDIALIBRARY_INFOTEXT_JS_REVIEW_COMMENT; ?>',
                                '<?php echo _MEDIALIBRARY_INFOTEXT_JS_REVIEW_RATING; ?>')"/>


                                <!-- hifde review button-->
                                <input class="button hidden_review" type="button"
                                value="<?php echo _MEDIALIBRARY_LABEL_BUTTON_REVIEW_HIDE; ?>"
                                onclick="ml_button_hidden(false);"/>

                                <input type="hidden" name="fk_mediaid" value="<?php echo $media->id; ?>" />
                                <!--    <input type="hidden" name="catid" value="<?php //echo $catid; ?>" />-->
                            </div>
                        </div>

                      </div>
                    </form>
                </div> <!-- end <div id="hidden_review"> -->
                <?php
            }
    
        ?>
        </div>

        <?php if ($params->get('back_button')!= ''): ?>
            <div style="text-align: center;" class="back_button">
              <?php mosHTML::BackButton ( $params, $hide_js ); ?>
            </div>
        <?php endif ?>

</div>
