public function uninstall()
 {
     foreach (CustomPage::model()->findAll() as $entry) {
         $entry->delete();
     }
     Yii::app()->db->createCommand()->dropTable(CustomPage::model()->tableName());
     return parent::uninstall();
 }
示例#2
0
 public function beforeControllerAction($controller, $action)
 {
     if (parent::beforeControllerAction($controller, $action)) {
         // this method is called before any module controller action is performed
         // you may place customized code here
         return true;
     } else {
         return false;
     }
 }
 /**
  * On global module disable, delete all created content
  */
 public function disable()
 {
     if (parent::disable()) {
         foreach (Content::model()->findAllByAttributes(array('object_model' => 'Document')) as $content) {
             $content->delete();
         }
         return true;
     }
     return false;
 }
示例#4
0
 public function disable()
 {
     if (parent::disable()) {
         foreach (CustomPage::model()->findAll() as $entry) {
             $entry->delete();
         }
         return true;
     }
     return false;
 }
示例#5
0
 public function disable()
 {
     if (parent::disable()) {
         foreach (WikiPage::model()->findAll() as $page) {
             $page->delete();
         }
         return true;
     }
     return false;
 }
 /**
  * Delete All Albums and settings.
  */
 public function disable()
 {
     if (parent::disable()) {
         foreach (Album::model()->findAll() as $album) {
             $album->delete();
         }
         $blacklisted_objects = explode(',', HSetting::Get('showFilesWidgetBlacklist', 'file'));
         if (false !== ($key = array_search('Album', $blacklisted_objects))) {
             unset($blacklisted_objects[$key]);
             HSetting::Set('showFilesWidgetBlacklist', implode(',', $blacklisted_objects));
         }
         HSetting::set('allowedExtensions', '', 'album');
         return true;
     }
     return false;
 }
 /**
  * Enables this module
  */
 public function enable()
 {
     parent::enable();
 }
 /**
  * Enables this module for a User.
  */
 public function enableUserModule(User $user)
 {
     if (!$this->isEnabled()) {
         // set default config values
         $this->setDefaultValues($user->container);
     }
     parent::enableUserModule($user);
 }