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


PHP Utility::convertCheckBoxValue方法代码示例

本文整理汇总了PHP中Utility::convertCheckBoxValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::convertCheckBoxValue方法的具体用法?PHP Utility::convertCheckBoxValue怎么用?PHP Utility::convertCheckBoxValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utility的用法示例。


在下文中一共展示了Utility::convertCheckBoxValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addGroupItem

 public static function addGroupItem($groupId, $objectId, $provide, $subscribe, $add, $update, $delete, $request, $respond)
 {
     //$db = ZitDBAdapter::getDBAdapter();
     $db = Zend_Registry::get('my_db');
     $data = array(DBConvertor::convertCase('object_id') => $objectId, DBConvertor::convertCase('can_provide') => Utility::convertCheckBoxValue($provide), DBConvertor::convertCase('can_subscribe') => Utility::convertCheckBoxValue($subscribe), DBConvertor::convertCase('can_add') => Utility::convertCheckBoxValue($add), DBConvertor::convertCase('can_update') => Utility::convertCheckBoxValue($update), DBConvertor::convertCase('can_delete') => Utility::convertCheckBoxValue($delete), DBConvertor::convertCase('can_request') => Utility::convertCheckBoxValue($request), DBConvertor::convertCase('can_respond') => Utility::convertCheckBoxValue($respond), DBConvertor::convertCase('group_permission_id') => $groupId);
     if ($db->insert(DBConvertor::convertCase('group_permission_item'), $data)) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:Koulio,项目名称:OpenZIS,代码行数:11,代码来源:GroupPermissionItem.php

示例2: savenewpermissionAction

 public function savenewpermissionAction()
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         Zend_Session::regenerateId();
         if (!$this->getRequest()->isXmlHttpRequest()) {
             $this->view->msg = 'Not Ajax Request';
             $this->_forward('error', 'error');
         } else {
             $filterChain = new Zend_Filter();
             $filterChain->addFilter(new Zend_Filter_Digits());
             $default = null;
             $zoneId = $filterChain->filter($_POST['ZONE_ID']);
             $contextId = $filterChain->filter($_POST['CONTEXT_ID']);
             $agentId = $filterChain->filter($_POST['AGENT_ID']);
             $dataObjectId = $filterChain->filter($_POST['DATA_OBJECT_ID']);
             $provide = $filterChain->filter(Utility::convertCheckBoxValue(isset($_POST['PROVIDE']) ? $_POST['PROVIDE'] : $default));
             $subscribe = $filterChain->filter(Utility::convertCheckBoxValue(isset($_POST['SUBSCRIBE']) ? $_POST['SUBSCRIBE'] : $default));
             $request = $filterChain->filter(Utility::convertCheckBoxValue(isset($_POST['REQUEST']) ? $_POST['REQUEST'] : $default));
             $respond = $filterChain->filter(Utility::convertCheckBoxValue(isset($_POST['RESPOND']) ? $_POST['RESPOND'] : $default));
             $add = $filterChain->filter(Utility::convertCheckBoxValue(isset($_POST['ADD']) ? $_POST['ADD'] : $default));
             $change = $filterChain->filter(Utility::convertCheckBoxValue(isset($_POST['CHANGE']) ? $_POST['CHANGE'] : $default));
             $delete = $filterChain->filter(Utility::convertCheckBoxValue(isset($_POST['DELETE']) ? $_POST['DELETE'] : $default));
             $validatorChain = new Zend_Validate();
             $validatorChain->addValidator(new Zend_Validate_Digits())->addValidator(new Zend_Validate_Between(array('min' => 0, 'max' => 1)));
             /*
             if (!$validatorChain->isValid($provide) &&
             	!$validatorChain->isValid($subscribe) &&
             	!$validatorChain->isValid($request) &&
             	!$validatorChain->isValid($respond) &&
             	!$validatorChain->isValid($add) &&
             	!$validatorChain->isValid($change) &&
             	!$validatorChain->isValid($delete)
             ) {
             	$this->view->msg = 'Data Validation Error';
             	$this->_forward('error', 'error');			
             }
             */
             $exist = Permission::checkIfPermissionExist($zoneId, $agentId, $contextId, $dataObjectId);
             if ($exist) {
                 $this->view->msg = 'Permission Already Exists';
                 $this->_forward('error', 'error');
             } else {
                 Permission::addPermission($zoneId, $agentId, $contextId, $dataObjectId, $provide, $subscribe, $add, $change, $delete, $request, $respond);
                 $this->render('ajaxsuccessjson');
             }
         }
     } else {
         if (!$this->getRequest()->isXmlHttpRequest()) {
             $this->view->msg = 'Not Ajax Request';
             $this->_forward('error', 'error');
         } else {
             $this->view->msg = 'Invalid User';
             $this->_forward('error', 'error');
         }
     }
 }
开发者ID:Koulio,项目名称:OpenZIS,代码行数:57,代码来源:AgentaccessController.php

示例3: updatePermission

 public static function updatePermission($permissionId, $provide, $subscribe, $add, $update, $delete, $request, $respond)
 {
     $db = Zend_Registry::get('my_db');
     $data = array(DBConvertor::convertCase('can_provide') => Utility::convertCheckBoxValue($provide), DBConvertor::convertCase('can_subscribe') => Utility::convertCheckBoxValue($subscribe), DBConvertor::convertCase('can_add') => Utility::convertCheckBoxValue($add), DBConvertor::convertCase('can_update') => Utility::convertCheckBoxValue($update), DBConvertor::convertCase('can_delete') => Utility::convertCheckBoxValue($delete), DBConvertor::convertCase('can_request') => Utility::convertCheckBoxValue($request), DBConvertor::convertCase('can_respond') => Utility::convertCheckBoxValue($respond));
     $n = $db->update(DBConvertor::convertCase('agent_permissions'), $data, 'permission_id = ' . $permissionId);
 }
开发者ID:Koulio,项目名称:OpenZIS,代码行数:6,代码来源:Permission.php

示例4: updategroupitemAction

 public function updategroupitemAction()
 {
     $auth = Zend_Auth::getInstance();
     $lic = $_REQUEST['lic'];
     if ($lic != $_SESSION['OPENZISKEYHOLE']) {
         $this->view->msg = 'Not Ajax Request';
         $this->_forward('error', 'error');
     } else {
         if ($auth->hasIdentity()) {
             if (!$this->getRequest()->isXmlHttpRequest()) {
                 $this->view->msg = 'Not Ajax Request';
                 $this->_forward('error', 'error');
             } else {
                 Zend_Session::regenerateId();
                 $filterChain = new Zend_Filter();
                 $filterChain->addFilter(new Zend_Filter_StripTags());
                 $filterChain2 = new Zend_Filter();
                 $filterChain2->addFilter(new Zend_Filter_Digits());
                 $itemId = $filterChain2->filter($_POST['ITEM_ID']);
                 $provide = $filterChain2->filter(Utility::convertCheckBoxValue($_POST['PROVIDE']));
                 $subscribe = $filterChain2->filter(Utility::convertCheckBoxValue($_POST['SUBSCRIBE']));
                 $request = $filterChain2->filter(Utility::convertCheckBoxValue($_POST['REQUEST']));
                 $respond = $filterChain2->filter(Utility::convertCheckBoxValue($_POST['RESPOND']));
                 $add = $filterChain2->filter(Utility::convertCheckBoxValue($_POST['ADD']));
                 $change = $filterChain2->filter(Utility::convertCheckBoxValue($_POST['CHANGE']));
                 $delete = $filterChain2->filter(Utility::convertCheckBoxValue($_POST['DELETE']));
                 GroupPermissionItem::updateGroupItem($itemId, $provide, $subscribe, $add, $change, $delete, $request, $respond);
                 $this->render('ajaxsuccessjson');
             }
         } else {
             if (!$this->getRequest()->isXmlHttpRequest()) {
                 $this->view->msg = 'Not Ajax Request';
                 $this->_forward('error', 'error');
             } else {
                 $this->view->msg = 'errors:{reason:"Invalid User"}';
                 $this->_forward('error', 'error');
             }
         }
     }
 }
开发者ID:Koulio,项目名称:OpenZIS,代码行数:40,代码来源:GrouppermissionController.php


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