<?php
/**
 * 
 * @file user_relations_edit.php
 * @copyright (c) 2005 - 2011 eifr.com
 * @license http://www.gnu.org/copyleft/gpl.html gnu/gpl
 * eifr is free software
 */

require_once('../../includes/inc_admin.php');
require_once('class_user_relations.php');

$url = 'mod_user_relations/user_relations.php';
Common::checkAdminFileAuth($url); //check file authority

$layout = array();
$layout['menu_nav'] = Common::createAdminMenuNav($url);

function layout_user_relations($uid) {
    global $url, $layout;
    $toolbar = Common::createToolbar($url, 'add', 'user_relations.php');
    $toolbar .= Common::createToolbar($url, 'edit', 'user_relations.php?act=edit');
    $toolbar .= Common::createToolbar($url, 'delete', 'user_relations.php?act=delete&selectid=');

    $layout['toolbar'] = $toolbar;
    $layout['eifr_list'] = ComUserRelations :: getRelationUsersByUid($uid);
} 

$act = kGet('act');

switch ($act) {
    case 'save_add':

        break;
    case 'save_edit':

        break;
    case 'edit':
    case 'add':
    default:
        layout_user_relations(getCookie('uid'));
        require_once(getAdminTemplatePath('user_relations', $url));
        break;
} 

?>