| Server IP : 103.48.194.25 / Your IP : 216.73.216.74 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 8.2.20 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/zomuaban.com/public_html/site/libraries/ |
Upload File : |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Module {
public $modName;
public $allow;
public function __construct() { }
public function init($conf, $modName) {
$this->modName = $modName;
if (!isset($conf)) {
$this->allow == false;
}else{
$allowWeb = $conf[0];
$allowMob = $conf[1];
# Check xem được phép hiển thị hay không
if (isMobile()) {
if ($allowMob == 'all')$this->allow = true;
else if ($allowMob == 'none')$this->allow = false;
else $this->allow = $allowMob === get_my_role();
}else {
if ($allowWeb == 'all')$this->allow = true;
else if ($allowWeb == 'none')$this->allow = false;
else $this->allow = $allowWeb === get_my_role();
}
}
}
public function getBlock($blockName, $data = null, $render = true) {
# Nếu cho phép thì mới tính tới việc hiển thị trên pc - tablet
if ($this->allow) {
$CI = & get_instance();
$path = $CI->moduleFolder.$this->modName.'/'.$blockName;
return getView( $path, $data, $render);
}else {
return false;
}
}
}