( p( @ O ( K K ( @ Y ( K @ ( ( L L ( P( X( @ O В( @ b `( N @ b @( N @ b x( N N ( ( ( @ `n( @ f ( N N ( ( N (( ( N ( @( ( e( @ ( $( O @ ( P( O @ ( (( O O ( ( O ( ( K (( 8( h( @ ( `#( S S ( @ i ة( S @ ( m( T T ( `( h( ( j @ ( #( V @ j ( V @ j #( V V ( ( ( h( l @ ( ( V V ( ( V 8( ( V P( ( @( @ l `"( W @ l ( W @ l "( W W ( ( W ( ( @ ( ( X @ ( @#( X X (( ( S 8( H( x( @ ( "( \ \ x( @ m @m( \ \ ( @ ( o \ ( ( o ( ( \ ( ( ( @ ( @"( ^ ^ 8( @ q ( ^ @ q m( _ _ x( ( m( r @ ( "( a @ r 訠( a @ q !( a a ( ( 8( ( ( @ ( ( a a ( ( a P( ( a ( h( ( X( @ ( !( b @ ( ( b @ !( b b ( ( b ( ( @ x ( c @ x ( c c @( (( ^ P( `( ( @ x @ ( g g ( @ z m( g g z ( i ( g ( ( ( ( ( g ( ( ( J ( ( X( ( p( 0( ( (( X( @ X ` ( i i ( @ ( ( i i ( ( i ( ( ( E J j 8P( ߦ( P( ߦ( F k ( æ( ڦ( @ ( @ N @ ( @ V @ ( @ a ( p( @ ( @( @ ( ( @ ( ( 0( H( P( ( @ ( @ @( @ ( @( @ ( ( @ ( @( ( ( 8( [ ( @ ( h( ( ( P( ( ( h( ( ( @ ( @ ( ( ( ( ( ( ( ( ( ( `( @ ( ( @ ( @ Ȋ( @ ( ( ( ( ( @ ( ( @ ( p( ( ( X( ( ( x( ( @ ( `/( @ ( ( `( H( ( @( @ @( @ ( @ 8( @ ( ( ( 8( @ ^ ( @ ( ( ( P( ( _ h( ( ( @ ( @ ( ( ( ( ( @ T( @ @(( @ ( @ ( *( ( X( ( צ( @ ( ( @( p( ( (( ( $this->setError(Text::_('JLIB_APPLICATION_ERROR_NOT_EXIST')); } else { $this->setError($table->getError()); } return false; } // If there is no checked_out or checked_out_time field, just return true. if (!$table->hasField('checked_out') || !$table->hasField('checked_out_time')) { return true; } $user = $this->getCurrentUser(); // When the user is a guest, don't do a checkout if (!$user->id) { return false; } $checkedOutField = $table->getColumnAlias('checked_out'); // Check if this is the user having previously checked out the row. if ($table->$checkedOutField > 0 && $table->$checkedOutField != $user->id) { $this->setError(Text::_('JLIB_APPLICATION_ERROR_CHECKOUT_USER_MISMATCH')); return false; } // Attempt to check the row out. if (!$table->checkOut($user->id, $pk)) { $this->setError($table->getError()); return false; } } return true; } /** * Method to validate the form data. * * @param Form $form The form to validate against. * @param array $data The data to validate. * @param string $group The name of the field group to validate. * * @return array|boolean Array of filtered data if valid, false otherwise. * * @see FormRule * @see InputFilter * @since 1.6 */ public function validate($form, $data, $group = null) { $dispatcher = $this->getDispatcher(); // Include the plugins for the delete events. PluginHelper::importPlugin($this->events_map['validate'], null, true, $dispatcher); if (!empty($dispatcher->getListeners('onUserBeforeDataValidation'))) { @trigger_error( 'The `onUserBeforeDataValidation` event is deprecated and will be removed in 6.0.' . 'Use the `onContentValidateData` event instead.', E_USER_DEPRECATED ); $data = $dispatcher->dispatch('onUserBeforeDataValidation', new Model\BeforeValidateDataEvent('onUserBeforeDataValidation', [ 'subject' => $form, 'data' => &$data, // @todo: Remove reference in Joomla 6, see BeforeValidateDataEvent::__constructor() ]))->getArgument('data', $data); } $data = $dispatcher->dispatch('onContentBeforeValidateData', new Model\BeforeValidateDataEvent('onContentBeforeValidateData', [ 'subject' => $form, 'data' => &$data, // @todo: Remove reference in Joomla 6, see AfterRenderModulesEvent::__constructor() ]))->getArgument('data', $data); // Filter and validate the form data. $return = $form->process($data, $group); // Check for an error. if ($return instanceof \Exception) { $this->setError($return->getMessage()); return false; } // Check the validation results. if ($return === false) { // Get the validation messages from the form. foreach ($form->getErrors() as $message) { $this->setError($message); } return false; } $data = $return; // Tags B/C break at 3.1.2 if (!isset($data['tags']) && isset($data['metadata']['tags'])) { $data['tags'] = $data['metadata']['tags']; } return $data; } }