Jump to content

Flux Menu


Recommended Posts


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   8
  • Joined:  03/03/12
  • Last Seen:  

Question I just want to put a Admin menu in a List/Menu or Jump Menu

Here's my code but it won't work for me

<form name="form1">
 <select name="menu1" onChange="MM_jumpMenu('parent',this,0)">

<?php $mItems = array(); foreach ($adminMenuItems as $menuItem) $mItems[] = sprintf('<a href="%s">%s</a>', $menuItem['url'], $menuItem['name']) ?>
  <strong>Admin</strong>: <option><?php echo implode(' • ', $mItems) ?></option></select>
<?php endif ?>
</form>

it only appears like this

Admin: Who's OnlineItem DatabaseeA LogsCP LogsIP Ban ListAccountsCharactersGuildsReloadSend MailNewsPages

Any one can help me pls? tnx in advance

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  68
  • Reputation:   12
  • Joined:  09/05/12
  • Last Seen:  

Are you trying to make a dropdown menu? If that is the case, then you can try this:

<?php if (!empty($adminMenuItems) && Flux::config('AdminMenuNewStyle')): ?>
<form name="form1"> <?php $mItems = array(); foreach ($adminMenuItems as $menuItem) $mItems[] = sprintf('<a href="%s">%s</a>', $menuItem['url'], $menuItem['name'])

function createDropdown($arr, $frm) {
echo '<select name="'.$frm.'" id="'.$frm.'">
<option value="">Select one…</option>';
foreach ($arr as $key => $value) {
echo '<option value="'.$value.'">'.$value.'</option>';
}
echo '</select>';
}
?>

<label for="frmadminmenu">Admin Menu:</label>
<!--?php createDropdown($mItems, 'frmadminmenu'); ?-->
</form>
<?php endif ?>

Edited by Heero Yuy
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   8
  • Joined:  03/03/12
  • Last Seen:  

Are you trying to make a dropdown menu? If that is the case, then you can try this:

<?php if (!empty($adminMenuItems) && Flux::config('AdminMenuNewStyle')): ?>
<form name="form1"> <?php $mItems = array(); foreach ($adminMenuItems as $menuItem) $mItems[] = sprintf('<a href="%s">%s</a>', $menuItem['url'], $menuItem['name'])

function createDropdown($arr, $frm) {
echo '<select name="'.$frm.'" id="'.$frm.'">
<option value="">Select one…</option>';
foreach ($arr as $key => $value) {
echo '<option value="'.$value.'">'.$value.'</option>';
}
echo '</select>';
}
?>

<label for="frmadminmenu">Admin Menu:</label>
<!--?php createDropdown($mItems, 'frmadminmenu'); ?-->
</form>
<?php endif ?>

still not working sir when i put you code the page won't load anymore :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   39
  • Joined:  01/20/12
  • Last Seen:  

Admin Drop Down Menu

<form name="form1">
<strong>Admin</strong>:
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<?php foreach ($adminMenuItems as $menuItem) : ?>
<option value="<?php echo $menuItem['url']; ?>"><?php echo $menuItem['name']; ?></option>
<?php endforeach; ?>
</select>
</form>

I don't know what your 'MM_jumpMenu()' function does but that code should work... Just play around

EDIT:

and btw,

sprintf('<a href="%s">%s</a>', $menuItem['url'], $menuItem['name'])

that code produce a url tag which you cannot put inside a combo box, use '<?php echo $menuItem['url']; ?>' instead if you want to get just the url of the menu and place it in the value property of an option tag

Edited by Jupeto
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   8
  • Joined:  03/03/12
  • Last Seen:  

Admin Drop Down Menu

<form name="form1">
<strong>Admin</strong>:
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<?php foreach ($adminMenuItems as $menuItem) : ?>
<option value="<?php echo $menuItem['url']; ?>"><?php echo $menuItem['name']; ?></option>
<?php endforeach; ?>
</select>
</form>

I don't know what your 'MM_jumpMenu()' function does but that code should work... Just play around

EDIT:

and btw,

sprintf('<a href="%s">%s</a>', $menuItem['url'], $menuItem['name'])

that code produce a url tag which you cannot put inside a combo box, use '<?php echo $menuItem['url']; ?>' instead if you want to get just the url of the menu and place it in the value property of an option tag

Sir jupeto the drop down menu works but it won't redirect me on every menu i choose sample who is online. it won't go. /sob

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  225
  • Reputation:   39
  • Joined:  01/20/12
  • Last Seen:  

Ekk then what's the use of that function in onChange property?

find:

onChange="MM_jumpMenu('parent',this,0)"

replace with:

onChange="window.location.href=this.value"

or just copy below

<form name="form1">
<strong>Admin</strong>:
<select name="menu1" onChange="window.location.href=this.value">
<option value="javascript:void(0);">Choose Menu</option>
<?php foreach ($adminMenuItems as $menuItem) : ?>
<option value="<?php echo $menuItem['url']; ?>"><?php echo $menuItem['name']; ?></option>
<?php endforeach; ?>
</select>
</form>

Edited by Jupeto
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   8
  • Joined:  03/03/12
  • Last Seen:  

@jupeto it works now sir. asahan mo po creds ko seo for this website hehehe tnx a lot ^_^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   8
  • Joined:  03/03/12
  • Last Seen:  

@sir Jupeto - hmmmm how about on SubMenus and Page Menus?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...