Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
I18N Class Reference
Inheritance diagram for I18N:
MvvI18N

Public Member Functions

 setReadonly ($state=true)
 
 checkMvvPerms (ModuleManagementModel $object, $perm=MvvPerm::PERM_WRITE)
 
 render (array $attributes=[])
 
 __toString ()
 

Static Public Member Functions

static input ($name, $value, array $attributes=[])
 
static textarea ($name, $value, array $attributes=[])
 
static isEnabled ()
 

Protected Member Functions

 __construct ($template, $name, $value, array $attributes)
 

Protected Attributes

 $template
 
 $name
 
 $value
 
 $attributes
 

Detailed Description

Translation class

Automatic generation of inputs and textareas for i18n

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Peter Thienel pthie.nosp@m.nel@.nosp@m.data-.nosp@m.ques.nosp@m.t.de
Elmar Ludwig elmar.nosp@m..lud.nosp@m.wig@u.nosp@m.os.d.nosp@m.e
Florian Bieringer GPL2 or any later version

Constructor & Destructor Documentation

__construct (   $template,
  $name,
  $value,
array  $attributes 
)
finalprotected

Protected constructor in order to always force a specific input type.

Parameters
string | Flexi_Template$templateTemplate to use
string$nameName of the element
string | I18NString$valueValue of the element
array_merge$attributesAdditional variables for the element

Member Function Documentation

__toString ( )

Converts the object to a string by rendering it.

Returns
string
See Also
I18N::render()
checkMvvPerms ( ModuleManagementModel  $object,
  $perm = MvvPerm::PERM_WRITE 
)

MVV: Check user's permissions for an object and set the readonly state accordingly.

Parameters
ModuleManagementModel$objectObject to check permissions for
string$permPermission to check (default create)
Returns
I18N object to allow chaining
static input (   $name,
  $value,
array  $attributes = [] 
)
static

Creates a set of HTML input elements for this form element in text form. One element will be generated for each configured content language.

Parameters
string$nameHTML name of the Inputfild
I18NString$value(Needs to be an i18n input string)
array$attributesAdditional attributes of the input
Returns
string Crafted input
static isEnabled ( )
static

Returns whether the i18n functionality is enabeld i.e. more than the default language is configured in config_defaults.inc.php.

Returns
bool True if i18n is enabled.
render ( array  $attributes = [])

Renders the element as html.

Parameters
array$attributesAdditional attributes
Returns
string
setReadonly (   $state = true)

Sets the readonly state of the element.

Parameters
bool$stateState of the readonly attribute (default true)
Returns
I18N object to allow chaining
static textarea (   $name,
  $value,
array  $attributes = [] 
)
static

Create a set of HTML textarea elements for this form element in text form. One element will be generated for each configured content language.

Parameters
string$nameHTML name of the Textarea
I18NString$value(Needs to be an i18n input string)
array$attributesAdditional attributes of the input
Returns
string Crafted textarea

Field Documentation

$attributes
protected
$name
protected
$template
protected
$value
protected

The documentation for this class was generated from the following file: