Back to PhocaGalleryRenderFront class

Method getAltValue

public static
getAltValue
(mixed $altValue = 0, mixed $title = '', mixed $description = '', mixed $metaDesc = '')

Method getAltValue - Source code

public static function getAltValue($altValue = 0, $title = '', $description = '', $metaDesc = '')
{
    $output = '';
    switch ($altValue) {
        case 1:
            $output = $title;
            break;
        case 2:
            $output = strip_tags($description);
            break;
        case 3:
            $output = $title;
            if ($description != '') {
                $output .= ' - ' . strip_tags($description);
            }
            break;
        case 4:
            $output = strip_tags($metaDesc);
            break;
        case 5:
            if ($title != '') {
                $output = $title;
            } else {
                if ($description != '') {
                    $output = strip_tags($description);
                } else {
                    $output = strip_tags($metaDesc);
                }
            }
            break;
        case 6:
            if ($description != '') {
                $output = strip_tags($description);
            } else {
                if ($title != '') {
                    $output = $title;
                } else {
                    $output = strip_tags($metaDesc);
                }
            }
            break;
        case 7:
            if ($description != '') {
                $output = strip_tags($description);
            } else {
                if ($metaDesc != '') {
                    $output = strip_tags($metaDesc);
                } else {
                    $output = $title;
                }
            }
            break;
        case 8:
            if ($metaDesc != '') {
                $output = strip_tags($metaDesc);
            } else {
                if ($title != '') {
                    $output = $title;
                } else {
                    $output = strip_tags($description);
                }
            }
            break;
        case 9:
            if ($metaDesc != '') {
                $output = strip_tags($metaDesc);
            } else {
                if ($description != '') {
                    $output = strip_tags($description);
                } else {
                    $output = $title;
                }
            }
            break;
        case 0:
        default:
            $output = '';
            break;
    }
    //return htmlspecialchars( addslashes($output));
    return htmlspecialchars($output);
}