Esempio n. 1
0
        $sql .= ")";
        $sql .= "values ";
        $sql .= "(";
        $sql .= "'" . $menu_uuid . "', ";
        $sql .= "'{$menu_name}', ";
        $sql .= "'{$menu_language}', ";
        $sql .= "'{$menu_description}' ";
        $sql .= ")";
        $db->exec(check_sql($sql));
        unset($sql);
        //add the menu items
        require_once "resources/classes/menu.php";
        $menu = new menu();
        $menu->db = $db;
        $menu->menu_uuid = $menu_uuid;
        $menu->restore();
        unset($menu);
        if ($display_type == "text") {
            echo "\tMenu:\t\t\tadded\n";
        }
    }
    unset($prep_statement, $sub_result);
}
//if there are no groups listed in v_menu_item_groups then add the default groups
if ($domains_processed == 1) {
    $sql = "SELECT * FROM v_menus ";
    $prep_statement = $db->prepare(check_sql($sql));
    $prep_statement->execute();
    $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
    $result_count = count($result);
    foreach ($result as $field) {
Esempio n. 2
0
 protected function create_menus()
 {
     $this->write_progress("\tCreating menus");
     //set the defaults
     $menu_name = 'default';
     $menu_language = 'en-us';
     $menu_description = 'Default Menu Set';
     $this->write_progress("\tChecking if menu exists");
     $sql = "select count(*) from v_menus ";
     $sql .= "where menu_uuid = '" . $this->menu_uuid . "' ";
     $sql .= "limit 1 ";
     $this->write_debug($sql);
     $prep_statement = $this->dbh->prepare(check_sql($sql));
     $prep_statement->execute();
     $result = $prep_statement->fetch(PDO::FETCH_NAMED);
     unset($sql, $prep_statement);
     if ($result['count'] == 0) {
         $this->write_progress("\t... creating menu '" . $menu_name . "'");
         $sql = "insert into v_menus ";
         $sql .= "(";
         $sql .= "menu_uuid, ";
         $sql .= "menu_name, ";
         $sql .= "menu_language, ";
         $sql .= "menu_description ";
         $sql .= ") ";
         $sql .= "values ";
         $sql .= "(";
         $sql .= "'" . $this->menu_uuid . "', ";
         $sql .= "'{$menu_name}', ";
         $sql .= "'{$menu_language}', ";
         $sql .= "'{$menu_description}' ";
         $sql .= ");";
         if ($this->debug) {
             $this->write_debug($sql . "\n");
         }
         $this->dbh->exec(check_sql($sql));
         unset($sql);
         //add the menu items
         require_once "resources/classes/menu.php";
         $menu = new menu();
         $menu->db = $this->dbh;
         $menu->menu_uuid = $this->menu_uuid;
         $menu->restore();
         unset($menu);
     }
 }