public function ToJSON() { $json = "{"; $json .= "\"Left\": " . $this->Left . ","; $json .= "\"Top\": " . $this->Top . ","; $json .= "\"Width\": " . $this->Width . ","; $json .= "\"Height\": " . $this->Height . ","; $json .= "\"Target\": " . \JH\Utilities::JavaScriptEncode($this->Target, "\"") . ","; $json .= "\"TargetType\": "; switch ($this->TargetType) { case PlaceHotspotTargetType::URL: $json .= "PlaceHotspotTargetType.URL"; break; case PlaceHotspotTargetType::Script: $json .= "PlaceHotspotTargetType.Script"; break; case PlaceHotspotTargetType::Place: $json .= "PlaceHotspotTargetType.Place"; break; default: $json .= "PlaceHotspotTargetType.Unknown"; break; } $json .= "}"; return $json; }
public function ToJSON() { $json = "{"; $json .= "\"ID\":" . $this->ID . ","; $json .= "\"Name\":\"" . \JH\Utilities::JavaScriptEncode($this->Name, "\"") . "\","; $json .= "\"Title\":\"" . \JH\Utilities::JavaScriptEncode($this->Title, "\"") . "\","; $json .= "\"Creator\":" . $this->Creator->ToJSON() . ","; $json .= "\"Description\":\"" . \JH\Utilities::JavaScriptEncode($this->Description, "\"") . "\","; $json .= "\"TimestampCreated\":\"" . $this->TimestampCreated . "\""; $json .= "}"; return $json; }
public function ToJSON() { $json = "{"; $json .= "\"ID\": " . $this->ID . ", "; $json .= "\"Name\": \"" . \JH\Utilities::JavaScriptEncode($this->Name) . "\", "; $json .= "\"Title\": \"" . \JH\Utilities::JavaScriptEncode($this->Title) . "\", "; $json .= "\"Description\": \"" . \JH\Utilities::JavaScriptEncode($this->Description) . "\", "; if ($this->Creator == null) { $json .= "\"CreationUser\": null, "; } else { $json .= "\"CreationUser\": " . $this->Creator->ToJSON() . ", "; } $json .= "\"CreationDate\": \"" . $this->DateCreated->ToJSON() . "\""; $json .= "}"; return $json; }
public function ToJSON() { $json = "{"; $json .= "\"ID\": " . $this->ID . ","; $json .= "\"Name\": \"" . \JH\Utilities::JavaScriptEncode($this->Name, "\"") . "\","; $json .= "\"Title\": \"" . \JH\Utilities::JavaScriptEncode($this->Title, "\"") . "\","; $json .= "\"Description\": \"" . \JH\Utilities::JavaScriptEncode($this->Description, "\"") . "\","; $json .= "\"Enabled\": " . ($this->Enabled ? "true" : "false") . ","; $json .= "\"Capacity\": " . $this->Capacity; $json .= "}"; return $json; }
/** * Gets the JSON representation of this object for use in AJAX calls. * @return string The JSON representation of this object. */ public function ToJSON() { $json = ""; $json .= "{ "; $json .= "\"ID\": " . $this->ID . ", "; $json .= "\"URL\": \"" . \JH\Utilities::JavaScriptEncode($this->URL, "\"") . "\", "; $json .= "\"Description\": \"" . \JH\Utilities::JavaScriptEncode($this->Description, "\"") . "\", "; // $json .= "\"Status\": " . $this->Status . ", "; $json .= "\"BeginTimestamp\": \"" . $this->BeginTimestamp . "\", "; $json .= "\"EndTimestamp\": \"" . $this->EndTimestamp . "\""; $json .= " }"; return $json; }
public function ToJSON() { $json = "{"; $json .= "\"ID\": " . $this->ID . ","; $json .= "\"Name\": \"" . \JH\Utilities::JavaScriptEncode($this->Name) . "\","; $json .= "\"Title\": \"" . \JH\Utilities::JavaScriptEncode($this->Title) . "\""; $json .= "}"; return $json; }
$item = $items[$i]; $displayName = $item->DisplayName == null ? $item->UserName : $item->DisplayName; $results[] = new SearchResult($displayName, "", "User", "~/users/modify/" . $item->ID); } $realResults = array(); $count = count($results); for ($i = 0; $i < $count; $i++) { $item = $results[$i]; if (strpos(strtolower($item->Title), strtolower($query)) === false) { continue; } $realResults[] = $item; } echo "{ "; echo "\"result\": \"success\", "; echo "\"items\": [ "; $count = count($realResults); for ($i = 0; $i < $count; $i++) { $item = $realResults[$i]; echo "{ "; echo "\"Title\": \"" . \JH\Utilities::JavaScriptEncode($item->Title, "\"") . "\", "; echo "\"Description\": \"" . \JH\Utilities::JavaScriptEncode($item->Description, "\"") . "\", "; echo "\"Subtitle\": \"" . \JH\Utilities::JavaScriptEncode($item->Type, "\"") . "\", "; echo "\"TargetURL\": \"" . \JH\Utilities::JavaScriptEncode(System::ExpandRelativePath($item->TargetURL), "\"") . "\""; echo " }"; if ($i < $count - 1) { echo ", "; } } echo " ]"; echo " }";
/** * Gets the JSON representation of this object for use in AJAX calls. * @return string The JSON representation of this object. */ public function ToJSON() { $json = ""; $json .= "{"; $json .= "\"ID\":" . $this->ID . ","; $json .= "\"Title\":\"" . \JH\Utilities::JavaScriptEncode($this->Title, "\"") . "\","; $json .= "\"Description\":\"" . \JH\Utilities::JavaScriptEncode($this->Description, "\"") . "\","; $json .= "\"HostName\":\"" . \JH\Utilities::JavaScriptEncode($this->HostName, "\"") . "\""; $json .= "}"; return $json; }
/** * Gets the JSON representation of this object for use in AJAX calls. * @return string The JSON representation of this object. */ public function ToJSON() { $json = ""; $json .= "{ "; $json .= "\"ID\": " . $this->ID . ", "; // $json .= "\"Tenant\": " . $this->Tenant->ToJSON() . ", "; // $json .= "\"Module\": " . $this->Module->ToJSON() . ", "; $json .= "\"ParentObject\": " . ($this->ParentObject == null ? "null" : $this->ParentObject->ToJSON()) . ", "; $json .= "\"Name\": \"" . \JH\Utilities::JavaScriptEncode($this->Name, "\"") . "\""; $json .= " }"; return $json; }