Drupal 8  8.0.2
ViewEditForm Class Reference
Inheritance diagram for ViewEditForm:

Public Member Functions

 __construct (SharedTempStoreFactory $temp_store_factory, RequestStack $requestStack, DateFormatterInterface $date_formatter, ElementInfoManagerInterface $element_info)
 
 form (array $form, FormStateInterface $form_state)
 
 validateForm (array &$form, FormStateInterface $form_state)
 
 save (array $form, FormStateInterface $form_state)
 
 cancel (array $form, FormStateInterface $form_state)
 
 getDisplayTab ($view)
 
 getDisplayDetails ($view, $display)
 
 submitDisplayUndoDelete ($form, FormStateInterface $form_state)
 
 submitDisplayEnable ($form, FormStateInterface $form_state)
 
 submitDisplayDisable ($form, FormStateInterface $form_state)
 
 submitDisplayDelete ($form, FormStateInterface $form_state)
 
 rebuildCurrentTab (ViewUI $view, AjaxResponse $response, $display_id)
 
 renderDisplayTop (ViewUI $view)
 
 submitDelayDestination ($form, FormStateInterface $form_state)
 
 submitDisplayDuplicate ($form, FormStateInterface $form_state)
 
 submitDisplayAdd ($form, FormStateInterface $form_state)
 
 buildOptionForm (ViewUI $view, $id, $option, $display)
 
 getFormBucket (ViewUI $view, $type, $display)
 
- Public Member Functions inherited from ViewFormBase
 init (FormStateInterface $form_state)
 
 buildForm (array $form, FormStateInterface $form_state, $display_id=NULL)
 
 getDisplayTabs (ViewUI $view)
 
 isDefaultDisplayShown (ViewUI $view)
 
 getDisplayLabel (ViewUI $view, $display_id, $check_changed=TRUE)
 
- Public Member Functions inherited from EntityForm
 setOperation ($operation)
 
 getBaseFormId ()
 
 getFormId ()
 
 buildForm (array $form, FormStateInterface $form_state)
 
 form (array $form, FormStateInterface $form_state)
 
 processForm ($element, FormStateInterface $form_state, $form)
 
 afterBuild (array $element, FormStateInterface $form_state)
 
 submitForm (array &$form, FormStateInterface $form_state)
 
 save (array $form, FormStateInterface $form_state)
 
 buildEntity (array $form, FormStateInterface $form_state)
 
 getEntity ()
 
 setEntity (EntityInterface $entity)
 
 getEntityFromRouteMatch (RouteMatchInterface $route_match, $entity_type_id)
 
 getOperation ()
 
 setModuleHandler (ModuleHandlerInterface $module_handler)
 
 setEntityManager (EntityManagerInterface $entity_manager)
 
 setEntityTypeManager (EntityTypeManagerInterface $entity_type_manager)
 
- Public Member Functions inherited from EntityFormInterface
 setStringTranslation (TranslationInterface $string_translation)
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Member Functions

 actions (array $form, FormStateInterface $form_state)
 
- Protected Member Functions inherited from ViewFormBase
 prepareEntity ()
 
- Protected Member Functions inherited from EntityForm
 init (FormStateInterface $form_state)
 
 actionsElement (array $form, FormStateInterface $form_state)
 
 actions (array $form, FormStateInterface $form_state)
 
 copyFormValuesToEntity (EntityInterface $entity, array $form, FormStateInterface $form_state)
 
 prepareEntity ()
 
 prepareInvokeAll ($hook, FormStateInterface $form_state)
 

Protected Attributes

 $tempStore
 
 $requestStack
 
 $dateFormatter
 
 $elementInfo
 
- Protected Attributes inherited from ViewFormBase
 $displayID
 
- Protected Attributes inherited from EntityForm
 $operation
 
 $moduleHandler
 
 $entityManager
 
 $entityTypeManager
 
 $entity
 

Detailed Description

Form controller for the Views edit form.

Constructor & Destructor Documentation

__construct ( SharedTempStoreFactory  $temp_store_factory,
RequestStack  $requestStack,
DateFormatterInterface  $date_formatter,
ElementInfoManagerInterface  $element_info 
)

Constructs a new ViewEditForm object.

Parameters
\Drupal\user\SharedTempStoreFactory$temp_store_factoryThe factory for the temp store object.
\Symfony\Component\HttpFoundation\RequestStack$requestStackThe request stack object.
\Drupal\Core\Datetime\DateFormatterInterface$date_formatterThe date Formatter service.
\Drupal\Core\Render\ElementInfoManagerInterface$element_infoThe element info manager.

References SharedTempStoreFactory\get(), and Drupal\requestStack().

Here is the call graph for this function:

Member Function Documentation

actions ( array  $form,
FormStateInterface  $form_state 
)
protected

{}

References t().

Here is the call graph for this function:

buildOptionForm ( ViewUI  $view,
  $id,
  $option,
  $display 
)

Build a renderable array representing one option on the edit form.

This function might be more logical as a method on an object, if a suitable object emerges out of refactoring.

References Html\cleanCssIdentifier(), and ViewUI\getExecutable().

Referenced by ViewEditForm\getDisplayDetails().

Here is the call graph for this function:

Here is the caller graph for this function:

cancel ( array  $form,
FormStateInterface  $form_state 
)

Form submission handler for the 'cancel' action.

Parameters
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.

References FormStateInterface\setRedirectUrl().

Here is the call graph for this function:

static create ( ContainerInterface  $container)
static

{}

form ( array  $form,
FormStateInterface  $form_state 
)

{}

References FormStateInterface\disableCache(), Drupal\entityManager(), ViewEditForm\getDisplayTab(), ViewEditForm\renderDisplayTop(), FormStateInterface\set(), and t().

Here is the call graph for this function:

getDisplayDetails (   $view,
  $display 
)

Helper function to get the display details section of the edit UI.

Parameters
$display
Returns
array A renderable page build array.

References ViewEditForm\buildOptionForm(), Drupal\config(), Views\fetchPluginNames(), Url\fromUri(), Url\fromUserInput(), ViewFormBase\getDisplayLabel(), ViewEditForm\getFormBucket(), and t().

Referenced by ViewEditForm\getDisplayTab().

Here is the call graph for this function:

Here is the caller graph for this function:

getDisplayTab (   $view)

Returns a renderable array representing the edit page for one display.

References ViewEditForm\getDisplayDetails(), Drupal\moduleHandler(), and t().

Referenced by ViewEditForm\form(), and ViewEditForm\rebuildCurrentTab().

Here is the call graph for this function:

Here is the caller graph for this function:

getFormBucket ( ViewUI  $view,
  $type,
  $display 
)

Add information about a section to a display.

References Html\cleanCssIdentifier(), Xss\filterAdmin(), SafeMarkup\format(), Url\fromRoute(), ViewUI\getExecutable(), ViewUI\id(), Drupal\l(), and t().

Referenced by ViewEditForm\getDisplayDetails().

Here is the call graph for this function:

Here is the caller graph for this function:

rebuildCurrentTab ( ViewUI  $view,
AjaxResponse  $response,
  $display_id 
)

Regenerate the current tab for AJAX updates.

Parameters
\Drupal\views_ui\ViewUI$viewThe view to regenerate its tab.
\Drupal\Core\Ajax\AjaxResponse$responseThe response object to add new commands to.
string$display_idThe display ID of the tab to regenerate.

References AjaxResponse\addCommand(), ViewEditForm\getDisplayTab(), ViewUI\getExecutable(), and ViewEditForm\renderDisplayTop().

Here is the call graph for this function:

renderDisplayTop ( ViewUI  $view)

Render the top of the display so it can be updated during ajax operations.

References ViewUI\access(), Views\fetchPluginNames(), Url\fromRoute(), ViewUI\get(), ViewFormBase\getDisplayTabs(), ViewUI\id(), Drupal\moduleHandler(), t(), ViewUI\url(), and ViewUI\urlInfo().

Referenced by ViewEditForm\form(), and ViewEditForm\rebuildCurrentTab().

Here is the call graph for this function:

Here is the caller graph for this function:

save ( array  $form,
FormStateInterface  $form_state 
)

{Form submission handler for the 'save' action.Normally this method should be overridden to provide specific messages to the user and redirect the form after the entity has been saved.

Parameters
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
Returns
int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.
}

Implements EntityFormInterface.

References Url\fromUri(), Views\getView(), Drupal\requestStack(), FormStateInterface\setRedirect(), FormStateInterface\setRedirectUrl(), and t().

Here is the call graph for this function:

submitDelayDestination (   $form,
FormStateInterface  $form_state 
)

Submit handler for form buttons that do not complete a form workflow.

The Edit View form is a multistep form workflow, but with state managed by the SharedTempStore rather than $form_state->setRebuild(). Without this submit handler, buttons that add or remove displays would redirect to the destination parameter (e.g., when the Edit View form is linked to from a contextual link). This handler can be added to buttons whose form submission should not yet redirect to the destination.

References Url\createFromRequest(), FormStateInterface\getRedirect(), Drupal\requestStack(), and FormStateInterface\setRedirectUrl().

Here is the call graph for this function:

submitDisplayAdd (   $form,
FormStateInterface  $form_state 
)

Submit handler to add a display to a view.

References FormStateInterface\getTriggeringElement(), and FormStateInterface\setRedirect().

Here is the call graph for this function:

submitDisplayDelete (   $form,
FormStateInterface  $form_state 
)

Submit handler to delete a display from a view.

References FormStateInterface\get(), and FormStateInterface\setRedirectUrl().

Here is the call graph for this function:

submitDisplayDisable (   $form,
FormStateInterface  $form_state 
)

Submit handler to disable display.

References FormStateInterface\get(), and FormStateInterface\setRedirect().

Here is the call graph for this function:

submitDisplayDuplicate (   $form,
FormStateInterface  $form_state 
)

Submit handler to duplicate a display for a view.

References FormStateInterface\setRedirect().

Here is the call graph for this function:

submitDisplayEnable (   $form,
FormStateInterface  $form_state 
)

Submit handler to enable a disabled display.

References FormStateInterface\get(), and FormStateInterface\setRedirect().

Here is the call graph for this function:

submitDisplayUndoDelete (   $form,
FormStateInterface  $form_state 
)

Submit handler to add a restore a removed display to a view.

References FormStateInterface\get(), and FormStateInterface\setRedirect().

Here is the call graph for this function:

validateForm ( array &  $form,
FormStateInterface  $form_state 
)

{Form validation handler.

Parameters
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
}

Implements FormInterface.

References FormStateInterface\setErrorByName(), and t().

Here is the call graph for this function:


The documentation for this class was generated from the following file: