Example #1
0
 /**
  * Get access group names
  *
  * @return     mixed
  */
 public function getAccessGroups()
 {
     if (!$this->exists() || !$this->masterType()) {
         return array();
     }
     if (!isset($this->_accessGroups)) {
         $paccess = new Tables\Access($this->_db);
         $aGroups = $paccess->getGroups($this->version->id, $this->publication->id);
         $this->_accessGroups = $this->getGroupProperty($aGroups);
     }
     return $this->_accessGroups;
 }
Example #2
0
 /**
  * Deletes assoc with pub version
  *
  * @param   integer  $vid
  * @param   integer  $pid
  * @return  void
  */
 public function deleteVersionExistence($vid, $pid)
 {
     // Delete authors
     $pa = new Tables\Author($this->database);
     $authors = $pa->deleteAssociations($vid);
     // Delete attachments
     $pContent = new Tables\Attachment($this->database);
     $pContent->deleteAttachments($vid);
     // Delete screenshots
     $pScreenshot = new Tables\Screenshot($this->database);
     $pScreenshot->deleteScreenshots($vid);
     // Delete access accosiations
     $pAccess = new Tables\Access($this->database);
     $pAccess->deleteGroups($vid);
     // Delete audience
     $pAudience = new Tables\Audience($this->database);
     $pAudience->deleteAudience($vid);
     // Build publication path
     $path = Helpers\Html::buildPubPath($pid, $vid, $this->config->get('webpath'), '', 1);
     // Delete all files
     if (is_dir($path)) {
         Filesystem::deleteDirectory($path);
     }
     return true;
 }