Hi! Hey, great menu!
I have a problem though, "remembering" does not work well for me... I did check what was being written to the cookie and then what restore function was reading... and it was different sometimes??? Puzzling for me, because I'm a newbie to javascript.
Any way, if I try 2 or more times to "save" the menu in a given stage, it works ok, but If I have the menu in, for example, 1 and 3 opened, reload the page and then change to 1,4,7 and reload again, then the nextime the page loades, the menu has the wrong titles opened...
I'm using this to generate my menu, I think its ok, but leave it here anyway:
Code:
$menu = '<div class="sdmenu">';
$menu .= ' <span class="title" id="top"><img src="'.JS_DIR.'collapsed.gif" class="arrow" alt="-" />'.LAN_MENU_HOME.'</span>';
$menu .= ' <div class="submenu">';
$menu .= ' <a href="'.$api->tpl->turl(PROFILE_DIR."profile.php").'">'.LAN_MAIN_PROFILE.'</a>';
$menu .= ' <a href="'.$api->tpl->turl(PROFILE_DIR."password.php").'">'.LAN_CHANGE_PASSWORD.'</a>';
$menu .= ' </div>';
$menu .= ' <span class="title" ><img src="'.JS_DIR.'collapsed.gif" class="arrow" alt="-" />Tienda</span>';
$menu .= ' <div class="submenu">';
$menu .= ' <a href="'.$api->tpl->turl(STORE_DIR."main.php").'">'.LAN_STORE_PREFERENCES.'</a>';
$menu .= ' </div>';
$menu .= ' <span class="title" ><img src="'.JS_DIR.'collapsed.gif" class="arrow" alt="-" />'.LAN_MENU_CATALOG.'</span>';
$menu .= ' <div class="submenu">';
$menu .= ' <a href="'.$api->tpl->turl(CATEGORY_DIR."main.php", array("type" => "catalog")).'">'.LAN_CATALOG_CATEGORIES.'</a>';
$menu .= ' <a href="'.$api->tpl->turl(CATEGORY_DIR."create.php", array("act" => "add", "type" => "catalog")).'">'.LAN_NEW_CATEGORY.'</a>';
$menu .= ' <a href="'.$api->tpl->turl(PRODUCT_DIR."main.php").'">'.LAN_PRODUCTS.'</a>';
$menu .= ' <a href="'.$api->tpl->turl(PRODUCT_DIR."create.php", array("act" => "add")).'">'.LAN_NEW_PRODUCT.'</a>';
$menu .= ' <a href="'.$api->tpl->turl(CATALOG_DIR."prefs.php").'">'.LAN_PREFERENCES.'</a>';
$menu .= ' </div>';
$menu .= ' <span class="title" id="bottom"><img src="'.JS_DIR.'collapsed.gif" class="arrow" alt="-" />'.LAN_MENU_CONTENT.'</span>';
$menu .= ' <div class="submenu">';
$menu .= ' <a href="'.$api->tpl->turl(CATEGORY_DIR."main.php", array("type" => "content")).'">'.LAN_CONTENT_CATEGORIES.'</a>';
$menu .= ' <a href="'.$api->tpl->turl(CATEGORY_DIR."create.php", array("act" => "add", "type" => "content")).'">'.LAN_NEW_CATEGORY.'</a>';
$menu .= ' <a href="'.$api->tpl->turl(CONTENT_DIR."inventory.php", array("type" => "page")).'">'.LAN_PAGES.'</a>';
$menu .= ' <a href="'.$api->tpl->turl(CONTENT_DIR."create.php", array("act" => "add", "type" => "page")).'">'.LAN_NEW_PAGE.'</a>';
$menu .= ' <a href="'.$api->tpl->turl(CONTENT_DIR."create.php", array("type" => "fpage")).'">'.LAN_FRONT_PAGE.'</a>';
$menu .= ' <a href="'.$api->tpl->turl(CONTENT_DIR."inventory.php", array("type" => "news")).'">'.LAN_NEWSS.'</a>';
$menu .= ' <a href="'.$api->tpl->turl(CONTENT_DIR."create.php", array("act" => "add", "type" => "news")).'">'.LAN_NEW_NEWS.'</a>';
$menu .= ' </div>';
$menu .= '</div>';
Bookmarks