TemplateConverterHelper::BuildUrxStatement PHP Méthode

BuildUrxStatement() public static méthode

public static BuildUrxStatement ( array $p_optArray ) : string
$p_optArray array
Résultat string $newTag
    public static function BuildUrxStatement($p_optArray)
    {
        $newTag = $p_optArray[0];
        $ifBlockStack = TemplateConverterIfBlock::GetIfBlockStack();
        $ifBlockStackSize = sizeof($ifBlockStack);
        if ($ifBlockStackSize > 0) {
            $option = '';
            $idx = $ifBlockStackSize - 1;
            switch ($ifBlockStack[$idx]->getIfBlock()) {
                case 'nextitems':
                    $option = 'next_items';
                    break;
                case 'previous_items':
                    $option = 'previous_items';
                    break;
                case 'nextsubtitles':
                    $withField = self::GetWithBodyField();
                    $option = 'next_subtitle';
                    $option .= strlen($withField) > 0 ? ' ' . $withField : '';
                    break;
                case 'prevsubtitles':
                    $withField = self::GetWithBodyField();
                    $option = 'previous_subtitle';
                    $option .= strlen($withField) > 0 ? ' ' . $withField : '';
                    break;
            }
            $newTag .= strlen($option) > 0 ? ' options="' . $option . '"' : '';
        }
        if (sizeof($p_optArray) > 1) {
            $newTag .= ' options="';
            for ($x = 1; $x < sizeof($p_optArray); $x++) {
                $newTag .= $x > 1 ? ' ' : '';
                $newTag .= strtolower($p_optArray[$x]);
            }
            $newTag .= '"';
        }
        return $newTag;
    }