/** * Get the user style to run the webdesktop * * @return array */ public function getUserStyle() { $dbThemes = new Webdesktop_Model_DbTable_Themes(); $dbWallpaper = new Webdesktop_Model_DbTable_Wallpapers(); $theme = $dbThemes->find($this->user->get('themeid')); $wp = $dbWallpaper->find($this->user->get('wpid')); $result = array('backgroundcolor' => $this->user->get('bgcolor'), 'fontcolor' => $this->user->get('fgcolor'), 'transparency' => $this->user->get('transparency'), 'theme' => array('id' => $theme->current()->sth_id, 'name' => $theme->current()->sth_name, 'src' => $theme->current()->sth_file), 'wallpaper' => array('id' => $wp->current()->swp_id, 'name' => $wp->current()->swp_name, 'file' => sprintf('%s%s', $this->config->path->wallpapers, $wp->current()->swp_file), 'position' => $this->user->get('wppos'))); return $result; }
/** * Load all available wallpapers from the database * * @return array */ public function loadWallpapersAction() { $wpModel = new Webdesktop_Model_DbTable_Wallpapers(); $wallpapers = array(); foreach ($wpModel->fetchAll() as $wp) { $w = new Webdesktop_Model_DbRow_Wallpaper($wp); $wallpapers[] = $w->toJsonArray(); } return $this->responseSuccess(array('wallpapers' => $wallpapers)); }