foreach ($pagearray as $v) { $pages .= "\n <option value='" . $v['id'] . "'>" . $v['name'] . "</option>\n"; } $typearray = $admin->getContentTypesArray(); $types = ""; foreach ($typearray as $v) { $types .= "\n <option value='" . $v['type'] . "'>" . $v['name'] . "</option>\n"; } $contents = ""; foreach ($pagearray as $v) { $contentsarray = $admin->getContentsFromPage($v['id']); $contents .= "\n <fieldset class=\"field_set margin_15\">\n <legend>" . $v['name'] . "</legend>\n "; $notempty = false; foreach ($contentsarray as $p) { $notempty = true; $contents .= "\n\n <div class=\"field_set padding_5 margin_10\">\n <label>Name: </label><span class=\"blue\">" . $p['name'] . "</span> \n <label>Type: </label><span class=\"green\">" . $admin->getTypeName($p['type']) . "</span>\n <!-- TODO: Make float right -->\n <div class=\"inline \">\n <a href=\"index.php?page=content&action=remove&id=" . $p['id'] . "\">\n <button type=\"button\">Remove</button>\n </a> \n <a href=\"index.php?page=content&action=unlink&id=" . $p['id'] . "\">\n <button type=\"button\">Unlink</button>\n </a>\n <a href=\"index.php?page=content&action=edit&id=" . $p['id'] . "\">\n <button type=\"button\">Edit Content</button>\n </a>\n </div>\n </div>\n\n "; } if (!$notempty) { $contents .= "No content, please add.."; } $contents .= "\n <new></new>\n </fieldset>\n "; } //Add $text = "\n<div class=\"contenttext\">\n<span class=\"undertitle\">Add Content</span>\n</div> \n<form method=\"GET\" action=\"index.php?page=content\">\n <input type=\"hidden\" name=\"page\" value=\"content\"/>\n <fieldset class=\"field_set margin_15\">\n <legend>New Content</legend>\n <label>Name:</label> <input class=\"text\" name=\"name\" type=\"text\" value=\"\"/>\n <label>Link to page:</label>\n <select name=\"parent\">\n " . $pages . "\n </select>\n <label>Type:</label>\n <select name=\"type\">\n " . $types . "\n </select>\n <input class=\"right\" type=\"submit\" value=\"Add Content\"/>\n </fieldset>\n</form>\n"; //Edit $text .= "\n<div class=\"contenttext margin_15\">\n<span class=\"undertitle\">Contents by Page</span>\n</div>\n " . $contents . "\n\n\n"; break; /** * Settings, here we can change diffrent settings, like sitename, and template. */ /**