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


PHP FabrikString::safeColnameToArrayKey方法代码示例

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


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

示例1: onCanSelectRow

 function onCanSelectRow($params, $tableModel, $row)
 {
     // If $row is null, we were called from the table's canEdit() in a per-table rather than per-row context,
     // and we don't have an opinion on per-table edit permissions, so just return true.
     if (!is_object($row[0])) {
         return true;
     }
     $field = $params->get('canselectrow_field');
     $field = FabrikString::safeColnameToArrayKey($field);
     // $$$ rob if no can edit field selected in admin return true
     if (trim($field) == '') {
         return true;
     }
     $value = $params->get('canselectrow_value');
     return $row[0]->{$field} == $value;
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:16,代码来源:canselectrow.php

示例2: onCanEdit

 function onCanEdit($params, $tableModel, $row)
 {
     // If $row is null, we were called from the table's canEdit() in a per-table rather than per-row context,
     // and we don't have an opinion on per-table edit permissions, so just return true.
     if (is_null($row) || is_null($row[0])) {
         return true;
     }
     if (is_array($row[0])) {
         $data = JArrayHelper::toObject($row[0]);
     } else {
         $data = $row[0];
     }
     //$field = str_replace('.', '___', $params->get('caneditrow_field'));
     $field = $params->get('caneditrow_field');
     $field = FabrikString::safeColnameToArrayKey($field);
     // $$$ rob if no can edit field selected in admin return true
     if (trim($field) == '') {
         return true;
     }
     // If they provided some PHP to eval, we ignore the other settings and just run their code
     $caneditrow_eval = $params->get('caneditrow_eval', '');
     if (!empty($caneditrow_eval)) {
         $w = new FabrikWorker();
         $data = JArrayHelper::fromObject($data);
         $caneditrow_eval = $w->parseMessageForPlaceHolder($caneditrow_eval, $data);
         $caneditrow_eval = @eval($caneditrow_eval);
         FabrikWorker::logEval($caneditrow_eval, 'Caught exception on eval in can edit row : %s');
         return $caneditrow_eval;
     } else {
         // No PHP given, so just do a simple match on the specified element and value settigns.
         if ($params->get('caneditrow_useraw', '0') == '1') {
             $field .= '_raw';
         }
         $value = $params->get('caneditrow_value');
         return $data->{$field} == $value;
     }
 }
开发者ID:nikshade,项目名称:fabrik21,代码行数:37,代码来源:caneditrow.php


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