mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 06:08:21 +01:00
Fix: Properly sort language and country select by users locale
Enh: Allow search in country profile field dropdown
This commit is contained in:
parent
3b227af3ff
commit
9681319c97
@ -219,6 +219,10 @@ class HForm extends \yii\base\Component
|
|||||||
$options['label'] = $definition['label'];
|
$options['label'] = $definition['label'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($definition['htmlOptions']) && is_array($definition['htmlOptions'])) {
|
||||||
|
$options = array_merge($options, $definition['htmlOptions']);
|
||||||
|
}
|
||||||
|
|
||||||
$showLabel = !isset($definition['label']) || $definition['label'] !== false;
|
$showLabel = !isset($definition['label']) || $definition['label'] !== false;
|
||||||
|
|
||||||
if (isset($definition['type'])) {
|
if (isset($definition['type'])) {
|
||||||
|
@ -28,6 +28,9 @@ HumHub Change Log
|
|||||||
- Fixed #2560: Markdown profile field editable flag not working
|
- Fixed #2560: Markdown profile field editable flag not working
|
||||||
- Fix: Hide also header (space, profile) counts when following system is disabled
|
- Fix: Hide also header (space, profile) counts when following system is disabled
|
||||||
- Fix: Perma link to space contents broken when space homepage was changed
|
- Fix: Perma link to space contents broken when space homepage was changed
|
||||||
|
- Fix: Properly sort language and country select by users locale
|
||||||
|
- Enh: Allow search in country profile field dropdown
|
||||||
|
|
||||||
|
|
||||||
1.2.0 (April 16, 2017)
|
1.2.0 (April 16, 2017)
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
@ -120,7 +120,12 @@ class AccountController extends BaseAccountController
|
|||||||
return $this->redirect(['edit-settings']);
|
return $this->redirect(['edit-settings']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('editSettings', array('model' => $model, 'languages' => Yii::$app->i18n->getAllowedLanguages()));
|
// Sort countries list based on user language
|
||||||
|
$languages = Yii::$app->i18n->getAllowedLanguages();
|
||||||
|
$col = new \Collator(Yii::$app->language);
|
||||||
|
$col->asort($languages);
|
||||||
|
|
||||||
|
return $this->render('editSettings', array('model' => $model, 'languages' => $languages));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
* @copyright Copyright (c) 2015 HumHub GmbH & Co. KG
|
* @copyright Copyright (c) 2015 HumHub GmbH & Co. KG
|
||||||
* @license https://www.humhub.com/licences
|
* @license https://www.humhub.com/licences
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace humhub\modules\user\models\fieldtype;
|
namespace humhub\modules\user\models\fieldtype;
|
||||||
|
|
||||||
use humhub\modules\user\models\User;
|
use humhub\modules\user\models\User;
|
||||||
@ -69,6 +70,10 @@ class CountrySelect extends Select
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort countries list based on user language
|
||||||
|
$col = new \Collator(Yii::$app->language);
|
||||||
|
$col->asort($items);
|
||||||
|
|
||||||
return $items;
|
return $items;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,4 +96,15 @@ class CountrySelect extends Select
|
|||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
public function getFieldFormDefinition()
|
||||||
|
{
|
||||||
|
$definition = parent::getFieldFormDefinition();
|
||||||
|
$definition[$this->profileField->internal_name]['htmlOptions'] = ['data-ui-select2' => true];
|
||||||
|
return $definition;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user