Ansel_Faces_Base::getFaceUrl PHP Метод

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

Get a URL for a face image suitable for using as the src attribute in an image tag.
public getFaceUrl ( integer $image_id, integer $face_id, boolean $full = false ) : string
$image_id integer Image ID to get url for
$face_id integer Face ID to get url for
$full boolean Should we generate a full URL?
Результат string The URL for the face image suitable for use as the src attribute in an tag.
    public function getFaceUrl($image_id, $face_id, $full = false)
    {
        global $conf;
        // If we won't be using img.php to generate it, make sure the image
        // is generated before returning a url to access it.
        if ($conf['vfs']['src'] != 'php') {
            $this->viewExists($image_id, $face_id, true);
        }
        // If not viewing directly out of the VFS, hand off to img.php
        if ($conf['vfs']['src'] != 'direct') {
            return Horde::url('faces/img.php', $full)->add('face', $face_id);
        } else {
            $path = substr(str_pad($image_id, 2, 0, STR_PAD_LEFT), -2) . '/faces';
            return $GLOBALS['conf']['vfs']['path'] . htmlspecialchars($path . '/' . $face_id . Ansel_Faces::getExtension());
        }
    }