Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
James 2013-01-10 14:52:45 -05:00
commit 55fa8b8dc1
15 changed files with 30 additions and 34 deletions

View file

@ -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

View file

@ -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())
{

View file

@ -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');