diff --git a/airtime_mvc/application/controllers/LibraryController.php b/airtime_mvc/application/controllers/LibraryController.php index 2974d85a1..d63b6d4e3 100644 --- a/airtime_mvc/application/controllers/LibraryController.php +++ b/airtime_mvc/application/controllers/LibraryController.php @@ -77,6 +77,17 @@ class LibraryController extends Zend_Controller_Action } } + //get user settings and determine if we need to hide + // or show the playlist editor + $showPlaylist = false; + $data = Application_Model_Preference::getLibraryScreenSettings(); + if (!is_null($data)) { + if ($data["playlist"] == "true") { + $showLib = true; + } + } + $this->view->showPlaylist = $showPlaylist; + $formatter = new LengthFormatter($obj->getLength()); $this->view->length = $formatter->format(); $this->view->type = $obj_sess->type; diff --git a/airtime_mvc/application/controllers/UsersettingsController.php b/airtime_mvc/application/controllers/UsersettingsController.php index 238e67f3b..9d8154578 100644 --- a/airtime_mvc/application/controllers/UsersettingsController.php +++ b/airtime_mvc/application/controllers/UsersettingsController.php @@ -15,6 +15,7 @@ class UsersettingsController extends Zend_Controller_Action ->addActionContext('remindme', 'json') ->addActionContext('remindme-never', 'json') ->addActionContext('donotshowregistrationpopup', 'json') + ->addActionContext('set-library-screen-settings', 'json') ->initContext(); } @@ -54,6 +55,7 @@ class UsersettingsController extends Zend_Controller_Action { $request = $this->getRequest(); $settings = $request->getParam("settings"); + Application_Model_Preference::setTimelineDatatableSetting($settings); } @@ -91,4 +93,11 @@ class UsersettingsController extends Zend_Controller_Action // unset session Zend_Session::namespaceUnset('referrer'); } + + public function setLibraryScreenSettingsAction() + { + $request = $this->getRequest(); + $settings = $request->getParam("settings"); + Application_Model_Preference::setLibraryScreenSettings($settings); + } } diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 1d56313f7..2af97d193 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -1262,7 +1262,19 @@ class Application_Model_Preference $data = self::getValue("nowplaying_screen", true); return ($data != "") ? unserialize($data) : null; } - + + public static function setLibraryScreenSettings($settings) + { + $data = serialize($settings); + self::setValue("library_screen", $data, true); + } + + public static function getLibraryScreenSettings() + { + $data = self::getValue("library_screen", true); + return ($data != "") ? unserialize($data) : null; + } + public static function SetEnableReplayGain($value) { self::setValue("enable_replay_gain", $value, false); } diff --git a/airtime_mvc/application/views/scripts/library/index.phtml b/airtime_mvc/application/views/scripts/library/index.phtml index 30c18e365..a00a32149 100644 --- a/airtime_mvc/application/views/scripts/library/index.phtml +++ b/airtime_mvc/application/views/scripts/library/index.phtml @@ -2,7 +2,14 @@ render('library/library.phtml') ?> -