src/wcmf/lib/presentation/format/impl/HtmlFormat.php
protected static function getValueDefFromInputControlName($name) {
    if (strpos($name, 'value') !== 0) {
      return null;
    }
    $def = [];
    $fieldDelimiter = StringUtil::escapeForRegex(self::$inputFieldNameDelimiter);
    $pieces = preg_split('/'.$fieldDelimiter.'/', $name);
    if (sizeof($pieces) != 4) {
      return null;
    }
    array_shift($pieces);
    $def['language'] = array_shift($pieces);
    $def['name'] = array_shift($pieces);
    $def['oid'] = array_shift($pieces);

    return $def;
  }
protected static function getValueDefFromInputControlName($name) {
    if (strpos($name, 'value') !== 0) {
      return null;
    }
    $def = [];
    $fieldDelimiter = StringUtil::escapeForRegex(self::$inputFieldNameDelimiter);
    $pieces = preg_split('/'.$fieldDelimiter.'/', $name);
    if (sizeof($pieces) != 4) {
      return null;
    }
    array_shift($pieces);
    $def['language'] = array_shift($pieces);
    $def['name'] = array_shift($pieces);
    $def['oid'] = array_shift($pieces);

    return $def;
  }
protected static function getValueDefFromInputControlName ( $ name ) { if ( strpos ( $ name , 'value' ) !== 0 ) { return null ; } $ def = [ ] ; $ fieldDelimiter = StringUtil :: escapeForRegex ( self :: $ inputFieldNameDelimiter ) ; $ pieces = preg_split ( '/' . $ fieldDelimiter . '/' , $ name ) ; if ( sizeof ( $ pieces ) != 4 ) { return null ; } array_shift ( $ pieces ) ; $ def [ 'language' ] = array_shift ( $ pieces ) ; $ def [ 'name' ] = array_shift ( $ pieces ) ; $ def [ 'oid' ] = array_shift ( $ pieces ) ; return $ def ; }
Get the object value definition from a HTML input field name.
@param $name The name of input field in the format value-`language`-`name`-`oid`, where name is the name
of the attribute belonging to the node defined by oid
@return An associative array with keys 'oid', 'language', 'name' or null if the name is not valid
Get the object value definition from a HTML input field name .