public function Execute($db, $params)
 {
     $itemID = NULL;
     $ownerID = NULL;
     $fetchFolders = TRUE;
     $fetchItems = TRUE;
     $childrenOnly = TRUE;
     if (!isset($params["ItemID"], $params["OwnerID"]) || !UUID::TryParse($params["ItemID"], $itemID) || !UUID::TryParse($params["OwnerID"], $ownerID)) {
         header("Content-Type: application/json", true);
         echo '{ "Message": "Invalid parameters" }';
         exit;
     }
     if (isset($params["IncludeFolders"])) {
         $fetchFolders = (bool) $params["IncludeFolders"];
     }
     if (isset($params["IncludeItems"])) {
         $fetchItems = (bool) $params["IncludeItems"];
     }
     if (isset($params["ChildrenOnly"])) {
         $childrenOnly = (bool) $params["ChildrenOnly"];
     }
     $this->inventory = new ALT($db);
     // Optimization for inventory skeleton fetching
     if ($itemID == $ownerID && $fetchFolders && !$fetchItems && !$childrenOnly) {
         log_message('debug', 'Doing a FetchSkeleton for ' . $ownerID);
         if ($library = $this->inventory->FetchSkeleton($ownerID)) {
             output_results($library);
             exit;
         } else {
             header("Content-Type: application/json", true);
             echo '{ "Message": "Inventory not found" }';
             exit;
         }
     } else {
         if ($nodes = $this->inventory->FetchDescendants($itemID, $fetchFolders, $fetchItems, $childrenOnly)) {
             output_results($nodes);
             exit;
         } else {
             header("Content-Type: application/json", true);
             echo '{ "Message": "Item or folder not found" }';
             exit;
         }
     }
 }
Esempio n. 2
0
">
        </a>
      <?php 
}
?>

      <div class="bar-link">
        <h2><?php 
echo $table;
?>
</h2>
        <?php 
if ($header['description'] !== '') {
    echo $header['description'];
}
?>
      </div>

      <div class="tiles">
        <?php 
output_results($table, 0, 0, 'tiles', $order_by);
?>
      </div>

  </div>
  <?php 
include 'footer.php';
?>

</body>
</html>
Esempio n. 3
0
output_results('events', 0, 0, 'blocks', 'date');
?>
      </div>

    </section>

    <!-- PROJECTS -->

    <section class="column" id='projects'>
      <a href="<?php 
echo $site_url;
?>
/projects" class="bar-link">
        <h2>
          Projects
        </h2>
      </a>
      <div class='inner-column'>
        <?php 
output_results('projects', 0, 0, 'blocks', 'edited');
?>
      </div>
    </section>

  </div>
  <?php 
include 'footer.php';
?>

</body>
</html>