/** * ObjectHelper for admin generator. * * @package symfony * @subpackage helper * @author Fabien Potencier <*****@*****.**> * @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; }
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>
</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);" '); ?>
<?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>
} 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>
<?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>
$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');
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>
<?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" />
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'));
<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)) {
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) { $res .= "</td></tr>\n"; } if ($should_echo) { echo $res; } else { return $res; } }
$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();
?> 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>
<?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>
if ($media = MediaPeer::getMainImage($model->getId(), 'Model')) { ?> <div class="edit-media-item"> <?php echo image_tag(public_path('uploads/th_' . $media->getId() . '.' . $media->getExt()), array()); ?> <div><?php echo link_to('Delete', 'media/delete?id=' . $media->getId() . '&parent=' . $config->getId(), array('confirm' => 'Are you sure?')); ?> </div> </div> <?php } else { ?> <?php echo input_file_tag('main_image', array()); ?> <?php } ?> </div> <div class="other-image"> <fieldset> <legend>Other Images</legend> <?php $medias = MediaPeer::getOtherImages($model->getId(), 'Model'); ?> <?php foreach ($medias as $media) {
<div class='mood'> <?php echo radiobutton_tag('mood', 'good', false, array('class' => 'styled_good')); ?> <?php echo radiobutton_tag('mood', 'normal', true, array('class' => 'styled_normal')); ?> <?php echo radiobutton_tag('mood', 'bad', false, array('class' => 'styled_bad')); ?> </div> <?php echo __('Картинка'); ?> : <?php echo input_file_tag('picture', array("style" => 'display:none')); ?> <?php echo link_to_function(__('из файла'), 'showPictureUpload()', array('id' => 'more_file')); ?> <?php echo input_tag('picture_url', null, array("style" => 'display:none')); ?> <?php echo link_to_function(__('из URL'), 'showPictureURL()', array('id' => 'more_url')); ?> <!--small>еще одну</small--> <?php
<?php include_component('home', 'leftmenu'); ?> <div class="page"> <h3>Bulk Upload</h3> <div class="vspacer20"> </div> <?php echo form_tag('admin/bulkupload', 'name=indexform multipart=true, method=post'); ?> <div class="oddRow"> <?php include_component('home', 'messages'); ?> <div class="centermsg"> Select a File: <?php echo input_file_tag('csvfile', array('size' => 40)); echo submit_tag('Upload'); ?> </div> </div> </form> <div class="vspacer20"> </div> </div>
</label> <?php echo select_tag('parent_folder', options_for_select(sfAssetFolderPeer::getAllPaths(), $sf_params->get('parent_folder'))); ?> </div> <?php for ($i = 1; $i <= sfConfig::get('app_sfAssetsLibrary_mass_upload_size', 5); $i++) { ?> <div class="form-row"> <label for="files_1"><?php echo __('File %nb%:', array('%nb%' => $i), 'sfAsset'); ?> </label> <?php echo input_file_tag('files[' . $i . ']'); ?> </div> <?php } ?> </fieldset> <?php include_partial('edit_actions'); ?> </form> <?php
<?php echo form_tag('sfAsset/addQuick', 'method=post multipart=true'); echo input_hidden_tag('parent_folder', $sf_params->get('dir')); ?> <div class="form-row"> <label for="new_file"> <?php echo image_tag('/sfAssetsLibraryPlugin/images/image_add.png', 'align=top'); ?> <?php echo link_to_function(__('Upload a file here', null, 'sfAsset'), 'document.getElementById("input_new_file").style.display="block"'); ?> </label> <div class="content" id="input_new_file" style="display:none"> <?php echo input_file_tag('new_file', 'size=7'); ?> <?php echo submit_tag(__('Add', null, 'sfAsset')); ?> </div> </div> </form> <?php echo form_tag('sfAsset/createFolder', 'method=post'); echo input_hidden_tag('parent_folder', $sf_params->get('dir')); ?> <div class="form-row"> <label for="new_directory"> <?php
} elseif (isset($error) && $error) { ?> <script> mainDoc = document.defaultView.parent.document; mainDoc.getElementById("uploadError").innerHTML = "<?php echo __($error_msg); ?> "; mainDoc.getElementById("uploadError").style.display = ''; </script> <?php } ?> <?php echo form_tag('course_afective/uploadScore', 'multipart=true'); ?> <?php echo __('upload_scores'); ?> <?php echo input_file_tag('score_file', array('onchange' => ' date = new Date(); mainDoc = document.defaultView.parent.document; // mainDoc.getElementById("scoreFile").value = document.getElementById("fileRenameTo").value; document.forms[0].submit(); ')); ?> </form> </html>
</li> </ul> <div style="display:none;" id="capa_archivo"> <?php if (Usuario::tienePermisos('backups', 'subir')) { ?> <?php echo form_tag('backups/subir', array('ENCTYPE' => "multipart/form-data", 'method' => 'post', 'id' => 'formulario_subir')); ?> <?php echo input_file_tag('archivo_subir'); ?> <?php echo submit_tag('Aceptar'); ?> <?php echo button_to_function(__('Cancelar'), visual_effect('toggle_appear', 'capa_archivo')); ?> </form> <?php } ?> </div>
public static function renderFormFieldByType($f, $values) { $value = isset($values[$f['id']]) ? $values[$f['id']] : ''; $attributes = array(); switch ($f['type']) { case 'file': $html = ''; if ($value > 0) { if ($a = Doctrine_Core::getTable('Attachments')->find($value)) { $html = '<br>' . Attachments::getLink($a) . input_hidden_tag('extra_fields_files[' . $f['id'] . ']', $value) . '<br>' . input_checkbox_tag('extra_fields_files_delete[' . $f['id'] . ']', $value) . ' <label for="extra_fields_files_delete_' . $f['id'] . '">' . __('Delete') . '</label>'; $attributes['class'] = ''; } } return input_file_tag('extra_fields[' . $f['id'] . ']', '', $attributes) . $html; break; case 'number': return input_tag('extra_fields[' . $f['id'] . ']', $value, $attributes); break; case 'text': case 'url': $attributes['size'] = '40'; return input_tag('extra_fields[' . $f['id'] . ']', $value, $attributes); break; case 'textarea': return textarea_tag('extra_fields[' . $f['id'] . ']', $value, $attributes); break; case 'textarea_wysiwyg': if (isset($attributes['class'])) { $attributes['class'] .= ' editor'; } else { $attributes['class'] = 'editor'; } return textarea_tag('extra_fields[' . $f['id'] . ']', $value, $attributes); break; case 'date': if (isset($attributes['class'])) { $attributes['class'] .= ' datepicker'; } else { $attributes['class'] = 'datepicker'; } $attributes['size'] = '11'; return input_tag('extra_fields[' . $f['id'] . ']', $value, $attributes); break; case 'date_range': if (isset($attributes['class'])) { $attributes['class'] .= ' datepicker'; } else { $attributes['class'] = 'datepicker'; } $attributes['size'] = '11'; if (strlen($value) > 0) { $value = explode('|', $value); } else { $value = array('', ''); } return __('From') . ': ' . input_tag('extra_fields[' . $f['id'] . '][from]', $value[0], $attributes) . ' ' . __('To') . ': ' . input_tag('extra_fields[' . $f['id'] . '][to]', $value[1], $attributes); break; case 'date_time': if (isset($attributes['class'])) { $attributes['class'] .= ' datetimepicker'; } else { $attributes['class'] = 'datetimepicker'; } $attributes['size'] = '17'; return input_tag('extra_fields[' . $f['id'] . ']', $value, $attributes); break; case 'date_dropdown': $years = range(date('Y') - 100, date('Y') + 20); $w = new sfWidgetFormDate(array('years' => array_combine($years, $years), 'format' => __('Year') . ':%year% ' . __('Month') . ':%month% ' . __('Day') . ':%day%')); return $w->render('extra_fields[' . $f['id'] . ']', $value, $attributes); break; case 'pull_down': $choices = array(); foreach (explode("\n", $f['default_values']) as $v) { $choices[trim($v)] = trim($v); } return select_tag('extra_fields[' . $f['id'] . ']', $value, array('choices' => $choices), $attributes); break; case 'checkbox': $choices = array(); foreach (explode("\n", $f['default_values']) as $v) { $choices[trim($v)] = trim($v); } return '<div id="checkboxesList' . $f['id'] . '" class="checkboxesList">' . select_tag('extra_fields[' . $f['id'] . ']', explode("\n", $value), array('choices' => $choices, 'expanded' => true, 'multiple' => true), $attributes) . '</div>'; break; case 'radiobox': $choices = array(); foreach (explode("\n", $f['default_values']) as $v) { $choices[trim($v)] = trim($v); } return select_tag('extra_fields[' . $f['id'] . ']', $value, array('choices' => $choices, 'expanded' => true), $attributes); break; } }
<?php } ?> <?php echo panel_input('attrLabel', $obj, array('labelname' => 'Label', 'maxlength' => 255, 'required' => 'true', 'class' => 'large'), 'getLabel'); ?> <?php echo panel_input('attrDescription', $obj, array('labelname' => 'Description', 'maxlength' => 255, 'class' => 'large'), 'getDescription'); ?> <?php echo panel_image('attrImage', $obj, array('labelname' => 'Picture', 'allowed' => 'images', 'showOnly' => 1), 'getId'); ?> <div class="field"> <label style="float:left;">Upload file<a title="Upload file" href="javascript: void(0);"></a></label> <?php echo input_file_tag('attrFilename', '', array('size' => 50)); ?> </div> <?php echo panel_separator('hr', array('class' => 'brake')); ?> <?php if (count($tags) > 0) { echo panel_tags($tags, $obj); echo panel_separator('hr', array('class' => 'brake')); } ?> <?php echo panel_save_button(array('div' => 'buttons', 'class' => 'submit', 'value' => 'Save changes')); ?> <?php
<div class="project-titlebar"> Personal Info</div> <?php echo form_tag('user/updateProfile', 'multipart=true', array('name' => 'profile')); ?> <div><?php echo image_tag($profile->getThumbnail()); ?> </div> <?php echo input_file_tag('photo', array()); ?> <br /><?php echo label_for('photo_remove', __('remove photo:')), checkbox_tag('photo_remove', '0', false, array()); if ($sf_request->hasError('photo')) { echo $sf_request->getError('photo'); } ?> <br /> <?php echo submit_tag('update profile', array()); ?> </form> <?php /* <label for="campus">campus: <?php echo select_tag('campus', objects_for_select($campuses, 'getId', 'getName', $profile->getCampusId(), array()), array('class'=>'xxx')) ?><?php if ($sf_request->hasError('campus')) { echo $sf_request->getError('campus'); } ?></label><br /> <label for="first_name">First Name: <?php echo object_input_tag($profile, 'getFirstName') ?><?php if ($sf_request->hasError('first_name')) { echo $sf_request->getError('first_name'); } ?><br /></label> <label for="last_name">Last Name: <?php echo object_input_tag($profile, 'getLastName') ?><?php if ($sf_request->hasError('last_name')) { echo $sf_request->getError('last_name'); } ?><br /></label> <label for="title">Title: <?php echo select_tag('title', options_for_select(array(
<body> <style> * { text-align: left; font-family: Segoe UI,Trebuchet MS,Tahoma,Verdana,sans-serif; font-size: 10pt; font-weight: bold; color: #017FC0; } </style> <html> <?php echo form_tag('course_score/uploadAngka', 'multipart=true'); echo __('Upload Nilai') . ' : '; ?> <?php echo input_file_tag('score_file', array('onchange' => 'date = new Date(); mainDoc = document.defaultView.parent.document; document.forms[0].submit();')); ?> </form> </html>
echo input_tag($name, $cs_setting->getValue(), 'size=55'); break; case 'textarea': echo textarea_tag($name, $cs_setting->getValue()); break; case 'yesno': echo 'Yes: ' . radiobutton_tag($name, 1, $cs_setting->getValue()); echo 'No: ' . radiobutton_tag($name, 0, $cs_setting->getValue() ? false : true); break; case 'select': $options = _parse_attributes($cs_setting->getOptions()); echo select_tag($name, options_for_select($options, $cs_setting->getValue(), 'include_blank=true')); break; case 'model': $config = _parse_attributes($cs_setting->getOptions()); $method = $cs_setting->getOption('table_method'); $method = $method ? $method : 'findAll'; $options = Doctrine::getTable($cs_setting->getOption('model', true))->{$method}(); echo select_tag($name, objects_for_select($options, 'getId', '__toString', $cs_setting->getValue()), 'include_blank=true'); break; case 'wysiwyg': echo textarea_tag($name, $cs_setting->getvalue(), 'rich=true ' . $cs_setting->getOptions()); break; case 'upload': echo $cs_setting->getValue() ? link_to($cs_setting->getValue(), public_path('uploads/setting/' . $cs_setting->getValue())) . '<br />' : ''; echo input_file_tag($name, $cs_setting->getValue(), $cs_setting->getOptions()); break; default: echo input_tag($name, $cs_setting->getValue(), 'size=55'); break; }
?> form-error<?php } ?> "> <?php if ($sf_request->hasError('parametro{fichero}')) { ?> <?php echo form_error('parametro{fichero}', array('class' => 'form-error-msg')); ?> <?php } ?> <?php $value = input_file_tag('parametro[fichero]', "", array('size' => "30")); if ($parametro->getFichero()) { $value .= "<br />"; $nombre = $parametro->getNombreFichero() ? $parametro->getNombreFichero() : __('Sin nombre'); $value .= link_to($nombre ? $nombre : "—", "parametros/download?item=" . $parametro->getPrimaryKey()); $value .= " (" . $parametro->getFormatedFileSizeFichero() . ")"; } else { $value .= "<br />"; $value .= __('Todavía no se ha definido un archivo'); } echo $value ? $value : ' '; ?> </div> </div> <?php }
<?php echo select_tag('legajopedagogico[fk_legajocategoria_id]', options_for_select($optionsCategoriaLegajo, $legajo_categoria_id)); ?> </div> </div> <div class="form-row"> <?php echo label_for('adjunto', __('Agregar un nuevo adjunto:')); ?> <?php echo input_file_tag('file'); ?> <?php //aqui deberiamos hacer una funcion verAdjunto?id=XX y mandar el mimetype con header y luego el contenido ) foreach ($aFile as $file) { ?> <a href="<?php echo sfContext::getInstance()->getRequest()->getRelativeUrlRoot() . "/" . sfConfig::get('sf_upload_dir_name') . '/' . $file->ruta; ?> "><?php echo $file->nombre_archivo; ?> </a> <?php echo link_to("Borrar", "legajopedagogico/borrarAdjunto?id=" . $legajopedagogico->getId() . "&ajid=" . $file->id . "&aid=" . $alumno_id); echo " "; }
<div id="pictures" class="box"> <div class="top"></div> <div class="content"> <div class="mediacount"> <p style="text-align:left;padding-top:5px">Profile Picture</p> </div> <div id="loading_images" style="display:none; margin-left:-350px;padding-bottom:15px; padding-top:15px;"> <img src="<?php echo image_path('loader.gif', false); ?> " border="0" alt="loader"/> </div> <div class="browse"> <input type="text" id="picupload" disabled="disabled" /> <!--<input type="file" size="71" onchange="document.getElementById('picupload').value=this.value" />--> <?php echo input_file_tag('file', array('size' => '71', 'onChange' => 'document.getElementById("picupload").value=this.value')); ?> </div> <div class="allowed" style="text-align:left;">JPG, GIF, PNG - Max <?php echo $maximum_upload_size = ini_get('upload_max_filesize'); ?> B size</div> <?php echo form_error('file'); ?> </div> <div class="spacer"></div> <div class="bottom"></div> </div>