protected function lockPage()
	{
		$this->isPostRequest();

		$currentUser = $this->getCurrentUser();

		if (! $currentUser) {
			return null;
		}

		$localization = $this->getPageLocalization();

		$force = $this->getRequestInput()
				->filter('force', false, false, FILTER_VALIDATE_BOOLEAN);

		try {
			if ($this->checkLock(false) === null) {
				$this->createLock();
			}
		} catch (ObjectLockedException $e) {
			if (! $force) {
				return new SupraJsonResponse($this->getLocalizationEditLockData($localization));
			}
		}

		return new SupraJsonResponse();
	}
protected function lockPage()
	{
		$this->isPostRequest();

		$currentUser = $this->getCurrentUser();

		if (! $currentUser) {
			return null;
		}

		$localization = $this->getPageLocalization();

		$force = $this->getRequestInput()
				->filter('force', false, false, FILTER_VALIDATE_BOOLEAN);

		try {
			if ($this->checkLock(false) === null) {
				$this->createLock();
			}
		} catch (ObjectLockedException $e) {
			if (! $force) {
				return new SupraJsonResponse($this->getLocalizationEditLockData($localization));
			}
		}

		return new SupraJsonResponse();
	}
protected function lockPage ( ) { $ this -> isPostRequest ( ) ; $ currentUser = $ this -> getCurrentUser ( ) ; if ( ! $ currentUser ) { return null ; } $ localization = $ this -> getPageLocalization ( ) ; $ force = $ this -> getRequestInput ( ) -> filter ( 'force' , false , false , FILTER_VALIDATE_BOOLEAN ) ; try { if ( $ this -> checkLock ( false ) === null ) { $ this -> createLock ( ) ; } } catch ( ObjectLockedException $ e ) { if ( ! $ force ) { return new SupraJsonResponse ( $ this -> getLocalizationEditLockData ( $ localization ) ) ; } } return new SupraJsonResponse ( ) ; }
Sets page lock, if no lock is found, or if force is used;
will output current lock data if page locked by another user and
force action is not allowed or not provided
Sets page lock if no lock is found or if force is used ; will output current lock data if page locked by another user and force action is not allowed or not provided