getImageByNumber() публичный Метод

public getImageByNumber ( $articleId, $imageNumber )
Пример #1
0
// Check that the requested sub-directory exists and valid.
if (isset($_REQUEST['dir'])) {
    $path = rawurldecode($_REQUEST['dir']);
    if ($manager->validRelativePath($path)) {
        $relative = $path;
    }
}
$manager = new ImageManager($IMConfig);
$articleId = isset($_REQUEST['article_id']) && is_numeric($_REQUEST['article_id']) ? $_REQUEST['article_id'] : null;
// Get the list of files and directories
$list = array();
if (!is_null($articleId)) {
    $list = $manager->getFiles($relative, $articleId);
}
if (isset($_REQUEST['image_id'])) {
    $image = $manager->getImageByNumber($articleId, $_REQUEST['image_id']);
    $imageAltOpt = '';
    $imageTitleOpt = '';
    if (isset($_REQUEST['image_alt'])) {
        $imageAltOpt = $_REQUEST['image_alt'];
    }
    if (isset($_REQUEST['image_title'])) {
        $imageTitleOpt = $_REQUEST['image_title'];
    }
    if (isset($_REQUEST['image_alignment'])) {
        $imageAlignOpt = $_REQUEST['image_alignment'];
    }
    if (isset($_REQUEST['image_ratio'])) {
        $imageRatioOpt = $_REQUEST['image_ratio'];
    }
    if (isset($_REQUEST['image_resize_width'])) {