/**
 * README
 * @author V.Krishn (vkrishn@insteps.net), Copyright 2005-2023
 * @note This file is part of Cookbook recipe "Jscm" for PmWiki;
 * You can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the  Free Software
 * Foundation; either version 2 of the License, or (at your option)
 * any later version. @see pmwiki.php for full details.
 * @package jscm
 */

/* *******************************************************************
** CAUTION
**  Use of CookMenu(Jscm) posses a security problem.
**  Use of this code lets you insert arbitary JavaScript Code.
**
**   DO NOT disable the Security Code in "jscookmenu.php" file.
**   Make appropriate settings with the default password = menupass
**
**  If using the uploaded files for menus don't forget to set password
**  for the group/pages.
**
**   Read the main documentation on Passwords related queries.
* ***************************************************************** */
Issues:
Please test this package at localhost or intranet to understand how it
works. Leaving out menu pages and group (Content or Jscm) unprotected from
password could be risky.

NOTE:
This recipe will work only under PHP 4 >= 4.3.0

HOW TO USE CookMenu(Jscm) v.2.2.x in PmWiki v.2.2+
==================================================
1. Place the 'cookmenu' folder under cookbook/

2. Make an entry in you config.php file (see sample config in local/ dir)

       include_once("cookbook/jscm/jscookmenu.php");

       Make appropiate changes in your jscookmenu.php file, including
       the password, for security reasons.
       Read main documentations on setting up passwords in PmWiki.

3. Then you need to create menus.
   Use cookmenu/buildmenu/MenuBuilder.html to build menus. See the
   structure for reference in defaultmenu.txt file.

   For any wikipage eg. Main.HomePage the following
   menu-wikipage or menu file are valid or would be loaded:
   1. Main.HomePageJscm if exist else /uploads/Jscm/Main.HomePageJscm.js
   2. Main.Jscm if exist else /uploads/Jscm/Main.Jscm.js
   3. Content.Jscm (default for all pages) -
      if exist else /uploads/Jscm/Content.Jscm.js

   Preference is given to menus on wikipages.
   If more than one page/file exist example "Main.HomePageJscm" and
   "/uploads/Jscm/Main.Jscm.js" and "Content.Jscm" -- All three
   would be loaded in the given order (page-group-default).

4. cookmenu works best inside the wikipage (and not sidebar).
   -- inserting (:cmMain:) in your wikipage would create the menu
   based on default settings.

   (:cmDraw id menu orient theme:) <- markup for inserting menus.

   id        = unique id per menu(a single word with upper or/and lower cases).
   menu      = name of the menu(a single word with upper or/and lower cases).
   orient    = can be any one of the values
                (hbr, hbl, hur, hul, vbr, vbl, vur, vul)
   theme     = can be any one of the values
                (cmThemeMiniBlack, cmThemePanel, cmThemeIE,
                cmThemeOffice, cmThemeOffice2003, cmThemeNB, cmThemeMini).
   effect    = fading:30:80:all | sliding:8:all
                 FADING is the theme fading property.
                   30 is the showing speed, 80 is the hiding speed.
                 SLIDING - <number> indicate that this property has sliding effect.
                   8 is the speed of the sliding.
                 all - effect the theme globally.
   delay     = 500 - auto disappear time for submenus in milli-seconds.
   clickopen = 0|1 - click on main, hover on sub.
   format    = pmwiki - create menu using simple pmwiki list wiki format.
   
/* USAGE
///////////////////////////////////////////////////   

(:jscmDraw cmIDa cmMainMenu hur cmThemeGray effect="fading:30:80" clickopen=1 delay=500:)   
   
///////////////////////////////////////////////////

(:jscmDraw menubuilder:) Web browser based easy menubuilder

///////////////////////////////////////////////////
*/

5. If no menu is build or found the defaultmenu.js is activated.

	Thats all friends. :-))

