2012-02-23 12:13:00 +01:00
|
|
|
<?php
|
|
|
|
class UsersettingsController extends Zend_Controller_Action
|
|
|
|
{
|
|
|
|
|
|
|
|
public function init()
|
|
|
|
{
|
|
|
|
/* Initialize action controller here */
|
|
|
|
$ajaxContext = $this->_helper->getHelper('AjaxContext');
|
2012-03-28 16:14:02 +02:00
|
|
|
$ajaxContext->addActionContext('get-now-playing-screen-settings', 'json')
|
|
|
|
->addActionContext('set-now-playing-screen-settings', 'json')
|
|
|
|
->addActionContext('get-library-datatable', 'json')
|
2012-02-23 12:13:00 +01:00
|
|
|
->addActionContext('set-library-datatable', 'json')
|
|
|
|
->addActionContext('get-timeline-datatable', 'json')
|
2012-07-16 03:17:13 +02:00
|
|
|
->addActionContext('set-timeline-datatable', 'json')
|
2012-03-29 15:34:58 +02:00
|
|
|
->addActionContext('remindme', 'json')
|
2012-08-28 23:30:34 +02:00
|
|
|
->addActionContext('remindme-never', 'json')
|
2012-04-20 13:03:50 +02:00
|
|
|
->addActionContext('donotshowregistrationpopup', 'json')
|
2012-02-23 12:13:00 +01:00
|
|
|
->initContext();
|
|
|
|
}
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function setNowPlayingScreenSettingsAction()
|
|
|
|
{
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$settings = $request->getParam("settings");
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-09-14 18:09:40 +02:00
|
|
|
Application_Model_Preference::setNowPlayingScreenSettings($data);
|
2012-03-28 16:14:02 +02:00
|
|
|
}
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function getNowPlayingScreenSettingsAction()
|
|
|
|
{
|
2012-09-14 18:09:40 +02:00
|
|
|
$data = Application_Model_Preference::getNowPlayingScreenSettings();
|
|
|
|
if (!is_null($data)) {
|
|
|
|
$this->view->settings = $data;
|
2012-07-16 03:17:13 +02:00
|
|
|
}
|
2012-03-28 16:14:02 +02:00
|
|
|
}
|
2012-02-23 12:13:00 +01:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function setLibraryDatatableAction()
|
|
|
|
{
|
2012-02-23 12:13:00 +01:00
|
|
|
$request = $this->getRequest();
|
|
|
|
$settings = $request->getParam("settings");
|
|
|
|
|
2012-09-14 18:09:40 +02:00
|
|
|
Application_Model_Preference::setCurrentLibraryTableSetting($settings);
|
2012-02-23 12:13:00 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function getLibraryDatatableAction()
|
|
|
|
{
|
2012-09-14 20:53:25 +02:00
|
|
|
$data = Application_Model_Preference::getCurrentLibraryTableSetting();
|
|
|
|
if (!is_null($data)) {
|
|
|
|
$this->view->settings = $data;
|
2012-02-23 12:13:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function setTimelineDatatableAction()
|
|
|
|
{
|
2012-04-16 16:33:32 +02:00
|
|
|
$start = microtime(true);
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-02-23 12:13:00 +01:00
|
|
|
$request = $this->getRequest();
|
|
|
|
$settings = $request->getParam("settings");
|
|
|
|
|
2012-09-14 18:09:40 +02:00
|
|
|
Application_Model_Preference::setTimelineDatatableSetting($settings);
|
2012-04-16 16:33:32 +02:00
|
|
|
$end = microtime(true);
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-04-16 16:33:32 +02:00
|
|
|
Logging::debug("saving timeline datatables info took:");
|
|
|
|
Logging::debug(floatval($end) - floatval($start));
|
2012-02-23 12:13:00 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function getTimelineDatatableAction()
|
|
|
|
{
|
2012-04-16 16:33:32 +02:00
|
|
|
$start = microtime(true);
|
2012-02-23 12:13:00 +01:00
|
|
|
|
2012-09-14 18:09:40 +02:00
|
|
|
$data = Application_Model_Preference::getTimelineDatatableSetting();
|
|
|
|
if (!is_null($data)) {
|
|
|
|
$this->view->settings = $data;
|
2012-02-23 12:13:00 +01:00
|
|
|
}
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
$end = microtime(true);
|
|
|
|
|
|
|
|
Logging::debug("getting timeline datatables info took:");
|
2012-04-16 16:33:32 +02:00
|
|
|
Logging::debug(floatval($end) - floatval($start));
|
2012-02-23 12:13:00 +01:00
|
|
|
}
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public function remindmeAction()
|
|
|
|
{
|
|
|
|
// unset session
|
|
|
|
Zend_Session::namespaceUnset('referrer');
|
|
|
|
Application_Model_Preference::SetRemindMeDate();
|
|
|
|
}
|
2012-08-28 23:30:34 +02:00
|
|
|
|
|
|
|
public function remindmeNeverAction()
|
|
|
|
{
|
|
|
|
Zend_Session::namespaceUnset('referrer');
|
|
|
|
//pass in true to indicate 'Remind me never' was clicked
|
|
|
|
Application_Model_Preference::SetRemindMeDate(true);
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
|
|
|
|
public function donotshowregistrationpopupAction()
|
|
|
|
{
|
|
|
|
// unset session
|
|
|
|
Zend_Session::namespaceUnset('referrer');
|
2012-03-29 15:34:58 +02:00
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
}
|