Exemplo n.º 1
0
  /**
   * Builds a standard list of eform permissions for a given type.
   *
   * @param \Drupal\eform\Entity\EFormType $type
   *   The machine name of the eform type.
   *
   * @return array
   *   An array of permission names and descriptions.
   */
  protected function buildPermissions(EFormType $type) {
    $type_params = array('%type_name' => $type->label());

    return array(
      $type->getPermission('submit') => array(
        'title' => $this->t('%type_name: Submit', $type_params),
      ),
      $type->getPermission('edit own') => array(
        'title' => $this->t('%type_name: Edit own submissions', $type_params),
      ),
      $type->getPermission('delete own') => array(
        'title' => $this->t('%type_name: Delete own submissions', $type_params),
      ),
      // @todo Which other permissions should be supported?
    );
  }
 /**
  * User Submission Page title callback.
  *
  * @param \Drupal\eform\Entity\EFormType $eform_type
  * @param null $views_display_id
  *
  * @return string
  */
 public function userSubmissionsTitle(EFormType $eform_type, $views_display_id = NULL) {
   return $this->t('@form_label: Your previous submissions', ['@form_label' => $eform_type->label()]);
 }