当前位置: 首页>>代码示例>>PHP>>正文


PHP Companies::actionMapping方法代码示例

本文整理汇总了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;
 }
开发者ID:Hassanj343,项目名称:candidats,代码行数:79,代码来源:PRGManagement.php

示例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">
开发者ID:Hassanj343,项目名称:candidats,代码行数:30,代码来源:Show.php


注:本文中的Companies::actionMapping方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。