Exemplo n.º 1
0
    global $serendipity;
    if (!serendipity_checkPermission('adminImagesView')) {
        return;
    }
    $output = "";
    // After upload, do not show the list to be able to proceed to
    // media selection.
    if ($addvar_check && !empty($GLOBALS['image_selector_addvars'])) {
        return true;
    }
    if (!isset($serendipity['thumbPerPage'])) {
        $serendipity['thumbPerPage'] = 2;
    }
    $smarty_vars = array('textarea' => isset($serendipity['GET']['textarea']) ? $serendipity['GET']['textarea'] : false, 'htmltarget' => isset($serendipity['GET']['htmltarget']) ? $serendipity['GET']['htmltarget'] : '', 'filename_only' => isset($serendipity['GET']['filename_only']) ? $serendipity['GET']['filename_only'] : false);
    $show_upload = isset($serendipity['GET']['showUpload']) ? $serendipity['GET']['showUpload'] : false;
    $output .= serendipity_displayImageList(isset($serendipity['GET']['page']) ? $serendipity['GET']['page'] : 1, $serendipity['thumbPerPage'], isset($serendipity['GET']['showMediaToolbar']) ? serendipity_db_bool($serendipity['GET']['showMediaToolbar']) : true, NULL, $show_upload, NULL, $smarty_vars);
    return $output;
}
if (!isset($data['showML'])) {
    if (isset($_REQUEST['go_properties'])) {
        $data['showMLbutton'] = true;
    } else {
        // always having the ML available is useful when switching the filter after adding an image, thus being in the add-case
        $data['showML'] = showMediaLibrary();
    }
}
$data['get']['fid'] = $serendipity['GET']['fid'];
// don't trust {$smarty.get.vars} if not proofed, as we often change GET vars via serendipty['GET'] by runtime
$data['get']['only_path'] = $serendipity['GET']['only_path'];
echo serendipity_smarty_show('admin/images.inc.tpl', $data);
/* vim: set sts=4 ts=4 expandtab : */
Exemplo n.º 2
0
    </form>

    <img src="<?php 
        echo $serendipity['uploadHTTPPath'] . $file['path'] . $file['name'] . '.' . $file['extension'];
        ?>
" name="serendipityScaleImg" style="width: <?php 
        echo $s[0];
        ?>
px; height: <?php 
        echo $s[1];
        ?>
px;" alt="" />
<?php 
        break;
    default:
        showMediaLibrary();
        break;
}
function showMediaLibrary($messages = false, $addvar_check = false)
{
    global $serendipity;
    if (!serendipity_checkPermission('adminImagesView')) {
        return;
    }
    if (!empty($messages)) {
        echo '<div class="imageMessage"><ul>';
        foreach ($messages as $message) {
            echo '<li>' . $message . '</li>';
        }
        echo '</ul></div>';
    }