<?php wp_nonce_field("theme-post-meta-form", "aventa_post_nonce");?>

<div class="rado-menu-field">
<?php
global $post;

$this->rad_SetWorkingDirectory(rad_path_combine(RAD_THEME_ADMIN, "settings/templates"));
foreach ($vars as $key => $settings) {
    $isArray     = rad_array_value("array", rad_array_value("meta", $settings, array()), false);
    $generalKey  = rtrim($key, "-" . $post->ID);
    $val         = $this->rad_GetValue($generalKey);
    $fieldRepeat = 1;

    //Convert the key so it become array type
    if ($isArray) {
        $key .= "[]";

        if (is_array($val)) {
            $fieldRepeat = max(count($val), $fieldRepeat);
        }

    }

    for ($m = 0; $m < $fieldRepeat; $m++) {
        $value = is_array($val) ? rad_array_value($m, $val) : $val;

        echo "" . $this->GetField($key, $settings, array("val" => $value));
    }
}
?>
</div>