steveosoule
1/27/2017 - 1:28 AM

Miva - Token List in JSON

Miva - Token List in JSON

{
    "l": {
        <mvt:assign name="l.settings:varlist__local" value="miva_array_deserialize( miva_getvarlist( 'l' ) )" />
        <mvt:foreach iterator="var__local" array="varlist__local">
            "&mvtj:var__local;": <mvt:do file="g.Module_JSON" name="l.success" value="JSON_Output( miva_variable_value( 'l.' $ l.settings:var__local ) )" />
            <mvt:if expr="l.pos1 NE miva_array_elements( l.settings:varlist__local )">
                ,
            </mvt:if>
        </mvt:foreach>
    },
    "g": {
        <mvt:assign name="l.settings:varlist__global" value="miva_array_deserialize( miva_getvarlist( 'g' ) )" />
        <mvt:foreach iterator="var__global" array="varlist__global">
            "&mvtj:var__global;": <mvt:do file="g.Module_JSON" name="l.success" value="JSON_Output( miva_variable_value( 'g.' $ l.settings:var__global ) )" />
            <mvt:if expr="l.pos1 NE miva_array_elements( l.settings:varlist__global )">
                ,
            </mvt:if>
        </mvt:foreach>
    },
    "s": {
        <mvt:assign name="l.settings:varlist__system" value="miva_array_deserialize( miva_getvarlist( 's' ) )" />
        <mvt:foreach iterator="var__system" array="varlist__system">
            "&mvtj:var__system;": <mvt:do file="g.Module_JSON" name="l.success" value="JSON_Output( miva_variable_value( 's.' $ l.settings:var__system ) )" />
            <mvt:if expr="l.pos1 NE miva_array_elements( l.settings:varlist__system )">
                ,
            </mvt:if>
        </mvt:foreach>
    }
}

<mvt:assign name="l.success" value="miva_output_header( 'Content-Type', 'application/json' )" />