CC-4434: Make Application_Model_Preference::getValue and setValue private methods
-done
This commit is contained in:
parent
6e239d08e9
commit
78460703a2
4 changed files with 17 additions and 11 deletions
|
@ -27,9 +27,9 @@ class ShowbuilderController extends Zend_Controller_Action
|
|||
$userType = $user->getType();
|
||||
$this->view->headScript()->appendScript("localStorage.setItem( 'user-type', '$userType' );");
|
||||
|
||||
$data = Application_Model_Preference::getValue("library_datatable", true);
|
||||
if ($data != "") {
|
||||
$libraryTable = json_encode(unserialize($data));
|
||||
$data = Application_Model_Preference::getCurrentLibraryTableSetting();
|
||||
if (!is_null($data)) {
|
||||
$libraryTable = json_encode($data);
|
||||
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-library', JSON.stringify($libraryTable) );");
|
||||
} else {
|
||||
$this->view->headScript()->appendScript("localStorage.setItem( 'datatables-library', '' );");
|
||||
|
|
|
@ -44,9 +44,9 @@ class UsersettingsController extends Zend_Controller_Action
|
|||
|
||||
public function getLibraryDatatableAction()
|
||||
{
|
||||
$data = Application_Model_Preference::getValue("library_datatable", true);
|
||||
if ($data != "") {
|
||||
$this->view->settings = unserialize($data);
|
||||
$data = Application_Model_Preference::getCurrentLibraryTableSetting();
|
||||
if (!is_null($data)) {
|
||||
$this->view->settings = $data;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class Application_Model_Datatables
|
|||
public static function findEntries($con, $displayColumns, $fromTable,
|
||||
$data, $dataProp = "aaData")
|
||||
{
|
||||
$librarySetting = Application_Model_Preference::getCurrentLibraryTableSetting();
|
||||
$librarySetting = Application_Model_Preference::getCurrentLibraryTableColumnMap();
|
||||
//$displayColumns[] = 'owner';
|
||||
|
||||
// map that maps original column position to db name
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
class Application_Model_Preference
|
||||
{
|
||||
|
||||
public static function setValue($key, $value, $isUserValue = false)
|
||||
private static function setValue($key, $value, $isUserValue = false)
|
||||
{
|
||||
try {
|
||||
//called from a daemon process
|
||||
|
@ -70,7 +70,7 @@ class Application_Model_Preference
|
|||
|
||||
}
|
||||
|
||||
public static function getValue($key, $isUserValue = false)
|
||||
private static function getValue($key, $isUserValue = false)
|
||||
{
|
||||
try {
|
||||
$con = Propel::getConnection();
|
||||
|
@ -1093,7 +1093,7 @@ class Application_Model_Preference
|
|||
}
|
||||
|
||||
|
||||
public static function getCurrentLibraryTableSetting()
|
||||
public static function getCurrentLibraryTableColumnMap()
|
||||
{
|
||||
$v = self::getValue("library_datatable", true);
|
||||
|
||||
|
@ -1118,6 +1118,12 @@ class Application_Model_Preference
|
|||
$v = self::setValue("library_datatable", $data, true);
|
||||
}
|
||||
|
||||
public static function getCurrentLibraryTableSetting()
|
||||
{
|
||||
$data = self::getValue("library_datatable", true);
|
||||
return ($data != "") ? unserialize($data) : null;
|
||||
}
|
||||
|
||||
|
||||
public static function setTimelineDatatableSetting($settings)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue