示例#1
0
文件: list.php 项目: legende91/ez
    }
}
// Redirect to content node browse in the user tree
// Assign the role for a user or group
if ($Module->isCurrentAction('AssignRole')) {
    $selectedObjectIDArray = eZContentBrowse::result('AssignRole');
    foreach ($selectedObjectIDArray as $objectID) {
        $role->assignToUser($objectID);
    }
    // Clear role caches.
    eZRole::expireCache();
    // Clear all content cache.
    eZContentCacheManager::clearAllContentCache();
}
if ($http->hasPostVariable('NewButton')) {
    $role = eZRole::createNew();
    return $Module->redirectToView('edit', array($role->attribute('id')));
}
$viewParameters = array('offset' => $offset);
$tpl = eZTemplate::factory();
$roles = eZRole::fetchByOffset($offset, $limit, $asObject = true, $ignoreTemp = true);
$roleCount = eZRole::roleCount();
$tempRoles = eZRole::fetchList($temporaryVersions = true);
$tpl->setVariable('roles', $roles);
$tpl->setVariable('role_count', $roleCount);
$tpl->setVariable('temp_roles', $tempRoles);
$tpl->setVariable('module', $Module);
$tpl->setVariable('view_parameters', $viewParameters);
$tpl->setVariable('limit', $limit);
$Result = array();
$Result['content'] = $tpl->fetch('design:role/list.tpl');
示例#2
0
 function createTemporaryVersion()
 {
     $db = eZDB::instance();
     $db->begin();
     $newRole = eZRole::createNew();
     $this->copyPolicies($newRole->attribute('id'));
     $newRole->setAttribute('name', $this->attribute('name'));
     $newRole->setAttribute('version', $this->attribute('id'));
     $newRole->store();
     $db->commit();
     return $newRole;
 }