ILIAS  release_4-4 Revision
ilChatroomTabFactory Class Reference

Class ilChatroomTabFactory. More...

+ Collaboration diagram for ilChatroomTabFactory:

Static Public Member Functions

static convertLowerCamelCaseToUnderscoreCaseConversion ($value)
 Convert a value given in lower camel case conversion to underscore case conversion (e.g. More...
 
static convertUnderscoreCaseToLowerCamelCaseConversion ($value, $upper_case_first=FALSE)
 Convert a value given in underscore case conversion to lower camel case conversion (e.g. More...
 

Private Member Functions

 getLabel ($tabDefinition, $id)
 Returns label for tab by $tabDefinition or $id. More...
 

Private Attributes

 $gui
 
 $lng
 

Detailed Description

Member Function Documentation

◆ convertLowerCamelCaseToUnderscoreCaseConversion()

static ilChatroomTabFactory::convertLowerCamelCaseToUnderscoreCaseConversion (   $value)
static

Convert a value given in lower camel case conversion to underscore case conversion (e.g.

MyClass to my_class)

Parameters
string$valueValue in lower camel case conversion
Returns
string The value in underscore case conversion

Definition at line 368 of file class.ilChatroomTabFactory.php.

369  {
370  return strtolower(preg_replace('/(.*?)-(.*?)/', '$1_$2', $value));
371  }

◆ convertUnderscoreCaseToLowerCamelCaseConversion()

static ilChatroomTabFactory::convertUnderscoreCaseToLowerCamelCaseConversion (   $value,
  $upper_case_first = FALSE 
)
static

Convert a value given in underscore case conversion to lower camel case conversion (e.g.

my_class to MyClass)

Parameters
string$valueValue in underscore case conversion
boolean$upper_case_firstIf TRUE first character in upper case, lower case if FALSE
Returns
string The value in lower camel case conversion

Definition at line 379 of file class.ilChatroomTabFactory.php.

380  {
381  $tokens = (array)explode('_', $value);
382  $value = '';
383 
384  foreach($tokens as $token)
385  {
386  $value .= ucfirst($token);
387  }
388 
389  if($upper_case_first === FALSE)
390  {
391  $value = strtolower($value, 0, 1) . substr($value, 1);
392  }
393 
394  return $value;
395  }

◆ getLabel()

ilChatroomTabFactory::getLabel (   $tabDefinition,
  $id 
)
private

Returns label for tab by $tabDefinition or $id.

Parameters
array$tabDefinition
string$id
Returns
string
Todo:
: $tabDefinition sollte doch stets ein array und $id stets ein string sein, oder? Dann sollte man auch hier typehinten. (array $tabDefinition, string $id)

Definition at line 355 of file class.ilChatroomTabFactory.php.

356  {
357  if(isset($tabDefinition['lng']))
358  return $this->lng->txt($tabDefinition['lng']);
359  else
360  return $this->lng->txt($id);
361  }

Field Documentation

◆ $gui

ilChatroomTabFactory::$gui
private

Definition at line 16 of file class.ilChatroomTabFactory.php.

◆ $lng

ilChatroomTabFactory::$lng
private

Definition at line 21 of file class.ilChatroomTabFactory.php.


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