Backend\Modules\FormBuilder\Actions\Index::parseNumForms PHP Method

parseNumForms() public static method

Parse amount of forms sent for the datagrid
public static parseNumForms ( integer $formId, integer $sentForms ) : string
$formId integer Id of the form.
$sentForms integer Amount of sent forms.
return string
    public static function parseNumForms($formId, $sentForms)
    {
        // redefine
        $formId = (int) $formId;
        $sentForms = (int) $sentForms;
        // one form sent
        if ($sentForms == 1) {
            $output = BL::getMessage('OneSentForm');
        } elseif ($sentForms > 1) {
            // multiple forms sent
            $output = sprintf(BL::getMessage('SentForms'), $sentForms);
        } else {
            // no forms sent
            $output = sprintf(BL::getMessage('SentForms'), $sentForms);
        }
        // check if data action is allowed
        if (BackendAuthentication::isAllowedAction('Data', 'FormBuilder')) {
            // output
            $output = '<a href="' . BackendModel::createURLForAction('Data') . '&amp;id=' . $formId . '" title="' . $output . '">' . $output . '</a>';
        }
        return $output;
    }