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