Changeset 3161:468195e4ad8b for inc/admin
- Timestamp:
- 02/05/16 17:05:45 (9 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
inc/admin/class.dc.favorites.php
r3075 r3161 52 52 53 53 if ($this->ws->prefExists('favorites')) { 54 $this->local_prefs = @unserialize($this->ws->getLocal('favorites'));55 $this->global_prefs = @unserialize($this->ws->getGlobal('favorites'));54 $this->local_prefs = $this->ws->getLocal('favorites'); 55 $this->global_prefs = $this->ws->getGlobal('favorites'); 56 56 // Since we never know what user puts through user:preferences ... 57 57 if (!is_array($this->local_prefs)) { … … 106 106 $fattr = $this->fav_defs[$p]; 107 107 } 108 $fattr = array_merge (array('id' => null,'class'=>null),$fattr);108 $fattr = array_merge(array('id' => null,'class' => null),$fattr); 109 109 if (isset($fattr['permissions'])) { 110 110 if (is_bool($fattr['permissions']) && !$fattr['permissions'] ) { … … 158 158 $u = explode('?',$_SERVER['REQUEST_URI']); 159 159 // Loop over prefs to enable active favorites 160 foreach ($this->user_prefs as $k =>&$v) {160 foreach ($this->user_prefs as $k => &$v) { 161 161 if (isset($v['active_cb']) && is_callable($v['active_cb'])) { 162 162 // Use callback if defined to match whether favorite is active or not … … 164 164 } else { 165 165 // Failback active detection. We test against URI name & parameters 166 $v['active'] =true; // true until something proves it is false166 $v['active'] = true; // true until something proves it is false 167 167 $u = explode('?',$v['url'],2); 168 168 if (!preg_match('/'.preg_quote($u[0],"/").'/',$_SERVER['REQUEST_URI'])) { … … 203 203 } 204 204 } 205 $this->ws->put('favorites', serialize($this->global_prefs),'string','User favorites',true,true);206 $this->ws->put('favorites', serialize($this->local_prefs));205 $this->ws->put('favorites',$this->global_prefs,'array','User favorites',true,true); 206 $this->ws->put('favorites',$this->local_prefs); 207 207 $this->user_prefs = $this->getFavorites($this->local_prefs); 208 208 } … … 271 271 */ 272 272 public function setFavoriteIDs($ids,$global=false) { 273 $this->ws->put('favorites', serialize($ids),null,null,true,$global);273 $this->ws->put('favorites',$ids,null,null,true,$global); 274 274 } 275 275 … … 307 307 */ 308 308 public function appendMenu($menu) { 309 foreach ($this->user_prefs as $k =>$v) {309 foreach ($this->user_prefs as $k => $v) { 310 310 $menu['Favorites']->addItem( 311 311 $v['title'], … … 330 330 */ 331 331 public function appendDashboardIcons($icons) { 332 foreach ($this->user_prefs as $k =>$v) {332 foreach ($this->user_prefs as $k => $v) { 333 333 if (isset($v['dashboard_cb']) && is_callable($v['dashboard_cb'])) { 334 334 $v = new ArrayObject($v); … … 368 368 */ 369 369 public function registerMultiple($data) { 370 foreach ($data as $k =>$v) {370 foreach ($data as $k => $v) { 371 371 $this->register($k,$v); 372 372 }
Note: See TracChangeset
for help on using the changeset viewer.