Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
Merge pull request #238 from dongilbert/bugfix-JForm
Browse files Browse the repository at this point in the history
Clean up Form Package
  • Loading branch information
Michael Babker committed Oct 22, 2013
2 parents 355a001 + b9f7aa3 commit 8562f00
Show file tree
Hide file tree
Showing 14 changed files with 260 additions and 819 deletions.
73 changes: 0 additions & 73 deletions src/Joomla/Form/Field/Combo.php

This file was deleted.

1 change: 0 additions & 1 deletion src/Joomla/Form/Field/Language.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace Joomla\Form;

use Joomla\Html\Html;
use Joomla\Language\LanguageHelper;

/**
Expand Down
17 changes: 0 additions & 17 deletions src/Joomla/Form/Field/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

namespace Joomla\Form;

use Joomla\Html\Html;

/**
* Form Field class for the Joomla Framework.
* Text field for passwords
Expand Down Expand Up @@ -44,24 +42,9 @@ protected function getInput()
$auto = ((string) $this->element['autocomplete'] == 'off') ? ' autocomplete="off"' : '';
$readonly = ((string) $this->element['readonly'] == 'true') ? ' readonly="readonly"' : '';
$disabled = ((string) $this->element['disabled'] == 'true') ? ' disabled="disabled"' : '';
$meter = ((string) $this->element['strengthmeter'] == 'true');
$threshold = $this->element['threshold'] ? (int) $this->element['threshold'] : 66;

$script = '';

if ($meter)
{
Html::_('script', 'system/passwordstrength.js', true, true);
$script = '<script type="text/javascript">new Form.PasswordStrength("' . $this->id . '",
{
threshold: ' . $threshold . ',
onUpdate: function(element, strength, threshold) {
element.set("data-passwordstrength", strength);
}
}
);</script>';
}

return '<input type="password" name="' . $this->name . '" id="' . $this->id . '"' .
' value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '"' .
$auto . $class . $readonly . $disabled . $size . $maxLength . '/>' . $script;
Expand Down
76 changes: 0 additions & 76 deletions src/Joomla/Form/Field/Sql.php

This file was deleted.

14 changes: 2 additions & 12 deletions src/Joomla/Form/Field/Timezone.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

namespace Joomla\Form;

use Joomla\Factory;
use Joomla\Html\Html;
use Joomla\Form\Html\Select;

/**
* Form Field class for the Joomla Framework.
Expand Down Expand Up @@ -46,15 +45,6 @@ protected function getGroups()
{
$groups = array();

$keyField = $this->element['key_field'] ? (string) $this->element['key_field'] : 'id';
$keyValue = $this->form->getValue($keyField);

// If the timezone is not set use the server setting.
if (strlen($this->value) == 0 && empty($keyValue))
{
$this->value = Factory::getConfig()->get('offset');
}

// Get the list of time zones from the server.
$zones = \DateTimeZone::listIdentifiers();

Expand Down Expand Up @@ -82,7 +72,7 @@ protected function getGroups()
// Only add options where a locale exists.
if (!empty($locale))
{
$groups[$group][$zone] = Html::_('select.option', $zone, str_replace('_', ' ', $locale), 'value', 'text', false);
$groups[$group][$zone] = Select::option($zone, str_replace('_', ' ', $locale), 'value', 'text', false);
}
}
}
Expand Down
Loading

0 comments on commit 8562f00

Please sign in to comment.