[2.0.10] DHTML Slide Menu for ACP

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
90
83%
Very Good
12
11%
Good
1
1%
Fair
0
No votes
Poor
5
5%
 
Total votes: 108

User avatar
passanger
Registered User
Posts: 9
Joined: Sun May 16, 2004 1:31 pm
Location: in paris !!!
Contact:

Re: [2.0.10] DHTML Slide Menu for ACP

Post by passanger » Sat Mar 31, 2007 4:23 pm

hello !
forgiveness Download: do not go
Download File: dhtml_menu_for_acp_mod_v1_0_0.zip :?:

User avatar
Raimon
Former Team Member
Posts: 12088
Joined: Tue May 30, 2006 5:31 pm
Location: Netherlands
Name: Raimon Meuldijk
Contact:

Re: [2.0.10] DHTML Slide Menu for ACP

Post by Raimon » Sat Mar 31, 2007 4:27 pm

passanger wrote: hello !
forgiveness Download: do not go
Download File: dhtml_menu_for_acp_mod_v1_0_0.zip :?:



When you read the beautiful pink box,
You can click on this How to securely download MODs while the database is unavailable
and then you know that you can download the mod on this location: http://www.phpbb.com/files/mods/dhtml_m ... v1_0_0.zip ;)
Need phpBB installation, extenstions, Styles or integrate phpBB with you website?
Contact me for fair prices and good service!

syntron
Registered User
Posts: 1
Joined: Mon Jul 16, 2007 9:48 pm

Re: [2.0.10] DHTML Slide Menu for ACP

Post by syntron » Mon Jul 16, 2007 9:55 pm

It's a great mod - but why not put the js in a seperate file?

collapsible_apc.js:

Code: Select all

function getCookie(name)
{
	var cookies = document.cookie;
	var start = cookies.indexOf(name + '=');
	if( start < 0 ) return null;
	var len = start + name.length + 1;
	var end = cookies.indexOf(';', len);
	if( end < 0 ) end = cookies.length;
	return unescape(cookies.substring(len, end));
}

function setCookie(name, value, expires, path, domain, secure)
{
	document.cookie = name + '=' + escape (value) +
		((expires) ? '; expires=' + ( (expires == 'never') ? 'Thu, 31-Dec-2099 23:59:59 GMT' : expires.toGMTString() ) : '') +
		((path)    ? '; path='    + path    : '') +
		((domain)  ? '; domain='  + domain  : '') +
		((secure)  ? '; secure' : '');
}

function delCookie(name, path, domain)
{
	if( getCookie(name) )
	{
		document.cookie = name + '=;expires=Thu, 01-Jan-1970 00:00:01 GMT' +
			((path)    ? '; path='    + path    : '') +
			((domain)  ? '; domain='  + domain  : '');
	}
}

function menuCat(id, rows)
{
	this.cat_id = id;
	this.cat_rows = rows;
	this.status = 'block';
}

function getObj(obj)
{
	return ( document.getElementById ? document.getElementById(obj) : ( document.all ? document.all[obj] : null ) );
}

function displayObj(obj, status)
{
	var x = getObj(obj);
	if( x && x.style ) x.style.display = status;
}

function queueStep(o, s)
{
	this.obj = o;
	this.status = s;
}

function execQueue()
{
	if( currentStep < queuedSteps.length )
	{
		var obj = queuedSteps[currentStep].obj;
		var status = queuedSteps[currentStep].status;
		displayObj(obj, status);
		if( menuCats[obj] ) menuCats[obj].status = status;
		currentStep++;
		setTimeout("execQueue();", execInterval);
	}
	else
	{
		execInterval = queueInterval;
	}
}

function onMenuCatClick(cat_id)
{
	var currentCat, currentStatus;

	currentCat = 'menuCat_'+cat_id;
	currentStatus = menuCats[currentCat].status;

	queuedSteps = new Array();
	currentStep = 0;

	for( var catName in menuCats )
	{
		if( menuCats[catName].status == 'none' ) continue;

		for( var i=(menuCats[catName].cat_rows-1); i >= 0; i-- )
		{
			queuedSteps[currentStep++] = new queueStep(catName+'_'+i, 'none');
		}
		queuedSteps[currentStep++] = new queueStep(catName, 'none');
	}

	if( currentStatus == 'none' )
	{
		queuedSteps[currentStep++] = new queueStep(currentCat, 'block');
		for( var i=0; i < menuCats[currentCat].cat_rows; i++ )
		{
			queuedSteps[currentStep++] = new queueStep(currentCat+'_'+i, 'block');
		}
		var	expdate = new Date();		// 72 Hours from now
		expdate.setTime(expdate.getTime() + (72 * 60 * 60 * 1000));
		setCookie(cookie_name, cat_id, expdate,
				(cookie_path   == '') ? null : cookie_path,
				(cookie_domain == '') ? null : cookie_domain,
				(cookie_secure == '0') ? false : true);
	}
	else
	{
		delCookie(cookie_name,
				(cookie_path   == '') ? null : cookie_path,
				(cookie_domain == '') ? null : cookie_domain);
	}

	currentStep = 0;
	setTimeout("execQueue();", execInterval);
}

function doOnLoadMenuACP()
{
	var cat_id;

	if( getObj('menuCat_0') )
	{
		cat_id = getCookie(cookie_name);
		if( !menuCats['menuCat_'+cat_id] )
		{
			cat_id = 0;
		}
		else
		{
			menuCats['menuCat_'+cat_id].status = 'none';
		}
		onMenuCatClick(cat_id);
	}
	if( oldOnLoadMenuACP )
	{
		oldOnLoadMenuACP();
	}
}
 
and admin/index_navigate.tpl (only changed code):

Code: Select all

<script language="javascript" type="text/javascript" src="../templates/collapsible_acp.js"></script>
<script language="javascript" type="text/javascript">
<!--

var menuVersion = "Slide Menu v1.0.0";

/*************************************************************
 *	DHTML Slide Menu for ACP MOD
 *
 *	Copyright (C) 2004, Markus (phpMiX)
 *	This script is released under GPL License.
 *	Feel free to use this script (or part of it) wherever you need
 *	it ...but please, give credit to original author. Thank you. :-)
 *	We will also appreciate any links you could give us.
 *
 *	Enjoy! ;-)
 *************************************************************/

menuVersion += ' &copy; 2004<br />by <a href="http://www.phpmix.com/" target="_blank" class="copyright">phpMiX</a>';

var menuCats = new Array();
<!-- BEGIN catrow -->
menuCats['menuCat_{catrow.MENU_CAT_ID}'] = new menuCat('{catrow.MENU_CAT_ID}', {catrow.MENU_CAT_ROWS});
<!-- END catrow -->

var queueInterval = 20;		// milliseconds between queued steps.
var execInterval = 0;
var queuedSteps;
var currentStep;

var cookie_name = '{COOKIE_NAME}_menu_cat_id';
var cookie_path = '{COOKIE_PATH}';
var cookie_domain = '{COOKIE_DOMAIN}';
var cookie_secure = '{COOKIE_SECURE}';

var oldOnLoadMenuACP = window.onload;
window.onload = doOnLoadMenuACP;

// -->
</script>
Its easier this way - and one file more for the squid ;-)

Asbestos
Registered User
Posts: 26
Joined: Wed Nov 08, 2006 7:40 pm
Location: GA
Contact:

Re: [2.0.10] DHTML Slide Menu for ACP

Post by Asbestos » Wed Sep 19, 2007 1:52 pm

Great mod Markus!

Post Reply

Return to “[2.0.x] MOD Database Cleanup”