示例#1
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;
 }
示例#2
0
 /**
  * Gets the ModulePages associated with this Module.
  * @return \PhoenixSNS\Objects\ModulePage[] an array of ModulePages associated with this Module
  */
 public function GetPages()
 {
     global $MySQL;
     $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "ModulePages WHERE modulepage_ModuleID = " . $this->ID;
     $retval = array();
     $result = $MySQL->query($query);
     if ($result === false) {
         return $retval;
     }
     $count = $result->num_rows;
     if ($count == 0) {
         return $retval;
     }
     for ($i = 0; $i < $count; $i++) {
         $values = $result->fetch_assoc();
         $retval[] = ModulePage::GetByAssoc($values);
     }
     return $retval;
 }