Render a compact view of the current status of the submission.

@param assign_submission_status_compact $status
@return string
490735
public function render_assign_submission_status_compact(assign_submission_status_compact $status) {
        $o = '';
        $o .= $this->output->container_start('submissionstatustable');
        $o .= $this->output->heading(get_string('submission', 'assign'), 3);
        $time = time();

        if ($status->teamsubmissionenabled) {
            $group = $status->submissiongroup;
            if ($group) {
                $team = format_string($group->name, false, $status->context);
            } else if ($status->preventsubmissionnotingroup) {
                if (count($status->usergroups) == 0) {
                    $team = '<span class="alert alert-error">' . get_string('noteam', 'assign') . '</span>';
                } else if (count($status->usergroups) > 1) {
                    $team = '<span class="alert alert-error">' . get_string('multipleteams', 'assign') . '</span>';
                }
            } else {
                $team = get_string('defaultteam', 'assign');
            }
            $o .= $this->output->container(get_string('teamname', 'assign', $team), 'teamname');
        }

        if (!$status->teamsubmissionenabled) {
            if ($status->submission && $status->submission->status != ASSIGN_SUBMISSION_STATUS_NEW) {
                $statusstr = get_string('submissionstatus_' . $status->submission->status, 'assign');
                $o .= $this->output->container($statusstr, 'submissionstatus' . $status->submission->status);
            } else {
                if (!$status->submissionsenabled) {
                    $o .= $this->output->container(get_string('noonlinesubmissions', 'assign'), 'submissionstatus');
                } else {
                    $o .= $this->output->container(get_string('noattempt', 'assign'), 'submissionstatus');
                }
            }
        } else {
            $group = $status->submissiongroup;
            if (!$group && $status->preventsubmissionnotingroup) {
                $o .= $this->output->container(get_string('nosubmission', 'assign'), 'submissionstatus');
            } else if ($status->teamsubmission && $status->teamsubmission->status != ASSIGN_SUBMISSION_STATUS_NEW) {
                $teamstatus = $status->teamsubmission->status;
                $submissionsummary = get_string('submissionstatus_' . $teamstatus, 'assign');
                $groupid = 0;
                if ($status->submissiongroup) {
                    $groupid = $status->submissiongroup->id;
                }

                $members = $status->submissiongroupmemberswhoneedtosubmit;
                $userslist = array();
                foreach ($members as $member) {
                    $urlparams = array('id' => $member->id, 'course' => $status->courseid);
                    $url = new moodle_url('/user/view.php', $urlparams);
                    if ($status->view == assign_submission_status::GRADER_VIEW && $status->blindmarking) {
                        $userslist[] = $member->alias;
                    } else {
                        $fullname = fullname($member, $status->canviewfullnames);
                        $userslist[] = $this->output->action_link($url, $fullname);
                    }
                }
                if (count($userslist) > 0) {
                    $userstr = join(', ', $userslist);
                    $formatteduserstr = get_string('userswhoneedtosubmit', 'assign', $userstr);
                    $submissionsummary .= $this->output->container($formatteduserstr);
                }
                $o .= $this->output->container($submissionsummary, 'submissionstatus' . $status->teamsubmission->status);
            } else {
                if (!$status->submissionsenabled) {
                    $o .= $this->output->container(get_string('noonlinesubmissions', 'assign'), 'submissionstatus');
                } else {
                    $o .= $this->output->container(get_string('nosubmission', 'assign'), 'submissionstatus');
                }
            }
        }

        // Is locked?
        if ($status->locked) {
            $o .= $this->output->container(get_string('submissionslocked', 'assign'), 'submissionlocked');
        }

        // Grading status.
        $statusstr = '';
        $classname = 'gradingstatus';
        if ($status->gradingstatus == ASSIGN_GRADING_STATUS_GRADED ||
            $status->gradingstatus == ASSIGN_GRADING_STATUS_NOT_GRADED) {
            $statusstr = get_string($status->gradingstatus, 'assign');
        } else {
            $gradingstatus = 'markingworkflowstate' . $status->gradingstatus;
            $statusstr = get_string($gradingstatus, 'assign');
        }
        if ($status->gradingstatus == ASSIGN_GRADING_STATUS_GRADED ||
            $status->gradingstatus == ASSIGN_MARKING_WORKFLOW_STATE_RELEASED) {
            $classname = 'submissiongraded';
        } else {
            $classname = 'submissionnotgraded';
        }
        $o .= $this->output->container($statusstr, $classname);

        $submission = $status->teamsubmission ? $status->teamsubmission : $status->submission;
        $duedate = $status->duedate;
        if ($duedate > 0) {

            if ($status->extensionduedate) {
                // Extension date.
                $duedate = $status->extensionduedate;
            }

            // Time remaining.
            $classname = 'timeremaining';
            if ($duedate - $time <= 0) {
                if (!$submission ||
                        $submission->status != ASSIGN_SUBMISSION_STATUS_SUBMITTED) {
                    if ($status->submissionsenabled) {
                        $remaining = get_string('overdue', 'assign', format_time($time - $duedate));
                        $classname = 'overdue';
                    } else {
                        $remaining = get_string('duedatereached', 'assign');
                    }
                } else {
                    if ($submission->timemodified > $duedate) {
                        $remaining = get_string('submittedlate',
                                              'assign',
                                              format_time($submission->timemodified - $duedate));
                        $classname = 'latesubmission';
                    } else {
                        $remaining = get_string('submittedearly',
                                               'assign',
                                               format_time($submission->timemodified - $duedate));
                        $classname = 'earlysubmission';
                    }
                }
            } else {
                $remaining = get_string('paramtimeremaining', 'assign', format_time($duedate - $time));
            }
            $o .= $this->output->container($remaining, $classname);
        }

        // Show graders whether this submission is editable by students.
        if ($status->view == assign_submission_status::GRADER_VIEW) {
            if ($status->canedit) {
                $o .= $this->output->container(get_string('submissioneditable', 'assign'), 'submissioneditable');
            } else {
                $o .= $this->output->container(get_string('submissionnoteditable', 'assign'), 'submissionnoteditable');
            }
        }

        // Grading criteria preview.
        if (!empty($status->gradingcontrollerpreview)) {
            $o .= $this->output->container($status->gradingcontrollerpreview, 'gradingmethodpreview');
        }

        if ($submission) {

            if (!$status->teamsubmission || $status->submissiongroup != false || !$status->preventsubmissionnotingroup) {
                foreach ($status->submissionplugins as $plugin) {
                    $pluginshowsummary = !$plugin->is_empty($submission) || !$plugin->allow_submissions();
                    if ($plugin->is_enabled() &&
                        $plugin->is_visible() &&
                        $plugin->has_user_summary() &&
                        $pluginshowsummary
                    ) {

                        $displaymode = assign_submission_plugin_submission::SUMMARY;
                        $pluginsubmission = new assign_submission_plugin_submission($plugin,
                            $submission,
                            $displaymode,
                            $status->coursemoduleid,
                            $status->returnaction,
                            $status->returnparams);
                        $plugincomponent = $plugin->get_subtype() . '_' . $plugin->get_type();
                        $o .= $this->output->container($this->render($pluginsubmission), 'assignsubmission ' . $plugincomponent);
                    }
                }
            }
        }

        $o .= $this->output->container_end();
        return $o;
    }
121819
protected function _status($id, $status) {
		if (!$this->{$this->modelClass}->changeStatus($id, $status)) {
			return $this->alert('status.fail');
		}
		$this->alert('status.success');
	}
48776
public function status($status = null)
    {
        if ($status !== null) {
            if (!isset($this->statusTexts[$status])) {
                throw new ResponseException('Unsupported status code "' . $status . '"');
            }

            $this->status = (int) $status;

            if ($this->content === null) {
                $this->content = $this->statusTexts[$this->status];
            }
        }

        return $this->status;
    }
246293
public function changeStatusActivity(string $status)
    {
        if ("enabled" === $status) {
            if (Locale::enableLocale()) {
                return ((new Renderer())->jsonRenderer(array("code" => 200, "msg" => "OK")));
            } else {
                return ((new Renderer())->jsonRenderer(array("code" => 500,
                    "results" => "Locale is already enabled")));
            }
        } elseif ("disabled" === $status) {
            if (Locale::disableLocale()) {
                return ((new Renderer())->jsonRenderer(array("code" => 200, "msg" => "OK")));
            } else {
                return ((new Renderer())->jsonRenderer(array("code" => 500,
                    "results" => "Locale is already disabled")));
            }
        }
        return ((new Renderer())->jsonRenderer(array("code" => 500,
            "results" => "Undefined locale status $status")));
    }
1369694
public function setStatus($status)
    {
        $statusAttribute = $this->statusAttribute;
        return (is_string($statusAttribute) && !empty($statusAttribute)) ? $this->$statusAttribute = $status : null;
    }
45515
public function status($status = null)
    {
        if (func_num_args()) {
            $this->_status = $status;
            return $this;
        }
        if ($this->root()->focused()) {
            return -1;
        }
        return $this->_status;
    }
819511
public static function statusToStr($status) {
        if (!is_int($status)) throw new IllegalTypeException('Illegal type of parameter $status: '.gettype($status));

        switch ($status) {
            case PGSQL_EMPTY_QUERY   : return 'PGSQL_EMPTY_QUERY';
            case PGSQL_COMMAND_OK    : return 'PGSQL_COMMAND_OK';
            case PGSQL_TUPLES_OK     : return 'PGSQL_TUPLES_OK';
            case PGSQL_COPY_OUT      : return 'PGSQL_COPY_OUT';
            case PGSQL_COPY_IN       : return 'PGSQL_COPY_IN';
            case PGSQL_BAD_RESPONSE  : return 'PGSQL_BAD_RESPONSE';
            case PGSQL_NONFATAL_ERROR: return 'PGSQL_NONFATAL_ERROR';
            case PGSQL_FATAL_ERROR   : return 'PGSQL_FATAL_ERROR';
        }
        return (string) $status;
    }
125201
public function render($status = 200, $data = null) {
        $app = $this->app;
        $status = \intval($status);

        if ($this->dataWrapper) {
            $response[$this->dataWrapper] = $this->all();
        } else {
            $response = $this->all();
        }

        if (!$this->dataOnly) {
            //append error bool
            if ($status < 400) {
                if ($this->metaWrapper) {
                    $response[$this->metaWrapper]['error'] = false;
                } else {
                    $response['error'] = false;
                }
            } else {
                if ($this->metaWrapper) {
                    $response[$this->metaWrapper]['error'] = true;
                } else {
                    $response['error'] = true;
                }
            }

            //append status code

            if ($app->config(Config::Status)) {
                if ($this->metaWrapper) {
                    $response[$this->metaWrapper]['status'] = $status;
                } else {
                    $response['status'] = $status;
                }
            }

            //add flash messages
            if (isset($this->data->flash) && \is_object($this->data->flash)) {
                // if (isset($response['flash']) && \is_object($response['flash'])) {

                $flash = $this->data->flash->getMessages();

                if ($this->dataWrapper) {
                    unset($response[$this->dataWrapper]['flash']);
                } else {
                    unset($response['flash']);
                }

                if (count($flash)) {
                    if ($this->metaWrapper) {
                        $response[$this->metaWrapper]['flash'] = $flash;
                    } else {
                        $response['flash'] = $flash;
                    }
                }
            }
        } else {
            unset($response['flash'], $response['status'], $response['error']);
        }

        $app->response()->status($status);
        $app->response()->header('Content-Type', $this->contentType);

        $jsonp_callback = $app->request->get('callback', null);

        /**
         * Bitmask consisting of <b>JSON_HEX_QUOT</b>,
         * <b>JSON_HEX_TAG</b>,
         * <b>JSON_HEX_AMP</b>,
         * <b>JSON_HEX_APOS</b>,
         * <b>JSON_NUMERIC_CHECK</b>,
         * <b>JSON_PRETTY_PRINT</b>,
         * <b>JSON_UNESCAPED_SLASHES</b>,
         * <b>JSON_FORCE_OBJECT</b>,
         * <b>JSON_UNESCAPED_UNICODE</b>.
         * The behaviour of these constants is described on
         * the JSON constants page.
         * @var int
         */
        $encodingOptions = $app->config(Config::JsonEncodeOptions);

        if ($jsonp_callback !== null) {
            $body = $jsonp_callback . '(' . json_encode($response, $encodingOptions) . ')';
        } else {
            $body = json_encode($response, $encodingOptions);
        }

        if ($status == 404) {
            return $body;
        } else {
            $app->response()->body($body);
        }
    }
376828
public function updateStatus($status)
    {
        if(empty($this->payload['id'])) {
            return;
        }

        $statusInstance = new Status($this->payload['id']);
        $statusInstance->update($status);
    }
1264699
private function getAmountStatusTitle($status)
    {
        $result = '';
        if ($status > static::Status_Success) {
            $result = $this->t('amount_status_' . $status);
        }
        return $result;
    }
1225837
public function index($page = null, $status = null)
    {
        $url = 'templates.json';

        $templates = $this->client->get($url, [
            'query' => [
                'status' => $status,
                'page' => $page,
            ],
        ]);

        return $this->indexResponse($templates, Template::class);
    }
41337
private function getStatusIcon($status)
    {
        switch ($status) {
            case static::Status_Success:
                $result = json_decode('"\u2714"');
                break;
            case static::Status_Info:
            case static::Status_Warning:
                $result = '!';
                break;
            case static::Status_Error:
            default:
                $result = json_decode('"\u2716"');
                break;
        }
        return $result;
    }
127469
public function getStatusClass($status)
    {
        switch ($status) {
            case static::Status_Success:
                $result = 'success';
                break;
            case static::Status_Info:
                $result = 'info';
                break;
            case static::Status_Warning:
                $result = 'warning';
                break;
            case static::Status_Error:
            default:
                $result = 'error';
                break;
        }
        return $result;
    }
797954
public function actionAll( $status = null ) {

		$this->layout	= CoreGlobalWeb::LAYOUT_PRIVATE;

		$user			= Yii::$app->user->getIdentity();
		$dataProvider 	= null;

		if( isset( $status ) ) {

			$dataProvider = $this->modelService->getPageByOwnerId( $user->id, [ 'status' => Page::$urlRevStatusMap[ $status ] ] );
		}
		else {

			$dataProvider = $this->modelService->getPageByOwnerId( $user->id );
		}

		return $this->render( 'all', [
			'dataProvider' => $dataProvider,
			'status' => $status
		]);
	}
686073
protected function setStatusReview($status)
    {
        $id = $this->getParam(0);
        $all = $this->getParam('all');

        if (!isset($id) && empty($all)) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        if (isset($id) && (empty($id) || !is_numeric($id))) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $options = null;

        if (isset($id)) {

            if ($this->getParam('user')) {
                $options = array('user_id' => $id);
            } else if ($this->getParam('product')) {
                $options = array('product_id' => $id);
            }

        } else if (!empty($all)) {
            $options = array();
        }

        if (isset($options)) {

            $deleted = $count = 0;
            foreach ($this->review->getList($options) as $item) {
                $count++;
                $deleted += (int) $this->review->update($item['review_id'], array('status' => $status));
            }

            $result = $count && $count == $deleted;

        } else if (!empty($id)) {
            $result = $this->review->update($id, array('status' => $status));
        }

        if (empty($result)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
294748
function presence($show, $status = null){
        $data = $this->reqdata();
        $data['nick'] = $this->endpoint->nick;
        $data['show'] = $show;
        if($status) $data['status'] = $status;
		return $this->request('presences/show', $data, 'POST');
	}
391920
public function setStatus($status)
    {
        $result = \Eix\Services\Net\Http::isStatusCodeValid($status);
        if ($result) {
            $this->status = $status;
        }

        return $result;
    }