public function generatePageTyposcript($json)
    {
        $pageColumns = array();
        $disableColumns = "";
        $pagesContent = "";
        if ($json["pages"]["elements"]) {
            foreach ($json["pages"]["elements"] as $element) {
                // Labels for pages
                $pagesContent .= "\n[userFunc = user_mask_beLayout(" . $element["key"] . ")]\n";
                // if page has backendlayout with this element-key
                if ($element["columns"]) {
                    foreach ($element["columns"] as $index => $column) {
                        $pagesContent .= " TCEFORM.pages." . $column . ".label = " . $element["labels"][$index] . "\n";
                    }
                    $pagesContent .= "\n";
                    foreach ($element["columns"] as $index => $column) {
                        $pageColumns[] = $column;
                        $pagesContent .= " TCEFORM.pages." . $column . ".disabled = 0\n";
                    }
                }
                $pagesContent .= "[end]\n";
            }
        }
        // disable all fields by default and only activate by condition
        foreach ($pageColumns as $column) {
            $disableColumns .= "TCEFORM.pages." . $column . ".disabled = 1\n";
        }
        $pagesContent = $disableColumns . "\n" . $pagesContent;
        return $pagesContent;
    }
public function generatePageTyposcript($json)
    {
        $pageColumns = array();
        $disableColumns = "";
        $pagesContent = "";
        if ($json["pages"]["elements"]) {
            foreach ($json["pages"]["elements"] as $element) {
                // Labels for pages
                $pagesContent .= "\n[userFunc = user_mask_beLayout(" . $element["key"] . ")]\n";
                // if page has backendlayout with this element-key
                if ($element["columns"]) {
                    foreach ($element["columns"] as $index => $column) {
                        $pagesContent .= " TCEFORM.pages." . $column . ".label = " . $element["labels"][$index] . "\n";
                    }
                    $pagesContent .= "\n";
                    foreach ($element["columns"] as $index => $column) {
                        $pageColumns[] = $column;
                        $pagesContent .= " TCEFORM.pages." . $column . ".disabled = 0\n";
                    }
                }
                $pagesContent .= "[end]\n";
            }
        }
        // disable all fields by default and only activate by condition
        foreach ($pageColumns as $column) {
            $disableColumns .= "TCEFORM.pages." . $column . ".disabled = 1\n";
        }
        $pagesContent = $disableColumns . "\n" . $pagesContent;
        return $pagesContent;
    }
public function generatePageTyposcript ( $ json ) { $ pageColumns = array ( ) ; $ disableColumns = "" ; $ pagesContent = "" ; if ( $ json [ "pages" ] [ "elements" ] ) { foreach ( $ json [ "pages" ] [ "elements" ] as $ element ) { // Labels for pages $ pagesContent .= "\n[userFunc = user_mask_beLayout(" . $ element [ "key" ] . ")]\n" ; // if page has backendlayout with this element-key if ( $ element [ "columns" ] ) { foreach ( $ element [ "columns" ] as $ index => $ column ) { $ pagesContent .= " TCEFORM.pages." . $ column . ".label = " . $ element [ "labels" ] [ $ index ] . "\n" ; } $ pagesContent .= "\n" ; foreach ( $ element [ "columns" ] as $ index => $ column ) { $ pageColumns [ ] = $ column ; $ pagesContent .= " TCEFORM.pages." . $ column . ".disabled = 0\n" ; } } $ pagesContent .= "[end]\n" ; } } // disable all fields by default and only activate by condition foreach ( $ pageColumns as $ column ) { $ disableColumns .= "TCEFORM.pages." . $ column . ".disabled = 1\n" ; } $ pagesContent = $ disableColumns . "\n" . $ pagesContent ; return $ pagesContent ; }
Generates the typoscript for pages
@param array $json
@return string
Generates the typoscript for pages