Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
55fa8b8dc1
15 changed files with 30 additions and 34 deletions
|
@ -117,6 +117,7 @@ class LocaleController extends Zend_Controller_Action
|
|||
"Dynamic block is not previewable" => _("Dynamic block is not previewable"),
|
||||
"Limit to: " => _("Limit to: "),
|
||||
"Playlist saved" => _("Playlist saved"),
|
||||
"Playlist shuffled" => _("Playlist shuffled"),
|
||||
"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."
|
||||
=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
|
||||
//listenerstat/listenerstat.js
|
||||
|
|
|
@ -13,7 +13,7 @@ class LoginController extends Zend_Controller_Action
|
|||
|
||||
$request = $this->getRequest();
|
||||
|
||||
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale'));
|
||||
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', 'en_CA'));
|
||||
if (Zend_Auth::getInstance()->hasIdentity())
|
||||
{
|
||||
|
||||
|
|
|
@ -129,12 +129,7 @@ class UserController extends Zend_Controller_Action
|
|||
$request = $this->getRequest();
|
||||
$form = new Application_Form_EditUser();
|
||||
if ($request->isPost()) {
|
||||
$params = $request->getPost();
|
||||
$postData = explode('&', $params['data']);
|
||||
foreach($postData as $k=>$v) {
|
||||
$v = explode('=', $v);
|
||||
$formData[$v[0]] = urldecode($v[1]);
|
||||
}
|
||||
$formData = $request->getPost();
|
||||
|
||||
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
|
||||
&& $formData['cu_login'] == 'admin') {
|
||||
|
@ -157,12 +152,19 @@ class UserController extends Zend_Controller_Action
|
|||
$user->setSkype($formData['cu_skype']);
|
||||
$user->setJabber($formData['cu_jabber']);
|
||||
$user->save();
|
||||
|
||||
Application_Model_Preference::SetUserLocale($user->getId(), $formData['cu_locale']);
|
||||
Application_Model_Preference::SetUserTimezone($user->getId(), $formData['cu_timezone']);
|
||||
$this->view->successMessage = "<div class='success'>"._("User updated successfully!")."</div>";
|
||||
|
||||
//configure localization with new locale setting
|
||||
Application_Model_Locale::configureLocalization($formData['cu_locale']);
|
||||
//reinitialize form so language gets translated
|
||||
$form = new Application_Form_EditUser();
|
||||
|
||||
$this->view->successMessage = "<div class='success'>"._("Settings updated successfully!")."</div>";
|
||||
}
|
||||
$this->view->form = $form;
|
||||
die(json_encode(array("locale"=>$formData['cu_locale'], "html"=>$this->view->render('user/edit-user.phtml'))));
|
||||
$this->view->html = $this->view->render('user/edit-user.phtml');
|
||||
}
|
||||
$this->view->form = $form;
|
||||
$this->view->html = $this->view->render('user/edit-user.phtml');
|
||||
|
|
|
@ -18,7 +18,7 @@ class Application_Form_EditUser extends Zend_Form
|
|||
$emailValidator = Application_Form_Helper_ValidationTypes::overrideEmailAddressValidator();
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/edit-user.phtml'))));
|
||||
array('ViewScript', array('viewScript' => 'form/edit-user.phtml', "currentUser" => $currentUser->getLogin()))));
|
||||
$this->setAttrib('id', 'current-user-form');
|
||||
|
||||
$hidden = new Zend_Form_Element_Hidden('cu_user_id');
|
||||
|
|
|
@ -7,7 +7,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
|||
|
||||
public function init()
|
||||
{
|
||||
$this->setAction('/Showbuilder');
|
||||
$this->setAction(Application_Common_OsPath::getBaseDir().'/Showbuilder');
|
||||
$this->setMethod('post');
|
||||
|
||||
$country_list = Application_Model_Preference::GetCountryList();
|
||||
|
|
|
@ -452,12 +452,12 @@ class Application_Model_Preference
|
|||
if (is_null($timezone)) {
|
||||
$timezone = self::GetDefaultTimezone();
|
||||
}
|
||||
self::setValue("user_".$userId."_timezone", $timezone, true, $userId);
|
||||
self::setValue("user_timezone", $timezone, true, $userId);
|
||||
}
|
||||
|
||||
public static function GetUserTimezone($id)
|
||||
{
|
||||
return self::getValue("user_".$id."_timezone", true);
|
||||
return self::getValue("user_timezone", true);
|
||||
}
|
||||
|
||||
public static function GetTimezone()
|
||||
|
@ -484,7 +484,7 @@ class Application_Model_Preference
|
|||
|
||||
public static function GetUserLocale($id)
|
||||
{
|
||||
return self::getValue("user_".$id."_locale", true);
|
||||
return self::getValue("user_locale", true);
|
||||
}
|
||||
|
||||
public static function SetUserLocale($userId, $locale = null)
|
||||
|
@ -494,7 +494,7 @@ class Application_Model_Preference
|
|||
if (is_null($locale)) {
|
||||
$locale = self::GetDefaultLocale();
|
||||
}
|
||||
self::setValue("user_".$userId."_locale", $locale, true, $userId);
|
||||
self::setValue("user_locale", $locale, true, $userId);
|
||||
}
|
||||
|
||||
public static function GetLocale()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<h2><? echo sprintf(_("%s's Settings"), $this->currentUser) ?></h2>
|
||||
<div id="current-user-container">
|
||||
<form id="current-user-form" class="edit-user-global" enctype="application/x-www-form-urlencoded">
|
||||
<form id="current-user-form" class="edit-user-global" method="post" enctype="application/x-www-form-urlencoded">
|
||||
<dl class="zend_form">
|
||||
<?php echo $this->element->getElement('cu_user_id') ?>
|
||||
<dt id="cu-username-label">
|
||||
|
@ -142,7 +143,7 @@
|
|||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<button id="cu_save_user" type="button" class="btn btn-small right-floated">Save</button>
|
||||
<button type="submit" id="cu_save_user" class="btn btn-small right-floated">Save</button>
|
||||
</dl>
|
||||
</form>
|
||||
</div>
|
|
@ -1,5 +1,4 @@
|
|||
<div class="ui-widget ui-widget-content block-shadow clearfix padded-strong edit-current-user">
|
||||
<h2><? echo _("Edit User") ?></h2>
|
||||
<?php echo $this->successMessage ?>
|
||||
<?php echo $this->form?>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue