Xaraya / Postnuke CVS Notices - Message

Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites

View Statistics - Next Notice - Previous Notice

Directory filter : [ all ] / postnuke_official / html / modules / groups [ view in CVS ]


Deprecated: Function gmstrftime() is deprecated in /home/mikespub/www/list.php on line 509
Date Directory [filter] File(s) [view] Author [filter]
07 Aug 2002 04:00:47postnuke_official/html/modules/groupspnuser.php,NONE,1.1st.ego
 groups_user_view shows all groups

Update of /home/cvsroot/postnuke_official/html/modules/groups
In directory ns7.hostnuke.net:/tmp/cvs-serv24797/html/modules/groups

Added Files:
	pnuser.php 
Log Message:
groups_user_view shows all groups
groups_user_display shows all members (possible replacement for memberslist?)
TODO: overview and read permissions where appropriate


--- NEW FILE: pnuser.php ---
<?php
// ----------------------------------------------------------------------
// PostNuke Content Management System
// Copyright (C) 2002 by the PostNuke Development Team.
// http://www.postnuke.com/
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
// Original Author of file: Chad Kraeft
// Purpose of file:  groups user display functions
// ----------------------------------------------------------------------

function groups_user_main()
{
    if (!pnSecAuthAction(0, 'Groups::', '::', ACCESS_OVERVIEW)) {
        return _GROUPSNOAUTH;
    }

    $data = groups_user_menu();

//    $data['welcome'] = pnML('Welcome to this Example module...');

    return $data;

}

function groups_user_view()
{
    $startnum = pnVarCleanFromInput('startnum');

    $data = groups_user_menu();

    $data['status'] = '';

    $data['items'] = array();

    $data['someheader'] = _GROUPSNAME;
    $data['pager'] = '';

    if (!pnSecAuthAction(0, 'Groups::', '::', ACCESS_OVERVIEW)) {
        $data['status'] = _GROUPSNOAUTH;
        return $data;
    }

    if (!pnModAPILoad('groups', 'user')) {
        $data['status'] = _LOADFAILED;
        return $data;
    }

    $groups = pnModAPIFunc('groups',
                          'user',
                          'getall',
                          array('startnum' => $startnum,
                                'numitems' => pnModGetVar('groups',
                                                          'itemsperpage')));

    if ($groups == false) {
        if (pnExceptionMajor() == PN_SYSTEM_EXCEPTION) {
             return; // throw back
        }
        $data['status'] = _GROUPSITEMFAILED;
        $reason = pnExceptionValueString();
        if (!empty($reason)) {
            $data['status'] .= '<br /><br />'. pnML('Reason') .' : '. $reason;
        }
        pnExceptionFree();
        return $data;
    }

    foreach ($groups as $group) {

        if (pnSecAuthAction(0,
                            'Groups::',
                            "$group[name]::$group[gid]",
                            ACCESS_READ)) {
            $group['link'] = pnModURL('groups',
                                     'user',
                                     'display',
                                     array('gid' => $group['gid']));

        } else {
            $group['link'] = '';
        }

        $group['name'] = pnVarPrepForDisplay(pnVarCensor($group['name']));

        $data['items'][] = $group;
    }

    $output = new pnHTML();

    $output->Pager($startnum,
            pnModAPIFunc('groups', 'user', 'countitems'),
                         pnModURL('groups',
                                  'user',
                                  'view',
                                  array('startnum' => '%%')),
                         pnModGetVar('groups', 'itemsperpage'));
    $data['pager'] = $output->GetOutput();

    $data['someheader'] = _GROUPSNAME;

    return $data;

}

function groups_user_display($args)
{
    list($gid,
         $objectid) = pnVarCleanFromInput('gid',
                                          'objectid');
	$pagesize = 20;
	
	if (!isset($letter)) {
		$letter = "A";
	}
	if (!isset($sortby)) {
		$sortby = "uname";
	}
	if (!isset($page)) {
		$page = 1;
	}

    extract($args);

    if (!empty($objectid)) {
        $gid = $objectid;
    }

	if(empty($gid)) $gid = 1;

    $data = groups_user_menu();

    $data['status'] = '';

    if (!pnModAPILoad('groups', 'user')) {
        $data['status'] = _LOADFAILED;
        return $data;
    }

    $userlist = pnModAPIFunc('groups',
                          'user',
                          'get',
                          array('gid' 		=> $gid,
                          		'startnum' 	=> $startnum,
                                'numitems' 	=> pnModGetVar('groups',
                                                          'itemsperpage')));

    if ($userlist == false) {
        if (pnExceptionMajor() == PN_SYSTEM_EXCEPTION) {
             return; // throw back
        }
        $data['status'] = _GROUPSITEMFAILED;
        $reason = pnExceptionValueString();
        if (!empty($reason)) {
            $data['status'] .= '<br /><br />'. pnML('Reason') .' : '. $reason;
        }
        pnExceptionFree();
        return $data;
    }

    foreach ($userlist as $member) {

        if (pnSecAuthAction(0,
                            'Groups::',
                            "$member[name]::$member[gid]",
                            ACCESS_READ)) {
            $member['link'] = pnModURL('groups',
                                     'user',
                                     'display',
                                     array('member_id' => $member['member_id']));

        } else {
            $member['link'] = '';
        }

        $member['name'] = pnVarPrepForDisplay(pnVarCensor($member['uname']));

        $data['items'][] = $member;
    }

    $output = new pnHTML();

    $output->Pager($startnum,
            pnModAPIFunc('groups', 'user', 'countitems'),
                         pnModURL('groups',
                                  'user',
                                  'display',
                                  array('gid' => $gid,
								  		'startnum' => '%%')),
                         pnModGetVar('groups', 'itemsperpage'));
    $data['pager'] = $output->GetOutput();

    $data['someheader'] = _GROUPSNAME;
/*	
    list($userlist['name']) = pnModCallHooks('item',
                                         'transform',
                                         $item['tid'],
                                         array($item['name']));

    $data['name_label'] = _GROUPSNAME;
    $data['name_value'] = pnVarCensor($item['name']);
    $data['number_label'] = _GROUPSNUMBER;
    $data['number_value'] = $item['number'];

    $data['is_bold'] = pnModGetVar('groups', 'bold');
*/
    $data['hookoutput'] = pnModCallHooks('item',
                                         'display',
                                         $gid,
                                         pnModURL('groups',
                                                  'user',
                                                  'display',
                                                  array('gid' => $gid)));

    return $data;

}

function groups_user_menu()
{
    $menu = array();

    $menu['menutitle'] = _GROUPS;

    $menu['menulabel_view'] = _GROUPSVIEW;
    $menu['menulink_view'] = pnModURL('groups','user','view');

    // Specify the labels/links for more menu items if relevant
    // $menu['menulabel_other'] = pnML('Some other menu item');
    // $menu['menulink_other'] = pnModURL('groups','user','other');
    // ...

    // Note : you could also put all menu items in a $menu['menuitems'] array
    //
    // Initialise the array that will hold the different menu items
    // $menu['menuitems'] = array();
    //
    // Define a menu item
    // $item = array();
    // $item['menulabel'] = _GROUPSVIEW;
    // $item['menulink'] = pnModURL('template','user','view');
    //
    // Add it to the array of menu items
    // $menu['menuitems'][] = $item;
    //
    // Add more menu items to the array
    // ...
    //
    // Then you can let the blocklayout template create the different
    // menu items *dynamically*, e.g. by using something like :
    //
    // <pnt:loop name="menuitems">
    //    <td><a href="&pnt-var-menulink;">&pnt-var-menulabel;</a></td>
    // </pnt:loop>
    //
    // in the templates of your module. Or you could even pass an argument
    // to the user_menu() function to turn links on/off automatically
    // depending on which function is currently called...
    //
    // But most people will prefer to specify all this manually in each
    // blocklayout template anyway :-)

    // Return the array containing the menu configuration
    return $menu;
}

?>


Directory filter : [ all ] / postnuke_official / html / modules / groups [ view in CVS ]

View Statistics - Next Notice - Previous Notice


Visit Developer Site - Browse CVS Repository Syndicate via backend.rss
(max. once per hour please)
Powered by CVSNotice 0.1.3