本文整理汇总了PHP中input_file_tag函数的典型用法代码示例。如果您正苦于以下问题:PHP input_file_tag函数的具体用法?PHP input_file_tag怎么用?PHP input_file_tag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了input_file_tag函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: object_admin_input_file_tag
/**
* ObjectHelper for admin generator.
*
* @package symfony
* @subpackage helper
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
* @version SVN: $Id: ObjectAdminHelper.php 3746 2007-04-11 08:08:38Z fabien $
*/
function object_admin_input_file_tag($object, $method, $options = array())
{
$options = _parse_attributes($options);
$name = _convert_method_to_name($method, $options);
$html = '';
$value = _get_object_value($object, $method);
if ($value) {
if ($include_link = _get_option($options, 'include_link')) {
$image_path = image_path('/' . sfConfig::get('sf_upload_dir_name') . '/' . $include_link . '/' . $value);
$image_text = ($include_text = _get_option($options, 'include_text')) ? __($include_text) : __('[show file]');
$html .= sprintf('<a onclick="window.open(this.href);return false;" href="%s">%s</a>', $image_path, $image_text) . "\n";
}
if ($include_remove = _get_option($options, 'include_remove')) {
$html .= checkbox_tag(strpos($name, ']') !== false ? substr($name, 0, -1) . '_remove]' : $name) . ' ' . ($include_remove != true ? __($include_remove) : __('remove file')) . "\n";
}
}
return input_file_tag($name, $options) . "\n<br />" . $html;
}
示例2: form_tag
echo form_tag('personal/update', 'multipart=true');
echo object_input_hidden_tag($personal, 'getId');
?>
<input type="hidden" name="user_id" value="<?php
echo $personal->getUserId();
?>
">
<div class="page">
<h3>Edit Profile</h3>
<div class="vspacer20"> </div>
<div class="oddRow">
<div class="editrowdataleft"><div class="editrowdatalefttext">Profile Image :</div></div>
<div class="editrowdatamiddle"><?php
echo input_file_tag('image', array('size' => '30'));
?>
</div>
<div class="editrowdataright"><span id="deletemsg"> </span><img src="/images/delete.png" alt="Delete profile image" onclick="deleteimage('<?php
echo $personal->getId();
?>
')" style="cursor: pointer;"></div>
</div>
<div class="evenRow">
<div class="editrowdataleft"><div class="editrowdatalefttext">Salutation :</div></div>
<div class="editrowdatamiddle"><?php
echo select_tag('salutation', options_for_select($salutations, $personal->getSalutation()));
?>
</div>
<div class="editrowdataright"> </div>
</div>
示例3: label_for
</div>
<?php
}
?>
<?php
if ($DefParametro->getCampoFichero() != "") {
?>
<div class="form-row">
<?php
echo label_for('nombrefichero', __($DefParametro->getCampoFichero()));
?>
<div class="row-data">
<?php
echo input_file_tag('nombrefichero', 0);
?>
<br />
<?php
if (!$parametro->getTamano()) {
?>
<font class='error'><?php
echo __('No hay fichero definido');
?>
</font>
<?php
} else {
?>
<?php
echo link_to($parametro->getNombrefichero(), 'parametros/bajar?idparametro=' . $parametro->getIdparametro(), 'onclick="descargar_fichero = true;setTimeout (\'descargar_fichero = false\',1000);" ');
?>
示例4: form_tag
<?php
echo form_tag('class_agenda/uploadFile', 'multipart=true');
?>
<?php
echo input_file_tag('file', array('onchange' => '
date = new Date();
mainDoc = document.defaultView.parent.document;
mainDoc.getElementById("file_4").value = document.getElementById("file").value;
mainDoc.getElementById("file_4").checked = \'checked\';
mainDoc.getElementById("file_tag_4").style.display = \'\';
mainDoc.getElementById("frame_4").style.display = \'none\';
mainDoc.getElementById("file_label_4").innerHTML = document.getElementById("file").value;
mainDoc.getElementById("frame_5").style.display = \'\';
document.forms[0].submit();
'));
?>
</form>
示例5: alert
} else {
?>
<script>
mainDoc = document.defaultView.parent.document;
mainDoc.getElementById("loading").style.display='';
alert('<?php
echo __('File Tidak Berhasil Diupload, Silahkan Coba Lagi');
?>
');
</script>
<?php
}
}
?>
<?php
echo form_tag('collection/uploadFile_6th', 'multipart=true');
?>
<?php
echo input_file_tag('file', array('onchange' => '
date = new Date();
mainDoc = document.defaultView.parent.document;
mainDoc.getElementById("file_6").value = document.getElementById("file").value;
mainDoc.getElementById("loading").style.display= \'\';
mainDoc.getElementById("frame_6").style.display = \'none\';
document.forms[0].submit();
'));
?>
</form>
示例6: alert
<?php
} else {
?>
<script>
mainDoc = document.defaultView.parent.document;
mainDoc.getElementById("loading").style.display='';
alert('<?php
echo __('File Tidak Berhasil Diupload, Silahkan Coba Lagi');
?>
');
</script>
<?php
}
}
?>
<?php
echo form_tag('collection/uploadFile_1st', 'multipart=true');
?>
<?php
echo input_file_tag('file', array('onchange' => '
date = new Date();
mainDoc = document.defaultView.parent.document;
mainDoc.getElementById("file_1").value = document.getElementById("file").value;
mainDoc.getElementById("loading").style.display= \'\';
mainDoc.getElementById("frame_1").style.display = \'none\';
document.forms[0].submit();
', 'before' => "showIndicator('content', 'snakebig_black')", 'complete' => "hideIndicator()"));
?>
</form>
示例7: array
$t->diag('input_tag()');
$t->is(input_tag('name'), '<input type="text" name="name" id="name" value="" />', 'input_tag() takes a name as its first argument');
$t->is(input_tag('name', 'foo'), '<input type="text" name="name" id="name" value="foo" />', 'input_tag() takes a value as its second argument');
// options
$t->is(input_tag('name', null, array('class' => 'foo')), '<input type="text" name="name" id="name" value="" class="foo" />', 'input_tag() takes an array of attribute options as its third argument');
$t->is(input_tag('name', null, array('type' => 'password')), '<input type="password" name="name" id="name" value="" />', 'input_tag() can override the "type" attribute');
$t->is(input_tag('name', null, array('id' => 'foo')), '<input type="text" name="name" id="foo" value="" />', 'input_tag() can override the "id" attribute');
// input_hidden_tag()
$t->diag('input_hidden_tag()');
$t->is(input_hidden_tag('name'), '<input type="hidden" name="name" id="name" value="" />', 'input_hidden_tag() takes a name as its first argument');
$t->is(input_hidden_tag('name', 'foo'), '<input type="hidden" name="name" id="name" value="foo" />', 'input_hidden_tag() takes a value as its second argument');
$t->is(input_hidden_tag('name', null, array('class' => 'foo')), '<input type="hidden" name="name" id="name" value="" class="foo" />', 'input_hidden_tag() takes an array of attribute options as its third argument');
// input_file_tag()
$t->diag('input_file_tag()');
$t->is(input_file_tag('name'), '<input type="file" name="name" id="name" value="" />', 'input_file_tag() takes a name as its first argument');
$t->is(input_file_tag('name', array('class' => 'foo')), '<input type="file" name="name" id="name" value="" class="foo" />', 'input_hidden_tag() takes an array of attribute options as its second argument');
// input_password_tag()
$t->diag('input_password_tag()');
$t->is(input_password_tag('name'), '<input type="password" name="name" id="name" value="" />', 'input_password_tag() takes a name as its first argument');
$t->is(input_password_tag('name', 'foo'), '<input type="password" name="name" id="name" value="foo" />', 'input_password_tag() takes a value as its second argument');
$t->is(input_password_tag('name', null, array('class' => 'foo')), '<input type="password" name="name" id="name" value="" class="foo" />', 'input_password_tag() takes an array of attribute options as its third argument');
// textarea_tag()
$t->diag('textarea_tag()');
$t->is(textarea_tag('name'), '<textarea name="name" id="name"></textarea>', 'textarea_tag() takes a name as its first argument');
$t->is(textarea_tag('name', 'content'), '<textarea name="name" id="name">content</textarea>', 'textarea_tag() takes a value as its second argument');
$t->is(textarea_tag('name', '<p>foo</p>'), '<textarea name="name" id="name"><p>foo</p></textarea>', 'textarea_tag() escapes the content');
$t->is(textarea_tag('name', '<p>foo</p>'), '<textarea name="name" id="name"><p>foo</p></textarea>', 'textarea_tag() does not escape an already escaped content');
// options
$t->is(textarea_tag('name', null, array('class' => 'foo')), '<textarea name="name" id="name" class="foo"></textarea>', 'textarea_tag() takes an array of attribute options as its third argument');
$t->is(textarea_tag('name', null, array('id' => 'foo')), '<textarea name="name" id="foo"></textarea>', 'textarea_tag() can override the "id" attribute');
$t->is(textarea_tag('name', null, array('size' => '5x20')), '<textarea name="name" id="name" rows="20" cols="5"></textarea>', 'textarea_tag() can take a "size" attribute');
示例8: elseif
mainDoc.getElementById("photoError").style.display = 'none';
</script>
<?php
}
} elseif (isset($error) && $error) {
?>
<script>
mainDoc = document.defaultView.parent.document;
mainDoc.getElementById("photoError").innerHTML = "<?php
echo __('imageUploadError');
?>
";
mainDoc.getElementById("photoError").style.display = '';
</script>
<?php
}
echo form_tag('employee/uploadPhoto', 'multipart=true');
?>
<?php
echo input_hidden_tag('fileRenameTo');
?>
<?php
echo input_file_tag('photo', array('onchange' => '
date = new Date();
mainDoc = document.defaultView.parent.document;
document.getElementById("fileRenameTo").value = ""+date.getFullYear()+date.getMonth()+date.getDate()+date.getHours()+date.getMinutes()+date.getSeconds()+date.getMilliseconds();
mainDoc.getElementById("photoFile").value = document.getElementById("fileRenameTo").value;
document.forms[0].submit();
'));
?>
</form>
示例9: form_tag
<?php
}
?>
</tbody>
</table>
</div>
<div style="float:left;clear:left;padding-top:15px;width:30%;" id="file_uploader">
<div class="blue-shadow"><div class="blue-title blue-content">Upload File</div></div>
<div class="blue-shadow">
<div class="blue-content">
<?php
echo form_tag('#');
?>
<?php
echo label_for('file', __('File Path'), array('style' => 'display:block;')), input_file_tag('file');
?>
<?php
echo label_for('tags', __('Tags'), array('style' => 'display:block;')), input_tag('tags');
?>
<?php
echo submit_tag('save', array('class' => 'btn'));
?>
</form>
</div>
</div>
</div>
<hr class="clear" />
示例10: __
echo __('You can add %1%, with %3% x %2% px and %4% mo', array('%1%' => implode(', ', $validation['file_extensions']), '%2%' => $validation['max_size']['height'], '%3%' => $validation['max_size']['width'], '%4%' => $validation['weight'] / pow(1024, 2))) . ' ' . __('Minsize is %1% x %2%', array('%1%' => $validation['min_size']['height'], '%2%' => $validation['min_size']['width']));
?>
</p>
<div id="image_input">
<?php
echo form_tag('images/jsupload?mod=' . $mod . '&document_id=' . $document_id, array('multipart' => true, 'name' => 'form_file_input', 'id' => 'form_file_input'));
?>
<div id="image_selection">
<div class="image_form_error" style="display:none">
↓ <?php
echo __('wrong file type');
?>
↓</div>
<?php
echo label_for('image_file', __('select an image file'));
echo input_file_tag('image_file[]', array('onchange' => 'C2C.ImageUpload.onchangeCallback()', 'multiple' => 'multiple'));
echo ' ';
echo button_to_function(__('save'), "\$('.images_submit').hide(); \$('#images_validate_form').submit()", array('disabled' => 'disabled', 'class' => 'images_submit'));
echo input_hidden_tag('action', 'addtempimages');
echo input_hidden_tag('image_number', 0);
?>
<span id="image_add_str" style="display:none">
<?php
echo __('add an other image');
?>
</span>
</div>
</form>
</div>
<?php
echo form_tag('images/jsupload?mod=' . $mod . '&document_id=' . $document_id, array('id' => 'images_validate_form'));
示例11: __
<th><label for="cfg_app_app_short_name"><?php
echo __('Short name of application');
?>
</label></th>
<td><?php
echo input_tag('cfg[app_app_short_name]', sfConfig::get('app_app_short_name'), array('size' => '40'));
?>
</td>
</tr>
<tr>
<th><label for="cfg_app_app_logo_file"><?php
echo __('Logo');
?>
</label></th>
<td><?php
echo input_file_tag('cfg_app_app_logo_file') . input_hidden_tag('cfg[app_app_logo]', sfConfig::get('app_app_logo'), array('size' => '40'));
if (is_file(sfConfig::get('sf_upload_dir') . '/' . sfConfig::get('app_app_logo'))) {
echo '<div>' . sfConfig::get('app_app_logo') . '</div>' . input_checkbox_tag('delete_logo') . ' <label for="delete_logo">' . __('Delete') . '</label>';
}
echo '<div><i>' . __('Note: logo might be not looks OK in all skins so you should pick one skin or create your own skin.') . '</i></div>';
?>
</td>
</tr>
</table>
<br>
<?php
$skins_list = array();
$skinsDir = sfConfig::get('sf_web_dir') . '/css/skins/';
if ($handle = opendir($skinsDir)) {
示例12: printParam
public function printParam($mandatory, $lable, $param_name, $input_type, $original_extra_params = NULL, $extra_params_for_select = NULL, $should_echo = NULL)
{
if ($should_echo == NULL) {
$should_echo = $this->m_should_echo;
}
$res = "";
if ($this->m_object_type === self::OBJECT_TYPE_MY_BASE_OBJECT) {
$p = $this->m_current_object->getParamFromObject($param_name);
} else {
if ($this->m_object_type === self::OBJECT_TYPE_ORM_BASE_OBJECT) {
$p = baseObjectUtils::getParamFromObject($this->m_current_object, $param_name);
}
}
// use this so the style=font-size:8pt will always be appended to the original_extra_params
$extra_params = array();
//["style"] = "font-size:8pt";
kArray::associativePush($extra_params, $original_extra_params);
if (kString::isEmpty($this->m_current_prefix)) {
$field_name = $param_name;
} else {
$field_name = $this->m_current_prefix . self::PREFIX_NAME_SEPARATOR . $param_name;
}
$error = form_error($param_name);
if ($this->m_create_tr) {
if ($error) {
$res .= "<tr><td colspan=2>" . $error . "</td></tr>";
}
if ($input_type == "hidden") {
$res .= "<tr><td></td>";
} else {
$res .= " <tr><td valign=top><label for=\"" . $field_name . "\">" . ($mandatory ? "*" : "") . $lable . ":</label></td>";
}
$res .= "<td sytle='font-size:8pt'>";
} else {
// do nothing - the format will be done externally
}
if ($input_type == "text") {
$res .= input_tag($field_name, $p, $extra_params);
} elseif ($input_type == "hidden") {
$res .= input_hidden_tag($field_name, $p, $extra_params);
} elseif ($input_type == "textarea") {
$res .= textarea_tag($field_name, $p, $extra_params);
} elseif ($input_type == "upload") {
$res .= self::createUploadStructure($field_name, $p, NULL, $extra_params, NULL, $should_echo);
/*
echo tag('input', array_merge(array('name' => $field_name, 'value' => $p ,
'id' => $field_name, 'READONLY' => '', 'oncomplete' => 'onComplete_'.str_replace('.', '_', $field_name).'()'), $extra_params));
echo tag('input', array_merge(array('type' => 'button', 'value' => 'MyBrowse...',
'onclick' => 'uploadBrowse(this)', 'uploadElement' => "$field_name"), $extra_params));
echo tag('input', array_merge(array('type' => 'button', 'value' => 'Clear',
'onclick' => 'javascript:{$(\''.$field_name.'\').value = \'\';}'), $extra_params));
if ( ! kString::isEmpty ( $p ) )
{
echo "<img src='/images/file_exists.png' width='16' height='16'>";
}
*/
} elseif ($input_type == "file") {
$res .= input_file_tag($field_name, $p, $extra_params);
} elseif ($input_type == "date") {
$extra_params["rich"] = "true";
$extra_params["style"] = "width:80";
kArray::associativePush($extra_params, $original_extra_params);
// TODO - see how to format the date there and back from the DB format "dd/mm/yyyy" to "
$converted_date = dateUtils::convertFromPhpDate($p);
// always append the default "rich=true" to the extra_params
//$extra_params[] = 'rich=true' ;
$res .= input_date_tag($field_name, $converted_date, $extra_params);
} elseif ($input_type == "select") {
$more_extra_params = array("style" => "font-size:8pt");
kArray::associativePush($more_extra_params, $extra_params_for_select);
$res .= select_tag($field_name, options_for_select($original_extra_params, $p), $more_extra_params);
} elseif ($input_type == "radio") {
// assume the $lable holda the value of the radio
$res .= radiobutton_tag($field_name, $lable, $p == $lable);
} elseif ($input_type == "radiogroup") {
// assume the $extra_params hold a lable-value array
foreach ($extra_params as $lable => $name) {
$value = $extra_params[$lable];
$res .= $lable . " " . radiobutton_tag($field_name, $value, $p == $value);
}
} elseif ($input_type == "checkbox") {
$res .= checkbox_tag($field_name, "true", $p == "true", $extra_params);
} elseif ($input_type == "color") {
die("color is no longer supported !");
// $res .= myColorPicker::getPickerHtml( $p , $field_name ); // TODO - pass on $extra_params ?
} elseif ($input_type == "country") {
$more_extra_params = array("style" => "font-size:8pt");
kArray::associativePush($more_extra_params, $extra_params_for_select);
$res .= select_country_tag($field_name, $p, $more_extra_params);
} elseif ($input_type == "language") {
$more_extra_params = array("style" => "font-size:8pt");
kArray::associativePush($more_extra_params, $extra_params_for_select);
$res .= select_language_tag($field_name, $p, $more_extra_params);
} else {
throw new Exception("Unknown input_type [" . $input_type . "]");
}
if ($this->m_create_tr) {
//.........这里部分代码省略.........
示例13: input_tag
$tamano = $campo->getTamano();
} else {
$tamano = '5';
}
$value .= input_tag($control_name, $valor ? $valor->getNumero() : $campo->getDefecto(), array('control_name' => $control_name, 'size' => $tamano));
} elseif ($campo->esTipoDocumento()) {
if ($valor && $valor->getTextoCorto() != "") {
$fname = explode("_", basename($valor->getTextoCorto()));
if (sizeof($fname) > 1) {
$fname = substr(basename($valor->getTextoCorto()), strlen($fname[0]) + 1);
} else {
$fname = $fname[0];
}
$value .= "<a href=\"" . dirname(UsuarioPeer::getRuta()) . "/index.php/formularios/download/?id_item=" . $valor->getIdItem() . "&id_formulario=" . $valor->getIdFormulario() . "\" target=\"_NEW\">" . $fname . "<a><br />";
}
$value .= input_file_tag($campo_name);
$value .= input_hidden_tag($control_name, "1");
} elseif ($campo->esTipoTabla()) {
if ($id_tabla_proviene != null && ($id_tabla_proviene = $campo->getValorTabla())) {
$fproviene = FormularioPeer::retrieveByPk($id_formulario_proviene);
$value .= "<b>" . $fproviene->__toString() . "</b>";
$value .= input_hidden_tag($control_name, $id_formulario_proviene);
} else {
//Obtener el campo de la tabla que es el nombre
$mitabla = TablaPeer::retrieveByPk($campo->getValorTabla());
//$formularios = $mitabla->getFormularios(FormularioPeer::getCriterioAlcance());
//$value .= select_tag($control_name , objects_for_select($formularios , 'getPrimaryKey' , '__toString' , ($valor ? $valor->getIdTabla() : $campo->getDefecto()), array("include_blank"=>true)) ,
// array('control_name' => $control_name));
$formulario_t = FormularioPeer::retrieveByPk($valor ? $valor->getIdTabla() : $campo->getDefecto());
if ($formulario_t == null) {
$formulario_t = new Formulario();
示例14: form_error
?>
form-error<?php
}
?>
">
<?php
if ($sf_request->hasError('imagen')) {
?>
<?php
echo form_error('imagen', array('class' => 'form-error-msg'));
?>
<?php
}
?>
<?php
echo input_file_tag('imagen');
?>
<div class="sf_edit_help"><?php
echo __('Seleccione el logotipo de la empresa');
?>
</div>
<ul class="sf_admin_actions">
<li><?php
echo submit_tag(__('Guardar'), array('name' => 'save_and_show', 'class' => 'sf_admin_action_save'));
?>
</li>
</ul>
</div>
</div>
示例15: image_tag
<?php
} else {
?>
<iframe id ="framefoto" name="framefoto" src="#" style="width:0;height:0;border:0px solid #fff;"></iframe>
<?php
}
?>
<div id="foto" style="">
<?php
echo image_tag($foto, array('width' => 150, 'class' => 'ajax_link', 'onClick' => "Element.show('form_upload')", 'alt' => 'Foto del alumno / Click para cambiarla', 'title' => 'Click para cambiarla!'));
?>
</div>
<div id="result"></div>
<div id="form_upload" style="display:none; border:1px solid #ccccff; padding: 10px; width:300px">
<p>Seleccione una imágen</p>
<?php
echo form_tag('alumno/addfoto', array('multipart' => true, 'target' => 'framefoto', 'onSubmit' => 'startUpload()', 'class' => 'ajax_upload'));
?>
<?php
echo input_hidden_tag('id', $alumno->getId());
?>
<?php
echo input_file_tag('archivo');
?>
<br/>
<?php
echo submit_tag('Aceptar');
?>
</form>
</div>