本文整理汇总了PHP中HTML_Template_Flexy::setData方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Template_Flexy::setData方法的具体用法?PHP HTML_Template_Flexy::setData怎么用?PHP HTML_Template_Flexy::setData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_Template_Flexy
的用法示例。
在下文中一共展示了HTML_Template_Flexy::setData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ic2_display
//.........这里部分代码省略.........
$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');
// FlexyとQurickForm_Rendererの初期化
$_flexy_options = array('locale' => 'ja', 'charset' => 'cp932', 'compileDir' => $_conf['compile_dir'] . DIRECTORY_SEPARATOR . 'ic2', 'templateDir' => P2EX_LIB_DIR . '/ic2/templates', 'numberFormat' => '');
$flexy = new HTML_Template_Flexy($_flexy_options);
$rdr = new HTML_QuickForm_Renderer_ObjectFlexy($flexy);
$qf->accept($rdr);
// 表示
$flexy->setData('p2vid', P2_VERSION_ID);
$flexy->setData('title', 'IC2::Cached');
$flexy->setData('pc', !$_conf['ktai']);
$flexy->setData('iphone', $_conf['iphone']);
if (!$_conf['ktai']) {
$flexy->setData('skin', $GLOBALS['skin_name']);
//$flexy->setData('stylesheets', array('css'));
//$flexy->setData('javascripts', array('js'));
} else {
$flexy->setData('k_color', array('c_bgcolor' => !empty($_conf['mobile.background_color']) ? $_conf['mobile.background_color'] : '#ffffff', 'c_text' => !empty($_conf['mobile.text_color']) ? $_conf['mobile.text_color'] : '#000000', 'c_link' => !empty($_conf['mobile.link_color']) ? $_conf['mobile.link_color'] : '#0000ff', 'c_vlink' => !empty($_conf['mobile.vlink_color']) ? $_conf['mobile.vlink_color'] : '#9900ff'));
}
$rank = isset($params['rank']) ? $params['rank'] : 0;
if ($_conf['iphone']) {
$img_dir = 'img/iphone/';
$img_ext = '.png';
} else {
$img_dir = 'img/';
$img_ext = $_conf['ktai'] ? '.gif' : '.png';
}
$stars = array();
$stars[-1] = $img_dir . ($rank == -1 ? 'sn1' : 'sn0') . $img_ext;
//$stars[0] = $img_dir . (($rank == 0) ? 'sz1' : 'sz0') . $img_ext;
$stars[0] = $img_dir . ($_conf['iphone'] ? 'sz0' : 'sz1') . $img_ext;
for ($i = 1; $i <= 5; $i++) {
$stars[$i] = $img_dir . ($rank >= $i ? 's1' : 's0') . $img_ext;
}
$k_at_a = str_replace('&', '&', $_conf['k_at_a']);
$setrank_url = "ic2.php?{$img_q}&t={$thumb}&r=0{$k_at_a}";
$flexy->setData('stars', $stars);
$flexy->setData('params', $params);
if ($thumb == 2 && $rank >= 0) {
if ($ini['General']['inline'] == 1) {
$t = 2;
示例2: sprintf
$where = $db->quoteIdentifier('rank') . ' < 0';
$to_blacklist = true;
}
$sql = sprintf('SELECT %s FROM %s WHERE %s;', $db->quoteIdentifier('id'), $db->quoteIdentifier($ini['General']['table']), $where);
$result = $db->getAll($sql, null, DB_FETCHMODE_ORDERED | DB_FETCHMODE_FLIPPED);
if (DB::isError($result)) {
P2Util::pushInfoHtml($result->getMessage());
break;
}
if ($result) {
$target = $result[0];
$removed_files = ImageCache2_DatabaseManager::remove($target, $to_blacklist);
} else {
$removed_files = array();
}
$flexy->setData('toBlackList', $to_blacklist);
break;
// PC用以外の作成済みサムネイルを消去する
// PC用以外の作成済みサムネイルを消去する
case 'clearThumb':
$thumb_dir2 = $ini['General']['cachedir'] . '/' . $ini['Thumb2']['name'];
$thumb_dir3 = $ini['General']['cachedir'] . '/' . $ini['Thumb3']['name'];
$result_files2 = P2Util::garbageCollection($thumb_dir2, -1, '', '', true);
$result_files3 = P2Util::garbageCollection($thumb_dir3, -1, '', '', true);
$removed_files = array_merge($result_files2['successed'], $result_files3['successed']);
$failed_files = array_merge($result_files2['failed'], $result_files3['failed']);
if (!empty($failed_files)) {
$info_msg_ht = '<p>以下のファイルが削除できませんでした。</p>';
$info_msg_ht .= '<ul><li>';
$info_msg_ht .= implode('</li><li>', array_map('p2h', $failed_files));
$info_msg_ht .= '</li></ul>';
示例3: array
$qf->addRule('rows', '1 to 100', 'numberInRange', array('min' => 1, 'max' => 100), 'client', true);
$qf->addRule('order', 'invalid order.', 'arrayKeyExists', $_order);
$qf->addRule('sort', 'invalid sort.', 'arrayKeyExists', $_sort);
$qf->addRule('field', 'invalid field.', 'arrayKeyExists', $_field);
$qf->addRule('threshold', '-1 to 5', 'numberInRange', array('min' => -1, 'max' => 5));
$qf->addRule('compare', 'invalid compare.', 'arrayKeyExists', $_compare);
$qf->addRule('mode', 'invalid mode.', 'arrayKeyExists', $_mode);
$qf->addRule('thumbtype', 'invalid thumbtype.', 'arrayKeyExists', $_thumbtype);
// Flexy
$_flexy_options =& PEAR5::getStaticProperty('HTML_Template_Flexy', 'options');
$_flexy_options = array('locale' => 'ja', 'charset' => 'Shift_JIS', 'compileDir' => $_conf['compile_dir'] . DIRECTORY_SEPARATOR . 'iv2', 'templateDir' => P2EX_LIB_DIR . '/ImageCache2/templates', 'numberFormat' => '', 'plugins' => array('P2Util' => P2_LIB_DIR . '/P2Util.php'));
if (!is_dir($_conf['compile_dir'])) {
FileCtl::mkdirRecursive($_conf['compile_dir']);
}
$flexy = new HTML_Template_Flexy();
$flexy->setData('php_self', $_SERVER['SCRIPT_NAME']);
$flexy->setData('base_dir', dirname($_SERVER['SCRIPT_NAME']));
$flexy->setData('p2vid', P2_VERSION_ID);
$flexy->setData('_hint', $_conf['detect_hint']);
if ($_conf['iphone']) {
$flexy->setData('top_url', 'index.php');
} elseif ($_conf['ktai']) {
$flexy->setData('k_color', array('c_bgcolor' => !empty($_conf['mobile.background_color']) ? $_conf['mobile.background_color'] : '#ffffff', 'c_text' => !empty($_conf['mobile.text_color']) ? $_conf['mobile.text_color'] : '#000000', 'c_link' => !empty($_conf['mobile.link_color']) ? $_conf['mobile.link_color'] : '#0000ff', 'c_vlink' => !empty($_conf['mobile.vlink_color']) ? $_conf['mobile.vlink_color'] : '#9900ff'));
$flexy->setData('top_url', dirname($_SERVER['SCRIPT_NAME']) . '/index.php');
$flexy->setData('accesskey', $_conf['accesskey']);
} else {
$flexy->setData('skin', str_replace('&', '&', $skin_en));
}
$flexy->setData('pc', !$_conf['ktai']);
$flexy->setData('iphone', $_conf['iphone']);
$flexy->setData('doctype', $_conf['doctype']);
示例4: array
foreach ($_preview_size as $value => $lavel) {
$preview_size[$value] = HTML_QuickForm::createElement('radio', null, null, $lavel, $value);
}
$qf->addGroup($preview_size, 'preview_size', 'プレビュー', ' ');
if (!isset($_GET['preview_size'])) {
$preview_size[1]->updateAttributes('checked="checked"');
}
// 決定・リセット・閉じる
$qfe['download'] = $qf->addElement('submit', 'download');
$qfe['reset'] = $qf->addElement('reset', 'reset');
$qfe['close'] = $qf->addElement('button', 'close', null, $_attr_close);
// Flexy
$_flexy_options =& PEAR5::getStaticProperty('HTML_Template_Flexy', 'options');
$_flexy_options = array('locale' => 'ja', 'charset' => 'Shift_JIS', 'compileDir' => $_conf['compile_dir'] . DIRECTORY_SEPARATOR . 'ic2', 'templateDir' => P2EX_LIB_DIR . '/ImageCache2/templates', 'numberFormat' => '');
$flexy = new HTML_Template_Flexy();
$flexy->setData('php_self', $_SERVER['SCRIPT_NAME']);
$flexy->setData('p2vid', P2_VERSION_ID);
$flexy->setData('skin', $skin_en);
$flexy->setData('isPopUp', $isPopUp);
$flexy->setData('pc', !$_conf['ktai']);
$flexy->setData('iphone', $_conf['iphone']);
$flexy->setData('doctype', $_conf['doctype']);
$flexy->setData('extra_headers', $_conf['extra_headers_ht']);
$flexy->setData('extra_headers_x', $_conf['extra_headers_xht']);
// }}}
// {{{ validate
$execDL = false;
if ($qf->validate() && ($params = $qf->getSubmitValues()) && isset($params['uri']) && isset($params['download'])) {
$execDL = true;
$params = array_map('trim', $params);
// URLを検証
示例5: elseif
$result = $db->query($sql);
if (DB::isError($result)) {
p2die($result->getMessage());
}
} elseif (isset($_POST['delete']) && isset($_POST['target']) && is_array($_POST['target'])) {
foreach ($_POST['target'] as $target) {
$delete = clone $table;
$delete->uri = $target;
$delete->delete();
}
}
// }}}
// {{{ 出力
$_flexy_options = array('locale' => 'ja', 'charset' => 'cp932', 'compileDir' => $_conf['compile_dir'] . DIRECTORY_SEPARATOR . 'ic2', 'templateDir' => P2EX_LIB_DIR . '/ic2/templates', 'numberFormat' => '');
$flexy = new HTML_Template_Flexy($_flexy_options);
$flexy->setData('php_self', $_SERVER['SCRIPT_NAME']);
$flexy->setData('skin', $skin_en);
$flexy->setData('title', $title);
$flexy->setData('mode', $mode);
$flexy->setData('reload_js', $_SERVER['SCRIPT_NAME'] . '?nt=' . time() . '&table=' . $mode);
$flexy->setData('info_msg', P2Util::getInfoHtml());
$flexy->setData('pc', !$_conf['ktai']);
$flexy->setData('iphone', $_conf['iphone']);
$flexy->setData('doctype', $_conf['doctype']);
$flexy->setData('extra_headers', $_conf['extra_headers_ht']);
$flexy->setData('extra_headers_x', $_conf['extra_headers_xht']);
if ($table->find()) {
switch ($mode) {
case 'errlog':
$flexy->setData('data_renderer_errlog', TRUE);
$flexy->setData('data', ic2_dump_table_errlog($table));