コード例 #1
0
function getEntityUsers($params)
{
    if (!isset($params['eid'])) {
        return FALSE;
    }
    $eid = $params['eid'];
    $util = new sspmod_janus_AdminUtil();
    $users = $util->hasAccess($eid);
    $return = array();
    foreach ($users as $user) {
        $return[] = array('optionValue' => $user['uid'], 'optionDisplay' => $user['userid']);
    }
    usort($return, function ($a, $b) {
        return strcasecmp($a['optionDisplay'], $b['optionDisplay']);
    });
    return array('data' => $return);
}
コード例 #2
0
ファイル: dashboard.php プロジェクト: baszoetekouw/janus
: </span><input type="text" id="admin_entities_search" />
            <br /><br />
            <?php 
                /** @var sspmod_janus_Entity[] $entities */
                $entities = $this->data['adminentities'];
                echo '<table class="dashboard_container2" style="border-collapse: collapse;" id="admin_entities_table">';
                echo '<thead><tr><th colspan="2">' . $this->t('tab_admin_tab_entities_header') . '</th><th>' . $this->t('admin_users') . '</th><th width=" 230px" align="center">' . $this->t('admin_permission') . '</th><th>' . $this->t('admin_action') . '</th></tr></thead>';
                echo '<tbody>';
                $i = 0;
                foreach ($entities as $entity) {
                    echo '<tr id="entity-' . $entity->getEid() . '" class="' . ($i % 2 == 0 ? 'even' : 'odd') . '"';
                    if ($entity->getActive() == 'no') {
                        echo ' style="text-decoration: line-through;" ';
                    }
                    echo '>';
                    $entity_users = $util->hasAccess($entity->getEid());
                    if ($entity->getPrettyname() !== $entity->getEntityid()) {
                        echo '<td class="dashboard_entity">', htmlspecialchars($entity->getPrettyname()), '</td>';
                        echo '<td class="dashboard_entity">', htmlspecialchars($entity->getEntityid()), '</td>';
                    } else {
                        echo '<td class="dashboard_entity" colspan="2">', htmlspecialchars($entity->getPrettyname()), '</td>';
                    }
                    echo '<td class="dashboard_entity users">';
                    foreach ($entity_users as $entity_user) {
                        echo '<span id="entityuser-', $entity->getEid(), '-', $entity_user['uid'], '">', $entity_user['userid'], ', </span>';
                    }
                    echo '</td>';
                    echo '<td class="dashboard_entity" align="center">';
                    echo '<input class="add-user" placeholder="*****@*****.**" id="add-user-' . $entity->getEid() . '">';
                    echo '<a class="janus_button" onclick="addUserToEntity(\'', $entity->getEid(), '\');">' . $this->t('admin_add') . '</a>';
                    echo '<a class="janus_button" onclick="getEntityUsers(\'', $entity->getEid(), '\');">' . $this->t('admin_remove') . '</a>';