TemplateConverterHelper::BuildEnvironmentalStatement PHP Méthode

BuildEnvironmentalStatement() public static méthode

public static BuildEnvironmentalStatement ( array $p_optArray ) : string
$p_optArray array
Résultat string $newTag
    public static function BuildEnvironmentalStatement($p_optArray)
    {
        if (strtolower($p_optArray[1]) == 'off') {
            if ($p_optArray[0] == 'articlecomment') {
                $p_optArray[0] = 'comment';
            }
            $newTag = 'unset_' . $p_optArray[0];
        } else {
            if (strtolower($p_optArray[1]) == 'current') {
                $newTag = 'set_current_' . $p_optArray[0];
            } elseif (strtolower($p_optArray[1]) == 'default') {
                $newTag = 'set_default_' . $p_optArray[0];
            } else {
                $newTag = 'set_' . $p_optArray[0];
                if ($p_optArray[0] == 'language') {
                    $newTag .= ' name="' . strtolower($p_optArray[1]) . '"';
                } else {
                    if (preg_match('/ /', $p_optArray[1])) {
                        $p_optArray[1] = '"' . $p_optArray[1] . '"';
                    }
                    $newTag .= isset($p_optArray[1]) ? ' ' . $p_optArray[1] : '';
                    $newTag .= isset($p_optArray[2]) ? '="' . $p_optArray[2] . '"' : '';
                }
            }
        }
        return $newTag;
    }