Ejemplo n.º 1
0
 public static function GetByAssoc($values)
 {
     $item = new ModuleMenuItem();
     $item->ID = $values["menuitem_ID"];
     $item->Title = $values["menuitem_Title"];
     $item->Description = $values["menuitem_Description"];
     $item->TargetURL = $values["menuitem_TargetURL"];
     $item->TargetScript = $values["menuitem_TargetScript"];
     if ($values["menuitem_ParentMenuItemID"] != null) {
         $item->ParentMenuItem = ModuleMenuItem::GetByAssoc($values["menuitem_ParentMenuItemID"]);
     }
     return $item;
 }
Ejemplo n.º 2
0
 /**
  * Gets the main menu items associated with this Module.
  * @return array The main menu items associated with this Module.
  */
 public function GetMainMenuItems()
 {
     global $MySQL;
     $query = "SELECT * FROM " . System::$Configuration["Database.TablePrefix"] . "ModuleMenuItems WHERE menuitem_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[] = ModuleMenuItem::GetByAssoc($values);
     }
     return $retval;
 }