本文整理汇总了PHP中checkbox_tag函数的典型用法代码示例。如果您正苦于以下问题:PHP checkbox_tag函数的具体用法?PHP checkbox_tag怎么用?PHP checkbox_tag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkbox_tag函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _wpo_edit_cat_row
function _wpo_edit_cat_row($category, $level, &$data)
{
$category = get_category($category);
$name = $category->cat_name;
echo '
<li class="required pad' . $level . '">
' . checkbox_tag('campaign_categories[]', $category->cat_ID, in_array($category->cat_ID, $data['categories']), 'id=category_' . $category->cat_ID) . '
' . label_for('category_' . $category->cat_ID, $name) . '</li>';
}
示例2: options_for_checklists
function options_for_checklists($options = array(), $selected = '', $html_options = array())
{
$html_options = _parse_attributes($html_options);
if (is_array($selected)) {
$valid = array_values($selected);
$valid = array_map('strval', $valid);
}
$html = '';
$i = 0;
foreach ($options as $key => $value) {
$option_options = array('value' => $key);
if (isset($selected) && (is_array($selected) && in_array(strval($key), $valid, true)) || strval($key) == strval($selected)) {
$option_options['selected'] = 'selected';
}
$tagValue = $html_options['name'];
$value = content_tag('label', checkbox_tag($tagValue, $key) . $value, array("for" => $tagValue));
$html .= content_tag('li', $value, $i++ % 2 ? array('class' => 'alt') : null) . "\n";
}
return $html;
}
示例3: object_admin_input_file_tag
function object_admin_input_file_tag($object, $method, $options = array())
{
$options = _parse_attributes($options);
$name = _convert_method_to_name($method, $options);
$html = '';
if ($object->{$method}()) {
if (isset($options['include_link']) && $options['include_link']) {
$image_path = image_path('/' . sfConfig::get('sf_upload_dir_name') . '/' . $options['include_link'] . '/' . $object->{$method}());
$image_text = isset($options['include_text']) ? __($options['include_text']) : __('[show file]');
$html .= sprintf('<a onclick="window.open(this.href);return false;" href="%s">%s</a>', $image_path, $image_text) . "\n";
}
if (isset($options['include_remove']) && $options['include_remove']) {
$html .= checkbox_tag(strpos($name, ']') !== false ? substr($name, 0, -1) . '_remove]' : $name) . ' ' . ($options['include_remove'] != true ? __($options['include_remove']) : __('remove file')) . "\n";
}
}
unset($options['include_link']);
unset($options['include_text']);
unset($options['include_remove']);
return input_file_tag($name, $options) . "\n<br />" . $html;
}
示例4: checkbox_tag
echo checkbox_tag('score[' . $counseling_spec->getId() . ']', 20, true, array('id' => 'score[' . $counseling_spec->getId() . ']'));
} else {
echo checkbox_tag('score[' . $counseling_spec->getId() . ']', 20, false, array('id' => 'score[' . $counseling_spec->getId() . ']'));
}
} else {
echo '';
}
?>
</td>
<td valign="middle" align="left">
<?php
if ($counseling_spec->getParent()) {
if ($stu_coun[$counseling_spec->getId()] == 30) {
echo checkbox_tag('score[' . $counseling_spec->getId() . ']', 30, true, array('id' => 'score[' . $counseling_spec->getId() . ']'));
} else {
echo checkbox_tag('score[' . $counseling_spec->getId() . ']', 30, false, array('id' => 'score[' . $counseling_spec->getId() . ']'));
}
} else {
echo '';
}
?>
</td>
</tr>
<?php
}
?>
<?php
}
?>
</tbody>
</table>
示例5: form_tag
<div id="sf_guard_auth_form">
<?php
echo form_tag('@sf_guard_signin');
?>
<fieldset>
<div class="form-row" id="sf_guard_auth_username">
<?php
echo form_error('username'), label_for('username', __('FAN:')), input_tag('username', $sf_data->get('sf_params')->get('username'));
?>
</div>
<div class="form-row" id="sf_guard_auth_password">
<?php
echo form_error('password'), label_for('password', __('password:')), input_password_tag('password');
?>
</div>
<div class="form-row" id="sf_guard_auth_remember">
<?php
echo label_for('remember', __('Remember me?')), checkbox_tag('remember');
?>
</div>
</fieldset>
<?php
echo submit_tag(__('sign in')), link_to(__('Forgot your password?'), '@sf_guard_password', array('id' => 'sf_guard_auth_forgot_password'));
?>
</form>
</div>
示例6: input_tag
echo input_tag('username', '', array('class' => 'textfield'));
?>
</span>
</li>
<li><span class="lbl"><?php
echo label_for('password', 'Password');
?>
<span class="req">*</span></span>
<span class="fld medium"><?php
echo input_password_tag('password', '', array('class' => 'textfield'));
?>
</span>
</li>
<li><span class="lbl"></span>
<span class="fld"><?php
echo checkbox_tag('rememberme', '1', false, array('id' => 'rememberme', 'class' => 'checkbox'));
echo label_for('rememberme', 'Keep me logged in');
?>
</span>
</li>
<li><span class="lbl"></span>
<span class="btn"><?php
echo submit_tag('Login');
?>
</span>
</li>
</ul>
</form>
<p><?php
echo link_to('Forgot your password ?', '@forgot_password');
示例7: foreach
} else {
?>
<?php
$i = 0;
foreach ($pager->getResults() as $employee) {
?>
<tr class="list<?php
++$i;
if ($i % 2 == 0) {
echo ' even';
}
?>
">
<td nowrap="nowrap">
<?php
echo checkbox_tag('employees', $employee->getId(), false, array('id' => 'employees'));
?>
<?php
echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage();
?>
</td>
<td><?php
echo strlen($employee->getEmpNo()) > 0 ? $employee->getEmpNo() : 'n/a';
?>
</td>
<td><?php
echo $employee->getName() ? $employee->getName() : '-';
?>
</td>
<td><?php
echo $employee->getStaffType() ? $employee->getStaffType()->toString() : '-';
示例8: form_error
?>
form-error<?php
}
?>
">
<?php
if ($sf_request->hasError('tabla{mostrar_en_lista}')) {
?>
<?php
echo form_error('tabla{mostrar_en_lista}', array('class' => 'form-error-msg'));
?>
<?php
}
?>
<?php
$value = checkbox_tag('tabla[mostrar_en_lista]', '', $tabla->getMostrarEnLista(), array('control_name' => 'tabla[mostrar_en_lista]'));
echo $value ? $value : ' ';
?>
<div class="sf_edit_help"><?php
echo __('Indique si desea que se muestre al usuario esta tabla en la lista de tablas');
?>
</div>
</div>
</div>
<div class="form-row">
<?php
echo label_for('tabla[orden]', __($labels['tabla{orden}']) . ":", '');
?>
<div class="content<?php
if ($sf_request->hasError('tabla{orden}')) {
示例9: label_for
</div>
<div class="form-row">
<?php
echo label_for("filters[estado_evento]", __('estado evento') . ":");
?>
<div class="content">
<?php
$opciones = TareaPeer::getAllEstadosEventos();
$html = "";
$html .= "<ul class=\"sf_admin_checklist\">\n";
foreach ($opciones as $estado) {
$i = $estado->getPrimaryKey();
$es_seleccionado = isset($filters['estado_' . $i]) ? true : false;
$html .= "<li>";
$html .= checkbox_tag('filters[estado_' . $i . ']', true, $es_seleccionado);
$html .= label_for("filters[estado_" . $i . "]", $estado->__toString() ? __($estado->__toString()) : '-');
$html .= "</li>\n";
}
$html .= "</ul>\n";
echo $html;
?>
</div>
</div>
<div class="form-row">
<?php
echo label_for("filters[fecha_inicio]", __('inicio') . ":");
?>
<div class="content">
<?php
示例10: checkbox_tag
?>
" width="250" height="33" frameborder="0"></iframe>
<!-- 9th Time -->
<div id='file_tag_9' style="display:none"><?php
echo checkbox_tag('file_9');
?>
<i id='file_label_9'></i></div>
<iframe id='frame_9' style="display:none" src="<?php
echo url_for('collection/uploadFile_9th');
?>
" width="250" height="33" frameborder="0"></iframe>
<!-- 10th Time -->
<div id='file_tag_10' style="display:none"><?php
echo checkbox_tag('file_10');
?>
<i id='file_label_10'></i></div>
<iframe id='frame_10' style="display:none" src="<?php
echo url_for('collection/uploadFile_10th');
?>
" width="250" height="33" frameborder="0"></iframe>
<?php
echo image_tag('ProgressBar.gif', array('style' => 'display: none; padding: 10px 10px;', 'id' => 'loading'));
?>
<br>
<div class="tips">Ukuran Maximum 100MB per File, Batas upload adalah 10 File untuk sekali Upload</div>
</td>
</tr>
</table>
示例11: foreach
} else {
?>
<?php
$i = 0;
foreach ($pager->getResults() as $subject) {
?>
<tr class="list<?php
++$i;
if ($i % 2 == 0) {
echo ' even';
}
?>
">
<td nowrap="nowrap">
<?php
echo checkbox_tag('subjects', $subject->getId(), false, array('id' => 'subjects'));
?>
<?php
echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage();
?>
</td>
<td><?php
echo strlen($subject->getCode()) > 0 ? $subject->getCode() : 'n/a';
?>
</td>
<td><?php
echo $subject->getName() ? $subject->getName() : '-';
?>
</td>
<td><?php
echo $subject->getCredit();
示例12: label_for
</div>
<div class="row">
<?php
echo label_for('password', __('Password') . required());
?>
<?php
echo input_password_tag('password');
?>
<br />
<?php
echo form_error('password', 'class=error');
?>
</div>
<div class="row">
<?php
echo label_for('remember', __('Remember me?'));
?>
<?php
echo checkbox_tag('remember');
?>
</div>
<div class="row right_col">
<?php
echo submit_tag(__('Sign In'));
?>
</div>
</form>
<br />
<?php
echo link_to(__('Forgot your password?'), '@sf_guard_password', array('id' => 'sf_guard_auth_forgot_password'));
示例13: import_process_item
function import_process_item($opml, $campaigns, $count = 0)
{
$i = 0;
foreach ($opml['OUTLINE'] as $key => $item) {
?>
<li class="<?php
echo $i % 2 ? 'even' : 'odd';
?>
">
<?php
if (isset($item['OUTLINE'])) {
// Campaign Category
$count++;
?>
<?php
echo input_hidden_tag('campaign[' . $count . ']', import_get_item_title($item));
?>
<div class="check">
<a href="#">(un)check all</a>
</div>
<h4><?php
echo import_get_item_title($item);
?>
</h4>
<span>Existing Campaign?:</span>
<?php
echo select_tag('use_this_campaign-' . $count, options_for_select($campaigns));
?>
<span>Category</span><?php
wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'cat[' . $count . ']', 'orderby' => 'name', 'order' => 'DESC'));
?>
<ul>
<?php
import_process_item($item, $campaigns, $count);
?>
</ul>
<?php
} else {
// Item
$url = urlencode(import_get_item_xmlurl($item));
if (!$count) {
$count++;
echo input_hidden_tag('campaign[' . $count . ']', import_get_item_title($item));
}
if ($url) {
?>
<ul class="import_links">
<li><?php
echo checkbox_tag('feed[' . $count . '][' . $url . ']', 1, isset($_REQUEST['add']) ? isset($_REQUEST['feed']) ? _data_value($_REQUEST['feed'][$count], $url) : false : true);
?>
</li>
<li><a class="feed_rss" href="<?php
echo import_get_item_xmlurl($item);
?>
">RSS</a></li>
<?php
if (import_get_item_htmlurl($item)) {
?>
<li><a class="feed_link" href="<?php
echo import_get_item_htmlurl($item);
?>
">Website</a></li>
<?php
}
?>
</ul>
<h4><label for="feed_<?php
echo $count;
?>
_<?php
echo $url;
?>
"><?php
echo import_get_item_title($item);
?>
</label></h4>
<?php
}
}
echo '</li>';
$i++;
}
}
示例14: renderJobListView
function renderJobListView($job, $classNum, $renderStatus = false)
{
?>
<div class="job-list-item-<?php
echo $classNum;
?>
">
<?php
$sTime = $job->getStartTime();
$eTime = $job->getEndTime();
$sTime = substr($sTime, -8, 5);
$eTime = substr($eTime, -8, 5);
?>
<table class="job-table" width="100%">
<tr>
<td style="width: 200px"><?php
echo checkbox_tag('job-' . $job->getId(), $job->getId(), 0, array("class" => "job-check"));
?>
Job #<?php
echo link_to($job->getId(), "job_show", $job);
?>
</td>
<td style="width: 250px"><small>Event:</small> <?php
echo truncate_text($job->getEvent(), 24) == $job->getEvent() ? $job->getEvent() : "<span class='tooltip' title=\"" . str_replace('"', "'", $job->getEvent()) . "\">" . truncate_text($job->getEvent(), 30) . "<span>";
?>
</td>
<td style="width: 250px">
<?php
if ($job->getProjectId()) {
$title = truncate_text($job->getProject()->getName(), 24);
if ($title == $job->getProject()->getName()) {
echo "<small>Project:</small> " . link_to($title, "project_view", $job->getProject());
} else {
echo "<small>Project:</small> <span class='tooltip' title=\"" . str_replace('"', "'", $job->getProject()->getName()) . "\">" . link_to($title, "project_view", $job->getProject()) . "</span>";
}
}
?>
</td>
<td style="width: 250px">
<?php
if ($renderStatus) {
?>
<small>Status:</small> <?php
echo $job->getStatus()->getState();
}
?>
</td>
</tr>
<tr>
<td><?php
echo $job->getDate("n/j/Y") . " " . $sTime . " - " . $eTime;
?>
</td>
<td><small>Tags:</small> <?php
renderTagList($job);
?>
</td>
<?php
$photogs = $job->getPhotographers();
if (count($photogs) == 1) {
$i = array_pop($photogs);
?>
<td><small>Photographer:</small> <?php
$name = truncate_text($i->getName(), "16");
echo link_to($name, "photographer_view_jobs", $i) . " ";
?>
</td>
<?php
} elseif (count($photogs) == 0) {
?>
<td><small>Photographer:</small> None</td>
<?php
} else {
?>
<td><small>Photographer:</small> <?php
echo count($photogs);
?>
Assigned</td>
<?php
}
?>
<td><?php
$clients = $job->getClients();
?>
<small>Client:</small>
<?php
if (count($clients) == 1) {
$n = array_pop($clients);
echo $n;
} else {
if (count($clients) > 1) {
echo count($clients);
} else {
//.........这里部分代码省略.........
示例15: object_checkbox_tag
/**
* Returns a checkbox html tag.
*
* @param object $object An object.
* @param string $method An object column.
* @param array $options Checkbox options.
* @param bool $default_value Checkbox value.
*
* @return string An html string which represents a checkbox tag.
*
*/
function object_checkbox_tag($object, $method, $options = array(), $default_value = null)
{
$options = _parse_attributes($options);
$checked = (bool) _get_object_value($object, $method, $default_value);
return checkbox_tag(_convert_method_to_name($method, $options), isset($options['value']) ? $options['value'] : 1, $checked, $options);
}