예제 #1
0
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = dirname(__FILE__) . '/center_inner_private.tpl';
     }
     $inner_html_gen =& new Template($inner_template);
     $role = new Roles();
     $this->links = $role->get_multiple();
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('display', @$this->display);
     $inner_html_gen->set('super_user_and_mothership', @$this->super_user_and_mothership);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('manage_roles'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_private.tpl';
     }
     $inner_html_gen = new Template($inner_template);
     $role = new Roles();
     $params = array('sort_by' => 'id', 'direction' => 'ASC', 'cnt' => false);
     $this->links = $role->get_multiple($params);
     $inner_html_gen->set('links', $this->links);
     $task = Tasks::get_instance();
     $tasklist = $task->get_tasks();
     $inner_html_gen->set('tasklist', $tasklist);
     $inner_html_gen->set('super_user_and_mothership', @$this->super_user_and_mothership);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('manage_tasks_relationship'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_private.tpl';
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $role = new Roles();
     $this->role_links = $role->get_multiple(null, DB_FETCHMODE_ASSOC);
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('link_role', $this->role_links);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html_gen->set('super_user_and_mothership', $this->super_user_and_mothership);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('manage_user'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = dirname(__FILE__) . '/center_inner_private.tpl';
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $role = new Roles();
     $this->role_links = $role->get_multiple();
     $inner_html_gen =& new Template($inner_template);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('link_role', $this->role_links);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html_gen->set('super_user_and_mothership', $this->super_user_and_mothership);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('manage_user'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 public function importRolesInfo()
 {
     $roles = new Roles();
     $roles_data = array();
     $roles_info = $roles->get_multiple(null, DB_FETCHMODE_ASSOC);
     foreach ($roles_info as &$role) {
         $roles_data[] = Roles::getRoleInfoByID($role['id'], DB_FETCHMODE_ASSOC);
     }
     return $roles_data;
 }
*/
require_once dirname(__FILE__) . '/../../config.inc';
require_once "api/Roles/Roles.php";
require_once "api/Group/Group.php";
//  echo "<pre>".print_r($_REQUEST,1)."</pre>";
$selected_role = null;
$sel_role_id = !empty($_REQUEST['role_id']) ? $_REQUEST['role_id'] : null;
$group_id = !empty($_REQUEST['gid']) && $_REQUEST['gid'] != '-1' ? $_REQUEST['gid'] : null;
$user_id = (int) $_REQUEST['uid'];
$roles_list = array();
$user_roles = array();
$user = new User();
$user->load($user_id);
$role = new Roles();
$params = $group_id ? array('condition' => 'type = \'group\'', 'cnt' => false) : array('condition' => 'type <> \'null\'', 'cnt' => false);
$all_roles = $role->get_multiple($params, DB_FETCHMODE_ASSOC);
foreach ($all_roles as $a_role) {
    $roles_list[$a_role['id']] = $a_role['name'];
}
$user_groups = array();
$u_groups = Group::get_user_groups($user_id);
if (count($u_groups) < 1) {
    $u_groups = Group::get_all_groups_for_admin(FALSE);
    foreach ($u_groups as $group) {
        $user_groups[$group['group_id']] = $group['title'];
    }
} else {
    foreach ($u_groups as $group) {
        $user_groups[$group['gid']] = $group['name'];
    }
}
 /**
  * @todo Implement testGet_multiple().
  */
 public function testGet_multiple()
 {
     $roles = Roles::get_multiple();
     $num = count($roles);
     $res = Dal::query('SELECT count(*) AS CNT FROM {admin_roles} ');
     $r = $res->fetchRow(DB_FETCHMODE_OBJECT);
     //if total rows in db are equal to rows returned by the function
     // then test is OK
     $this->assertEquals($num, $r->CNT);
 }
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/cnmodule.php';
     }
     $inner_html_gen = new Template($inner_template);
     $role = new Roles();
     $params = array('sort_by' => 'id', 'direction' => 'ASC', 'cnt' => false);
     $this->links = $role->get_multiple($params);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('display', @$this->display);
     $inner_html_gen->set('super_user_and_mothership', @$this->super_user_and_mothership);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('manage_roles'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }