本文整理汇总了PHP中Companies::actionMapping方法的典型用法代码示例。如果您正苦于以下问题:PHP Companies::actionMapping方法的具体用法?PHP Companies::actionMapping怎么用?PHP Companies::actionMapping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Companies
的用法示例。
在下文中一共展示了Companies::actionMapping方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isModuleActionPermitted
public function isModuleActionPermitted($module = false, $action = false)
{
if ($module === false && isset($_REQUEST["m"])) {
$module = $_REQUEST["m"];
}
if ($action === false && isset($_REQUEST["a"])) {
$action = $_REQUEST["a"];
}
/**
* if module not set, it is home module. It is allowed
*/
if ($module === false) {
return true;
}
$data_item_type = 0;
$actionMapping = array();
switch ($module) {
case 'candidates':
$data_item_type = 100;
$actionMapping = Candidates::actionMapping();
break;
case 'companies':
$data_item_type = 200;
$actionMapping = Companies::actionMapping();
break;
case 'contacts':
$data_item_type = 300;
$actionMapping = Contacts::actionMapping();
break;
case 'joborders':
$data_item_type = 400;
$actionMapping = JobOrders::actionMapping();
break;
}
/**
* if $data_item_type is 0, it indicates other modules. so it is allowed
*/
if ($data_item_type <= 0) {
return true;
}
$modulePermission = isset($this->permission[$data_item_type]) ? $this->permission[$data_item_type] : array();
/**
* checks whether any one operation is allowed
*/
$isModulePermited = false;
if ($modulePermission) {
foreach ($modulePermission as $operation => $permission) {
if ($permission > 0) {
$isModulePermited = true;
break;
}
}
}
/**
* since all the operation is not allowed, don't allow
*/
if ($isModulePermited === false) {
return false;
}
/**
* if $action is false, check whether default action exist in action mapping
*/
if ($action === false) {
if (isset($actionMapping["default"])) {
$action = $actionMapping["default"];
}
}
if (!isset($actionMapping[$action])) {
return true;
}
$operation = $actionMapping[$action];
/**
* if the action allowed
*/
if (isset($modulePermission[$operation]) && $modulePermission[$operation] > 0) {
return true;
}
return false;
}
示例2: ob_start
<?php
//trace("======");
/*
* CandidATS
* Sites Management
*
* Copyright (C) 2014 - 2015 Auieo Software Private Limited, Parent Company of Unicomtech.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
ob_start();
TemplateUtility::printHeader('Company - '.$this->data['name'], array( 'js/sorttable.js', 'js/attachment.js'));
$AUIEO_HEADER= ob_get_clean();
$objRole=Users::getInstance()->getRole();
$allowDelete=$objRole->getModulePermission(200, Companies::actionMapping("delete"));
$allowEdit=$objRole->getModulePermission(200, Companies::actionMapping("edit"));
$AUIEO_CONTENT="";
ob_start();
?>
<p class="note">Company Details</p>
<table class="detailsOutside" width="100%">
<tr style="vertical-align:top;">
<td width="50%" height="100%">
<table class="detailsInside" height="100%">
<tr>
<td class="vertical">Name:</td>
<td class="data">