Beispiel #1
0
function AddMenu($mysqli)
{
    if (!empty($_GET['p'])) {
        $query = $mysqli->query("SELECT * FROM menu_items WHERE name = '" . $_GET['p'] . "'");
        if (!($row = $query->fetch_array(MYSQLI_BOTH))) {
            AddMenuItem($mysqli);
        } else {
            echo "Item Already Exists";
        }
    } else {
        echo "Please Enter a Menu Item Name";
    }
}
Beispiel #2
0
 public function Add($text, $column, $flags = ROW_NOACTION, $action = null)
 {
     $row = AddMenuItem($this->id, $column, $text);
     if ($column == 0) {
         if ($flags & ROW_DISABLED) {
             DisableMenuRow($this->id, $row);
         }
         if ($flags & ROW_NAVIGATE && !$action instanceof Menu) {
             echo "WARNING! Adding a navigation row '{$text}' for menu '{$this->title}' referencing to a non menu. Setting to ROW_NOACTION";
             $flags = ROW_NOACTION;
         }
         if ($flags & ROW_ACTION && $action == null) {
             echo "WARNING! Adding an action row '{$text}' for menu '{$this->title}' with a null action. Setting to ROW_NOACTION";
             $flags = ROW_NOACTION;
         }
         $this->rows[$row] = $flags & ~ROW_DISABLED;
         $this->rownames[$row] = $text;
         $this->actions[$row] = $action;
     }
 }