$parameter[4] = -1;
 }
 if (!isset($parameter[5])) {
     $parameter[5] = $_SESSION['userid'];
 }
 switch ($parameter[2]) {
     case "GW_label":
         $obj = db_query($parameter[3]);
         $run_result .= stripslashes($obj[0]->value);
         break;
     case "HR":
         $run_result .= '<hr color="red" height="1">';
         break;
     case "GW_dropdown":
         //$run_result .= DisplayGW_dropdown($parameter[3], $parameter[1], false, $parameter[0]);
         $run_result .= DisplayGW_dropdown($parameter[3], $parameter[1], $parameter["fullParam"][-1], $parameter[0], $parameter["fullParam"]);
         break;
     case "GW_GroupCheckBox":
         //DisplayGW_dropdown($parameter[3], $parameter[1], false, $parameter[0]);
         $run_result .= DisplayGW_GroupCheckBox($parameter[3], $parameter[1], $parameter["fullParam"][-1], $parameter[0], $parameter["fullParam"]["type"]);
         break;
     case "text":
         if (is_array($parameter["fullParam"]) && $parameter["fullParam"][-1] === true) {
             $run_result .= htmlentities(stripslashes($parameter[1]));
         } else {
             $run_result .= "<input type=\"text\" name=\"" . $parameter[0] . "\" value=\"" . stripslashes($parameter[1]) . "\" style=\"width: 95%\" id=\"" . $parameter[0] . "\" />";
         }
         break;
     case "password":
         $run_result .= "<input type=\"password\" name=\"" . $parameter[0] . "\" value=\"" . htmlentities(stripslashes($parameter[1])) . "\" style=\"width: 95%\" id=\"" . $parameter[0] . "\" />";
         break;
global $page_owner;
if (isset($parameter) && sizeof($parameter) > 1) {
    if (!isset($parameter[4])) {
        $parameter[4] = -1;
    }
    if (!isset($parameter[5])) {
        if (isset($page_owner)) {
            $parameter[5] = $page_owner;
        } else {
            $parameter[5] = -1;
        }
    }
    switch ($parameter[1]) {
        case "GW_dropdown":
            //$run_result .= DisplayGW_dropdown($parameter[2], $parameter[0]);
            $run_result .= DisplayGW_dropdown($parameter[2], $parameter[0], true, "", $parameter["fullParam"]);
            break;
        case "GW_GroupCheckBox":
            $sql = sprintf("SELECT data as value from other_data where name='%s' and lang='en'", $parameter[2]);
            $obj = db_query($sql);
            $arr = explode("\n", $obj[0]->value);
            $arr = array_map("trim", $arr);
            //$arr contains all valid values from database && $parameter[0] - contains selected value;
            $param_arr = $parameter[0] == "" ? array() : explode(",", $parameter[0]);
            if (count($arr) > 0) {
                $catched = false;
                for ($i = 0; $i < count($arr); $i++) {
                    if (!(array_search($i, $param_arr) === FALSE)) {
                        $run_result .= ($catched ? ", " : "") . $arr[$i];
                        $catched = true;
                    }