Location: PHPKode > projects > Banshee PHP Framework > controllers/admin.php
<?php
	class admin_controller extends controller {
		private $menu = array(
			"Authentication and authorization" => array(
				"Users"         => array("admin/user", "users.png"),
				"Roles"         => array("admin/role", "roles.png"),
				"Organisations" => array("admin/organisation", "organisations.png"),
				"Access"        => array("admin/access", "access.png")),
			"Content" => array(
				"Agenda"        => array("admin/agenda", "agenda.png"),
				"Dictionary"    => array("admin/dictionary", "dictionary.png"),
				"F.A.Q."        => array("admin/faq", "faq.png"),
				"Files"         => array("admin/file", "files.png"),
				"Forum"         => array("admin/forum", "forum.png"),
				"Guestbook"     => array("admin/guestbook", "guestbook.png"),
				"Languages"     => array("admin/languages", "languages.png"),
				"Links"         => array("admin/links", "links.png"),
				"Menu"          => array("admin/menu", "menu.png"),
				"News"          => array("admin/news", "news.png"),
				"Pages"         => array("admin/page", "page.png"),
				"Polls"         => array("admin/poll", "poll.png"),
				"Settings"      => array("admin/settings", "settings.png"),
				"Weblog"        => array("admin/weblog", "weblog.png")),
			"Photo album" => array(
				"Albums"        => array("admin/albums", "albums.png"),
				"Photos"        => array("admin/photos", "photos.png")),
			"Newsletter" => array(
				"Newsletter"    => array("admin/newsletter", "newsletter.png"),
				"Subscriptions" => array("admin/subscriptions", "subscriptions.png")),
			"Support and testing" => array(
				"Action log"    => array("admin/action", "action.png"),
				"User switch"   => array("admin/switch", "switch.png")));

		public function execute() {
			if (($this->user->id == 1) && ($this->user->password == "2651bc1e8f5cef2099799d3ae845334d")) {
				$this->output->add_tag("message", "Don't forget to change the password of the admin account!");
			}

			if (SLIMSTAT_PASSWORD == "banshee") {
				$this->output->add_tag("message", "Don't forget to change the SlimStat password in settings/websites.conf!");
			}

			$access_list = page_access_list($this->db, $this->user);
			$private_pages = config_file("private_pages");

			$this->output->open_tag("menu");

			foreach ($this->menu as $text => $section) {

				$this->output->open_tag("section", array(
					"text"  => $text,
					"class" => str_replace(" ", "_", strtolower($text))));

				foreach ($section as $text => $info) {
					list($page, $icon) = $info;

					if (in_array($page, $private_pages) == false) {
						continue;
					}

					if (isset($access_list[$page])) {
						$access = show_boolean($access_list[$page] > 0);
					} else {
						$access = show_boolean(true);
					}

					$this->output->add_tag("entry", $page, array(
						"text"   => $text,
						"access" => $access,
						"icon"   => $icon));
				}

				$this->output->close_tag();
			}

			$this->output->close_tag();
		}
	}
?>
Return current item: Banshee PHP Framework