
NAVT Word Press Plugin
Copyright (c) 2006-2008 Greg A. Bellucci/Atalaya Studio

Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

@package NAVT Word Press Plugin
@author Greg A. Bellucci <greg[AT]gbellucci[DOT]us
@copyright Copyright &copy; 2006-2008 Greg A. Bellucci
@license http://www.opensource.org/licenses/mit-license.php The MIT License

--------------------------------------------------------------------------------------------------------------------------

Changelog (applies to all files in the plugin)


   v.1 01/04/2006 - gab: initial coding (not really worth a version number)

   v.2 01/05/2006 - gab: stable alpha - initially supports only a top menu and one sidebar menu
     added write_debug since debugging this without a IDE is a pain in the ass. Reminds me of debugging
     C on UNIX with only a printf statement.

   v.3 01/08/2006 - gab: added phpDocumentor tags and decided to get a copy of Zend Enterprise Edition
     which has absolutely nothing to do with the code ~:@)  - just my sanity.

   v.4 01/10/2006 - gab: completely revamped. added draggable menu items to remove the need to indicate
     the menu order. Now the order is based on relative position. Created the ability to add a arbitrary
     menu "group" and move menu items between multiple group definitions.

     Why can't someone write some decent documentation for using scriptaculous.js? Even the code is barely
     internally documented. Must be the "new" norm... I can't find a single javascript framework that is
     documented. Some of us don't have the time to plow through pages of functions to figure out how they
     work or what can be done with them. "Experimentation" isn't a good alternative to documentation.

   v.5 01/152006 - gab: added "menus" to the menu group boxes for Rename and removing the menu group.
     Stopped using builder.js functions. Found them to be way too cumbersome for creating nodes.
     Created a 'template' of a section and cloned it to create a new menu group - much faster and easier than
     using builder.js to create complex nodes with several children.

   v.6 01/24/2006 - gab: reworked again! Simplified the underlying HTML to use unordered lists. Experimented with
     different structures and decided that unordered lists worked best for cross browser support. Changed the menu
     group containers to use left floats. Vertical dragging of menu items between groups is not the best way to
     do this. Made the interface more compact by using icons. An icon implies the menu type (page or category).

   v.65 01/25/2006 - gab: small changes needed for support of Wordpress 2.1 but I don't think I'm done - it was too easy.

   v.70 02/01/2007 - gab: extensive changes to draggables. Completed menu group menus and item alias rename menus.
     fixed a multitude of problems associated with IE7. (see notation on cloning nodes in NAVT_display.php). Upgraded
     to prototype 1.5 and scriptaculous 1.7. Changed css file to css.php so I could 'program' the stylesheet. The
     page classes and selectors are shared between NAVT_display.php, NAVT.js.php and NAVT.css.php. Makes maintenance
     much easier when and if the class names or selectors change.

   v.75 02/10/2007 - gab: More changes to the html structure for group menus. Removed the use of icons for delete and
     rename group and used a unordered list instead. The list performs better as a menu. Resolved a few issues with
     mouse-clicks - draggable handles and menu links used in close proximity to one another can confuse the scripaculous
     code because it can't distinguish between a menu item click and a click that begins a drag sequence - added a 50ms
     delay to the mouse-click (for draggables) in the hopes of fixing the problem.

   v.85 02/13/2007 - gab: Completed the navt_getlist function that constructs the requested navigation list
     output. Added comments and notes on usage.

   v.90rc-1 02/22/2007 - gab: corrected several problems due to changes in WordPress 2.1 - added help panel for the plugin
     added the "uninstall" admin screen - which doesn't uninstall the plugin it simply deletes the plugin options. Finally
     tested the plugin live with the new K2 release. Added "reset" button functionality.

   v.93rc-1 03/05/2007 - gab: bugfixes related to adding/removing Pages and Categories. The map was not updated correctly
     due to changes in WordPress 2.1. Added the admin/register link to the default menu items. Finished the companion widget.

   v.93rc-2 03/26/2007 - gab: added options capability to menu items. First options added went to categories. Categories may now
     be included in the catgory list if the same category appears in a menu. The number of posts appearing in a category may now
     be appended to the category name. The count may be styled independently of the list item.

   v.93rc-3 04/03/2007 - gab: Problems loading help div with IE7 - IE7 times out the script and brings up the annoying box that
     asks the user if they should stop executing the script. Moved the help to a separate helpfile that comes up in a new window.

   v.93rc-4 04/04/2007 - gab: Just an update to the readme.txt file (more details). Added missing title on href for login/admin
     navigation link. (tisk-tisk), changed the homepage to point to the svn repository.

   v.94rc-1 04/07/2007 - gab: Fixed a problem with setting the correct 'current_page' in the navigation list. Removed the hook
     that was in parse_query and now I determine the current page from the queried object.

   v.94rc2 04/11/2007 - gab: Fixed a problem with serializing UTF-8 strings by Javascript for use by PHP. Incorrect character byte
     length calculations probably resulting in navigation lists that would not save. This would have been true if you use European
     (except ASCII), Arabic, Hebrew, Indic, Thai, certain symbols (such as the euro symbol), Chinese, Japanese, Korean character sets

   v.95.1 04/20/2007 - gab: Added two new item types: external links and navigation subgroup dividers. Improvements made to animations,
     menu items are now added or moved to the top of a column rather than the bottom. Updated all of the icons. Code clean up. Decided
     to support the WordPress widget plugin. I'm sure someone will be happy about that, although it isn't as nice as sidebar modules.
     Themes are using widgets heavily. Added version checking and backward compatibility checking.

   v.95.1.1 04/20/2007 - gab: Minor corrections to the readme.txt file

   v.95.20   04/23/2007 - gab: added 'show category when empty' option to categories - the default is to hide categories when they don't
     contain posts.

   v.95.30   05/11/07 - gab: Rewrote the entire Javascript code - turned it into a set of manageable classes. Code is much tighter and
     hopefully more reliable - it makes more sense anyway.

     Ran the code through a PHP analyizer - interesting... found small typos in $variables that would eventually have produced non-functioning
     areas of the code... removed a few 'unused' $variables, added declarations for $variables used... wish PHP forced the use of declared
     variables.

     Added NAVT fields to the standard WordPress Manage Category and Manage Page to allow group assignments, alias and options changes to
     item navigation. Changing a page to 'private' on the NAVT List page will change the page status from 'publish' to 'private'. Draft
     pages must be published from the Manage Page screen and cannot be made private from the NAVT List page.

     Removed javascript comparisons of changes to an alias name in lowercase only: "name" != "Name" != "NaMe" != "naME" ....

     05/28/2007
     Removed the use of private database calls to locate categories and pages; too many issues occur with WordPress version changes so it is
     much safer to use WordPress API calls.

     Added a 'private' option to all menu items. Setting this option means that the viewer cannot see the page/category/link or divider IF they
     are not logged in. Later I might add privacy based on user levels.

     Private items are now indicated with a red hand over the icon. Draft pages now appear with a "pencil" on the paper icon.

     Unpublished pages (drafts) are no longer displayed in a navigation list via the navt_getlist call. They probably shouldn't have
     been in the first place. A draft page item will appear in the unassigned area and you can move it to a navigation group but it will not be
     shown on the web site unless you publish it. Unpublished and private items have different background colors from 'normal' items to attach
     some significance to them.

     Moved the api call into its own file: navtapi.php

     Improved Wordpress Widget - the widget now supports up to 5 instances of itself - this makes it far more useful - one navigation list is not enough.

     Navigation lists that are designated as 'dropdown' style can now be 'split' by adding a divider in the navigation list. The divider will end the
     select statement and begin a new one. This makes it possibe to create multiple-dropdowns using a single navigation list of items. A split will occur
     at each divider. Plain text dividers can be used as headings above the dropdown list that will appear below it.

   v.95.31   06/12/07 - gab: Added support for show_on_front
   v.95.32   06/14/07 - gab: Fixed a major problem with the markup characters showing up in page and category titles.
   v.95.33   06/21/07 - gab: Compatibility issues with WP 2.1 - updated the WordPress version check for 2.1 and below.
                             95.33 is not compatible with WP 2.1.x
   v.95.34   06/22/07 - gab: Clean up readme
   v.95.35   06/23/07 - gab: Fixed broken widgets. WordPress decided to change the widget API. Incorrect widget registration.
   v.95.36   07/12/07 - gab: Added 'siteurl' to 'login' path - Login was broken if the web site was not installed in the root directory.
                             Took off restriction of alphanumeric only characters in a menu alias
   v.95.37   07/17/07 - gab: Added functionality to support adding categories "on-the-fly' when they are added from the 'write post' page.
                             Added the ability to specify a default navigation list when new catgories are added automatically -
                             the option is on the NAVT list page
                             Moved the widget code within the NAVT class source - having a separate widget activate is no longer necessary

   v.95.38   08/23/07 - gab: Very big modification.
    1. Decided to look into why this doesn't work with WPMU - fixed a bug in the activation code -
       this *may* fix a bug I've seen with non-MU installations.
    2. Decided to rewrite the "this is not compatible with your version of WP" by allowing the plugin to initialize but disabling the functionality.
       The way this previously worked prevented people from getting back into their blog.
    3. Decided to stop using Prototype and Scriptaculous in favor of jQuery - simpler/faster - this caused the majority of the rewrite.
    4. Added the ability to manage Authors with and without avatars - user custom avatars can be placed in the NAVT avatar directory.
    5. Added four 'link type' selections to each link. (Standard text link/Text over graphic/Text next to a graphic/graphic only).
    6. Added new classes for more precise styling options.
    7. Added 'indent/outdent' functions to provide hierarchical representations of lists - the code will build nested ULs
    8. Rewrote all WP NAVT options for pages, categories and users.
    9. Started moving towards multi-language support by adding a navt text domain.
    10. 'Ajaxified' the submits from the WP NAVT List page to shorten the update time.
    11. Added page/category 'filtering' on the unassigned group for those with long lists of navigation items.
    12. Added a feature that will 'hide' unused navigation items from the NAVT selections - this is called "Do not use".
    13. Added "rel=nofollow" and "target=_blank" to external link options.
    14. Fixed 'private' for pages - this is no longer tied to the 'private' page as defined by Wordpress  it doesn't work the way I would expect.
    15. Added help tips for each of the navigation items. Access by rolling over the question mark inside the item's option box.
    16. Navigation lists can now be embedded in posts and pages by adding:
        [NAVT group=groupname, title=titlename] in the content. title is optional and may contain tags
    17. Compatibility changes for upcoming WordPress 2.3 database schema changes.
    18. Group names are forced to lowercase.

   v.95.39 - fix for quotation marks that may appear in category and page titles
   v.95.40 - moved NAVT Admin to the bottom of the NAVT List page.
             added wpmu_navt.php for mu-plugins installations
   v.95.41 - added an automtic data conversion check for plugin versions < 95.40
           - last minute checks against WordPress 2.3

   v.95.42 10/23/07 - gab:
     1. Fixed problems with International character sets transferred to the server from the browser (UTF-8/unicode issues).
     2. Fixed issues with nested ULs and class information.
     3. Added rel=nofollow to all link items (including internal pages/categories/users).
     4. Login navigation item can produce an alternative login form instead of a link with after-login url redirection.
     5. You can now set a new group menu item that will produce a 'naked list' (all NAVT generated classes are stripped from the HTML).
     6. Added backup and restore facility to the NAVT List sidebar. Navigation lists can be saved/restored to/from your local hard drive.
     7. Force all Navigation Group names to UPPERCASE - found that Navigation Group Names could interfere with existing CSS Selector Ids in user themes.
     8. Made an attempt to reduce the number of classes and selectors searched for event observation. Reduces load time and eliminated script timeouts.
     9. Javascript fixes for alias names and creating groups. Weird and unexplainable junk do to changes in jQuery?
    10. Fixes for select style menus - this was never tested very extensively in the past.

   v.95.43 10/23/07 - gab
     1. corrected &nbsp; (missing semicolon)

   v.95.44 10/25/07 - gab
     1. removed the unicode functions - there were really not needed at all. The encoding problem is two-fold. First converting characters to is not
        necessary - just placing them inside a CDATA block was all I really needed to do. The real problem is the $_POST to the ajax php file and the
        use of '&' in the $_POST data. The browser interprets the '&' as the start of a URL argument so it truncates the $_POST data. I've simply
        replaced the '&' with '#amp;' (not &amp) - the php routine on the server side merely replaces #amp; with '&'. This is the one and only character
        that I needed to be concerned with.

     2. Changed the xml_create_parser functions to use 'UTF-8' instead of the default for target encoding. The default target encoding will
        change multibyte characters to '?' - UTF-8 seems to work now.

   v.95.45
     1. changed the include file from wp-blog-header.php to wp-content.php to correct falsely reported 404 errors by word press

   v.95.46
     1. Removed extra 'li' from nested lists. Pattern changes from:
     <ul>
        <li> </li>
        <li>
           <ul>
               <li> </li>
           </ul>
        </li>
     </ul>

     to:

     <ul>
        <li>
           <ul>
               <li> </li>
           </ul>
        </li>
     </ul>

+------------------------------------------------------------------------------------------------------------+
    v.96.02.07 (gab) - major rewrite - removed the use of prototype.js and rewrote all of the javascript
                       new GUI, new backup/restore, all AJAX updated, allows for multiple instances
                       jQuery handles all drag/drop functionality, added localization, divided NAVT into
                       multiple static classes.
+-------

  NAVT was 2 years old on January 4th, 2008.

    v.1.0.2a 03/25/08 (gab) - Release Candidate
    v.1.0.3 (gab) corrections to all of the stylesheets to change '#wpcontent select' (changed in WP 2.5RC1.1) back to height:auto.
    v.1.0.4 (gab) fix for user defined links (missing ending anchor tag)
    v.1.0.5 (gab) correction to handle hyphen in group names correctly
    v.1.0.6 03/30/08 (gab) fix for text with side graphic html output.
                  fix for incorrect radio button states when selecting the use of user avatars
                  fix for show on... Not handling hide on pages correctly
                  change to navt sbm and widget - no html is output if there is no list returned from navt_getlist
                  added atalayastudio as the NAVT home page

    v1.0.7 (gab)
        04/03/08 - added sorting capability to pages and category assets.
                   added hierarchical representations to pages and categories in the asset select lists.
                   added language (I.E, en-US) code and browser name and version as menu classes.

    * lost track *

    v1.0.26 (gab)
        05/14/08 - changes to navt restore.

	v.1.0.28 (gab)
		03/23/09 - added to navt.php a routine that dynamically creates the file app/wp-root.php. The wp-root.php file contains
		           the absolute directory location for the WordPress installation for the benefit of app/navtajx.php. 
TODO:

