function check_box_tag($name, $checked = false, $options = array()) { $options['type'] = 'checkbox'; $options['name'] = $name; $options['value'] = 1; if ($checked) { $options['checked'] = 'checked'; } return hidden_field_tag($name, 0) . empty_tag('input', $options); }
</tbody> </table> </form> <div id="add-box" style="display: none;"> <?php echo form_tag("#create"); ?> <h4>Add Implication</h4> <p>You can suggest a new implication, but it must be approved by a moderator before it is activated.</p> <p>The predicate tag is the tag that is matched against, and the consequent tag is the tag that is added. For example, a tag implication with predicate=square consequent=rectangle would mean any post tagged with square would also be tagged with rectangle.</p> <?php if (!User::$current->is_anonymous) { ?> <?php echo hidden_field_tag("tag_implication[creator_id]", User::$current->id); ?> <?php } ?> <table> <tr> <th><label for="tag_implication_predicate">Predicate</label></th> <td><?php echo text_field_tag("tag_implication[predicate]", array('size' => 40)); ?> </td> </tr> <tr> <th><label for="tag_implication_consequent">Consequent</label></th>
/** * Returns an input tag of the "hidden" type. */ function hidden_field($objectName, $method, $object, $options = array()) { list($name, $value, $options) = default_options($objectName, $method, $object, $options); return hidden_field_tag($name, $value, $options); }
<?php if (!$forum_post->is_locked) { ?> <div style="clear: both;"> <div id="preview" class="response-list" style="display: none; margin: 1em 0;"> </div> <div id="reply" style="display: none; clear: both;"> <form action="/forum/create" class="need-signup" method="post"> <?php echo hidden_field_tag(">forum_post[title]", ""); ?> <?php echo hidden_field_tag(">forum_post[parent_id]", $forum_post->root_id); ?> <?php echo text_area(">forum_post[body]", array('rows' => 20, 'cols' => 80, 'value' => "")); ?> <?php echo submit_tag("Post"); ?> <input name="preview" onclick="new Ajax.Updater('preview', '/forum/preview', {asynchronous:true, evalScripts:true, method:'get', onSuccess:function(request){$('preview').show()}, parameters:Form.serialize(this.form)});" type="button" value="Preview"/> </form> </div> </div> <?php } ?>
<div class="palette palette-info"> <?php echo text_field($this->entity, "url", "Project's Github url", array("class" => "span10", "id" => "project-url-field", "no-container" => true)); ?> <?php echo link_to("#", "Query", array("class" => "btn btn-primary", "id" => "query-btn")); ?> <br/> <span class="">Enter the url for your project and the information below will be gathered using GitHub's API</span> </div> <div class="palette palette-info-dark"> <?php echo hidden_field_tag("owner_avatar", "owner_avatar"); ?> <?php echo text_field($this->entity, "name", "Project's Name", array("class" => "span6")); ?> <?php echo textarea_field($this->entity, "description", "Project's description", array("class" => "span10")); ?> <div class="one-line-form-elements"> <?php echo text_field_tag("owner_name", "project_owner_name", "Project Owner"); ?> <?php
<?php } ?> <?php } ?> </p> <?php } ?> <?php echo form_tag("#authenticate"); ?> <?php echo hidden_field_tag("url", Request::$params->url); ?> <table class="form"> <tr> <th width="15%"><label class="block" for="user_name">Name</label></th> <td width="85%"><?php echo text_field_tag("user->name", array('tabindex' => 1)); ?> </td> </tr> <tr> <th><label class="block" for="user_password">Password</label></th> <td><input type="password" id="user_password" name="user[password]" tabindex="1" /></td> </tr> <tr> <td colspan="2"><?php
echo hidden_field_tag(">user_id", $params->user_id); ?> <?php } ?> <?php echo hidden_field_tag(">left", 0); ?> <?php echo hidden_field_tag(">right", 0); ?> <?php echo hidden_field_tag(">top", 0); ?> <?php echo hidden_field_tag(">bottom", 0); ?> <div width="200px"> <div id="crop-preview-box"> <div class="crop-preview-frame" style="width: <?php echo CONFIG::avatar_max_width + 10; ?> px; height: <?php echo CONFIG::avatar_max_height + 10; ?> px;"> <div class="crop-preview-frame-inner"> <div id="crop-preview"></div> </div> </div>
</table> </form> </div> <div id="add-box" style="display: none;"> <?php echo form_tag("#create"); ?> <h4>Add Alias</h4> <p>You can suggest a new alias, but it must be approved by an administrator before it is activated.</p> <?php if (!User::$current->is_anonymous) { ?> <?php echo hidden_field_tag("tag_alias[creator_id]", User::$current->id); ?> <?php } ?> <table> <tr> <th><label for="tag_alias_name">Name</label></th> <td><?php echo text_field_tag("tag_alias->name", array('size' => 40)); ?> </td> </tr> <tr> <th><label for="tag_alias_alias">Alias to</label></th>
<?php echo form_tag("#create"); ?> <?php echo hidden_field_tag(">forum_post[parent_id]", request::$params->parent_id, array('id' => "forum_post_parent_id")); ?> <table> <tr><td><label for="forum_post_title">Title</label></td><td><?php echo text_field_tag(">forum_post[title]", array('size' => 60)); ?> </td></tr> <tr><td colspan="2"><?php echo text_area(">forum_post[body]", array('rows' => 20, 'cols' => 80)); ?> </td></tr> <tr><td colspan="2"><?php echo submit_tag("Post"); ?> </td></tr> </table> </form>
?> <li><?php echo link_to("Help", "help#forum"); ?> </li> <?php end_content_for(); ?> <div id="preview" style="display: none; margin: 1em 0;"> </div> <div id="reply" style="display: none;"> <form action="/forum/create" class="need-signup" method="post"> <?php echo hidden_field_tag("forum_post[parent_id]", request::$params->parent_id); ?> <table> <tr> <td><label for="forum_post_title">Title</label></td> <td><?php echo text_field_tag("forum_post[title]", array('size' => 60)); ?> </td> </tr> <tr> <td colspan="2"><?php echo text_area("forum_post[body]", array('rows' => 20, 'cols' => 80)); ?> </td> </tr>
function checkbox_tag($tag_name, $tag_value = 'no_value_attribute', $attrs = array()) { $hidden_tag = hidden_field_tag($tag_name, 0, array('id' => null)); $checkbox_tag = HTMLTags::create_form_tag('checkbox', $tag_name, $tag_value, array_merge($attrs, array('value' => '1'))); return $hidden_tag . "\r\n" . $checkbox_tag; }
<?php echo form_tag("#add_post"); ?> <?php echo hidden_field_tag('>post_id', Request::$params->post_id); ?> <?php echo select_tag('>pool_id', $options, $option_value); ?> <input onclick="User.run_login(false, function() { Pool.add_post(<?php echo Request::$params->post_id; ?> , $F('pool_id')) });" type="button" value="Add"/> </form>
public function testHiddenFieldTag() { $this->assertDomEqual(hidden_field_tag('id', 3), '<input id="id" name="id" type="hidden" value="3" />'); }
</ul> </td> </tr> <?php } ?> </tbody> </table> </form> </div> <div> <h2>Flagged</h2> <form method="post" action="/post/moderate"> <?php echo hidden_field_tag("reason2", ''); ?> <table width="100%"> <tfoot> <tr> <td colspan="3"> <a href="#" onclick="$$('.f').each(function (i) {i.checked = true; highlight_row(i)});return false;">Select all</a> <a href="#" onclick="$$('.f').each(function (i) {i.checked = !i.checked; highlight_row(i)});return false;">Invert selection</a> <?php echo submit_tag("Approve"); ?> <?php echo submit_tag("Delete", array('onclick' => "var reason = prompt('Enter a reason'); if (reason != null) {\$('reason2').value = reason; return true} else {return false}")); ?>
<h2>New Topic</h2> <div style="margin: 1em 0;"> <div id="preview" class="response-list" style="display: none;"> </div> <div id="reply" style="clear: both;"> <?php echo form_tag("#create"); ?> <?php $forum_post->parent_id && (print hidden_field_tag("forum_post->parent_id")); ?> <table> <tr> <td><label for="forum_post_title">Title</label></td> <td><?php echo text_field_tag("forum_post->title", array('size' => 60)); ?> </td> </tr> <tr> <td colspan="2"><?php echo text_area("forum_post->body", array('rows' => 20, 'cols' => 80)); ?> </td> </tr> <tr> <td colspan="2"><?php echo submit_tag("Post"); ?>
/** * Campo para tipo hora * @param string $name id del campo * * format: %h:%m:%s (%h=hora, %m=minutos, %s=segundos) * * @return string **/ function time_field_tag($name = '') { $params = is_array($name) ? $name : Util::getParams(func_get_args()); $hours = array('00' => '00', '01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23'); $mins = array('00' => '00', '01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05', '06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20', '21' => '21', '22' => '22', '23' => '23', '24' => '24', '25' => '25', '26' => '26', '27' => '27', '28' => '28', '29' => '29', '30' => '30', '31' => '31', '32' => '32', '33' => '33', '34' => '34', '35' => '35', '36' => '36', '37' => '37', '38' => '38', '39' => '39', '40' => '40', '41' => '41', '42' => '42', '43' => '43', '44' => '44', '45' => '45', '46' => '46', '47' => '47', '48' => '48', '49' => '49', '50' => '50', '51' => '51', '52' => '52', '53' => '53', '54' => '54', '55' => '55', '56' => '56', '57' => '57', '58' => '58', '59' => '59'); if (isset($params['value'])) { $value = $params['value']; unset($params['value']); } else { $value = get_value_from_action($name); } if (!$value) { $value = '00:00:00'; } $format = isset($params['format']) ? $params['format'] : '%h:%m'; $hidden = hidden_field_tag($params[0], "value: {$value}"); if ($value) { $value = explode(':', $value); } $data = get_id_and_name($params[0]); $code = ''; $format = explode(':', $format); $onchange = "\n\t\tvar hora = document.getElementById('{$data['id']}_h');\n\t\tvar min = document.getElementById('{$data['id']}_m');\n\t\tvar seg = document.getElementById('{$data['id']}_s');\n\t\tvar value = '';\n\t\tif(hora) {\n\t\t\tvalue+=hora.value;\n\t\t} else {\n\t\t\tvalue+='00';\n\t\t}\n\t\tvalue+=':';\n\t\tif(min) {\n\t\t\tvalue+=min.value;\n\t\t} else {\n\t\t\tvalue+='00';\n\t\t}\n\t\tvalue+=':';\n\t\tif(seg) {\n\t\t\tvalue+=seg.value;\n\t\t} else {\n\t\t\tvalue+='00';\n\t\t}\n\t\tdocument.getElementById('{$data['id']}').value = value;\n\t"; if (isset($params['onchange'])) { $params['onchange'] .= $onchange; } else { $params['onchange'] = $onchange; } foreach ($format as $f) { if ($f == '%h') { if ($code) { $code .= ':'; } if ($value) { $params['selected'] = $value[0]; } $params[1] = $hours; $code .= select_tag(array_merge($params, array('name' => '', 'id' => $data['id'] . '_h'))); unset($params['selected']); } elseif ($f == '%m') { if ($code) { $code .= ':'; } if ($value) { $params['selected'] = $value[1]; } $params[1] = $mins; $code .= select_tag(array_merge($params, array('name' => '', 'id' => $data['id'] . '_m'))); unset($params['selected']); } elseif ($f == '%s') { if ($code) { $code .= ':'; } if ($value) { $params['selected'] = $value[2]; } $params[1] = $mins; $code .= select_tag(array_merge($params, array('name' => '', 'id' => $data['id'] . '_s'))); unset($params['selected']); } } return $code . $hidden; }
<div id="comment-edit"> <h4>Edit Comment</h4> <?php echo form_tag("#update"); ?> <?php echo hidden_field_tag("id", Request::$params->id); ?> <?php echo text_area("comment->body", array('rows' => 10, 'cols' => 60)); ?> <br> <?php echo submit_tag("Save changes"); ?> </form> </div>
?> <?php echo form_tag("#destroy"); ?> <?php echo hidden_field_tag("id", Request::$params->id); ?> <label>Reason</label> <?php echo text_field_tag("reason"); ?> <?php if ($post->is_deleted()) { ?> <?php echo hidden_field_tag("destroy", "1"); ?> <?php } else { ?> <br /> <input type="hidden" name="destroy" value="0" /> <label for="post_destroy">Destroy completely</label> <input id="post_destroy" type="checkbox" name="destroy" value="1" /><br /> <?php } ?> <?php echo submit_tag($post->is_deleted() ? "Destroy permanently" : "Delete"); ?> <?php
var found = false; $$(".pp").each(function(x) { if(x.id == "pool_post_sequence_" + start) found = true; if(!found) return; x.value = Number(x.value) + offset; }); } </script> <?php echo form_tag("#order"); ?> <?php echo hidden_field_tag("pool->id", $pool->id); ?> <table> <thead> <tr> <th></th> <th>Order</th> </tr> </thead> <tbody> <?php foreach ($pool_posts as $pp) { ?> <tr> <td> <?php