Ferreteria/v2/class/fcDynamicLink

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< Ferreteria‎ | v2‎ | class
Jump to: navigation, search
/*::::
  PURPOSE: selectable link that isn't dropin-specific
  ABSTRACT: n/i = GetLinkURL()
*/
abstract class fcDynamicLink extends fcLink_fromArray {

    // ++ CALCULATIONS ++ //
    
    private $isSel;
    // PUBLIC so other objects can see whether menu options are activated
    public function GetIsSelected() {
	if (empty($this->isSel)) {
	    $sKeyValue = $this->GetKeyValue();
	    $sKeyName = $this->GetKeyName();
	    $oPathIn = $this->GetKioskObject()->GetInputObject();
	    if ($sKeyValue === TRUE || is_null($sKeyValue)) {
		// if key name is TRUE or NULL, we use the presence of the value as a flag
		$this->isSel = $oPathIn->GetBool($sKeyName);
	    } else {
		$sInValue = $oPathIn->GetString($sKeyName);
		$this->isSel = ($sInValue == $sKeyValue);
	    }
	}
	return $this->isSel;
    }
    
    // -- CALCULATIONS -- //

}