/** * Generate HTML of the list <option> element. * * @param string,integer $optionValue Value of the option. * @param mixed $option Option object, pair array or single title value. * @param string,integer $currentValue Current selected list option value (optional). * @param string $template HTML template of this component (optional). */ public function __construct($optionValue, $option, $currentValue, $template = "") { if (empty($template)) { $template = self::DEFAULT_TEMPLATE; } if (isObject($option)) { parent::__construct(['value' => $option->id, 'title' => $option->title], $template, [], $currentValue); } elseif (is_array($option)) { parent::__construct($option, $template, [], $currentValue); } else { parent::__construct(['value' => $optionValue, 'title' => $option], $template, [], $currentValue); } }
/** * Generate HTML of the list <option> element. * * @param string,integer $optionValue Value of the option. * @param mixed $option Option object, pair array or single title value. * @param string,integer $currentValue Current selected list option value (optional). * @param string $template HTML template of this component (optional). */ public function UIListOption($optionValue, $option, $currentValue, $template = "") { if (empty($template)) { $template = self::DEFAULT_TEMPLATE; } if (isObject($option)) { parent::UIComponent(array('value' => $option->id, 'title' => $option->title), $template, array(), $currentValue); } elseif (is_array($option)) { parent::UIComponent($option, $template, array(), $currentValue); } else { parent::UIComponent(array('value' => $optionValue, 'title' => $option), $template, array(), $currentValue); } }
if ($line != '') { if (isObject($line)) { $_CheckOuts->checkin($line); } else { echo 'Invalid barcode: "' . $line . '"<br />'; } } } } else { if ($m == 'checkout') { $user = trim(array_shift($arr)); if (isUser($user)) { foreach ($arr as $line) { $line = trim($line); if ($line != '') { if (isObject($line)) { $_CheckOuts->checkout($user, $line); } else { echo 'Invalid barcode: "' . $line . '"<br />'; } } } } else { echo 'Invalid user: '******'<br />'; } } } } echo html_a('logout.php', 'Logout', 'leftnavitem', 'target="_top"') . "\n"; ?> <form action="kiosk.php" method="POST">
function fIsObject() { return function ($d) { return isObject($d); }; }
/** * @param string $method * @param callable $callback * @param array $methodArgs * @return \Closure */ function methodReturnApply($method, callable $callback, array $methodArgs = []) { return combine(isObject(), hasMethod($method), function ($object) use($method, $callback, $methodArgs) { return $callback(callOnClone($object, $method, $methodArgs)); }); }
/** * @return \Closure */ function isNotObject() { return negate(isObject()); }