This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/application/classes/URL.php

45 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2014-08-25 04:41:07 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class adds reseller/affilate support
*
* @package OSB
* @category Modifications
* @author Deon George
* @copyright (c) 2014 Deon George
* @license http://dev.osbill.net/license.html
*/
class URL extends lnApp_URL {
// Our method paths for different functions
public static $method_directory = array(
'admin'=>'a',
'reseller'=>'r',
'affiliate'=>'f',
'user'=>'u',
);
public static function navbar() {
$result = array();
foreach (array_reverse(self::$method_directory) as $k=>$v)
switch ($k) {
case 'admin': $result[$k] = array('name'=>'Administrator','icon'=>'fa-globe');
2014-08-25 04:41:07 +00:00
break;
case 'affiliate':
case 'reseller': $result[$k] = array('name'=>'Reseller','icon'=>'fa-dashboard');
2014-08-25 04:41:07 +00:00
break;
2016-01-10 23:09:38 +00:00
case 'user':
if (is_object(Auth::instance()->get_user()))
$result[$k] = array('name'=>Auth::instance()->get_user()->name(),'icon'=>'fa-user');
2014-08-25 04:41:07 +00:00
break;
default: $result[$k] = array('name'=>$k,'icon'=>'fa-question');
2014-08-25 04:41:07 +00:00
}
return $result;
}
}
?>