예제 #1
0
 /**
  * formats variable array into data attribute string
  *
  * @param  FieldTable   $field
  * @param  UserTable    $user
  * @param  string       $output
  * @param  string       $reason
  * @param  array        $attributeArray
  * @return null|string
  */
 protected function getDataAttributes($field, $user, $output, $reason, $attributeArray = array())
 {
     $pregExp = $this->_getRegexp($field);
     if ($pregExp) {
         $attributeArray[] = cbValidator::getRuleHtmlAttributes('pattern', $pregExp, $this->pregExpErrorText($field));
     }
     return parent::getDataAttributes($field, $user, $output, $reason, $attributeArray);
 }
예제 #2
0
	/**
	 * formats variable array into data attribute string
	 *
	 * @param  FieldTable $field
	 * @param  UserTable  $user
	 * @param  string     $output
	 * @param  string     $reason
	 * @param  array      $attributeArray
	 * @return null|string
	 */
	protected function getDataAttributes( $field, $user, $output, $reason, $attributeArray = array() )
	{
		if ( $field->params->get( 'cbantispam_captcha_ajax_valid', 0 ) ) {
			$attributeArray[]	=	cbValidator::getRuleHtmlAttributes( 'cbfield', array( 'user' => (int) $user->id, 'field' => htmlspecialchars( $field->name ), 'reason' => htmlspecialchars( $reason ) ) );
		}

		return parent::getDataAttributes( $field, $user, $output, $reason, $attributeArray );
	}