Sets SwaggerUiAction as controller if the requested format is HTML.
768940
public function onKernelRequest(GetResponseEvent $event): void
    {
        $request = $event->getRequest();
        if (
            'html' !== $request->getRequestFormat('') ||
            !($request->attributes->has('_api_resource_class') || $request->attributes->getBoolean('_api_respond', false))
        ) {
            return;
        }

        $request->attributes->set('_controller', 'api_platform.swagger.action.ui');
    }
116956
function validateAction (action, interactable) {
        if (!isObject(action)) { return null; }

        var actionName = action.name,
            options = interactable.options;

        if ((  (actionName  === 'resize'   && options.resize.enabled )
            || (actionName      === 'drag'     && options.drag.enabled  )
            || (actionName      === 'gesture'  && options.gesture.enabled))
            && actionIsEnabled[actionName]) {

            if (actionName === 'resize' || actionName === 'resizeyx') {
                actionName = 'resizexy';
            }

            return action;
        }
        return null;
    }
1177831
function(index, style)
	{
		style = YAHOO.lang.JSON.stringify(style);
		if(this._swf && this._swf.setSeriesStylesByIndex) this._swf.setSeriesStylesByIndex(index, style);
	}
1285678
def generate_swagger_html(swagger_static_root, swagger_json_url):
    
    tmpl = _get_template("swagger.html")
    return tmpl.render(
        swagger_root=swagger_static_root, swagger_json_url=swagger_json_url
    )
124075
private Object wrappedAction(final Context cx, final Scriptable scope,
			final Scriptable thisObj, final Object[] args, final int actionType) {

		// take care to set the context's RegExp proxy to the original one as
		// this is checked
		// (cf net.sourceforge.htmlunit.corejs.javascript.regexp.RegExpImp:334)
		try {
			ScriptRuntime.setRegExpProxy(cx, wrapped_);
			return wrapped_.action(cx, scope, thisObj, args, actionType);
		} finally {
			ScriptRuntime.setRegExpProxy(cx, this);
		}
	}
158323
function parser () {
  // When the form is submitted, parse the Swagger API
  form.form.on("submit", function (event) {
    event.preventDefault();
    parseSwagger();
  });

  // When the "x" button is clicked, discard the results
  $("#clear").on("click", function () {
    swaggerParser = null;
    editors.clearResults();
    analytics.trackEvent("results", "clear");
  });
}
1098143
protected function setResponseFromControllerResponse($controllerResponse, $status = Service::OK, $format = NULL) {
    
    if ($controllerResponse instanceof \Psc\CMS\EntityFormPanel) {
      $format = ServiceResponse::HTML;

    } elseif ($controllerResponse instanceof \Psc\CMS\Entity) {
      $format = ServiceResponse::JSON;

    } elseif ($controllerResponse instanceof \Psc\Doctrine\Object) {
      $format = ServiceResponse::JSON;
    }
    
    parent::setResponseFromControllerResponse($controllerResponse, $status, $format);
  }
587908
def SetAction(self, action, **kws):
        ""
        if hasattr(action,'__call__'):
            self.__action = Closure(action, **kws)
607815
function customHTTPAction( $module, $http, $action )
    {
        $dataType = $this->dataType();
        $this->Module = $module;
        $dataType->customClassAttributeHTTPAction( $http, $action, $this );
        unset( $this->Module );
        $this->Module = null;
    }
801344
def set_input_format(self, content_type, handler):
        """"""
        if getattr(self, '_input_format', None) is None:
            self._input_format = {}
        self._input_format[content_type] = handler
1330716
public void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {
		if (target.indexOf('.') != -1) {
			return ;
		}
		
		isHandled[0] = true;
		String[] urlPara = {null};
		Action action = actionMapping.getAction(target, urlPara);
		
		if (action == null) {
			if (log.isWarnEnabled()) {
				String qs = request.getQueryString();
				log.warn("404 Action Not Found: " + (qs == null ? target : target + "?" + qs));
			}
			renderManager.getRenderFactory().getErrorRender(404).setContext(request, response).render();
			return ;
		}
		
		Controller controller = null;
		try {
			// Controller controller = action.getControllerClass().newInstance();
			controller = controllerFactory.getController(action.getControllerClass());
			if (injectDependency) {com.jfinal.aop.Aop.inject(controller);}
			controller._init_(action, request, response, urlPara[0]);
			
			if (devMode) {
				if (ActionReporter.isReportAfterInvocation(request)) {
					new Invocation(action, controller).invoke();
					ActionReporter.report(target, controller, action);
				} else {
					ActionReporter.report(target, controller, action);
					new Invocation(action, controller).invoke();
				}
			}
			else {
				new Invocation(action, controller).invoke();
			}
			
			Render render = controller.getRender();
			if (render instanceof ForwardActionRender) {
				String actionUrl = ((ForwardActionRender)render).getActionUrl();
				if (target.equals(actionUrl)) {
					throw new RuntimeException("The forward action url is the same as before.");
				} else {
					handle(actionUrl, request, response, isHandled);
				}
				return ;
			}
			
			if (render == null) {
				render = renderManager.getRenderFactory().getDefaultRender(action.getViewPath() + action.getMethodName());
			}
			render.setContext(request, response, action.getViewPath()).render();
		}
		catch (RenderException e) {
			if (log.isErrorEnabled()) {
				String qs = request.getQueryString();
				log.error(qs == null ? target : target + "?" + qs, e);
			}
		}
		catch (ActionException e) {
			handleActionException(target, request, response, action, e);
		}
		catch (Exception e) {
			if (log.isErrorEnabled()) {
				String qs = request.getQueryString();
				log.error(qs == null ? target : target + "?" + qs, e);
			}
			renderManager.getRenderFactory().getErrorRender(500).setContext(request, response, action.getViewPath()).render();
		} finally {
			controllerFactory.recycle(controller);
		}
	}
862059
private boolean checkActionMethod(AppController controller, String actionMethod) {
        HttpMethod method = HttpMethod.getMethod(RequestContext.getHttpRequest());
        if (!controller.actionSupportsHttpMethod(actionMethod, method)) {
            DirectResponse res = new DirectResponse("");
            //see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
            res.setStatus(405);
            LOGGER.warn("Requested action does not support HTTP method: " + method.name() + ", returning status code 405.");
            RequestContext.setControllerResponse(res);

            //TODO: candidate for caching below, list of allowed HTTP methods
            //see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
            RequestContext.getHttpResponse().setHeader("Allow", join(controller.allowedActions(actionMethod), ", "));
            return false;
        }
        return true;
    }
516035
def add_swagger(app, json_route, html_route, **kwargs):
    
    app.route(json_route)(create_swagger_json_handler(app, **kwargs))
    add_swagger_api_route(app, html_route, json_route)
480764
def add_swagger_api_route(app, target_route, swagger_json_route):
    
    static_root = get_swagger_static_root()
    swagger_body = generate_swagger_html(
        STATIC_ROOT, swagger_json_route
    ).encode("utf-8")

    async def swagger_ui(request):
        return web.Response(body=swagger_body, content_type="text/html")

    app.router.add_route("GET", target_route, swagger_ui)
    app.router.add_static(STATIC_ROOT, static_root)
1017742
function customObjectAttributeHTTPAction( $http, $action, $contentObjectAttribute, $parameters )
    {
        $params = explode( '-', $action );

        switch ( $params[0] )
        {
            case 'new_zone_layout':
                if ( $http->hasPostVariable( 'ContentObjectAttribute_ezpage_zone_allowed_type_' . $contentObjectAttribute->attribute( 'id' ) ) )
                {
                    $zoneMap = array();
                    if ( $http->hasPostVariable( 'ContentObjectAttribute_ezpage_zone_map' ) )
                        $zoneMap = $http->postVariable( 'ContentObjectAttribute_ezpage_zone_map' );

                    $zoneINI = eZINI::instance( 'zone.ini' );
                    $page = $contentObjectAttribute->content();
                    $zoneAllowedType = $http->postVariable( 'ContentObjectAttribute_ezpage_zone_allowed_type_' . $contentObjectAttribute->attribute( 'id' ) );

                    if ( $zoneAllowedType == $page->attribute('zone_layout') )
                        return false;

                    $allowedZones = $zoneINI->variable( $zoneAllowedType, 'Zones' );
                    $allowedZonesCount = count( $allowedZones );

                    $page->setAttribute( 'zone_layout', $zoneAllowedType );
                    $existingZoneCount = $page->getZoneCount();

                    $zoneCountDiff = 0;
                    if ( $allowedZonesCount < $existingZoneCount )
                        $zoneCountDiff = $existingZoneCount - $allowedZonesCount;

                    if ( !empty( $zoneMap ) )
                    {
                        foreach( $page->attribute( 'zones' ) as $zoneIndex => $zone )
                        {
                            $zoneMapKey = array_search( $zone->attribute( 'zone_identifier' ), $zoneMap );

                            if ( $zoneMapKey )
                            {
                                $zone->setAttribute( 'action', 'modify' );
                                $zone->setAttribute( 'zone_identifier', $zoneMapKey );
                            }
                            else
                            {
                                if ( $zone->toBeAdded() )
                                    $page->removeZone( $zoneIndex );
                                else
                                    $zone->setAttribute( 'action', 'remove' );
                            }
                        }
                    }
                    else
                    {
                        foreach ( $allowedZones as $index => $zoneIdentifier )
                        {
                            $existingZone = $page->getZone($index);

                            if ( $existingZone instanceof eZPageZone )
                            {
                                $existingZone->setAttribute( 'action', 'modify' );
                                $existingZone->setAttribute( 'zone_identifier', $zoneIdentifier );
                            }
                            else
                            {
                                $newZone = $page->addZone( new eZPageZone() );
                                $newZone->setAttribute( 'id', md5( mt_rand() . microtime() . $page->getZoneCount() ) );
                                $newZone->setAttribute( 'zone_identifier', $zoneIdentifier );
                                $newZone->setAttribute( 'action', 'add' );
                            }
                        }

                        if ( $zoneCountDiff > 0 )
                        {
                            while ( $zoneCountDiff != 0 )
                            {
                                $existingZoneIndex = $existingZoneCount - $zoneCountDiff;
                                $existingZone = $page->getZone( $existingZoneIndex );

                                if ( $existingZone->toBeAdded() )
                                    $page->removeZone( $existingZoneIndex );
                                else
                                    $existingZone->setAttribute( 'action', 'remove' );

                                $zoneCountDiff -= 1;
                            }
                        }
                    }

                    $page->sortZones();
                }
                break;
            case 'set_rotation':
                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );
                $block = $zone->getBlock( $params[2] );

                $rotationValue = $http->postVariable( 'RotationValue_' . $params[2] );
                $rotationUnit = $http->postVariable( 'RotationUnit_' . $params[2] );
                $rotationSuffle = $http->postVariable( 'RotationShuffle_' . $params[2] );

                if ( trim( $rotationValue ) == '' || $rotationValue == 0 )
                {
                    $block->setAttribute( 'rotation', array( 'interval' => 0,
                                                             'type' => 0,
                                                             'value' => '',
                                                             'unit' => '' ) );
                    $waitingItems = $block->attribute( 'waiting' );
                    foreach ( $waitingItems as $item )
                    {
                        $item->setAttribute( 'ts_publication', time() );
                        $item->setAttribute( 'ts_visible', time() );
                        $item->setAttribute( 'ts_hidden', '0' );
                        $item->setAttribute( 'action', 'add' );
                        $item->setXMLStorable( true );
                        $block->addItem( $item );
                    }
                }
                else
                {
                    switch ( $rotationUnit )
                    {
                        case '2':
                            $rotationInterval = $rotationValue * 60;
                            break;

                        case '3':
                            $rotationInterval = $rotationValue * 3600;
                            break;

                        case '4':
                            $rotationInterval = $rotationValue * 86400;

                        default:
                            break;
                    }

                    $rotationType = 1;

                    if ( $rotationSuffle )
                    $rotationType = 2;

                    $block->setAttribute( 'rotation', array( 'interval' => $rotationInterval,
                                                             'type' => $rotationType,
                                                             'value' => $rotationValue,
                                                             'unit' => $rotationUnit ) );
                }
                break;
            case 'remove_block':
                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );
                $block = $zone->getBlock( $params[2] );

                if ( $block->toBeAdded() )
                {
                    $zone->removeBlock( $params[2] );
                }
                else
                {
                    $block->setAttribute( 'action', 'remove' );
                }
                break;
            case 'new_block':
                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );

                $blockType = $http->hasPostVariable( 'ContentObjectAttribute_ezpage_block_type_' . $contentObjectAttribute->attribute( 'id' ) . '_' . $params[1] ) ? $http->postVariable( 'ContentObjectAttribute_ezpage_block_type_' . $contentObjectAttribute->attribute( 'id' ) . '_' . $params[1] ) : '';
                $blockName = $http->hasPostVariable( 'ContentObjectAttribute_ezpage_block_name_' . $contentObjectAttribute->attribute( 'id' ) . '_' . $params[1] ) ? $http->postVariable( 'ContentObjectAttribute_ezpage_block_name_' . $contentObjectAttribute->attribute( 'id' ) . '_' . $params[1] ) : '';

                $block = $zone->addBlock( new eZPageBlock( $blockName ) );
                $block->setAttribute( 'action', 'add' );
                $block->setAttribute( 'id', md5( mt_rand() . microtime() . $zone->getBlockCount() ) );
                $block->setAttribute( 'zone_id', $zone->attribute( 'id' ) );
                $block->setAttribute( 'type', $blockType );

                $blockState = 'id_' . $block->attribute( 'id' ) . '=1';
                setrawcookie( 'eZPageBlockState', isset( $_COOKIE['eZPageBlockState'] ) ? $_COOKIE['eZPageBlockState'] . '&' . $blockState : $blockState, time() + 3600, '/' );
                break;
            case 'move_block_up':
                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );
                $zone->moveBlockUp( $params[2] );
                break;
            case 'move_block_down':
                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );
                $zone->moveBlockDown( $params[2] );
                break;
            case 'new_item':
                if ( $http->hasPostVariable( 'SelectedNodeIDArray' ) )
                {
                    if ( !$http->hasPostVariable( 'BrowseCancelButton' ) )
                    {
                        $selectedNodeIDArray = $http->postVariable( 'SelectedNodeIDArray' );

                        $page = $contentObjectAttribute->content();
                        $zone = null;
                        $block = null;

                        if( isset( $params[1] ) && ( $page instanceof eZPage ) )
                            $zone = $page->getZone( $params[1] );

                        if ( $zone instanceof eZPageZone )
                            $block = $zone->getBlock( $params[2] );

                        if ( $block instanceof eZPageBlock )
                        {
                            foreach ( $selectedNodeIDArray as $index => $nodeID )
                            {
                                $object = eZContentObject::fetchByNodeID( $nodeID );

                                if ( !$object instanceof eZContentObject )
                                    return false;

                                $objectID = $object->attribute( 'id' );

                                    //judge the list if there is a same item in history
                                    $itemAdded = false;
                                    $itemValid = false;
                                    $historyItems = $block->attribute( 'archived' );
                                    foreach( $historyItems as $historyItem )
                                    {
                                        if( $historyItem->attribute( 'object_id' ) == $objectID )
                                        {
                                            $itemAdded = $historyItem;
                                        }
                                    }
                                    $validItems = $block->attribute( 'valid' );
                                    foreach( $validItems as $validItem )
                                    {
                                        if( $validItem->attribute( 'object_id' ) == $objectID )
                                        {
                                            $itemValid = $validItem;
                                        }
                                    }

                                    //judge if the item will be removed
                                    $itemToBeRemoved = false;
                                    if ( $block->getItemCount() > 0 )
                                    {
                                        foreach ( $block->attribute( 'items' ) as $itemID => $item )
                                        {
                                            if ( $item->attribute( 'object_id' ) == $objectID )
                                            {
                                                if ( $item->toBeRemoved() )
                                                {
                                                    $itemToBeRemoved = true;
                                                    $itemAdded = $item;
                                                 }
                                            }
                                        }
                                    }

                                    if( $itemAdded || $itemToBeRemoved )
                                    {
                                        //if there is same item in history, or item to be removed (in history or valid), set the item in history to be modified
                                        // if item is not to be removed, add to the block since it's not in block ,but in history or valid
                                        if( !$itemToBeRemoved )
                                        {
                                            $block->addItem( $itemAdded );
                                        }
                                        $itemAdded->setXMLStorable( true );
                                        $itemAdded->setAttribute( 'node_id', $nodeID );
                                        $itemAdded->setAttribute( 'priority', $block->getItemCount() );
                                        $itemAdded->setAttribute( 'ts_publication', time() );
                                        $itemAdded->setAttribute( 'ts_visible', '0' );
                                        $itemAdded->setAttribute( 'ts_hidden', '0' );
                                        $itemAdded->setAttribute( 'action', 'modify' );
                                    }
                                    else
                                    {
                                        if( !$itemValid )
                                        {
                                            //if there is no same item in history and valid, also the item is not to be removed, add new
                                            $item = $block->addItem( new eZPageBlockItem() );
                                            $item->setAttribute( 'object_id', $objectID );
                                            $item->setAttribute( 'node_id', $nodeID );
                                            $item->setAttribute( 'priority', $block->getItemCount() );
                                            $item->setAttribute( 'ts_publication', time() );
                                            $item->setAttribute( 'action', 'add' );
                                        }
                                    }
                                }
                            }

                            $contentObjectAttribute->setContent( $page );
                            $contentObjectAttribute->store();
                        }
                    }
                    break;
            case 'new_item_browse':
                $module = $parameters['module'];
                $redirectionURI = $redirectionURI = $parameters['current-redirection-uri'];

                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );
                $block = $zone->getBlock( $params[2] );

                $type = $block->attribute( 'type' );
                $blockINI = eZINI::instance( 'block.ini' );
                $classArray = false;

                if( $blockINI->hasVariable( $type, 'AllowedClasses' ) )
                    $classArray = $blockINI->variable( $type, 'AllowedClasses' );

                $browseParameters = array( 'class_array' => $classArray,
                                           'action_name' => 'AddNewBlockItem',
                                           'browse_custom_action' => array( 'name' => 'CustomActionButton[' . $contentObjectAttribute->attribute( 'id' ) . '_new_item-' . $params[1] . '-' . $params[2] . ']',
                                                                            'value' => $contentObjectAttribute->attribute( 'id' ) ),
                                           'from_page' => $redirectionURI,
                                           'cancel_page' => $redirectionURI,
                                           'persistent_data' => array( 'HasObjectInput' => 0 ) );

                if( $blockINI->hasVariable( $block->attribute( 'type' ), 'ManualBlockStartBrowseNode' ) )
                {
                    $browseParameters['start_node'] = $blockINI->variable( $block->attribute( 'type' ), 'ManualBlockStartBrowseNode' );
                }

                eZContentBrowse::browse( $browseParameters, $module );
                break;
            case 'new_source':
                $page = $contentObjectAttribute->content();

                $zone = $page->getZone( $params[1] );
                $block = $zone->getBlock( $params[2] );

                if ( $http->hasPostVariable( 'SelectedNodeIDArray' ) )
                {
                    $selectedNodeIDArray = $http->postVariable( 'SelectedNodeIDArray' );
                    $blockINI = eZINI::instance( 'block.ini' );

                    $fetchParametersSelectionType = $blockINI->variable( $block->attribute( 'type' ), 'FetchParametersSelectionType' );
                    $fetchParams = unserialize( $block->attribute( 'fetch_params' ) );

                    if ( $fetchParametersSelectionType['Source'] == 'single' )
                        $fetchParams['Source'] = $selectedNodeIDArray[0];
                    else
                        $fetchParams['Source'] = $selectedNodeIDArray;

                    $block->setAttribute( 'fetch_params', serialize( $fetchParams ) );

                    $persBlockObject = eZFlowBlock::fetch( $block->attribute( 'id' ) );

                    if ( $persBlockObject instanceof eZFlowBlock )
                    {
                        $persBlockObject->setAttribute( 'last_update', 0 );
                        $persBlockObject->store();
                    }
                }

                $contentObjectAttribute->setContent( $page );
                $contentObjectAttribute->store();
                break;
            case 'new_source_browse':
                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );
                $block = $zone->getBlock( $params[2] );

                $blockINI = eZINI::instance( 'block.ini' );

                $fetchParametersSelectionType = $blockINI->variable( $block->attribute( 'type' ), 'FetchParametersSelectionType' );

                $module = $parameters['module'];
                $redirectionURI = $redirectionURI = $parameters['current-redirection-uri'];

                $browseParameters = array( 'action_name' => 'AddNewBlockSource',
                                           'selection' => $fetchParametersSelectionType['Source'],
                                           'browse_custom_action' => array( 'name' => 'CustomActionButton[' . $contentObjectAttribute->attribute( 'id' ) . '_new_source-' . $params[1] . '-' . $params[2] . ']',
                                                                            'value' => $contentObjectAttribute->attribute( 'id' ) ),
                                           'from_page' => $redirectionURI,
                                           'cancel_page' => $redirectionURI,
                                           'persistent_data' => array( 'HasObjectInput' => 0 ) );

                if( $blockINI->hasVariable( $block->attribute( 'type' ), 'DynamicBlockStartBrowseNode' ) )
                {
                    $browseParameters['start_node'] = $blockINI->variable( $block->attribute( 'type' ), 'DynamicBlockStartBrowseNode' );
                }

                eZContentBrowse::browse( $browseParameters, $module );
                break;
            case 'remove_source':
                $page = $contentObjectAttribute->content();

                $zone = $page->getZone( $params[1] );
                $block = $zone->getBlock( $params[2] );

                $fetchParams = unserialize( $block->attribute( 'fetch_params' ) );

                unset( $fetchParams['Source'] );

                $block->setAttribute( 'fetch_params', serialize( $fetchParams ) );
                $contentObjectAttribute->setContent( $page );
                $contentObjectAttribute->store();
                break;
            case 'custom_attribute':
                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );
                $block = $zone->getBlock( $params[2] );

                if ( !$http->hasPostVariable( 'BrowseCancelButton' ) )
                {
                    $customAttributes = $block->attribute( 'custom_attributes' );

                    if ( $http->hasPostVariable( 'SelectedNodeIDArray' ) )
                    {
                        $selectedNodeIDArray = $http->postVariable( 'SelectedNodeIDArray' );
                        $customAttributes[$params[3]] = $selectedNodeIDArray[0];
                    }

                    $block->setAttribute( 'custom_attributes', $customAttributes );
                    $contentObjectAttribute->setContent( $page );
                    $contentObjectAttribute->store();
                }
                break;
            case 'custom_attribute_browse':
                $module = $parameters['module'];
                $redirectionURI = $redirectionURI = $parameters['current-redirection-uri'];
                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );
                $block = $zone->getBlock( $params[2] );
                $blockINI = eZINI::instance( 'block.ini' );

                $browseParameters = array( 'action_name' => 'CustomAttributeBrowse',
                                           'browse_custom_action' => array( 'name' => 'CustomActionButton[' . $contentObjectAttribute->attribute( 'id' ) . '_custom_attribute-' . $params[1] . '-' . $params[2] . '-' . $params[3] . ']',
                                                                            'value' => $contentObjectAttribute->attribute( 'id' ) ),
                                           'from_page' => $redirectionURI,
                                           'cancel_page' => $redirectionURI,
                                           'persistent_data' => array( 'HasObjectInput' => 0 ) );

                if( $blockINI->hasVariable( $block->attribute( 'type' ), 'CustomAttributeStartBrowseNode' ) )
                {
                    $customAttributeStartBrowseNode = $blockINI->variable( $block->attribute( 'type' ), 'CustomAttributeStartBrowseNode' );
                    $customAttributeIdentifier = $params[3];
                    if( isset( $customAttributeStartBrowseNode[$customAttributeIdentifier] ) )
                    {
                        $browseParameters['start_node'] = $customAttributeStartBrowseNode[$customAttributeIdentifier];
                    }
                }

                eZContentBrowse::browse( $browseParameters, $module );
                break;
            case 'custom_attribute_remove_source':
                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );
                $block = $zone->getBlock( $params[2] );

                $customAttributes = $block->attribute( 'custom_attributes' );

                unset( $customAttributes[$params[3]] );

                $block->setAttribute( 'custom_attributes', $customAttributes );
                $contentObjectAttribute->setContent( $page );
                $contentObjectAttribute->store();
                break;
            case 'remove_item':
                $page = $contentObjectAttribute->content();
                $zone = $page->getZone( $params[1] );
                $block = $zone->getBlock( $params[2] );

                $deleteItemIDArray = $http->postVariable( 'DeleteItemIDArray' );

                if ( $block->getItemCount() > 0 )
                {
                    foreach ( $block->attribute( 'items' ) as $itemID => $item )
                    {
                        foreach ( $deleteItemIDArray as $index => $deleteItemID )
                        {
                            if ( $item->attribute( 'object_id' ) == $deleteItemID )
                            {
                                if ( $item->toBeAdded() )
                                {
                                    $block->removeItem( $itemID );
                                    unset( $deleteItemIDArray[$index] );
                                }
                                elseif( $item->toBeModified() )
                                {
                                    $block->removeItem( $itemID );
                                }
                             }
                         }
                     }
                 }

                 foreach ( $deleteItemIDArray as $deleteItemID )
                 {
                     $item = $block->addItem( new eZPageBlockItem() );
                     $item->setAttribute( 'object_id', $deleteItemID );
                     $item->setAttribute( 'action', 'remove' );
                 }

                 break;
            default:
            break;
        }
    }
836921
def to_format
      if !get? && has_errors? && !response_overridden?
        display_errors
      elsif has_view_rendering? || response_overridden?
        default_render
      else
        api_behavior
      end
    rescue ActionView::MissingTemplate
      api_behavior
    end
156557
function actionCreator(modelName, actionName) {
  return data => (
    dispatch({
      type: getFullTypeName(modelName, actionName),
      data
    })
  )
}