Example #1
0
 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;
 }
Example #2
0
 public function ToJSON()
 {
     echo "{";
     echo "\"ID\":" . $this->ID . ",";
     echo "\"Title\":\"" . \JH\Utilities::JavaScriptDecode($this->Title, "\"") . "\",";
     echo "\"Description\":\"" . \JH\Utilities::JavaScriptDecode($this->Description, "\"") . "\"";
     echo "}";
 }
Example #3
0
 public function ToJSON()
 {
     $json = "{";
     $json .= "\"ID\":" . $this->ID . ",";
     $json .= "\"Title\":\"" . \JH\Utilities::JavaScriptDecode($this->Title) . "\",";
     $json .= "\"URL\":\"" . \JH\Utilities::JavaScriptDecode($this->URL) . "\"";
     $json .= "}";
     return $json;
 }
Example #4
0
 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;
 }
Example #5
0
 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;
 }
Example #6
0
 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;
 }
Example #7
0
 /**
  * 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;
 }
Example #8
0
 case "members.rss":
     header("Content-Type: application/rss+xml");
     echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
     echo "<rss version=\"2.0\">\n";
     echo "\t<channel>\n";
     echo "\t\t<title>Members</title>\n";
     echo "\t\t<description>A list of all members in " . System::$Configuration["Application.Name"] . "</description>\n";
     echo "\t\t<link>" . System::ExpandRelativePath("~/") . "</link>\n";
     echo "\t\t<lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000 </lastBuildDate>\n";
     echo "\t\t<pubDate>Mon, 06 Sep 2009 16:20:00 +0000 </pubDate>\n";
     echo "\t\t<ttl>1800</ttl>\n";
     $members = User::Get();
     foreach ($members as $member) {
         echo "\t\t<item>\n";
         echo "\t\t\t<title>" . $member->LongName . "</title>\n";
         echo "\t\t\t<description>" . \JH\Utilities::HtmlEncode($member->ProfileContent->Description) . "</description>\n";
         echo "\t\t\t<link>" . System::ExpandRelativePath("~/community/members/" . $member->ShortName) . "</link>\n";
         // <guid>unique string per item</guid>
         echo "\t\t\t<pubDate>Mon, 06 Sep 2009 16:20:00 +0000 </pubDate>\n";
         echo "\t\t</item>\n";
     }
     echo "\t</channel>\n";
     echo "</rss>";
     return true;
 case "members":
     require "Members/Main.inc.php";
     return true;
 case "groups":
     if (System::$Configuration["Groups.Enabled"]) {
         require "Groups/Main.inc.php";
         return true;
Example #9
0
    $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 " }";
Example #10
0
 public function ToJSON()
 {
     $json = "{";
     $json .= "\"ID\": " . $this->ID . ",";
     $json .= "\"ShortName\": \"" . \JH\Utilities::JavaScriptEncode($this->ShortName) . "\",";
     $json .= "\"LongName\": \"" . \JH\Utilities::JavaScriptEncode($this->LongName) . "\"";
     $json .= "}";
     return $json;
 }
Example #11
0
 /**
  * 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;
 }
Example #12
0
 /**
  * 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;
 }
Example #13
0
 /**
  * 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 . ",";
     if ($this->Module == null) {
         $json .= "\"Module\":null,";
     } else {
         $json .= "\"Module\":" . $this->Module->ToJSON() . ",";
     }
     if ($this->ParentPage == null) {
         $json .= "\"ParentPage\":null,";
     } else {
         $json .= "\"ParentPage\":" . $this->ParentPage->ToJSON() . ",";
     }
     $json .= "\"URL\":\"" . \JH\Utilities::JavaScriptDecode($this->URL, "\"") . "\",";
     $json .= "\"Content\":\"" . \JH\Utilities::JavaScriptDecode($this->Content, "\"") . "\"";
     $json .= "}";
     return $json;
 }