Пример #1
0
 /**
  * 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;
 }
Пример #2
0
 /**
  * Load all available themes from the database
  *
  * @return array
  */
 public function loadThemesAction()
 {
     $model = new Webdesktop_Model_DbTable_Themes();
     $themes = array();
     foreach ($model->fetchAll() as $row) {
         $theme = new Webdesktop_Model_DbRow_Theme($row);
         $themes[] = $theme->toJsonArray();
     }
     return $this->responseSuccess(array('themes' => $themes));
 }