예제 #1
0
 *
 * This software 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
?>

<div class="error_message">
    ®Unauthorized®
    <?php 
if (acl_has_album_permissions($album)) {
    ?>
        <div style="margin-top: 18px;">
            ®Error_permission_denied®
            <form action="index.php?action=export_album_bookmarks" method="post" name="export_album_bookmarks_form" onsubmit="return false">
                <input type="hidden" name="album" value="<?php 
    echo $album;
    ?>
"/>
            </form>
            <br/><br/>
                <a class="button" style="width:300px;" href="javascript: delete_album_token('<?php 
    echo $album;
    ?>
');">®Delete_album®</a>
                <a class="button" style="width:300px;" href="#" onclick="document.export_album_bookmarks_form.submit(); return false;">®Export_album_bookmarks®</a>
예제 #2
0
}
if (isset($asset_meta['record_type']) && $asset_meta['record_type'] == 'camslide') {
    ?>
                    <li>
                        <a class="movie-button active" title="®Watch_video®" href="javascript:switch_video('cam');"></a>
                        <a class="slide-button" title="®Watch_slide®" href="javascript:switch_video('slide');"></a>
                    </li>
                <?php 
}
?>
                <li>
                    <a class="high-button" title="®Watch_high®" href="javascript:toggle_video_quality('high');"></a>
                    <a class="low-button active" title="®Watch_low®" href="javascript:toggle_video_quality('low');"></a>
                </li>
                <?php 
if (acl_user_is_logged() && acl_has_album_permissions($album)) {
    ?>
                    <li>
                        <a class="add-bookmark-button" title="®Add_bookmark®" href="javascript:toggle_bookmark_form('custom');"></a>
                        <?php 
    if (acl_has_album_moderation($album) || acl_is_admin()) {
        ?>
                            <a class="add-toc-button" title="®Add_toc®" href="javascript:toggle_bookmark_form('official');"></a>
                            <?php 
    }
    if (acl_display_threads()) {
        ?>
                            <a class="add-thread-button" title="®Add_discussion®" href="javascript:toggle_thread_form();"></a>
                        <?php 
    }
    ?>
예제 #3
0
 * This software 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
?>

<div class="error_message">
    ®Non-existant_asset®

    <?php 
if (acl_has_album_permissions($album) && user_prefs_asset_bookmarks_list_get($_SESSION['user_login'], $album, $error_asset)) {
    ?>
        <div style="margin-top: 18px;">
            ®Error_asset_not_found®
            <form action="index.php?action=export_asset_bookmarks" method="post" name="export_asset_bookmarks_form" onsubmit="return false">
                <input type="hidden" name="album" value="<?php 
    echo $album;
    ?>
"/>
                <input type="hidden" name="asset" value="<?php 
    echo $asset;
    ?>
"/>
            </form>
            <br/><br/>
            <a class="button" style="width:300px;" href="javascript: remove_bookmarks('<?php 
예제 #4
0
/**
 * Searches a specific pattern in the bookmarks lists.
 * @global type $input
 * @global type $bookmarks
 * @global type $repository_path
 * @global type $user_files_path
 * @global type $words 
 */
function bookmarks_search()
{
    global $input;
    global $bookmarks;
    global $search_result_threads;
    global $bookmarks_toc;
    global $repository_path;
    global $user_files_path;
    global $words;
    // used to highlight the searched words in 'div_search_result.php'
    $search = $input['search'];
    // the pattern to be searched
    $target = $input['target'];
    // where to search (all albums / selected albums / current album)
    $albums = $input['albums'];
    // the selection of albums
    $fields = $input['fields'];
    // where to search in the bookmark fields (title / descr. / keywords)
    $fields_thread = $input['fields_thread'];
    $level = $input['level'];
    $tab = $input['tab'];
    if (!isset($level) || is_nan($level) || $level < 0 || $level > 3) {
        $level = 0;
    }
    log_append('search_bookmarks : ' . PHP_EOL . 'search - ' . $search . PHP_EOL . 'target - ' . $target . PHP_EOL . 'fields - ' . implode(", ", $fields) . PHP_EOL . 'fields thread - ' . implode(", ", $fields_thread) . PHP_EOL . 'tab - ' . implode(", ", $tab));
    // defines target
    if (!isset($target) || $target == '') {
        $target = 'global';
    }
    $album = $_SESSION['album'];
    $asset = $_SESSION['asset'];
    if ($target == 'current' && (!isset($album) || $album == '')) {
        $target = 'global';
    }
    // transforms the search string in well formed string
    /*   $words = str_getcsv($search, ' ', '"');
         $wordsCSV = '';
         foreach ($words as $index => $word) {
         if (trim($word) == '' || $word == '+') {
         unset($words[$index]);
         } else {
         $wordsCSV = $wordsCSV . "," . $word;
         }
         } */
    // split the string, saves the value to search in a array
    $words = str_getcsv($search, ' ', '"');
    $search = array();
    foreach ($words as $index => $word) {
        if ($word == '' || $word == '+') {
            unset($words[$index]);
        } else {
            $search[] = $word;
        }
    }
    // init paths
    ezmam_repository_path($repository_path);
    user_prefs_repository_path($user_files_path);
    $bookmarks_toc = array();
    switch ($target) {
        case 'current':
            // searches in current location (either global or album or asset)
            $albums = array($album);
            break;
        case 'album':
            // searches in albums selection
            if (!acl_has_album_permissions($album)) {
                $bookmarks_toc = toc_bookmarks_search($search, $fields, $level, array($album), $asset);
            }
            $asset = "";
            // asset must be empty for searching in albums selection
            break;
        default:
            // searches in all albums
            if (!acl_has_album_permissions($album)) {
                $bookmarks_toc = toc_bookmarks_search($search, $fields, $level, array($album), $asset);
            }
            $asset = "";
            // asset must be empty for searching in all albums
            $albums = acl_authorized_albums_list();
            break;
    }
    if (in_array('official', $tab)) {
        // searches in official bookmarks
        $bookmarks_toc = array_merge($bookmarks_toc, toc_bookmarks_search($search, $fields, $level, $albums, $asset));
    }
    if (in_array('custom', $tab)) {
        // searches in personal bookmarks
        $bookmarks = user_prefs_bookmarks_search($_SESSION['user_login'], $search, $fields, $level, $albums, $asset);
    }
    if (acl_user_is_logged() && acl_display_threads && in_array('threads', $tab)) {
        // searches in threads
        $search_result_threads = thread_search($search, $fields_thread, $albums, $asset);
    }
    $lvl = $_SESSION['album'] != '' && $_SESSION['asset'] != '' ? 3 : ($_SESSION['album'] != '' ? 2 : 1);
    trace_append(array($lvl, $input['origin'] == 'keyword' ? 'keyword_search' : 'bookmarks_search', $_SESSION['album'] == '' ? '-' : $_SESSION['album'], $_SESSION['asset'] == '' ? '-' : $_SESSION['asset'], $search, $target, implode(", ", $fields), implode(", ", $fields_thread), implode(", ", $tab), count($bookmarks_toc), count($bookmarks), count($search_result_threads)));
    include_once template_getpath('div_search_result.php');
}
예제 #5
0
/**
 * Moves asset from $input['from'] to $input['to']
 * @global type $input
 * @global type $repository_path 
 */
function asset_move()
{
    global $input;
    global $repository_path;
    ezmam_repository_path($repository_path);
    //
    // Sanity checks
    //
    if (!isset($input['asset']) || !isset($input['from']) || !isset($input['to'])) {
        echo 'Usage: web_index.php?action=move_asset&amp;from=SOURCE&amp;to=DESTINATION&amp;asset=ASSET';
        die;
    }
    if (!acl_has_album_permissions($input['from']) || !acl_has_album_permissions($input['to'])) {
        error_print_message(template_get_message('Unauthorized', get_lang()));
        log_append('warning', 'move_asset: you can\'t manage album ' . $input['from'] . ' or ' . $input['to']);
        die;
    }
    if (!ezmam_asset_exists($input['from'], $input['asset'])) {
        error_print_message(template_get_message('Non-existant_album', get_lang()));
        log_append('warning', 'move_asset: asset ' . $input['asset'] . ' of album ' . $input['from'] . ' does not exist');
        die;
    }
    // saves the bookmarks to copy
    $bookmarks = toc_asset_bookmark_list_get($input['from'], $input['asset']);
    // deletes the bookmarks from the source album
    toc_asset_bookmarks_delete_all($input['from'], $input['asset']);
    //
    // Moving the asset
    // TODO: the moving won't work if there is a different asset with the same name in dest folder. Should be corrected in the future (new asset renamed)
    //
    $res = ezmam_asset_move($input['asset'], $input['from'], $input['to']);
    if (!$res) {
        error_print_message(ezmam_last_error());
        die;
    }
    // adds the previously saved bookmarks to the new album
    $count = count($bookmarks);
    for ($index = 0; $index < $count; $index++) {
        $bookmarks[$index]['album'] = $input['to'];
    }
    toc_album_bookmarks_add($bookmarks);
    include_once template_getpath('popup_asset_successfully_moved.php');
}