Ejemplo n.º 1
0
 /**
  * Method to instantiate the form field object.
  *
  * @param   object  $form  The form to attach to the form field object.
  *
  * @since   11.1
  */
 public function __construct($form = null)
 {
     // If there is a form passed into the constructor set the form and form control properties.
     if ($form instanceof JForm) {
         $this->form = $form;
         $this->formControl = $form->getFormControl();
     }
     // Detect the field type if not set
     if (!isset($this->type)) {
         $parts = JString::splitCamelCase(get_called_class());
         if ($parts[0] == 'J') {
             $this->type = JString::ucfirst($parts[count($parts) - 1], '_');
         } else {
             $this->type = JString::ucfirst($parts[0], '_') . JString::ucfirst($parts[count($parts) - 1], '_');
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Method to instantiate the form field object.
  *
  * @param   object  $form  The form to attach to the form field object.
  *
  * @since   11.1
  */
 public function __construct($form = null)
 {
     parent::__construct($form);
     // Detect the field type if not set
     if (!isset($this->type)) {
         $parts = JString::splitCamelCase(get_class($this));
         if ($parts[0] == 'J') {
             $this->type = JString::ucfirst($parts[count($parts) - 1], '_');
         } else {
             $this->type = JString::ucfirst($parts[0], '_') . JString::ucfirst($parts[count($parts) - 1], '_');
         }
     }
     $this->assets_content = $this->container->getParameter('form.field.assets.context');
 }
Ejemplo n.º 3
0
 /**
  * Method to instantiate the form field object.
  *
  * @param   object  $form  The form to attach to the form field object.
  *
  * @since   11.1
  */
 public function __construct($form = null)
 {
     parent::__construct($form);
     // Detect the field type if not set
     if (!isset($this->type)) {
         $parts = JString::splitCamelCase(get_class($this));
         if ($parts[0] == 'J') {
             $this->type = JString::ucfirst($parts[count($parts) - 1], '_');
         } else {
             $this->type = JString::ucfirst($parts[0], '_') . JString::ucfirst($parts[count($parts) - 1], '_');
         }
     }
 }
Ejemplo n.º 4
0
 /**
  * @return  void
  *
  * @dataProvider  getSplitCamelCaseData
  * @since   11.3
  */
 public function testSplitCamelCase($string, $expected)
 {
     $this->assertThat(JString::splitCamelCase($string), $this->equalTo($expected));
 }