Ferreteria/v0.4/class/fcMenuOptionLink

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< Ferreteria‎ | v0.4‎ | class
Revision as of 22:35, 12 January 2020 by Woozle (talk | contribs) (example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Usage

Objects are constructed with a single array argument:

array['base'] = base URL to prefix all output URLs
array['kname'] = name of option group to which this option belongs
array['kval'] (NEW) = value of unique key
array['value'] = default for [text-on] and [text-off]
array['text-on'] = (optional) text to display when toggle is on; defaults to [text-off]
array['text-off'] = (optional) text to display when toggle is off; defaults to [value]
array['popup'] = (optional) hover-over text

Example - simple [edit] link in a linkable row:

	$oMenu = fcApp::Me()->GetHeaderMenu();
	  $ol = new fcMenuOptionLink(
	    array(
	      'base' 		=> $this->SelfURL(),	// base URL to prefix all output URLs
	      'kname' 		=> 'do',		// name of option group to which this option belongs
	      'kval' 		=> 'edit',		// value of unique key
	      'value' 		=> 'edit',		// default for [text-on] and [text-off]
	      'text-on' 	=> 'edit',		// (optional) text to display when toggle is on; defaults to [text-off]
	      'text-off' 	=> 'edit',		// (optional) text to display when toggle is off; defaults to [value]
	      'popup' 		=> 'edit this account'	// (optional) hover-over text 	
	    )
	  );
	  $oMenu->SetNode($ol);