Exemplo n.º 1
0
 */
namespace Fisharebest\Webtrees;

/**
 * Defined in session.php
 *
 * @global Tree   $WT_TREE
 */
global $WT_TREE;
use Fisharebest\Webtrees\Controller\MediaController;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
use Fisharebest\Webtrees\Functions\FunctionsPrintFacts;
use Fisharebest\Webtrees\Functions\FunctionsPrintLists;
define('WT_SCRIPT_NAME', 'mediaviewer.php');
require './includes/session.php';
$controller = new MediaController();
if ($controller->record && $controller->record->canShow()) {
    $controller->pageHeader();
    if ($controller->record->isPendingDeletion()) {
        if (Auth::isModerator($controller->record->getTree())) {
            echo '<p class="ui-state-highlight">', I18N::translate('This media object has been deleted.  You should review the deletion and then %1$s or %2$s it.', '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the deletion and then accept or reject it.', 'reject') . '</a>'), ' ', FunctionsPrint::helpLink('pending_changes'), '</p>';
        } elseif (Auth::isEditor($controller->record->getTree())) {
            echo '<p class="ui-state-highlight">', I18N::translate('This media object has been deleted.  The deletion will need to be reviewed by a moderator.'), ' ', FunctionsPrint::helpLink('pending_changes'), '</p>';
        }
    } elseif ($controller->record->isPendingAddtion()) {
        if (Auth::isModerator($controller->record->getTree())) {
            echo '<p class="ui-state-highlight">', I18N::translate('This media object has been edited.  You should review the changes and then %1$s or %2$s them.', '<a href="#" onclick="accept_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . I18N::translateContext('You should review the changes and then accept or reject them.', 'reject') . '</a>'), ' ', FunctionsPrint::helpLink('pending_changes'), '</p>';
        } elseif (Auth::isEditor($controller->record->getTree())) {
            echo '<p class="ui-state-highlight">', I18N::translate('This media object has been edited.  The changes need to be reviewed by a moderator.'), ' ', FunctionsPrint::helpLink('pending_changes'), '</p>';
        }
    }
Exemplo n.º 2
0
     echo '</td></tr></', $tsection, '>';
 }
 echo '<tbody><tr>';
 for ($i = 0, $n = 0; $i < $number_on_page; ++$i) {
     $mediaobject = $medialist[($page - 1) * $max + $i];
     if ($columns === 1) {
         echo '<td class="media-col1 list_value_wrap">';
     }
     if ($columns === 2) {
         echo '<td class="media-col2 list_value_wrap">';
     }
     echo '<table><tr><td class="media-image">';
     echo $mediaobject->displayImage();
     echo '</td><td class="media-col list_value_wrap">';
     if (Auth::isEditor($WT_TREE)) {
         echo MediaController::getMediaListMenu($mediaobject);
     }
     // If sorting by title, highlight the title. If sorting by filename, highlight the filename
     if ($sortby === 'title') {
         echo '<p><b><a href="', $mediaobject->getHtmlUrl(), '">';
         echo $mediaobject->getFullName();
         echo '</a></b></p>';
     } else {
         echo '<p><b><a href="', $mediaobject->getHtmlUrl(), '">';
         echo basename($mediaobject->getFilename());
         echo '</a></b></p>';
         echo GedcomTag::getLabelValue('TITL', $mediaobject->getFullName());
     }
     // Show file details
     if ($mediaobject->isExternal()) {
         echo GedcomTag::getLabelValue('URL', $mediaobject->getFilename());