code/CMSBatchActionHandler.php
public function handleApplicablePages($request)
    {
        // Find the action handler
        $action = $request->param('BatchAction');
        $actionHandler = $this->actionByName($action);

        // Sanitise ID list and query the database for apges
        $csvIDs = $request->requestVar('csvIDs');
        $ids = $this->cleanIDs($csvIDs);

        // Filter by applicable pages
        if ($ids) {
            $applicableIDs = $actionHandler->applicablePages($ids);
        } else {
            $applicableIDs = array();
        }

        $response = new HTTPResponse(json_encode($applicableIDs));
        $response->addHeader("Content-type", "application/json");
        return $response;
    }
public function handleApplicablePages($request)
    {
        // Find the action handler
        $action = $request->param('BatchAction');
        $actionHandler = $this->actionByName($action);

        // Sanitise ID list and query the database for apges
        $csvIDs = $request->requestVar('csvIDs');
        $ids = $this->cleanIDs($csvIDs);

        // Filter by applicable pages
        if ($ids) {
            $applicableIDs = $actionHandler->applicablePages($ids);
        } else {
            $applicableIDs = array();
        }

        $response = new HTTPResponse(json_encode($applicableIDs));
        $response->addHeader("Content-type", "application/json");
        return $response;
    }
public function handleApplicablePages ( $ request ) { // Find the action handler $ action = $ request -> param ( 'BatchAction' ) ; $ actionHandler = $ this -> actionByName ( $ action ) ; // Sanitise ID list and query the database for apges $ csvIDs = $ request -> requestVar ( 'csvIDs' ) ; $ ids = $ this -> cleanIDs ( $ csvIDs ) ; // Filter by applicable pages if ( $ ids ) { $ applicableIDs = $ actionHandler -> applicablePages ( $ ids ) ; } else { $ applicableIDs = array ( ) ; } $ response = new HTTPResponse ( json_encode ( $ applicableIDs ) ) ; $ response -> addHeader ( "Content-type" , "application/json" ) ; return $ response ; }
Respond with the list of applicable pages for a given filter

@param HTTPRequest $request
@return HTTPResponse
Respond with the list of applicable pages for a given filter