Ejemplo n.º 1
0
 protected function _postSave($is_new)
 {
     TBGScopeHostnamesTable::getTable()->saveScopeHostnames($this->getHostnames(), $this->getID());
     // Load fixtures for this scope if it's a new scope
     if ($is_new) {
         if (!$this->isDefault()) {
             $prev_scope = TBGContext::getScope();
             TBGContext::setScope($this);
         }
         $this->loadFixtures();
         if (!$this->isDefault()) {
             TBGModule::installModule('publish', $this);
             TBGContext::setScope($prev_scope);
             TBGContext::clearPermissionsCache();
         }
     }
 }
Ejemplo n.º 2
0
 public final function uninstall($scope = null)
 {
     if ($this->isCore()) {
         throw new Exception('Cannot uninstall core modules');
     }
     $scope = $scope === null ? TBGContext::getScope()->getID() : $scope;
     $this->_uninstall($scope);
     \b2db\Core::getTable('TBGModulesTable')->doDeleteById($this->getID());
     TBGSettings::deleteModuleSettings($this->getName(), $scope);
     TBGContext::deleteModulePermissions($this->getName(), $scope);
     TBGContext::clearRoutingCache();
     TBGContext::clearPermissionsCache();
 }