當前位置: 首頁>>代碼示例>>PHP>>正文


PHP asset::build_history方法代碼示例

本文整理匯總了PHP中asset::build_history方法的典型用法代碼示例。如果您正苦於以下問題:PHP asset::build_history方法的具體用法?PHP asset::build_history怎麽用?PHP asset::build_history使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在asset的用法示例。


在下文中一共展示了asset::build_history方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _message

 private static function _message($id, $data, $fields, $table)
 {
     $sgsml = new sgsml($data["folder"], "display", array($id), false);
     $message = $sgsml->att["MODULENAME"] . "\n";
     $message .= str_repeat("-", strlen($message) - 1) . "\n\n";
     foreach ($data as $key => $value) {
         if (strlen($value) == 0 or !in_array($key, $fields)) {
             continue;
         }
         $value = trim(asset::build_history($sgsml->fields[$key]["SIMPLE_TYPE"], $value, ""));
         if ($value != "") {
             $message .= $sgsml->fields[$key]["DISPLAYNAME"] . ": " . $value . "\n";
         }
     }
     $url = "http" . (sys_https() ? "s" : "") . "://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER["SCRIPT_NAME"]) . "/index.php?view=details&find=" . $table . "|" . $id;
     return $message . "\n{t}Details{/t}: " . $url;
 }
開發者ID:drognisep,項目名稱:Simple-Groupware,代碼行數:17,代碼來源:notify.php

示例2: build_history

 function build_history($new_data, $old_data)
 {
     $cdata = "";
     $cfields = array();
     $no_history = array("created", "createdby", "lastmodified", "lastmodifiedby", "history", "notification_summary", "dsize", "id");
     foreach ($new_data as $data_key => $data_value) {
         $field = $this->fields[$data_key];
         if (isset($old_data[$data_key]) and strcmp(trim($old_data[$data_key], "|"), trim($data_value, "|")) == 0) {
             unset($new_data[$data_key]);
             continue;
         }
         if (in_array($data_key, $no_history)) {
             continue;
         }
         if (isset($field["SIMPLE_TYPE"]) and (strlen($data_value) > 0 or !empty($old_data[$data_key]))) {
             $data_value = asset::build_history($field["SIMPLE_TYPE"], $data_value, @$old_data[$data_key]);
         }
         if (!empty($field["NO_SEARCH_INDEX"])) {
             $data_value = "";
         }
         if (!empty($field["DISPLAYNAME"])) {
             $key = $field["DISPLAYNAME"];
         } else {
             $key = $data_key;
         }
         if (trim($data_value) != "") {
             $cdata .= $key . ": " . $data_value . "\n";
         }
         $cfields[] = $key;
     }
     $new_data["history"] = str_replace("@fields@", implode(", ", $cfields), $new_data["history"]) . $cdata . "\n";
     return $new_data;
 }
開發者ID:drognisep,項目名稱:Simple-Groupware,代碼行數:33,代碼來源:sgsml.php


注:本文中的asset::build_history方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。