[KNOWN ISSUE] mosCommonHTML::menuLinksContent()

Locked
User avatar
pollen8
Joomla! Explorer
Joomla! Explorer
Posts: 350
Joined: Wed Aug 17, 2005 10:32 pm
Location: la Rochelle - France
Contact:

[KNOWN ISSUE] mosCommonHTML::menuLinksContent()

Post by pollen8 » Wed Sep 20, 2006 6:38 am

Description:
For component developers mosCommonHTML::menuLinksContent() contains specific javascript which needs generalisation

Reported on:
Joomla 1.0.11

Classification:
Enhancement

Affected functions:
Any 3rd party component that wants to call this function and which doesnt have an image list on their admin page

Related files:
includes/joomla.php

Steps to replicate:
Download mosforms 0.4b install add a table, link table to menu, click on the 'menu' or 'link name' links - gives js error "form.imagelist.options not defined"

Analysis:


Proposed fix(es):
In mosCommonHTML::menuLinksContent()  replace

Code: Select all

		<script language="javascript" type="text/javascript">
		function go2( pressbutton, menu, id ) {
			var form = document.adminForm;

			// assemble the images back into one field
			var temp = new Array;
			
			for (var i=0, n=form.imagelist.options.length; i < n; i++) {
				temp[i] = form.imagelist.options[i].value;
			}
			form.images.value = temp.join( '\n' );

			if (pressbutton == 'go2menu') {
				form.menu.value = menu;
				submitform( pressbutton );
				return;
			}

			if (pressbutton == 'go2menuitem') {
				form.menu.value 	= menu;
				form.menuid.value 	= id;
				submitform( pressbutton );
				return;
			}
		}
		</script>
with

Code: Select all

		<script language="javascript" type="text/javascript">
		function go2( pressbutton, menu, id ) {
			var form = document.adminForm;

			// assemble the images back into one field
			var temp = new Array;
			if(form.imagelist){
				for (var i=0, n=form.imagelist.options.length; i < n; i++) {
					temp[i] = form.imagelist.options[i].value;
				}
				form.images.value = temp.join( '\n' );
			}
			if (pressbutton == 'go2menu') {
				form.menu.value = menu;
				submitform( pressbutton );
				return;
			}

			if (pressbutton == 'go2menuitem') {
				form.menu.value 	= menu;
				form.menuid.value 	= id;
				submitform( pressbutton );
				return;
			}
		}
		</script>


System info:
n/a
aka

User avatar
RobS
Joomla! Ace
Joomla! Ace
Posts: 1367
Joined: Mon Dec 05, 2005 10:17 am
Location: New Orleans, LA, USA
Contact:

Re: mosCommonHTML::menuLinksContent()

Post by RobS » Sat Oct 28, 2006 10:56 pm

This is a feature request which is not in the scope of 1.0.x.

Q&T Note; Status> Known Issue.  Moving to appropriate forum.
Rob Schley - Open Source Matters
Webimagery - http://www.webimagery.net/ - Professional Consulting Services
JXtended - http://www.jxtended.com/ - Free and Commercial Joomla! Extensions

User avatar
pollen8
Joomla! Explorer
Joomla! Explorer
Posts: 350
Joined: Wed Aug 17, 2005 10:32 pm
Location: la Rochelle - France
Contact:

Re: [KNOWN ISSUE] mosCommonHTML::menuLinksContent()

Post by pollen8 » Sun Oct 29, 2006 11:07 am

sniff  8)

hardly a "feature" just some basic checking of dom!
aka


Locked

Return to “Known Issues - Archive”