<?php
  
return array(
    "data" => array(
        "model" => "Question",
        "type" => "question",
        "languageKey" => "common.question",
        "menuKey" => "questions",
        "fields" => array(
            
            array(
                "name" => "question",
                "languageKey" => "common.question",
                "fieldType" => "textbox",
                "fieldMaxSize" => 150,
                "fieldSize" => 50,
                "multiLanguage" => false,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation" => "required|max:150"
            ),
            array(
                "name" => "answer_a",
                "languageKey" => "common.answer_a",
                "fieldType" => "textbox",
                "fieldMaxSize" => 100,
                "fieldSize" => 50,
                "multiLanguage" => false,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation" => "required|max:100"
            ),
            array(
                "name" => "answer_b",
                "languageKey" => "common.answer_b",
                "fieldType" => "textbox",
                "fieldMaxSize" => 100,
                "fieldSize" => 50,
                "multiLanguage" => false,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation" => "required|max:100"
            ),
            array(
                "name" => "answer_c",
                "languageKey" => "common.answer_c",
                "fieldType" => "textbox",
                "fieldMaxSize" => 100,
                "fieldSize" => 50,
                "multiLanguage" => false,
                "preValidation" => "strip_tags|xss_clean|trim",
                "validation" => "required|max:100"
            ),
            array(
                "name" => "correct_answer",
                "languageKey" => "common.correct_answer",
                "fieldType" => "combobox",
                "multiLanguage" => false,
                "customList" => array('respostaA'=>'respostaA',
                                      'respostaB'=>'respostaB',
                                      'respostaC'=>'respostaC'),                
                "preValidation" => "trim",
                "validation" => "required|in:respostaA,respostaB,respostaC"
            ),
             array(
                "name" => "game",
                "languageKey" => "common.games",
                "fieldType" => "list_checkbox",
                "relation" => "games",
                "listModel" => "Game",
                "listValueField" => "id",
                "listDisplayField" => "name",                
                "preValidation" => "trim"
            ),             
         ),   
        "grid" => array(
            "columns" => array(
                array(
                    "type" => "action",
                    "name" => "edit",
                    "languageKey" => "common.edit",
                    "width" => 50,
                    "url" => "/admin/list/edit/{LIST_ID}/{ID}/{PARENT_ID}",
                    "img" => "edit.png"
                ),
                array(
                    "type" => "action",
                    "name" => "delete",
                    "languageKey" => "common.delete",
                    "width" => 50,
                    "url" => "/admin/list/delete/{LIST_ID}/{ID}/{PARENT_ID}",
                    "img" => "delete.png"
                ), 
                array(
                    "type" => "field",
                    "name" => "question",
                    "languageKey" => "common.question",
                    "width" => 400,
                    "search" => true,
                    "order" => array("direction" => "asc", "default" => true)
                ),                
                
            ),
            "actions" => array(
                array(
                    "url" => "/admin/list/insert/{LIST_ID}/{PARENT_ID}",
                    "languageKey" => "common.insert",
                    "icon" => "add.png"
                )                
            )
        )
    )
);

           