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-04-20 13:03:50 +02:00
|
|
|
->addActionContext('set-timeline-datatable', 'json')
|
2012-03-29 15:34:58 +02:00
|
|
|
->addActionContext('remindme', '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-03-28 16:14:02 +02:00
|
|
|
public function setNowPlayingScreenSettingsAction() {
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-03-28 16:14:02 +02:00
|
|
|
$request = $this->getRequest();
|
|
|
|
$settings = $request->getParam("settings");
|
|
|
|
|
|
|
|
$data = serialize($settings);
|
2012-07-10 05:32:21 +02:00
|
|
|
Application_Model_Preference::setValue("nowplaying_screen", $data, true);
|
2012-03-28 16:14:02 +02:00
|
|
|
}
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-03-28 16:14:02 +02:00
|
|
|
public function getNowPlayingScreenSettingsAction() {
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-07-10 05:32:21 +02:00
|
|
|
$data = Application_Model_Preference::getValue("nowplaying_screen", true);
|
2012-03-28 16:14:02 +02:00
|
|
|
if ($data != "") {
|
|
|
|
$this->view->settings = unserialize($data);
|
|
|
|
}
|
|
|
|
}
|
2012-02-23 12:13:00 +01:00
|
|
|
|
|
|
|
public function setLibraryDatatableAction() {
|
|
|
|
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$settings = $request->getParam("settings");
|
|
|
|
|
|
|
|
$data = serialize($settings);
|
2012-07-10 05:32:21 +02:00
|
|
|
Application_Model_Preference::setValue("library_datatable", $data, true);
|
2012-02-23 12:13:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getLibraryDatatableAction() {
|
|
|
|
|
2012-07-10 05:32:21 +02:00
|
|
|
$data = Application_Model_Preference::getValue("library_datatable", true);
|
2012-02-23 12:13:00 +01:00
|
|
|
if ($data != "") {
|
|
|
|
$this->view->settings = unserialize($data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
$data = serialize($settings);
|
2012-07-10 05:32:21 +02:00
|
|
|
Application_Model_Preference::setValue("timeline_datatable", $data, true);
|
2012-07-11 00:53:06 +02:00
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
public function getTimelineDatatableAction() {
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-04-16 16:33:32 +02:00
|
|
|
$start = microtime(true);
|
2012-02-23 12:13:00 +01:00
|
|
|
|
2012-07-10 05:32:21 +02:00
|
|
|
$data = Application_Model_Preference::getValue("timeline_datatable", true);
|
2012-02-23 12:13:00 +01:00
|
|
|
if ($data != "") {
|
|
|
|
$this->view->settings = unserialize($data);
|
|
|
|
}
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-04-16 16:33:32 +02:00
|
|
|
$end = microtime(true);
|
|
|
|
|
|
|
|
Logging::debug("getting timeline datatables info took:");
|
|
|
|
Logging::debug(floatval($end) - floatval($start));
|
2012-02-23 12:13:00 +01:00
|
|
|
}
|
2012-07-11 00:53:06 +02:00
|
|
|
|
2012-03-29 15:34:58 +02:00
|
|
|
public function remindmeAction()
|
|
|
|
{
|
|
|
|
// unset session
|
|
|
|
Zend_Session::namespaceUnset('referrer');
|
|
|
|
Application_Model_Preference::SetRemindMeDate();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function donotshowregistrationpopupAction()
|
|
|
|
{
|
|
|
|
// unset session
|
|
|
|
Zend_Session::namespaceUnset('referrer');
|
|
|
|
}
|
2012-02-23 12:13:00 +01:00
|
|
|
}
|