public function get_description() { return Template::strip_html($this->description); }
public function RCall($code, $include_ini_code = false, $close = false, $debug_syntax = false) { $command = ""; if (!$debug_syntax) { if ($include_ini_code) { $command = $this->get_ini_RCode(); } else { $command .= $this->get_next_ini_RCode(); } } $command .= $code; if (!$debug_syntax) { $command .= $this->get_post_RCode(); } $output = array(); $return = -999; $command_obj = json_encode(array("session_id" => $this->id, "code" => $command, "close" => 0)); if (TestServer::$debug) { TestServer::log_debug("TestSession->RCall --- checking for server"); } if (!TestServer::is_running()) { TestServer::start_process(); } if (TestServer::$debug) { TestServer::log_debug("TestSession->RCall --- server found, trying to send"); } $response = TestServer::send($command_obj); $result = json_decode(trim($response)); if (TestServer::$debug) { TestServer::log_debug("TestSession->RCall --- sent and recieved response"); } $output = explode("\n", $result->output); $return = $result->return; $thisSession = null; $status = TestSession::TEST_SESSION_STATUS_ERROR; $removed = false; $release = 0; $html = ""; $head = ""; $Template_id = 0; $debug = 0; $hash = ""; $time_limit = 0; $Test_id = 0; $finished = 0; $loader_HTML = ""; $loader_head = ""; $loader_effect_show = "none"; $loader_effect_hide = "none"; $loader_effect_show_options = ""; $loader_effect_hide_options = ""; $effect_show = "none"; $effect_hide = "none"; $effect_show_options = ""; $effect_hide_options = ""; if (!$debug_syntax) { $thisSession = TestSession::from_mysql_id($this->id); if ($thisSession != null) { $status = $thisSession->status; $release = $thisSession->release; $html = $thisSession->HTML; $Template_id = $thisSession->Template_id; $debug = $thisSession->debug; $hash = $thisSession->hash; $time_limit = $thisSession->time_limit; $Test_id = $thisSession->Test_id; $loader_HTML = $thisSession->loader_HTML; $loader_head = $thisSession->loader_head; $loader_effect_hide = $thisSession->loader_effect_hide; $loader_effect_hide_options = $thisSession->loader_effect_hide_options; $loader_effect_show = $thisSession->loader_effect_show; $loader_effect_show_options = $thisSession->loader_effect_show_options; $effect_hide = $thisSession->effect_hide; $effect_hide_options = $thisSession->effect_hide_options; $effect_show = $thisSession->effect_show; $effect_show_options = $thisSession->effect_show_options; if ($return != 0) { $status = TestSession::TEST_SESSION_STATUS_ERROR; } if ($status == TestSession::TEST_SESSION_STATUS_WORKING && $release == 1 || $close) { $status = TestSession::TEST_SESSION_STATUS_COMPLETED; } $thisSession->status = $status; $thisSession->mysql_save(); switch ($status) { case TestSession::TEST_SESSION_STATUS_COMPLETED: if ($debug) { TestSession::unregister($thisSession->id); $removed = true; } else { $thisSession->serialize(); } break; case TestSession::TEST_SESSION_STATUS_ERROR: case TestSession::TEST_SESSION_STATUS_TAMPERED: if ($debug) { TestSession::unregister($thisSession->id); $removed = true; } else { $thisSession->close(); } break; case TestSession::TEST_SESSION_STATUS_TEMPLATE: if ($debug) { $html = Template::strip_html($html); if ($release) { TestSession::unregister($thisSession->id); } } else { $head = Template::from_mysql_id($Template_id)->head; if ($release) { $thisSession->serialize(); } } break; } } else { $removed = true; } } $test = Test::from_mysql_id($this->Test_id); $debug_data = false; $logged_user = User::get_logged_user(); if ($logged_user != null) { $debug_data = $logged_user->is_object_readable($test); } if ($release == 1 || $status == TestSession::TEST_SESSION_STATUS_COMPLETED || $status == TestSession::TEST_SESSION_STATUS_ERROR || $status == TestSession::TEST_SESSION_STATUS_TAMPERED) { $finished = 1; } if (!$debug_syntax) { $response = array("data" => array("HEAD" => $head, "HASH" => $hash, "TIME_LIMIT" => $time_limit, "HTML" => $html, "TEST_ID" => $Test_id, "TEST_SESSION_ID" => $this->id, "STATUS" => $status, "TEMPLATE_ID" => $Template_id, "FINISHED" => $finished, "LOADER_HTML" => $loader_HTML, "LOADER_HEAD" => $loader_head, "LOADER_EFFECT_SHOW" => $loader_effect_show, "LOADER_EFFECT_SHOW_OPTIONS" => $loader_effect_show_options, "LOADER_EFFECT_HIDE" => $loader_effect_hide, "LOADER_EFFECT_HIDE_OPTIONS" => $loader_effect_hide_options, "EFFECT_SHOW" => $effect_show, "EFFECT_HIDE" => $effect_hide, "EFFECT_SHOW_OPTIONS" => $effect_show_options, "EFFECT_HIDE_OPTIONS" => $effect_hide_options)); } if ($debug_data) { for ($i = 0; $i < count($output); $i++) { if (strpos($output[$i], "CONCERTO_DB_PASSWORD <-") !== false) { $output[$i] = "[hidden]"; } $output[$i] = htmlspecialchars($output[$i], ENT_QUOTES); } $command_lines = explode("\n", $command); for ($i = 0; $i < count($command_lines); $i++) { if (strpos($command_lines[$i], "CONCERTO_DB_PASSWORD <-") !== false) { $command_lines[$i] = "[hidden]"; } } $command = implode("\n", $command_lines); $command = htmlspecialchars($command, ENT_QUOTES); if (!is_array($response)) { $response = array(); } $response["debug"] = array("code" => $command, "return" => $return, "output" => $output); } if (Ini::$timer_tamper_prevention && !$debug_syntax && !$removed) { $sql = sprintf("UPDATE `%s` SET `time_tamper_prevention`=%d WHERE `id`=%d", TestSession::get_mysql_table(), time(), $this->id); mysql_query($sql); } return $response; }
)"></span></td> <td class="tdSectionColumnType"><?php echo DS_TestSectionType::get_name_by_id(8); ?> </td> <td class="tdSectionColumnAction"> <table class="fullWidth"> <tr> <td> <span class="spanIcon ui-icon ui-icon-plus tooltip" title="<?php echo Language::string(205); ?> " onclick="Test.uiAddNewRelatedObject(8)"></span> </td> <td><span class="spanIcon ui-icon ui-icon-help tooltip" title="<?php echo htmlspecialchars(Template::strip_html($description), ENT_QUOTES); ?> "></span></td> <?php if (isset($vals[3]) && $vals[3] != 0) { ?> <td> <span class="spanIcon ui-icon ui-icon-extlink tooltip" title="<?php echo Language::string(522); ?> " onclick="Test.uiGoToRelatedObject(8,<?php echo $vals[3]; ?> )"></span> </td> <?php
public function get_preview_HTML() { return Template::strip_html($this->HTML); }
:</b></legend> <div> <table> <?php for ($i = 0; $i < count($returns); $i++) { $ret = $returns[$i]->name; for ($j = 0; $j < $vals[2] * 2; $j = $j + 2) { if ($vals[3 + $vals[1] * 2 + $j] == $returns[$i]->name && isset($vals[3 + $vals[1] * 2 + $j]) && $vals[3 + $vals[1] * 2 + $j] != "") { $ret = $vals[3 + $vals[1] * 2 + $j + 1]; break; } } ?> <tr> <td class="tdSectionColumnIcon"><span class="spanIcon ui-icon ui-icon-help tooltip" title="<?php echo htmlspecialchars(Template::strip_html($returns[$i]->description), ENT_QUOTES); ?> "></span></td> <td><?php echo $returns[$i]->name; ?> </td> <td class="noWrap tdVarPointer"><b>->></b></td> <td class="tdVarPointer"><input referenced="<?php echo $returns[$i]->name; ?> " onchange="Test.uiSetVarNameChanged($(this))" type="text" class="ui-state-focus comboboxSetVars comboboxVars controlValue<?php echo $_POST['counter']; ?> _rets ui-widget-content ui-corner-all fullWidth" value="<?php echo htmlspecialchars($ret, ENT_QUOTES);