Current File : //root/panel/dryden/ui/tpl/username.class.php
<?php

/**
 * @copyright 2014-2015 Sentora Project (http://www.sentora.org/) 
 * Sentora is a GPL fork of the ZPanel Project whose original header follows:
 *
 * Generic template place holder class.
 * @package zpanelx
 * @subpackage dryden -> ui -> tpl
 * @version 1.0.0
 * @author Bobby Allen (ballen@bobbyallen.me)
 * @copyright ZPanel Project (http://www.zpanelcp.com/)
 * @link http://www.zpanelcp.com/
 * @license GPL (http://www.gnu.org/licenses/gpl.html)
 */
class ui_tpl_username {

    public static function Template() {
        $user_array = ctrl_users::GetUserDetail();
        return $user_array['username'];
    }

}
class ui_tpl_access_module {

    public static function Template() {
		global $zdbh, $controller;
        $line = '';
   $user_array = ctrl_users::GetUserDetail();
	return ctrl_users::GetAccessModule($user_array['userid']);
  
    }
}
class ui_tpl_showreturnadmin{
public static function Template() {
		global $zdbh, $controller;
     if(isset($_SESSION['whmchklogin'])&&($_SESSION['whmchklogin']=="trueset"))
	 {
	 	$returnval='<li class="logout"><a href="./?changepanel=whm" ><span>Go To WHM</span></a></li>'; 
	        return $returnval;
	 }		 
	 else
	 {
		 return "";
	 }
		 
    }	
}

class ui_tpl_showreturnadmin_zmaster{
public static function Template() {
                global $zdbh, $controller;
     if(isset($_SESSION['whmchklogin'])&&($_SESSION['whmchklogin']=="trueset"))
         {
        $returnval='<a href="./?changepanel=whm" style="
    display: block;
    color: #000;
    background: #FFF;
    width: 157px;
    margin: 20px auto;
    padding: 5px;
    border-radius: 10px 10px 10px 10px;
    -moz-border-radius: 10px 10px 10px 10px;
    -webkit-border-radius: 10px 10px 10px 10px;
    border: 0px solid #000000;"
        >Return to WHM Panel</a>';
        return  $returnval;
         }
         else
         {
                 return "";
         }


    }
}

class ui_tpl_whm_top_right_data {
    public static function Template() 
    {
        global $zdbh, $controller;
        $hrpanel_version = ctrl_options::GetSystemOption('dbversion');
        $text_one = strtoupper(shell_exec("lsb_release -d | awk '{print $2}'"));
        $text_two = strtoupper(shell_exec("lsb_release -d | awk '{print $3}'"));
        $text_three = shell_exec("lsb_release -d | awk '{print $5}'");
        $text_four = shell_exec("lsb_release -d | awk '{print $6}'");
        $centos_version = "$text_one $text_two $text_three $text_four";
        $server_load_data = sys_getloadavg();
        $server_load = implode(" ", $server_load_data);
        $return = '<div class="top-each-data">'.$centos_version.'</div>
                    <div class="top-each-data">WHM '.$hrpanel_version.'</div>
                    <div class="top-each-data">Load Average: '.$server_load.'</div>';
        return $return;
    }
}

class ui_tpl_wpm_modulelist2column {

    public static function Template() {
        global $zdbh,$controller;
		static $reseller_add;
if (!$controller->GetControllerRequest('URL', 'module')) {
	// $sql_for_models=" Select * from x_modules where mo_enabled_en='true' And mo_category_fk NOT IN ('5','8') Order By mo_name_vc Asc";
	$sql_for_models='SELECT  DISTINCT a.* FROM `x_modules` a,`x_permissions` b  WHERE a.`mo_enabled_en` = "true" AND b.pe_module_fk=a.mo_id_pk AND b.pe_group_fk=1 Order By a.mo_name_vc Asc'; 
$sql = $zdbh->prepare($sql_for_models);
    $sql->execute();
	$line="";
	
	  $line .= '<div id="sortable-with-handles" class="sortable grid ">';
	  
	  /* /////////////////////////////////// Add Account and List Account Start //////////////////////////////////// */
	  
	  				$line.='<div class="each-module-block"><a href="/?module=manage_clients&show=list" class="show_module_div">';
						$translatename = "List Accounts";
						//$cleanname = str_replace(" ", "ZP(br)", $translatename);
						$cleanname = $translatename;

						// Check is User Style Module Icon Exist
					

						//$icon = 'modules/' . $mod['mo_folder_vc'] . '/assets/icon.png';
						if (file_exists('etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/manage_clients/assets/list-accounts.png')) {
					    	$icon = 'etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/manage_clients/assets/list-accounts.png';	
						}
						if (file_exists('etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/manage_clients/assets/list-accounts.jpg')) {
						    $icon = 'etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/manage_clients/assets/list-accounts.jpg';	
						}
						

					$line .= '<img src="' .$icon. '" border="0">';
						$line .= '                      <br />';
						$line .= '<: ' . $cleanname . ' :>';
						$line.='</a></div>';
					
						$line.='<div class="each-module-block"><a href="/?module=manage_clients&show=create" class="show_module_div">';
						$translatename = "Create Account";
						//$cleanname = str_replace(" ", "ZP(br)", $translatename);
						$cleanname = $translatename;

						// Check is User Style Module Icon Exist
					

						//$icon = 'modules/' . $mod['mo_folder_vc'] . '/assets/icon.png';
						if (file_exists('etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/manage_clients/assets/create-accounts.png')) 
                        {
	    					$icon = 'etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/manage_clients/assets/create-accounts.png';	
						}
						if (file_exists('etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/manage_clients/assets/create-accounts.jpg')) 
                        {
    						$icon = 'etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/manage_clients/assets/create-accounts.jpg';	
						}
						

					$line .= '<img src="' .$icon. '" border="0">';
						$line .= '                      <br />';
						$line .= '<: ' . $cleanname . ' :>';
						$line.='</a></div>';
						
	  
	  /* /////////////////////////////////// Add Account and List Account End //////////////////////////////////// */
	  
			while($mod= $sql->fetch())
			{
					$flag=1;
					#if($mod['mo_id_pk']==76 ||$mod['mo_id_pk']==77 )
					#$flag=0;
					if($mod['mo_category_fk']=="6")
					{
						$flag=0;
						if($mod['mo_folder_vc']=="maillog")
						{
							$flag=1;
						}
					}
					if($mod['mo_category_fk']=="4")
					{
						$flag=0;
						if($mod['mo_folder_vc']=="phpmyadmin")
						{
							$flag=1;
						}
					}
					              if($mod['mo_id_pk']==76 ||$mod['mo_id_pk']==77 )
		                                       $flag=0;

                   if($flag){				
	
						$line.='<div class="each-module-block"><a href="?module=' . $mod['mo_folder_vc'] . '" class="show_module_div">';
						$translatename = $mod['mo_name_vc'];
						//$cleanname = str_replace(" ", "ZP(br)", $translatename);
						$cleanname = $translatename;

						// Check is User Style Module Icon Exist
						if (file_exists('etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/'.$mod['mo_folder_vc'].'/assets/icon.png')) 
                        {
    						$icon = 'etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/'.$mod['mo_folder_vc'].'/assets/icon.png';
						} 
                        else if(file_exists('etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/'.$mod['mo_folder_vc'].'/assets/icon.jpg'))
                        {
                            $icon = 'etc/styles/' . ui_template::GetUserTemplate() . '/img/modules/'.$mod['mo_folder_vc'].'/assets/icon.jpg';    
                        }
                        else 
                        {
                            $icon = null; 
						}

					$line .= '<img src="' .$icon. '" border="0">';
						$line .= '                      <br />';
						$line .= '<: ' . $cleanname . ' :>';
						$line.='</a></div>';			
					}
			}	
			$line.='</div>';
return $line;	
}else
	{
		return "";
	}		
    }
	
}
class ui_tpl_home {

    public static function Template() {
          global $zdbh,$controller;
		
if ($controller->GetControllerRequest('URL', 'module')) {
return "";
}else
{
	return "home_left";
}
    }

}

class ui_tpl_modulelistzsidebar {
static $reseller_add;
    public static function Template() {
        $line = '';
        $modcats = ui_moduleloader::GetModuleCats();

        foreach ($modcats as $modcat) {
		//$blacklist=array('5','6','8','9');
		// $blacklist=array('5','8');
		$blacklist=array();
		
		if(!in_array($modcat['mc_id_pk'],$blacklist))	
		{
            $mods = ui_moduleloader::GetModuleList($modcat['mc_id_pk'], 'modadmin');
				
					
            if ($mods) {
                $line .= '<li>';
                $line .= '<div class="heading list-arrow-right">' .$modcat['mc_name_vc']. ' <span class="open"></span></div>';
                $line .= '<ul>';
				$reseller_add=0;
                foreach ($mods as $mod) {
					
					
				
				
					$flag=1;
				
					if($mod['mo_category_fk']=="7" && $reseller_add==0)
					{
		
                    $line .= '<li>';
					$line .= '<a href="/?module=manage_clients&show=list">';
                    $line .= '<: List Accounts :>';
                    $line .= '</a>';
                    $line .= '</li>';
					
					
                    $line .= '<li>';
					$line .= '<a href="/?module=manage_clients&show=create">';
                    $line .= '<: Create Account :>';
                    $line .= '</a>';
                    $line .= '</li>';
					
					$reseller_add=1;	
					}
					if($mod['mo_category_fk']=="6")
					{
						$flag=0;
						if($mod['mo_folder_vc']=="maillog")
						{
							$line .= 'Hai';
							$flag=1;
						}
					}
					if($mod['mo_category_fk']=="4")
					{
						$flag=0;
						if($mod['mo_folder_vc']=="phpmyadmin")
						{
							$flag=1;
						}
					}
				
                   if($flag){	
                    $class_name = str_replace(array(' ', '_'), '-', strtolower($mod['mo_folder_vc']));
                    $line .= '<li>';
                    
                   /* if ($mod['mo_installed_ts'] != 0) {
                        $line .= '<a href="?module=' . $mod['mo_folder_vc']. '"><i class="icon-' . $class_name . ' greyscale transparent"><img src="/modules/' . $mod['mo_folder_vc'] . '/assets/icon.png" height="16px" width="16px"></i> ';
                    } else {
                        $line .= '<a href="?module=' . $mod['mo_folder_vc']. '"><i class="icon-'.$class_name.'"></i> ';
                    } */
					$line .= '<a href="?module=' . $mod['mo_folder_vc']. '">';
                    $line .= '<: '.$mod['mo_name_vc'].' :>';
                    $line .= '</a>';
                    $line .= '</li>';
				   }
                }
                $line .= '</ul></li>';
            }
        }
	
	}
        return $line;
    }

}

?>