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


PHP PluginDatainjectionCommonInjectionLib::getLogLabel方法代码示例

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


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

示例1: prepareLogResults

 /**
  * @param $models_id
  **/
 static function prepareLogResults($models_id)
 {
     $results = Toolbox::stripslashes_deep(json_decode(PluginDatainjectionSession::getParam('results'), true));
     $todisplay = array();
     $model = new self();
     $model->getFromDB($models_id);
     if (!empty($results)) {
         foreach ($results as $result) {
             $tmp = array('line' => $result['line'], 'status' => $result['status'], 'check_sumnary' => PluginDatainjectionCommonInjectionLib::getLogLabel(PluginDatainjectionCommonInjectionLib::SUCCESS), 'check_message' => PluginDatainjectionCommonInjectionLib::getLogLabel(PluginDatainjectionCommonInjectionLib::SUCCESS), 'type' => __('Undetermined', 'datainjection'), 'status_message' => PluginDatainjectionCommonInjectionLib::getLogLabel($result['status']), 'itemtype' => $model->fields['itemtype'], 'url' => '', 'item' => '');
             if (isset($result[PluginDatainjectionCommonInjectionLib::ACTION_CHECK])) {
                 $check_infos = $result[PluginDatainjectionCommonInjectionLib::ACTION_CHECK];
                 $tmp['check_status'] = $check_infos['status'];
                 $tmp['check_sumnary'] = PluginDatainjectionCommonInjectionLib::getLogLabel($check_infos['status']);
                 $tmp['check_message'] = '';
                 $first = true;
                 foreach ($check_infos as $key => $val) {
                     if ($key !== 'status' && $val[0] != PluginDatainjectionCommonInjectionLib::SUCCESS) {
                         $tmp['check_message'] .= ($first ? '' : "\n") . sprintf(__('%1$s (%2$s)'), PluginDatainjectionCommonInjectionLib::getLogLabel($val[0]), $val[1]);
                         $first = false;
                     }
                 }
             }
             //Store the action type (add/update)
             if (isset($result['type'])) {
                 $tmp['type'] = PluginDatainjectionCommonInjectionLib::getActionLabel($result['type']);
             }
             if (isset($result[$model->fields['itemtype']])) {
                 $tmp['item'] = $result[$model->fields['itemtype']];
                 $url = Toolbox::getItemTypeFormURL($model->fields['itemtype']) . "?id=" . $result[$model->fields['itemtype']];
                 $tmp['url'] = "<a href='" . $url . "'>" . $result[$model->fields['itemtype']] . "</a>";
             }
             if ($result['status'] == PluginDatainjectionCommonInjectionLib::SUCCESS) {
                 $todisplay[PluginDatainjectionCommonInjectionLib::SUCCESS][] = $tmp;
             } else {
                 $todisplay[PluginDatainjectionCommonInjectionLib::FAILED][] = $tmp;
             }
         }
     }
     return $todisplay;
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:43,代码来源:model.class.php


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