Processes the HTML get/post paramters passed through on the maintain screen
482173
public function handleUserEntry()
    {
        $sessionClass = ReporticoSession();

        // First look for a parameter beginning "submit_". This will identify
        // What the user wanted to do.

        $hide_area = false;
        $show_area = false;
        $maintain_sql = false;
        $xmlsavefile = false;
        $xmldeletefile = false;
        if (($k = $this->getMatchingPostItem("/^submit_/"))) {
            // Strip off "_submit"
            preg_match("/^submit_(.*)/", $k, $match);

            // Now we should be left with a field element and an action
            // Lets strip the two
            $match1 = preg_split('/_/', $match[0]);
            $fld = $match1[1];
            $action = $match1[2];

            switch ($action) {
                case "ADD":
                    // We have chosen to set a block of data so pass through Request set and see which
                    // fields belong to this set and take appropriate action
                    $this->addMaintainFields($fld);
                    $show_area = $fld;
                    break;

                case "DELETE":
                    // We have chosen to set a block of data so pass through Request set and see which
                    // fields belong to this set and take appropriate action
                    $this->deleteMaintainFields($fld);
                    $show_area = $fld;
                    break;

                case "MOVEUP":
                    // We have chosen to set a block of data so pass through Request set and see which
                    // fields belong to this set and take appropriate action
                    $this->moveupMaintainFields($fld);
                    $show_area = $fld;
                    break;

                case "MOVEDOWN":
                    // We have chosen to set a block of data so pass through Request set and see which
                    // fields belong to this set and take appropriate action
                    $this->movedownMaintainFields($fld);
                    $show_area = $fld;
                    break;

                case "SET":
                    // We have chosen to set a block of data so pass through Request set and see which
                    // fields belong to this set and take appropriate action
                    $this->updateMaintainFields($fld);
                    $show_area = $fld;
                    break;

                case "REPORTLINK":
                case "REPORTLINKITEM":
                    // Link in an item from another report
                    $this->linkInReportFields("link", $fld, $action);
                    $show_area = $fld;
                    break;

                case "REPORTIMPORT":
                case "REPORTIMPORTITEM":
                    // Link in an item from another report
                    $this->linkInReportFields("import", $fld, $action);
                    $show_area = $fld;
                    break;

                case "SAVE":
                    $xmlsavefile = $this->query->xmloutfile;
                    if (!$xmlsavefile) {
                        trigger_error(ReporticoLang::templateXlate("UNABLE_TO_SAVE") . ReporticoLang::templateXlate("SPECIFYXML"), E_USER_ERROR);
                    }

                    break;

                case "PREPARESAVE":
                    $xmlsavefile = $this->query->xmloutfile;
                    $sessionClass::setReporticoSessionParam("execute_mode", "PREPARE");

                    if (!$xmlsavefile) {
                        header("HTTP/1.0 404 Not Found", true);
                        echo '<div class="reportico-error-box">' . ReporticoLang::templateXlate("UNABLE_TO_SAVE") . ReporticoLang::templateXlate("SPECIFYXML") . "</div>";
                        die;
                    }

                    break;

                case "DELETEREPORT":
                    $xmldeletefile = $this->query->xmloutfile;
                    break;

                case "HIDE":
                    $hide_area = $fld;
                    break;

                case "SHOW":
                    $show_area = $fld;
                    break;

                case "SQL":
                    $show_area = $fld;
                    if ($fld == "mainquerqury") {
                        // Main Query SQL Generation.
                        $sql = stripslashes($_REQUEST["mainquerqury_SQL"]);

                        $maintain_sql = $sql;
                        if ($this->query->loginCheck()) {
                            $p = new SqlParser($sql);
                            if ($p->parse()) {
                                $p->importIntoQuery($qr);
                                if ($this->query->datasource->connect()) {
                                    $p->testQuery($this->query, $sql);
                                }

                            }
                        }
                    } else {
                        // It's a lookup
                        if (preg_match("/mainquercrit(.*)qury/", $fld, $match1)) {
                            $lookup = (int) $match1[1];
                            $lookup_char = $match1[1];

                            // Access the relevant crtieria item ..
                            $qc = false;
                            $ak = array_keys($this->query->lookup_queries);
                            if (array_key_exists($lookup, $ak)) {
                                $q = $this->query->lookup_queries[$ak[$lookup]]->lookup_query;
                            } else {
                                $q = new Reportico();
                            }

                            // Parse the entered SQL
                            $sqlparm = $fld . "_SQL";
                            $sql = $_REQUEST[$sqlparm];
                            $q->maintain_sql = $sql;
                            $q = new Reportico();
                            $p = new SqlParser($sql);
                            if ($p->parse()) {
                                if ($p->testQuery($this->query, $sql)) {
                                    $p->importIntoQuery($q);
                                    $this->query->setCriteriaLookup($ak[$lookup], $q, "WHAT", "NOW");
                                }
                            }
                        }
                    }

                    break;

            }
        }

        // Now work out what the maintainance screen should be showing by analysing
        // whether user pressed a SHOW button a HIDE button or keeps a maintenance item
        // show by presence of a shown value
        if (!$show_area) {
            // User has not pressed SHOW_ button - this would have been picked up in previous submit
            // So look for longest shown item - this will allow us to draw the maintenace screen with
            // the correct item maximised
            foreach ($_REQUEST as $k => $req) {
                if (preg_match("/^shown_(.*)/", $k, $match)) {
                    $containee = "/^" . $hide_area . "/";
                    $container = $match[1];
                    if (!preg_match($containee, $container)) {
                        if (strlen($match[1]) > strlen($show_area)) {
                            $show_area = $match[1];
                        }
                    }
                }
            }

        }

        if (!$show_area) {
            $show_area = "mainquer";
        }

        $xmlout = new XmlWriter($this->query);
        $xmlout->prepareXmlData();

        // If Save option has been used then write data to the named file and
        // use this file as the defalt input for future queries
        if ($xmlsavefile) {
            if ($this->query->allow_maintain != "SAFE" && $this->query->allow_maintain != "DEMO" && ReporticoApp::getConfig('allow_maintain')) {
                $xmlout->writeFile($xmlsavefile);
                $sessionClass::setReporticoSessionParam("xmlin", $xmlsavefile);
                $sessionClass::unsetReporticoSessionParam("xmlintext");
            } else {
                trigger_error(ReporticoLang::templateXlate("SAFENOSAVE"), E_USER_ERROR);
            }

        }

        // If Delete Report option has been used then remove the file
        // use this file as the defalt input for future queries
        if ($xmldeletefile) {
            if ($this->query->allow_maintain != "SAFE" && $this->query->allow_maintain != "DEMO" && ReporticoApp::getConfig('allow_maintain')) {
                $xmlout->removeFile($xmldeletefile);
                $sessionClass::setReporticoSessionParam("xmlin", false);
                $sessionClass::unsetReporticoSessionParam("xmlintext");
            } else {
                trigger_error(ReporticoLang::templateXlate("SAFENODEL"), E_USER_ERROR);
            }

        }

        $xml = $xmlout->getXmldata();

        if ($this->query->top_level_query) {
            $this->query->xmlintext = $xml;
        }

        $this->query->xmlin = new XmlReader($this->query, false, $xml);
        $this->query->xmlin->show_area = $show_area;
        $this->query->maintain_sql = false;
    }
507682
private function processHtml()
    {
        $this->tree->build_tree();

        $this->css->load_css_file(Stylesheet::getDefaultStylesheet(), Stylesheet::ORIG_UA);

        $acceptedmedia = Stylesheet::$ACCEPTED_GENERIC_MEDIA_TYPES;
        $acceptedmedia[] = $this->options->getDefaultMediaType();

        // <base href="" />
        $base_nodes = $this->dom->getElementsByTagName("base");
        if ($base_nodes->length && ($href = $base_nodes->item(0)->getAttribute("href"))) {
            list($this->protocol, $this->baseHost, $this->basePath) = Helpers::explode_url($href);
        }

        // Set the base path of the Stylesheet to that of the file being processed
        $this->css->set_protocol($this->protocol);
        $this->css->set_host($this->baseHost);
        $this->css->set_base_path($this->basePath);

        // Get all the stylesheets so that they are processed in document order
        $xpath = new DOMXPath($this->dom);
        $stylesheets = $xpath->query("//*[name() = 'link' or name() = 'style']");

        /** @var \DOMElement $tag */
        foreach ($stylesheets as $tag) {
            switch (strtolower($tag->nodeName)) {
                // load <link rel="STYLESHEET" ... /> tags
                case "link":
                    if (mb_strtolower(stripos($tag->getAttribute("rel"), "stylesheet") !== false) || // may be "appendix stylesheet"
                        mb_strtolower($tag->getAttribute("type")) === "text/css"
                    ) {
                        //Check if the css file is for an accepted media type
                        //media not given then always valid
                        $formedialist = preg_split("/[\s\n,]/", $tag->getAttribute("media"), -1, PREG_SPLIT_NO_EMPTY);
                        if (count($formedialist) > 0) {
                            $accept = false;
                            foreach ($formedialist as $type) {
                                if (in_array(mb_strtolower(trim($type)), $acceptedmedia)) {
                                    $accept = true;
                                    break;
                                }
                            }

                            if (!$accept) {
                                //found at least one mediatype, but none of the accepted ones
                                //Skip this css file.
                                break;
                            }
                        }

                        $url = $tag->getAttribute("href");
                        $url = Helpers::build_url($this->protocol, $this->baseHost, $this->basePath, $url);

                        $this->css->load_css_file($url, Stylesheet::ORIG_AUTHOR);
                    }
                    break;

                // load <style> tags
                case "style":
                    // Accept all <style> tags by default (note this is contrary to W3C
                    // HTML 4.0 spec:
                    // http://www.w3.org/TR/REC-html40/present/styles.html#adef-media
                    // which states that the default media type is 'screen'
                    if ($tag->hasAttributes() &&
                        ($media = $tag->getAttribute("media")) &&
                        !in_array($media, $acceptedmedia)
                    ) {
                        break;
                    }

                    $css = "";
                    if ($tag->hasChildNodes()) {
                        $child = $tag->firstChild;
                        while ($child) {
                            $css .= $child->nodeValue; // Handle <style><!-- blah --></style>
                            $child = $child->nextSibling;
                        }
                    } else {
                        $css = $tag->nodeValue;
                    }

                    $this->css->load_css($css, Stylesheet::ORIG_AUTHOR);
                    break;
            }
        }
    }
758454
protected function processVariables()
    {
        $this->request->variables = $this->fillVariables();
        $this->request->contentVariables = $this->fillContentVariables();
        $this->request->get = $_GET;
        $this->request->post = $_POST;
    }
858421
function process( $tpl, &$textElements, $functionName, $functionChildren, $functionParameters, $functionPlacement, $rootNamespace, $currentNamespace )
    {
        $params = $functionParameters;
        switch ( $functionName )
        {
            case $this->BlockName:
            {
                $name ="";
                $menuIni = eZINI::instance( "menu.ini" );

                if ( isset( $functionParameters["name"] ) )
                {
                    $menuName = $tpl->elementValue( $functionParameters["name"], $rootNamespace, $currentNamespace, $functionPlacement );
                    if ( $menuIni->hasVariable( 'SelectedMenu', $menuName ) )
                    {
                        $menuTemplate = $menuIni->variable( 'SelectedMenu', $menuName );
                        if ( $menuTemplate != null )
                        {
                            $uri = "design:menu/$menuTemplate.tpl";
                            $tpl->processURI( $uri, true, $extraParameters, $textElements, $name, $name );
                        }
                    }
                }
            }
        }
    }
1210750
function process_post(request, response, uri, body) {
	if (!authorised(request))
		return fail(401, "unauthorized", response);

	// be safe
	if (body === undefined)
		body = null;
		
	let path = URL.parse(request.url).pathname;

	// does path start with /things/thingID for some thingID?

	if (/^\/things\/.+/.test(path)) {
		path = path.substr(8);
		
		let i = path.indexOf('/');
		var thingID;
		
		if (i < 0) {
			thingID = path;
			path = "";
		} else {
			thingID = path.substr(0, i);
			path = path.substr(i);
		}
		
		if (thingID) {
			let thing = things[thingID];
			
			if (!thing)
				return fail(404, "unknown thing: " + thingID, response);
				
			// /things/thingID/properties to update all properties
			// /things/thingID/properties/propName to update given property
			
			if (path === "/properties") {
				// update properties from request body
				
				try {
					let values = JSON.parse(body);
					if (typeof values != 'object')
						return fail(555, "invalid data", response);
					
					// fail if any of the values are invalid or readonly
					for (var name in values) {
						if (values.hasOwnProperty(name)) {
							let value = values[name];
							let property = thing.properties[name];
							
							if (property === undefined)
								return fail(404, "unknown property name: " + name, response);

							if (property.meta) {
								if (property.meta.writable !== undefined  && !property.meta.writable)
									return fail(405, "read-only", response);
							
								if (invalid(value, property.meta, thing))
									return fail(400, "invalid data", response);
							}							
						}
					}
					
					// all values are good so update and notify
					for (var name in values) {
						if (values.hasOwnProperty(name)) {
							let value = values[name];
							let property = thing.properties[name];
							
							if (property != undefined) {
								property.value = value;
								
								// notify exposing app of external change
								if (property.handler)
									property.handler(value);
							}
						}
					}
					
					thing.emitState(values); // notify all clients
					// *** need to validate against model's data type ***
					// *** need to notify clients ***
					return succeed(204, "no data", response);
				} catch (err) {
					return fail(404, "invalid: " + body, response);
				}
			} else if (/^\/properties\/.+/.test(path)) {
				path = path.substr(12);
				console.log("property name: " + path);
				let property = thing.properties[path];
				
				if (property === undefined)
					return fail(404, "unknown property: " + path, response);
					
				console.log('parsing request body');
					
				// update named property from request body
				try {
					let value = JSON.parse(body);
					
					if (property.meta) {
						if (property.meta.writable !== undefined  && !property.meta.writable)
							return fail(405, "read-only", response);

						if (invalid(value, property.meta, thing)) {
							console.log('failed to set ' + path + ' to ' + value);
							return fail(400, "invalid data", response);
						}
					}

					property.value = value;
					
					// notify exposing app of external change
					if (property.handler)
						property.handler(value);
									
					console.log('setting ' + property.name + ' to ' + value);
					console.log('calling emitValue with path = ' + path + ' and value = ' + value);
					thing.emitValue(path, value);
					// *** need to validate against model's data type ***
					// *** need to notify clients ***
					console.log('succeeded in setting ' + property.name + ' to ' + property.value);
					return succeed(204, "no data", response);
				} catch (err) {
					console.log('failed to parse request body');
					return fail(404, "invalid: " + body, response);
				}
			}
			
			// /things/thingID/actions/actName to invoke given action (POST only)
			
			if (/^\/actions\/.+/.test(path)) {
				path = path.substr(9);
				//console.log("action name: " + path);
				
				let action = thing.actions[path];
				
				if (action === undefined)
					return fail(404, "unknown action: " + path, response);
					
				// *** need to validate input data against model's data type
				let input = null;
				
				//console.log(" input body is: " + JSON.stringify(body));
				
				if (body !== undefined) {
					try {
						input = JSON.parse(body);
					} catch (err) {
						return fail(404, "invalid: " + body, response);
					}
				}
				
				if (action.meta && action.meta.input && invalid(input, action.meta.input, thing))
					return fail(400, "invalid input", response);
					
				if (action.handler === undefined) {
					// succeed immediately as nothing to be done
					console.log('action ' + action.name + ' has no handler');
					return succeed(204, "no data", response);
				} else {
					//console.log('ready to invoke handler for action ' + action.name);
					// invoke handler and use promise to deliver response
					// after testing response against model's data type
					action.handler(input).then(output => {
						if (action.meta && action.meta.output && invalid(output, action.meta.output, thing)) {
							console.log(output + ' is invalid');
							return fail(400, "invalid output", response);
						}
						let body = JSON.stringify(output, null, 4);
						
						console.log('output body is ' + body);
						
						if (body === undefined) {
							console.log('body is undefined');
							response.writeHead(204, {
								'Content-Type': mime_types.json,
								'Pragma': 'no-cache',
								'Cache-Control': 'no-cache',
								'Access-Control-Allow-Origin': '*'
							});
						} else {
							response.writeHead(200, {
								'Content-Type': mime_types.json,
								'Pragma': 'no-cache',
								'Cache-Control': 'no-cache',
								'Access-Control-Allow-Origin': '*',
								'Content-Length': body.length
							});
							response.write(body);
						}
						
						response.end();
						return;
					}).catch(err => {
						console.log('handler failed: ' + err);
						return fail(500, "action failed: " + err, response);
					});
					
					return;  // deferred response
				}
			}
		}
		
		return fail(404, "missing thingID: " + uri.path, response);
	}
}
938018
public void setFormParams(TreeSet<HtmlParameter> postParams) {
		if (postParams.isEmpty()) {
			this.setBody("");
			return;
		}
		
		StringBuilder postData = new StringBuilder();
		
		for(HtmlParameter parameter: postParams) {
			if (parameter.getType() != HtmlParameter.Type.form) {
				continue;
			}
			
			postData.append(parameter.getName());
			postData.append('=');
			postData.append(parameter.getValue());
			postData.append('&');
		}
		
		String data = "";
		if (postData.length() != 0) {
			data = postData.substring(0, postData.length() - 1);
		}
		
		this.setBody(data);
	}
806683
function postToSource()
			{
				// clear unnecessary tags when editor view empty
				var sourceStrings = editor.text()=="" && editor.html().length<12 ? "" : editor.html();
				
				thisElement.val(extractToText(sourceStrings));
			}
1177440
def preview_processed_html(self, group_id, html=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - group_id
        """ID"""
        path["group_id"] = group_id

        # OPTIONAL - html
        """The html content to process"""
        if html is not None:
            data["html"] = html

        self.logger.debug("POST /api/v1/groups/{group_id}/preview_html with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/groups/{group_id}/preview_html".format(**path), data=data, params=params, no_data=True)
1025905
public function process()
    {
        if (
            $this->getForm()->getHiddenField($this->id . '_submitted') === null
        ) {
            return;
        }

        parent::process();

        foreach ($this->values as $option_value) {
            $this->getEntryWidget($option_value)->process();
        }
    }
776968
def handle_get(self):
        

        code = 400
        message, explain = \
                 BaseHTTPServer.BaseHTTPRequestHandler.responses[code]

        response = BaseHTTPServer.DEFAULT_ERROR_MESSAGE % { #@UndefinedVariable
             'code' : code,
             'message' : message,
             'explain' : explain
            }
        sys.stdout.write('Status: %d %s\n' % (code, message))
        sys.stdout.write('Content-Type: text/html\n')
        sys.stdout.write('Content-Length: %d\n' % len(response))
        sys.stdout.write('\n')

        sys.stdout.write(response)
434474
def process_request_result(self, prepare_response_func=None):
        

        now = datetime.utcnow()
        # TODO: move into separate method
        if self.config['debug_post']:
            post = self.config['post'] or self.config['multipart_post']
            if isinstance(post, dict):
                post = list(post.items())
            if post:
                if isinstance(post, six.string_types):
                    post = make_str(post[:self.config['debug_post_limit']],
                                    errors='ignore') + b'...'
                else:
                    items = normalize_http_values(
                        post, charset=self.config['charset'])
                    new_items = []
                    for key, value in items:
                        if len(value) > self.config['debug_post_limit']:
                            value = value[
                                :self.config['debug_post_limit']] + b'...'
                        else:
                            value = value
                        new_items.append((key, value))
                    post = '\n'.join('%-25s: %s' % x for x in new_items)
            if post:
                logger_network.debug('[%02d] POST request:\n%s\n',
                                     self.request_counter, post)

        # It's important to delete old POST data after request is performed.
        # If POST data is not cleared then next request will try to use them
        # again!
        self.reset_temporary_options()

        if prepare_response_func:
            self.doc = prepare_response_func(self.transport, self)
        else:
            self.doc = self.transport.prepare_response(self)

        self.doc.process_grab(self)

        if self.config['reuse_cookies']:
            self.cookies.update(self.doc.cookies)

        self.doc.timestamp = now

        self.config['charset'] = self.doc.charset

        if self.config['log_file']:
            with open(self.config['log_file'], 'wb') as out:
                out.write(self.doc.body)

        if self.config['cookiefile']:
            self.cookies.save_to_file(self.config['cookiefile'])

        if self.config['reuse_referer']:
            self.config['referer'] = self.doc.url

        self.copy_request_data()

        # Should be called after `copy_request_data`
        if self.config['log_dir']:
            self.save_dumps()

        return self.doc
633046
public function process()
	{
		$context = $this->_getContext();
		$view = $this->getView();

		try
		{
			$params = $this->_getClientParams( $view->param() );
			$context->getSession()->set( 'arcavias/catalog/detail/params/last', $params );

			parent::process();
		}
		catch( Client_Html_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'client/html', $e->getMessage() ) );
			$view->detailErrorList = $view->get( 'detailErrorList', array() ) + $error;
		}
		catch( Controller_Frontend_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
			$view->detailErrorList = $view->get( 'detailErrorList', array() ) + $error;
		}
		catch( MShop_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$view->detailErrorList = $view->get( 'detailErrorList', array() ) + $error;
		}
		catch( Exception $e )
		{
			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );

			$error = array( $context->getI18n()->dt( 'client/html', 'A non-recoverable error occured' ) );
			$view->detailErrorList = $view->get( 'detailErrorList', array() ) + $error;
		}
	}
295816
def obtain_the_content(check = nil)
    	post = obtain_record(check)
    	render :inline => prep_content(post).html_safe if !post.blank?
    end
794686
def process_parameters(parameters):
    
    if not parameters:
        return {}
    params = copy.copy(parameters)
    for param_name in parameters:
        value = parameters[param_name]
        server_param_name = re.sub(r'_(\w)', lambda m: m.group(1).upper(), param_name)
        if isinstance(value, dict):
            value = process_parameters(value)
        params[server_param_name] = value
        if server_param_name != param_name:
            del params[param_name]
    return params
644080
def process_request(self, req):
        '''  '''
        # Check status code of request
        req.raise_for_status() # if codes not in 200s; error raise
        # Proper status code, but check if server returned a warning
        try:
            output = req.json()
        except:
            exit(req.text) # server returned html error
        # Try to find an error msg in the server response
        try:
            error = output['data'].get('errormsg')
        except:
            error = output.get('errormsg') # server has 2 variations of errormsg
        finally:
            if error:
                exit(error)
            return output
1002080
public void doProcessOutput(BasicServlet servlet, HttpServletRequest req, HttpServletResponse res, PrintWriter outExt, ScreenModel screen) 
        throws ServletException, IOException
    {
        PrintWriter out = outExt;
        if (screen == null)
        {
        	if (out != null)
        		out.println("Error: default screen not available");
        }
        else
        {
            try
            { // create and execute the query
                // if no parameters, just print the form
                String strDatatype = this.getProperty(DBParams.DATATYPE); // Raw data (such as in image from the DB)
                if (strDatatype == null)
                {
                    if (out == null)
                        out = servlet.getOutputStream(res); // Always
                    ((ScreenModel)screen).printReport(out);
                }
                else
                {       // Raw data output
                    ((ScreenModel)screen).getScreenFieldView().sendData(req, res);
                }
                screen.free();
                screen = null;
            }
            catch (DBException ex) {
                if (out != null)
                {
                    out.println("<hr>*** SQLException caught ***<p>");
                    out.println("Message:  " + ex.getMessage() + "<br>");
                    ex.printStackTrace(out);
                }
                ex.printStackTrace();
            }
            catch (java.lang.Exception ex) {
                ex.printStackTrace();
            } finally {
            	if (outExt == null)
            		if (out != null)
            			out.close();
            }
        }
    }
369210
public function process()
	{
		$refresh = false;
		$view = $this->getView();
		$context = $this->_getContext();
		$session = $context->getSession();
		$str = $session->get( 'arcavias/catalog/session/pinned/list' );

		if( ( $pinned = @unserialize( $str ) ) === false ) {
			$pinned = array();
		}

		switch( $view->param( 'pin-action' ) )
		{
			case 'add':

				foreach( (array) $view->param( 'pin-id', array() ) as $id ) {
					$pinned[$id] = $id;
				}

				/** client/html/catalog/session/pinned/default/maxitems
				 * Maximum number of products displayed in the "pinned" section
				 *
				 * This option limits the number of products that are shown in the
				 * "pinned" section after the users added the product to their list
				 * of pinned products. It must be a positive integer value greater
				 * than 0.
				 *
				 * Note: The higher the value is the more data has to be transfered
				 * to the client each time the user loads a page with the list of
				 * pinned products.
				 *
				 * @param integer Number of products
				 * @since 2014.09
				 * @category User
				 * @category Developer
				 */
				$max = $context->getConfig()->get( 'client/html/catalog/session/pinned/default/maxitems', 50 );

				$pinned = array_slice( $pinned, -$max, $max, true );
				$refresh = true;
				break;

			case 'delete':

				foreach( (array) $view->param( 'pin-id', array() ) as $id ) {
					unset( $pinned[$id] );
				}

				$refresh = true;
				break;
		}


		if( $refresh )
		{
			$session->set( 'arcavias/catalog/session/pinned/list', serialize( $pinned ) );

			foreach( $session->get( 'arcavias/catalog/session/pinned/cache', array() ) as $key => $value ) {
				$session->set( $key, null );
			}
		}

		parent::process();
	}