/**
  * @inheritdoc
  */
 public function disable()
 {
     foreach (models\ReportContent::find()->all() as $reportContent) {
         $reportContent->delete();
     }
     parent::disable();
 }
Example #2
0
 /**
  * Enables this module
  */
 public function enable()
 {
     if (!Yii::$app->hasModule('gcm')) {
         //Actions to do on enabling
     }
     parent::enable();
 }
 /**
  * @inheritdoc
  */
 public function disable()
 {
     foreach (CustomPage::find()->all() as $entry) {
         $entry->delete();
     }
     parent::disable();
 }
 /**
  * Enables this module
  */
 public function enable()
 {
     if (!Yii::$app->hasModule('mostactiveusers')) {
         // set default config values
         Setting::Set('noUsers', 5, 'mostactiveusers');
     }
     parent::enable();
 }
Example #5
0
 /**
  * @inheritdoc 
  */
 public function beforeAction($action)
 {
     // Block installer, when it's marked as installed
     if (Yii::$app->params['installed']) {
         throw new \yii\web\HttpException(500, 'HumHub is already installed!');
     }
     Yii::$app->controller->enableCsrfValidation = false;
     return parent::beforeAction($action);
 }
Example #6
0
 public function init()
 {
     parent::init();
     try {
         $tableSchema = Yii::$app->db->schema->getTableSchema('insighter_stripe');
         if ($tableSchema != null) {
             $stripe_setting = Stripe::findOne(1);
             if ($stripe_setting) {
                 $api_key = $stripe_setting->private_key;
                 \Stripe\Stripe::setApiKey($api_key);
             }
         }
     } catch (Exception $e) {
     }
 }
Example #7
0
 public function init()
 {
     parent::init();
     // custom initialization code goes here
 }
Example #8
0
 /**
  * Enables a module
  * 
  * @since 1.1
  * @param \humhub\components\Module $module
  */
 public function enable(Module $module)
 {
     $moduleEnabled = ModuleEnabled::findOne(['module_id' => $module->id]);
     if ($moduleEnabled == null) {
         $moduleEnabled = new ModuleEnabled();
         $moduleEnabled->module_id = $module->id;
         $moduleEnabled->save();
     }
     $this->enabledModules[] = $module->id;
     $this->register($module->getBasePath());
 }
 /**
  * @inheritdoc
  */
 public function enable()
 {
     parent::enable();
     Setting::Set('shownDays', 2, 'birthday');
 }
Example #10
0
 public function init()
 {
     parent::init();
     $this->modules = [['stripe' => ['class' => 'app\\modules\\stripe\\Module']]];
 }
Example #11
0
 public function init()
 {
     parent::init();
 }