Example #1
0
             if ($admin->insertNewPage($_POST['name'], $_POST['position'], $_POST['position_item'])) {
                 $success = "Added the page <b>" . $_POST['name'] . "</b> to the site!";
             } else {
                 $error = "Could not add page due to unknown error..";
             }
         }
     } else {
         if (isset($_POST['editpages'])) {
             $pagearray = $admin->getSiteMenuArray(true);
             for ($i = 0;; $i++) {
                 $b = "pages_" . $i;
                 if (!isset($_POST[$b])) {
                     break;
                 }
                 if (isset($_POST[$b]['remove']) && $_POST[$b]['remove'] == "remove") {
                     $admin->removePage($_POST[$b]['id']);
                     $success .= "<br />removed the page " . $_POST[$b]['name'];
                     continue;
                 }
                 if (isset($_POST[$b]['name']) && $_POST[$b]['name'] != $pagearray[$i]['name'] && $_POST[$b]['name'] != "") {
                     $admin->updatePage($_POST[$b]['id'], $_POST[$b]['name']);
                     $success .= "changed page <b>" . $pagearray[$i]['name'] . "</b> name to <b>" . $_POST[$b]['name'] . "</b><br />";
                 }
             }
         }
     }
 }
 $pagearray = $admin->getSiteMenuArray(true);
 $pages = "";
 foreach ($pagearray as $v) {
     $pages .= "\n                <option value='" . $v['sort'] . "'>" . $v['name'] . "</option>\n";