コード例 #1
0
ファイル: mediaviewer.php プロジェクト: brambravo/webtrees
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
define('WT_SCRIPT_NAME', 'mediaviewer.php');
require './includes/session.php';
require_once WT_ROOT . 'includes/functions/functions_print_lists.php';
$controller = new WT_Controller_Media();
if ($controller->record && $controller->record->canShow()) {
    $controller->pageHeader();
    if ($controller->record->isOld()) {
        if (WT_USER_CAN_ACCEPT) {
            echo '<p class="ui-state-highlight">', WT_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() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the deletion and then accept or reject it.', 'reject') . '</a>'), ' ', help_link('pending_changes'), '</p>';
        } elseif (WT_USER_CAN_EDIT) {
            echo '<p class="ui-state-highlight">', WT_I18N::translate('This media object has been deleted.  The deletion will need to be reviewed by a moderator.'), ' ', help_link('pending_changes'), '</p>';
        }
    } elseif ($controller->record->isNew()) {
        if (WT_USER_CAN_ACCEPT) {
            echo '<p class="ui-state-highlight">', WT_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() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'accept') . '</a>', '<a href="#" onclick="reject_changes(\'' . $controller->record->getXref() . '\');">' . WT_I18N::translate_c('You should review the changes and then accept or reject them.', 'reject') . '</a>'), ' ', help_link('pending_changes'), '</p>';
        } elseif (WT_USER_CAN_EDIT) {
            echo '<p class="ui-state-highlight">', WT_I18N::translate('This media object has been edited.  The changes need to be reviewed by a moderator.'), ' ', help_link('pending_changes'), '</p>';
        }
    }
コード例 #2
0
ファイル: medialist.php プロジェクト: brambravo/webtrees
     echo '</td></tr></', $tsection, '>';
 }
 echo '<tbody><tr>';
 for ($i = $start, $n = 0; $i < $start + $count; ++$i) {
     $mediaobject = $medialist[$i];
     if ($columns == '1') {
         echo '<td class="list_value_wrap width80">';
     }
     if ($columns == '2') {
         echo '<td class="list_value_wrap width50">';
     }
     echo '<table><tr><td style="vertical-align:top; white-space:normal;">';
     echo $mediaobject->displayImage();
     echo '</td><td class="list_value_wrap width100" style="border: none; padding-left: 5px;">';
     if (WT_USER_CAN_EDIT) {
         echo WT_Controller_Media::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 WT_Gedcom_Tag::getLabelValue('TITL', $mediaobject->getFullName());
     }
     // Show file details
     if ($mediaobject->isExternal()) {
         echo WT_Gedcom_Tag::getLabelValue('URL', $mediaobject->getFilename());