コード例 #1
0
ファイル: UIListOption.php プロジェクト: asymptix/framework
 /**
  * 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);
     }
 }
コード例 #2
0
ファイル: UIListOption.php プロジェクト: pomed/Framework
 /**
  * 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);
     }
 }
コード例 #3
0
ファイル: kiosk.php プロジェクト: robbat2/rats
            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">
コード例 #4
0
ファイル: colander.php プロジェクト: netom/colander
function fIsObject()
{
    return function ($d) {
        return isObject($d);
    };
}
コード例 #5
0
/**
 * @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));
    });
}
コード例 #6
0
ファイル: type.php プロジェクト: Giuseppe-Mazzapica/Pentothal
/**
 * @return \Closure
 */
function isNotObject()
{
    return negate(isObject());
}