Exemplo n.º 1
0
 protected function _saveGroups(KDatabaseRowInterface $entity)
 {
     $table = $this->getObject('com://admin/docman.database.table.levels');
     $row = $table->select(array('entity' => $entity->uuid), KDatabase::FETCH_ROW);
     $groups = KObjectConfig::unbox($entity->groups);
     $access = null;
     if (is_array($groups) && count($groups)) {
         sort($groups);
         $row->groups = implode(',', array_map('intval', $groups));
         $row->entity = $entity->uuid;
         if ($row->save()) {
             $access = -1 * $row->id;
         }
     } elseif ($entity->inherit || $groups) {
         if (!$row->isNew()) {
             $row->delete();
         }
         $access = $groups ?: self::INHERIT;
     }
     if ($access !== null) {
         if ($entity->getIdentifier()->name === 'document') {
             $entity->access = $access;
         } else {
             $entity->access_raw = $access;
         }
     }
 }
Exemplo n.º 2
0
 protected function _createURL(KDatabaseRowInterface $row)
 {
     $option = 'com_' . $row->getIdentifier()->package;
     $view = $row->getIdentifier()->name;
     $url = 'index.php?option=' . $option . '&view=' . $view;
     return $url;
 }