23 $json =
new stdClass();
25 $json->status =
"fail";
26 $json->title = self::jsonSafeString(
$lng->txt(
"bgtask_failure"));
27 $json->message = self::jsonSafeString($a_message);
28 $json->button = self::jsonSafeString(
$lng->txt(
"ok"));
44 $json =
new stdClass();
46 $json->status =
"block";
47 $json->task_id = $a_task_id;
48 $json->title = self::jsonSafeString(
$lng->txt(
"bgtask_blocked"));
49 $json->message = self::jsonSafeString(
$lng->txt(
"bgtask_blocked_info"));
50 $json->button_old = self::jsonSafeString(
$lng->txt(
"bgtask_blocked_cancel_old"));
51 $json->button_new = self::jsonSafeString(
$lng->txt(
"bgtask_blocked_cancel_new"));
69 $json =
new stdClass();
72 $json->task_id = $a_task_id;
73 $json->title = self::jsonSafeString(
$lng->txt(
"bgtask_processing"));
74 $json->message = self::jsonSafeString($a_message);
75 $json->button = self::jsonSafeString(
$lng->txt(
"cancel"));
76 $json->steps = (int) $a_steps;
91 $json =
new stdClass();
98 if ($a_finished_cmd) {
99 $json->result_cmd = $a_finished_cmd;
100 $json->result = $a_finished_result;
116 $json =
new stdClass();
118 $json->status =
"finished";
119 $json->task_id = $a_task_id;
120 $json->result_cmd = $a_cmd;
121 $json->result = $a_result;
134 if (!is_string($a_text)) {
138 $a_text = htmlentities($a_text, ENT_COMPAT | ENT_HTML401,
"UTF-8");
139 $a_text = str_replace(
"'",
"'", $a_text);
static getFinishedJson($a_task_id, $a_cmd, $a_result)
Get json for finished task.
getSteps()
Gets the steps.
static getProcessingJson($a_task_id, $a_message, $a_steps)
Get json for processing task.
static jsonSafeString($a_text)
Makes the specified string safe for JSON.
static getFailedJson($a_message)
Get json for failed task.
getCurrentStep()
Gets the current step.
Background task JSON helper.
static getProgressJson(ilBackgroundTask $a_task, $a_finished_cmd=null, $a_finished_result=null)
Get json for task progress.
static getBlockedJson($a_task_id)
Get json for blocked task.
getStatus()
Gets the status.