In part two of this article we created a simple news management application. That application contained only two menu options: one to direct an authenticated user to a form for managing news releases, and another to direct all users to our imaginary company's news release page. That was a great introduction to Nennius development, but not very practical. More often than not, when it comes to data management tools, a wide variety of data is being managed. Because of this, most Nennius applications will deal with more than one component. To add additional components to our example application, we will first start by expanding our menu configuration file as follows: <?php # include config_defaults file for threshold values # NOTE: ignore a failed include for the purposes of the admin GUI @ include_once '../../config.defaults.php'; # intiialize nennius menu array $nennius_menu_array = NULL; # Manage Releases - links to Nennius page for adding & removing news releases $admin_options_array[] = ( array( 'menu_display_name' => 'Manage Releases', 'menu_hyperlink' => 'index.php', 'menu_threshold' => $GLOBALS['ADMIN'] ) ); # Manage Comments - links to Nennius page for adding & removing user comments $admin_options_array[] = ( array( 'menu_display_name' => 'Manage User Comments', 'menu_hyperlink' => 'comments.php', 'menu_threshold' => $GLOBALS['USER'] ) ); # Corporate Website - links to external corporate website to view changes in realtime $public_menu_array[] = ( array( 'menu_display_name' => 'Corporate Website', 'menu_hyperlink' => 'http://www.corporatewebsite.com/news.php', 'menu_threshold' => $GLOBALS['PUBLIC'] ) );
# add all menus to nennius menu array $nennius_menu_array['Admin Options'] = $admin_options_array; $nennius_menu_array['Public Menu'] = $public_menu_array; # globalize nennius menu array for access by Display Template $GLOBALS['nennius_menu_array'] = $nennius_menu_array; ?> The menu configuration file now specifies two menu categories: 'Admin Options' (shown only if a user is logged into the application) and 'Public Menu'. In addition we have also added a new menu link: 'Manage User Comments'. (For the purposes of this article, we will assume that our application's front end allows users to attach comments to a news entry. This new menu option will then allow us to moderate the comments if necessary.) It will also show us another important aspect of Nennius development: how to create meaningful component relationships.
blog comments powered by Disqus |
|
|
|
|
|
|
|