本文整理汇总了PHP中Folder::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::__construct方法的具体用法?PHP Folder::__construct怎么用?PHP Folder::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Folder
的用法示例。
在下文中一共展示了Folder::__construct方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Group
/**
* @param integer $folder_id
*/
function __construct($folder_id)
{
global $user;
if (is_numeric($folder_id)) {
parent::__construct($folder_id);
$this->group_folder = new FolderIsGroupFolder_Access($folder_id);
$this->group_id = $this->group_folder->get_group_id();
$group = new Group($this->group_id);
if ($group->is_user_in_group($user->get_user_id()) == true) {
if ($this->read_access == false) {
$this->data_entity_permission->set_read_permission();
if ($this->data_entity_permission->is_access(1)) {
$this->read_access = true;
}
}
if ($this->write_access == false) {
$this->data_entity_permission->set_write_permission();
if ($this->data_entity_permission->is_access(2)) {
$this->write_access = true;
}
}
}
} else {
parent::__construct(null);
$this->group_folder = null;
$this->group_id = null;
}
}
示例2: OrganisationUnit
/**
* @param integer $folder_id
*/
function __construct($folder_id)
{
if (is_numeric($folder_id)) {
global $user;
parent::__construct($folder_id);
$this->organisation_unit_folder = new FolderIsOrganisationUnitFolder_Access($folder_id);
$this->organisation_unit_id = $this->organisation_unit_folder->get_organisation_unit_id();
$organisation_unit = new OrganisationUnit($this->organisation_unit_id);
if ($organisation_unit->is_user_in_organisation_unit($user->get_user_id()) == true or $organisation_unit->is_leader_in_organisation_unit($user->get_user_id()) == true or $organisation_unit->is_owner_in_organisation_unit($user->get_user_id()) == true or $organisation_unit->is_quality_manager_in_organisation_unit($user->get_user_id()) == true) {
if ($this->read_access == false) {
$this->data_entity_permission->set_read_permission();
if ($this->data_entity_permission->is_access(1)) {
$this->read_access = true;
}
}
if ($this->write_access == false) {
$this->data_entity_permission->set_write_permission();
if ($this->data_entity_permission->is_access(2)) {
$this->write_access = true;
}
}
}
} else {
parent::__construct(null);
$this->organisation_unit_folder = null;
$this->organisation_unit_id = null;
}
}
示例3: __construct
/**
* TemporaryFolder constructor.
*/
public function __construct()
{
$path = TMP;
$path .= Security::hash(mt_rand() . microtime(), 'md5');
//$mode = '0775'; // ε( v ゚ω゚) <パーミッションいくつが適切だ?
$mode = false;
// とりあえずデフォルトのまま
register_shutdown_function(array($this, 'delete'));
parent::__construct($path, true, $mode);
}
示例4:
/**
* @param integer $folder_id
*/
function __construct($folder_id)
{
if (is_numeric($folder_id)) {
parent::__construct($folder_id);
$this->user_folder = new FolderIsUserFolder_Access($folder_id);
$this->user_id = $this->user_folder->get_user_id();
} else {
parent::__construct(null);
$this->user_folder = null;
$this->user_id = null;
}
}
示例5:
/**
* @param integer $folder_id
*/
function __construct($folder_id)
{
if (is_numeric($folder_id)) {
parent::__construct($folder_id);
$this->data_entity_permission->set_read_permission();
if ($this->data_entity_permission->is_access(1)) {
$this->read_access = true;
}
} else {
parent::__construct(null);
}
}
示例6:
/**
* @param integer $folder_id
*/
function __construct($folder_id)
{
if (is_numeric($folder_id)) {
parent::__construct($folder_id);
$this->project_status_folder = new ProjectStatusHasFolder_Access($folder_id);
$this->project_status_id = $this->project_status_folder->get_project_status_id();
$this->project_id = $this->project_status_folder->get_project_id();
} else {
parent::__construct(null);
$this->project_status_folder = null;
$this->project_status_id = null;
$this->project_id = null;
}
}
示例7: SampleSecurity
/**
* @param integer $folder_id
*/
function __construct($folder_id)
{
global $user;
if (is_numeric($folder_id)) {
parent::__construct($folder_id);
$this->sample_folder = new SampleHasFolder_Access($folder_id);
$this->sample_id = $this->sample_folder->get_sample_id();
if ($this->sample_id) {
$sample_security = new SampleSecurity($this->sample_id);
if ($this->get_automatic == false) {
$permission_bin = decbin($this->get_permission());
$permission_bin = str_pad($permission_bin, 16, "0", STR_PAD_LEFT);
$permission_bin = strrev($permission_bin);
}
// Read-Access
if ($this->get_automatic() == true) {
if ($sample_security->is_access(1, false)) {
$this->read_access = true;
} else {
$this->read_access = false;
}
} else {
if ($permission_bin[8] == "1" and $sample_security->is_access(1, false)) {
$this->read_access = true;
} else {
$this->read_access = false;
}
}
// Write-Access
if ($this->get_automatic() == true) {
if ($sample_security->is_access(2, false)) {
$this->write_access = true;
} else {
$this->write_access = false;
}
} else {
if ($permission_bin[9] == "1" and $sample_security->is_access(2, false)) {
$this->write_access = true;
} else {
$this->write_access = false;
}
}
// Delete-Access
if ($user->is_admin() == true) {
if ($sample_security->is_access(5, false)) {
$this->delete_access = true;
} else {
$this->delete_access = false;
}
} else {
if ($permission_bin[10] == "1" and $user->is_admin() == true) {
$this->delete_access = true;
} else {
$this->delete_access = false;
}
}
// Control-Access
if ($user->is_admin() == true) {
if ($sample_security->is_access(7, false)) {
$this->control_access = true;
} else {
$this->control_access = false;
}
} else {
if ($permission_bin[11] == "1" and $user->is_admin() == true) {
$this->control_access = true;
} else {
$this->control_access = false;
}
}
}
} else {
parent::__construct(null);
$this->sample_folder = null;
$this->sample_id = null;
}
}
示例8: ProjectSecurity
/**
* @param integer $folder_id
*/
function __construct($folder_id)
{
if (is_numeric($folder_id)) {
parent::__construct($folder_id);
$this->project_folder = new ProjectHasFolder_Access($folder_id);
$this->project_id = $this->project_folder->get_project_id();
if ($this->project_id) {
$project_security = new ProjectSecurity($this->project_id);
if ($this->get_automatic == false) {
$permission_bin = decbin($this->get_permission());
$permission_bin = str_pad($permission_bin, 16, "0", STR_PAD_LEFT);
$permission_bin = strrev($permission_bin);
}
if ($this->read_access == false) {
if ($this->get_automatic() == true) {
if ($project_security->is_access(1, false) or $project_security->is_access(2, false)) {
$this->read_access = true;
}
} else {
if ($permission_bin[8] == "1" and ($project_security->is_access(1, false) or $project_security->is_access(2, false))) {
$this->read_access = true;
}
}
}
if ($this->write_access == false) {
if ($this->get_automatic() == true) {
if ($project_security->is_access(3, false) or $project_security->is_access(4, false)) {
$this->write_access = true;
}
} else {
if ($permission_bin[9] == "1" and ($project_security->is_access(3, false) or $project_security->is_access(4, false))) {
$this->write_access = true;
}
}
}
if ($this->delete_access == false) {
if ($this->get_automatic() == true) {
if ($project_security->is_access(5, false)) {
$this->delete_access = true;
}
} else {
if ($permission_bin[10] == "1" and $project_security->is_access(5, false)) {
$this->delete_access = true;
}
}
}
if ($this->control_access == false) {
if ($this->get_automatic() == true) {
if ($project_security->is_access(7, false)) {
$this->control_access = true;
}
} else {
if ($permission_bin[11] == "1" and $project_security->is_access(7, false)) {
$this->control_access = true;
}
}
}
}
} else {
parent::__construct(null);
$this->project_folder = null;
$this->project_id = null;
}
}