本文整理汇总了PHP中HTML_QuickForm::setConstants方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_QuickForm::setConstants方法的具体用法?PHP HTML_QuickForm::setConstants怎么用?PHP HTML_QuickForm::setConstants使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_QuickForm
的用法示例。
在下文中一共展示了HTML_QuickForm::setConstants方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
} else {
$message = _LOGINERRORPLEASEMAKESURECAPSLOCKISOFF;
$message_type = 'failure';
}
}
} elseif ($e->getCode() == EfrontUserException::USER_PENDING) {
$message = $e->getMessage();
$message_type = 'failure';
} elseif ($e->getCode() == EfrontUserException::USER_INACTIVE) {
$message = $e->getMessage();
$message_type = 'failure';
} else {
$message = _LOGINERRORPLEASEMAKESURECAPSLOCKISOFF;
$message_type = 'failure';
}
$fb_form_new->setConstants(array("fb_new_login" => $values['fb_new_login'], "fb_new_password" => ""));
}
} catch (Exception $e) {
$message = _USERCOULDNOTBECREATED . ': ' . $e->getMessage() . '(' . $e->getCode() . ')';
$message_type = 'failure';
}
$fb_form_new->setConstants(array("fb_new_login" => $values['login'], "fb_new_password" => ""));
}
$renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty);
$fb_form_new->setJsWarnings(_BEFOREJAVASCRIPTERROR, _AFTERJAVASCRIPTERROR);
$fb_form_new->setRequiredNote(_REQUIREDNOTE);
$fb_form_new->accept($renderer);
$smarty->assign('T_NEW_FACEBOOK_USER_LOGIN_FORM', $renderer->toArray());
$smarty->assign("T_FACEBOOK_EXTERNAL_LOGIN", 1);
$smarty->assign("T_FACEBOOK_LOGIN_WELCOME", _WELCOME . " " . $name . "! " . _FACEBOOKLOGININFO);
} else {
示例2: ic2_display
function ic2_display($path, $params)
{
global $_conf, $ini, $thumb, $dpr, $redirect, $id, $uri, $file, $thumbnailer;
if (P2_OS_WINDOWS) {
$path = str_replace('\\', '/', $path);
}
if (strncmp($path, '/', 1) == 0) {
$s = empty($_SERVER['HTTPS']) ? '' : 's';
$to = 'http' . $s . '://' . $_SERVER['HTTP_HOST'] . $path;
} else {
$dir = dirname(P2Util::getMyUrl());
if (strncasecmp($path, './', 2) == 0) {
$to = $dir . substr($path, 1);
} elseif (strncasecmp($path, '../', 3) == 0) {
$to = dirname($dir) . substr($path, 2);
} else {
$to = $dir . '/' . $path;
}
}
$name = basename($path);
$ext = strrchr($name, '.');
switch ($redirect) {
case 1:
header("Location: {$to}");
exit;
case 2:
switch ($ext) {
case '.jpg':
header("Content-Type: image/jpeg; name=\"{$name}\"");
break;
case '.png':
header("Content-Type: image/png; name=\"{$name}\"");
break;
case '.gif':
header("Content-Type: image/gif; name=\"{$name}\"");
break;
default:
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false) {
header("Content-Type: application/octetstream; name=\"{$name}\"");
} else {
header("Content-Type: application/octet-stream; name=\"{$name}\"");
}
}
header("Content-Disposition: inline; filename=\"{$name}\"");
header('Content-Length: ' . filesize($path));
readfile($path);
exit;
default:
if (!class_exists('HTML_Template_Flexy', false)) {
require 'HTML/Template/Flexy.php';
}
if (!class_exists('HTML_QuickForm', false)) {
require 'HTML/QuickForm.php';
}
if (!class_exists('HTML_QuickForm_Renderer_ObjectFlexy', false)) {
require 'HTML/QuickForm/Renderer/ObjectFlexy.php';
}
if (isset($uri)) {
$img_o = 'uri';
$img_p = $uri;
} elseif (isset($id)) {
$img_o = 'id';
$img_p = $id;
} else {
$img_o = 'file';
$img_p = $file;
}
$img_q = $img_o . '=' . rawurlencode($img_p);
// QuickFormの初期化
$_size = explode('x', $thumbnailer->calc($params['width'], $params['height']));
$_constants = array('o' => sprintf('原寸 (%dx%d)', $params['width'], $params['height']), 's' => '作成', 't' => $thumb, 'd' => $dpr, 'u' => $img_p, 'v' => $img_o, 'x' => $_size[0], 'y' => $_size[1]);
$_defaults = array('q' => $ini["Thumb{$thumb}"]['quality'], 'r' => '0');
$mobile = Net_UserAgent_Mobile::singleton();
$qa = 'size=3 maxlength=3';
if ($mobile->isDoCoMo()) {
$qa .= ' istyle=4';
} elseif ($mobile->isEZweb()) {
$qa .= ' format=*N';
} elseif ($mobile->isSoftBank()) {
$qa .= ' mode=numeric';
}
$_presets = array('' => 'サイズ・品質');
foreach ($ini['Dynamic']['presets'] as $_preset_name => $_preset_params) {
$_presets[$_preset_name] = $_preset_name;
}
$qf = new HTML_QuickForm('imgmaker', 'get', 'ic2_mkthumb.php');
$qf->setConstants($_constants);
$qf->setDefaults($_defaults);
$qf->addElement('hidden', 't');
$qf->addElement('hidden', 'u');
$qf->addElement('hidden', 'v');
$qf->addElement('text', 'x', '高さ', $qa);
$qf->addElement('text', 'y', '横幅', $qa);
$qf->addElement('text', 'q', '品質', $qa);
$qf->addElement('select', 'p', 'プリセット', $_presets);
$qf->addElement('select', 'r', '回転', array('0' => 'なし', '90' => '右に90°', '270' => '左に90°', '180' => '180°'));
$qf->addElement('checkbox', 'w', 'トリム');
$qf->addElement('checkbox', 'z', 'DL');
$qf->addElement('submit', 's');
$qf->addElement('submit', 'o');
//.........这里部分代码省略.........
示例3: array
$_attr_s_from = array('size' => 4, 'id' => 's_from');
$_attr_s_to = array('size' => 4, 'id' => 's_to');
$_attr_s_pad = array('size' => 1, 'id' => 's_pad');
$_attr_ref = array('size' => 50);
$_attr_memo = array('size' => 50);
$_attr_submit = array();
$_attr_reset = array();
$_attr_close = array('onclick' => 'window.close()');
// }}}
// {{{ prepare (Form & Template)
// 画像ダウンロード用フォームを設定
$_attribures = array('accept-charset' => 'UTF-8,Shift_JIS');
$_target = $isPopUp ? '_self' : 'read';
$qf = new HTML_QuickForm('get', 'get', $_SERVER['SCRIPT_NAME'], $_target, $_attribures);
$qf->setDefaults($qf_defaults);
$qf->setConstants($qf_constants);
// フォーム要素の定義
$qfe = array();
// 隠し要素
$qfe['detect_hint'] = $qf->addElement('hidden', '_hint');
$qfe['popup'] = $qf->addElement('hidden', 'popup');
$qfe['close'] = $qf->addElement('hidden', 'close');
// URLと連番設定
$qfe['uri'] = $qf->addElement('text', 'uri', 'URL', $_attr_uri);
$qfe['serial'] = $qf->addElement('checkbox', 'serial', '連番', null, $_attr_s_chk);
$qfe['from'] = $qf->addElement('text', 'from', 'From', $_attr_s_from);
$qfe['to'] = $qf->addElement('text', 'to', 'To', $_attr_s_to);
$qfe['padding'] = $qf->addElement('text', 'padding', '0で詰める桁数', $_attr_s_pad);
// リファラとメモ
$qfe['ref'] = $qf->addElement('text', 'ref', 'リファラ', $_attr_ref);
$qfe['memo'] = $qf->addElement('text', 'memo', ' メモ', $_attr_memo);