/**
  * Return setting template with typePage: public, admin_sweeto or back_office
  */
 public static function getCurrentTemplate($typePage)
 {
     $model = OmmuThemes::model()->find(array('select' => 'folder, layout', 'condition' => 'group_page = :group AND default_theme = "1"', 'params' => array(':group' => $typePage)));
     if ($model != null) {
         return array('folder' => $model->folder, 'layout' => $model->layout);
     }
 }
 /**
  * Get default theme from database
  *
  * @return string theme name
  */
 public function getDefaultTheme()
 {
     $theme = OmmuThemes::model()->find(array('select' => 'folder', 'condition' => 'group_page= :group AND default_theme= "1"', 'params' => array(':group' => 'public')));
     if ($theme !== null) {
         return $theme->folder;
     } else {
         return null;
     }
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = OmmuThemes::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, Yii::t('phrase', 'The requested page does not exist.'));
     }
     return $model;
 }