function form($objectName, $object, $options = array())
{
    if (!isset($options['action'])) {
        if ($object->isNewRecord()) {
            $options['action'] = 'create';
        } else {
            $options['action'] = 'update';
        }
    }
    if (!isset($options['submit_value'])) {
        $options['submit_value'] = ucfirst($options['action']);
    }
    if (isset($options['multipart']) && $options['multipart'] === true) {
        $form = form_tag(array('action' => $options['action']), array('multipart' => true));
    } else {
        $form = form_tag(array('action' => $options['action']));
    }
    if (!$object->isNewRecord()) {
        $form .= hidden_field($objectName, 'id', $object);
    }
    $fields = $object->contentAttributes();
    foreach ($fields as $attr) {
        $form .= '<p><label for="' . $objectName . '_' . $attr->name . '">' . SInflection::humanize($attr->name) . "</label>\n" . input($objectName, $attr->name, $object) . "</p>\n";
    }
    if (isset($options['include'])) {
        $form .= $options['include'];
    }
    $form .= submit_tag($options['submit_value']);
    $form .= end_form_tag();
    return $form;
}
示例#2
0
function pp_button(esPaypalButton $button)
{
    $html = array();
    foreach ($button as $name => $value) {
        $html[] = tag('input', array('type' => 'hidden', 'name' => $name, 'value' => $value));
    }
    return form_tag($button->getUrl(), array('method' => 'post')) . join("\n", $html) . tag('input', array('type' => 'image', 'src' => $button->getImage(), 'alt' => $button->getAltText())) . '</form>';
}
示例#3
0
文件: form.php 项目: ahmed555/Cupcake
 public function form_for($name, $object = null, $url = "", $options = null, $block = null)
 {
     if (is_closure($options)) {
         $block = $options;
         $options = array();
     }
     $this->object = $object;
     $this->object_name = $name;
     echo form_tag($url, array_merge($options, array("name" => $name)));
     echo $block($this);
     echo "</form>";
 }
示例#4
0
 function form($content, $attributes)
 {
     $to = TemplateLogic::content($attributes["to"], $this->data);
     $name = array_key_exists("name", $attributes) ? TemplateLogic::content($attributes["name"], $this->data) : $this->getUniqueFormID();
     $options = array();
     $options["method"] = array_key_exists("method", $attributes) ? $attributes["method"] : "post";
     $options["action"] = linkForm($to);
     if (array_key_exists("validate", $attributes) && $attributes["validate"] != '') {
         $options["onsubmit"] = "return \$validate(this,'" . $attributes["validate"] . "');";
     }
     //$validate(frm,debug)
     if (array_key_exists("files", $attributes) && strToLower($attributes["files"]) == "true") {
         $options["enctype"] = "multipart/form-data";
     }
     $result = $this->process($content);
     $select = form_tag($name, $result, $options);
     return $select;
 }
示例#5
0
 public static function inicioAjax($accion, $contenedor, $referencia = 0)
 {
     $params = is_array($accion) ? $accion : Util::getParams(func_get_args());
     $params["enctype"] = "multipart/form-data";
     if ($referencia == 0) {
         $referencia = rand(0, 9999999);
     }
     $params["name"] = "f" . $referencia;
     $params["id"] = "f" . $referencia;
     $opciones = 'target: "#' . $contenedor . '"';
     if (isset($params["success"])) {
         $opciones .= ', success: function() { ' . $params["success"] . ' }';
     }
     if (isset($params["before"])) {
         $opciones .= ', beforeSubmit: function() { ' . $params["before"] . ' }';
     }
     $code = '<script type="text/javascript"> $.metadata.setType("attr", "validate"); $(document).ready(function() { $("#' . $params["id"] . '").validate({});  $("#' . $params["id"] . '").ajaxForm({ ' . $opciones . ' }); }); </script>';
     $code .= form_tag($params);
     return $code;
 }
示例#6
0
<div class="sf_admin_filters">
<!--
<?php 
echo form_tag('tablas/list', array('method' => 'get'));
?>

  <fieldset>
    <h2><?php 
echo __('filters');
?>
</h2>
     <div class="form-row">
    <?php 
echo label_for('filters[id_empresa]', __('empresa'), '');
?>
    <div class="content">
    <?php 
$id_empresa = isset($filters['id_empresa']) ? $filters['id_empresa'] : null;
$c = EmpresaPeer::getCriterioAlcance();
$empresas = EmpresaPeer::doSelect($c);
$value = select_empresas('filters[id_empresa]', objects_for_select($empresas, 'getIdEmpresa', '__toString', $id_empresa, array('include_blank' => true)), array('control_name' => 'filters[id_empresa]', 'include_blank' => true));
echo $value ? $value : "&nbsp;";
?>
    </div>
    </div>
   
    
    
  </fieldset>

  <ul class="sf_admin_actions">
示例#7
0
use_helper('I18N', 'Javascript', 'Object', 'Number');
echo include_partial('parametros/mensajes');
?>


<?php 
include_partial('datos_edit_titulo', array('DefParametro' => $DefParametro, 'parametro' => $parametro, 'nuevo' => $nuevo));
?>

<?php 
if ($DefParametro->getCampoFichero() != "") {
    ?>

  <?php 
    echo form_tag('parametros/guardar_valor', array('ENCTYPE' => "multipart/form-data", 'method' => 'post', 'id' => 'formulario_guardar'));
} else {
    echo form_remote_tag(array('url' => 'parametros/guardar_valor', 'update' => 'datos_parametro', 'script' => 'true', 'complete' => enlaceACargarParametros($DefParametro)), 'id=formulario_guardar');
}
?>




<?php 
if ($DefParametro->getCampoNombre() != "") {
    ?>
<div class="form-row clear">  
  <?php 
    echo label_for('nombre', __($DefParametro->getCampoNombre()));
    ?>
示例#8
0
<div class="row">
  <div class="span4"><?php 
echo link_to(op_image_tag_sf_image($community->getImageFileName(), array('size' => '48x48')), '@community_home?id=' . $id);
?>
</div>
  <div class="span8"><?php 
echo link_to($community->getName(), '@community_home?id=' . $id);
?>
</div>
  <div class="span12 center"><?php 
echo __('Do you really join to the following %community%?');
?>
</div>
  <div class="span12">
    <?php 
echo form_tag($sf_request->getCurrentUri());
?>
    <?php 
foreach ($form as $field) {
    ?>
    <?php 
    if (!$field->isHidden()) {
        ?>
      <div class="control-group<?php 
        echo $field->hasError() ? ' error' : '';
        ?>
">
        <label class="control-label"><?php 
        echo $field->renderLabel();
        ?>
</label>
?>

<!-- flash messages and new comment form -->
<?php 
if ($read_only) {
    ?>
  <div class="related_details"><?php 
    echo __('Comments are closed');
    ?>
.</div>
<?php 
} else {
    ?>

  <?php 
    echo form_tag('deppCommenting/addComment', 'name=add_comment id=comment-form');
    ?>
    <h4><?php 
    echo __('Leave a reply');
    ?>
</h4>

    <?php 
    echo form_error('name');
    ?>
    <p>
      <?php 
    echo image_tag('star.png', array('alt' => '*'));
    ?>
      <?php 
    echo input_tag('name', $sf_request->hasErrors() ? $sf_params->get('name') : ($sf_user->isAuthenticated() ? isset($author_name) ? $author_name : '' : ''), 'id= class=text' . ($sf_user->isAuthenticated() ? ' readonly=true' : ''));
示例#10
0
<?php

echo form_tag('historico_documentos/edit', array('id' => 'sf_admin_edit_form', 'name' => 'sf_admin_edit_form', 'multipart' => true));
?>

<?php 
echo object_input_hidden_tag($historico_documento, 'getIddocumento');
echo object_input_hidden_tag($historico_documento, 'getVersion');
?>

<fieldset id="sf_fieldset_none" class="">

<div class="form-row">
  <?php 
echo label_for('historico_documento[id_documento]', __($labels['historico_documento{id_documento}']), '');
?>
  <div class="content<?php 
if ($sf_request->hasError('historico_documento{id_documento}')) {
    ?>
 form-error<?php 
}
?>
">
  <?php 
if ($sf_request->hasError('historico_documento{id_documento}')) {
    ?>
    <?php 
    echo form_error('historico_documento{id_documento}', array('class' => 'form-error-msg'));
    ?>
  <?php 
}
示例#11
0
  });
  $("#collections_parent_ref").change(function() {
    if($(this).val())
    {
      $.get("<?php 
echo url_for('collection/setInstitution');
?>
/parent_ref/"+$(this).val(), function (data) {
        $("#institution_to_change").html(data);
      });
    }
  });
});
</script>
<?php 
echo form_tag('collection/' . ($form->getObject()->isNew() ? 'create' : 'update?id=' . $form->getObject()->getId()), array('class' => 'edition'));
echo $form->renderGlobalErrors();
?>
  <table class="collections">
    <tbody>
      <tr>
        <th>
	  <?php 
echo $form['is_public']->renderLabel("Public collection");
?>
          <?php 
echo help_ico($form['is_public']->renderHelp(), $sf_user);
?>
        </th>
        <td>
          <?php 
示例#12
0
<?php

use_helper('Validation');
use_helper('Object');
include_partial('global/page_header', array('title' => 'Weryfikacja właściciela bloga'));
echo form_tag('blog/verification');
?>
    <fieldset>
        <div class="row">
            <label for="login">Wybierz swój blog: </label>
            <?php 
echo select_tag('blog_id', objects_for_select($blogs, 'getId', 'getName'));
?>
        </div>
    
        <div class="infobox"><p class="center">Podaj swój login i hasło z <a href="http://forum.php.pl">Forum PHP.pl</a></p></div>
    
        <div class="row">
            <?php 
echo form_error('login');
?>
            <label for="login">Login: </label>
            <?php 
echo input_tag('login');
?>
        </div>
        
        <div class="row">
            <?php 
echo form_error('password');
?>
示例#13
0
<?php

include_stylesheets_for_form($form);
include_javascripts_for_form($form);
?>
  <div class="import_filter">
  <?php 
echo form_tag($format == 'taxon' ? 'import/searchCatalogue' : 'import/search', array('class' => 'search_form', 'id' => 'import_filter'));
?>
  <div class="container">
    <table class="search" id="search">
      <thead>
        <tr>
          <th><?php 
if ($format != 'taxon') {
    echo $form['collection_ref']->renderLabel();
}
?>
</th>
          <th><?php 
echo $form['filename']->renderLabel();
?>
</th>
          <th><?php 
echo $form['state']->renderLabel();
?>
</th>
          <th><?php 
echo $form['show_finished']->renderLabel();
?>
</th>
示例#14
0
<?php

use_helper('Form', 'Validation', 'Widgets');
echo form_tag('manage/RemoveCustomProcess', array('class' => 'main-form'));
?>

	<?php 
echo form_errors();
?>

	<p> The following <strong><?php 
echo $count;
?>
</strong> kanji flashcard(s) have been removed:</p>
	
	<div style="background:#E7F5CD;color:#000;padding:5px;margin:0 0 1em;">
<?php 
$kanjis = array();
foreach ($cards as $id) {
    $kanjis[] = rtkBook::getKanjiForIndex($id);
}
echo implode(', ', $kanjis);
?>
	</div>

	<p><a href="#" class="proceed" onclick="return ManageFlashcards.load(this,{'reset':true});">Remove more cards</a></p>

</form>
示例#15
0
    <?php 
echo link_to(image_tag('askeet_logo.gif', 'alt=askeet align=middle'), '@homepage');
?>
    <?php 
echo __('ask %1%it%2% - find %1%it%2% - answer %1%it%2%', array('%1%' => '<strong>', '%2%' => '</strong>'));
?>
    </h1>
  </div>

  <div id="login" style="display: none">
    <h2><?php 
echo __('please sign-in first');
?>
</h2>
    <?php 
echo form_tag('@login', 'id=loginform');
?>
      <label for="nickname"><?php 
echo __('nickname:');
?>
</label><?php 
echo input_tag('nickname');
?>
      <label for="password"><?php 
echo __('password:'******'password');
?>
      <?php 
echo input_hidden_tag('referer', $sf_params->get('referer') ? $sf_params->get('referer') : $sf_request->getUri());
示例#16
0
<?php

include_stylesheets_for_form($form);
include_javascripts_for_form($form);
?>
<div class="catalogue_comments">
<?php 
echo form_tag('comment/search', array('class' => 'search_form', 'id' => 'comments_filter'));
?>
  <div class="container">
<table class="search" id="<?php 
echo $is_choose ? 'search_and_choose' : 'search';
?>
">
  <thead>
    <tr>
      <th ><?php 
echo $form['referenced_relation']->renderLabel();
?>
        <?php 
echo $form['referenced_relation']->renderError();
?>
</th>
      <th ><?php 
echo $form['comment']->renderLabel();
?>
        <?php 
echo $form['comment']->renderError();
?>
</th>
      <th><?php 
示例#17
0
<?php

echo form_tag('@sf_guard_user_export');
?>
<table>
  <tr><th><?php 
echo __('Include in Export', array(), 'messages');
?>
</th><th><?php 
echo __('Field', array(), 'messages');
?>
</th><th><?php 
echo __('Label (optional)', array(), 'messages');
?>
</th></tr>
  <tr>
    <td><input name="include[id]" type="checkbox" checked /></td>
    <td><?php 
echo __('Id', array(), 'messages');
?>
</td>
    <td>
      <input name="export[id]" type="textbox" size="20">
    </td>
  </tr>
  <tr>
    <td><input name="include[username]" type="checkbox" checked /></td>
    <td><?php 
echo __('Username', array(), 'messages');
?>
</td>
示例#18
0
<?php

use_helper('Object', 'Date', 'sfAsset');
echo form_tag('sfAsset/save', array('id' => 'sf_admin_edit_form', 'name' => 'sf_admin_edit_form', 'multipart' => true));
?>

<?php 
echo object_input_hidden_tag($sf_asset, 'getId');
?>

<fieldset id="sf_fieldset_none" class="">

  <div class="form-row">
    <?php 
echo label_for('sf_asset[filepath]', __('Path:', null, 'sfAsset'), '');
?>
    <div class="content<?php 
if ($sf_request->hasError('sf_asset{filepath}')) {
    ?>
 form-error<?php 
}
?>
">
    <?php 
if (!$sf_asset->isNew()) {
    ?>
      <?php 
    echo assets_library_breadcrumb($sf_asset->getRelativePath(), 0);
    ?>
    <?php 
}
示例#19
0
<?php

include_stylesheets_for_form($form);
include_javascripts_for_form($form);
echo form_tag('loan/search' . (isset($is_choose) ? '?is_choose=' . $is_choose : ''), array('class' => 'search_form', 'id' => 'loans_filter'));
?>
  <div class="container">
    <table class="search" id="<?php 
echo $is_choose ? 'search_and_choose' : 'search';
?>
">
      <thead>
        <tr>
          <th><?php 
echo $form['name']->renderLabel();
?>
</th>
          <th><?php 
echo $form['status']->renderLabel();
?>
</th>
          <th><?php 
echo $form['from_date']->renderLabel();
?>
</th>
          <th><?php 
echo $form['to_date']->renderLabel();
?>
</th>
        </tr>
      </thead>
示例#20
0
<?php 
echo form_tag('tablas/edit', array('id' => 'sf_admin_edit_form', 'name' => 'sf_admin_edit_form', 'multipart' => true, 'onsubmit' => 'double_list_submit(); return true;'));
?>

<?php 
echo object_input_hidden_tag($tabla, 'getIdTabla');
?>

<fieldset id="sf_fieldset_editable" class="">
<h2><?php 
echo __('Datos');
?>
</h2>

<div class="form-row">
  <?php 
echo label_for('tabla[nombre]', __($labels['tabla{nombre}']), 'class="required" ');
?>
  <div class="content<?php 
if ($sf_request->hasError('tabla{nombre}')) {
    ?>
 form-error<?php 
}
?>
">
  <?php 
if ($sf_request->hasError('tabla{nombre}')) {
    ?>
    <?php 
    echo form_error('tabla{nombre}', array('class' => 'form-error-msg'));
示例#21
0
</li>
        <?php 
    }
    ?>
        </ul>
      </div>
    <?php 
}
?>


<div class="blue-shadow"><div class="blue-title blue-content">Compose a Message</div></div>
<div class="blue-shadow">
  <div class="blue-content">
    <?php 
echo form_tag('messages/send');
?>
      <?php 
echo object_input_hidden_tag($message, 'getParentId');
?>
      <div class="message-view-single" style="border: medium none;">
        <?php 
echo link_to(image_tag($sf_user->getProfile()->getThumbnail(), array('class' => 'sender-pic')), 'user/show?user='******'to'));
?>
:<br />      
            <?php 
示例#22
0
?>

<div class="encoding">
  <?php 
include_stylesheets_for_form($form);
?>
  <?php 
include_javascripts_for_form($form);
?>
  <div class="page" id="search_div">
    <h1 id="title"><?php 
echo __('Specimens Search Result');
?>
</h1>
    <?php 
echo form_tag('specimensearch/search' . (isset($is_choose) ? '?is_choose=' . $is_choose : ''), array('class' => 'specimensearch_form', 'id' => 'specimen_filter'));
?>
      <ul id="intro" class="hidden">
        <?php 
// Render all the form fields as hidden input if possible. if the value is an array or and object render them as usual
foreach ($form as $row) {
    $w = new sfWidgetFormInputHidden();
    $attributes = $form->getWidget($row->getName())->getAttributes();
    if (is_string($row->getValue()) || is_null($row->getValue())) {
        echo '<li>' . $w->render($form->getWidgetSchema()->generateName($row->getName()), $row->getValue(), $attributes) . '</li>';
    } else {
        echo '<li>' . $row . '</li>';
    }
}
?>
      </ul>
<?php

use_javascript('jquery-1.3.2.min.js');
use_helper('Form', 'Javascript', 'Object');
echo form_tag('Login/changePassword');
?>

<div id="main_content">
	<div class="box_content">
	<div class="box_title">
		<h2><span class="dark_blue">Change Password</span></h2>
	</div>
	<div class="box_text_content">
	<div class="box_text">
	
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="form">

                <tr>
                  <td height="7" colspan="2"></td>
                </tr>
                <tr>
                  <td colspan="2" valign="top">&nbsp;</td>
  </tr>
               
				<tr>
                  <td width="15%" height="27" valign="top" style="padding-left: 10px; line-height: 18px;">Old Password:<span class="error">*</span></td>
                  <td width="85%" valign="top" style="padding-left: 10px; line-height: 18px;"><?php 
echo input_password_tag('old_password', '', 'size=25');
?>
				  <script type="text/javascript">
	var old_password = new LiveValidation('old_password', { validMessage: "<?php 
    if ($format->getSerialiserClass()) {
        $output_format_options[$format->getLabel()] = $format->getName();
    }
    if ($format->getParserClass()) {
        $input_format_options[$format->getLabel()] = $format->getName();
    }
}
?>
<html>
<head><title>EasyRdf Converter</title></head>
<body>
<h1>EasyRdf Converter</h1>

<div style="margin: 10px">
  <?php 
echo form_tag();
?>
  <?php 
echo label_tag('data', 'Input Data: ') . '<br />' . text_area_tag('data', '', array('cols' => 80, 'rows' => 10));
?>
<br />
  <?php 
echo label_tag('uri', 'or Uri: ') . text_field_tag('uri', 'http://www.dajobe.org/foaf.rdf', array('size' => 80));
?>
<br />
  <?php 
echo label_tag('input_format', 'Input Format: ') . select_tag('input_format', $input_format_options, 'guess');
?>
<br />
  <?php 
echo label_tag('output_format', 'Output Format: ') . select_tag('output_format', $output_format_options, 'turtle');
<?php

echo form_tag('sfSimpleForum/add' . (isset($topic) ? 'Post' : 'Topic'), 'id=add_topic name=add_topic');
?>

  <?php 
if (isset($topic)) {
    ?>
    
    <?php 
    echo input_hidden_tag('topic_id', $topic->getId());
    ?>
    
  <?php 
} else {
    ?>
    
    <?php 
    echo form_error('title');
    ?>
    <?php 
    echo label_for('title', __('Title', null, 'sfSimpleForum'));
    ?>
    <?php 
    echo input_tag('title', '', 'id=topic_title');
    ?>
    <?php 
    if (isset($forum)) {
        ?>
      <?php 
        echo input_hidden_tag('forum_name', $forum->getStrippedName());
示例#26
0
<div class="sf_admin_filters">
<?php 
echo form_tag('tareas/list', array('method' => 'get', 'name' => 'form_filtros'));
?>

<fieldset >
  <h2><?php 
echo __('filtros');
?>
</h2>
  
  <div class="form-row">
  <?php 
echo label_for("filters[es_evento]", __('tipo') . ":");
?>
    <div class="content">
    <?php 
$opciones = array('0' => __('tareas'), '1' => __('eventos'));
$tipo_tarea = isset($filters['es_evento']) ? $filters['es_evento'] : null;
$value = select_tag('filters[es_evento]', options_for_select($opciones, $tipo_tarea, array('include_custom' => __('tareas y eventos'))));
echo $value ? $value : "&nbsp";
?>
    </div>
  </div>

  
  <div class="form-row">
    <?php 
echo label_for("filters[estado_tarea]", __('estado tarea') . ":");
?>
    <div class="content">
示例#27
0
<?php

echo use_helper('AdvancedOptionsForSelect');
?>


<?php 
echo form_tag('#', array("id" => "disegni-decreti-filter", "class" => $active ? 'active' : ''));
?>
  <fieldset class="labels">
    <label for="filter_article">articolo:</label>
    <label for="filter_site">sede:</label>
    <label for="filter_presenter">presentatore:</label>
    <label for="filter_status">status:</label>
  </fieldset>
  <p>filtra per</p>
  <fieldset>
    <?php 
echo select_tag('filter_article', options_for_select($available_articles, $selected_article));
?>
                          
    <?php 
echo select_tag('filter_site', options_for_select($available_sites, $selected_site));
?>

    <?php 
echo select_tag('filter_presenter', options_for_select($available_presenters, $selected_presenter));
?>

    <?php 
echo select_tag('filter_status', options_for_select($available_statuses, $selected_status));
示例#28
0
	<div class="col-box col-box-top block">

		<h2>Request a New Password</h2>

		<p>	Did you forget your password?
		
		<p> Enter your username and you will receive
			a new password by email.
		</p>
		
		<?php 
echo form_errors();
?>
		
		<?php 
echo form_tag('@request_password', array('class' => 'block'));
?>

		<ul>
		<li><span class="lbl"><?php 
echo label_for('username', 'Username');
?>
</span>
			<span class="fld medium"><?php 
echo input_tag('username', '', array('class' => 'textfield'));
?>
</span>
		</li>
		<li><span class="lbl"></span>
			<span class="btn"><?php 
echo submit_tag('Get a new password');
示例#29
0
<?php 
if ($sf_user->hasFlash('notice')) {
    ?>
<div class="save-ok">
<h2><?php 
    echo __($sf_user->getFlash('notice'));
    ?>
</h2>
</div>
<?php 
}
?>

<?php 
echo form_tag('legajopedagogico/save', 'id=sf_admin_edit_form name=sf_admin_edit_form multipart=true');
?>

<?php 
echo object_input_hidden_tag($legajopedagogico, 'getId');
echo input_hidden_tag('legajopedagogico[fk_alumno_id]', $alumno_id);
echo input_hidden_tag('aid', $alumno_id);
echo input_hidden_tag('cid', $legajo_categoria_id);
?>


<fieldset id="sf_fieldset_informacion_general" class="">
<h2><?php 
echo __('Entrada');
?>
</h2>
示例#30
0
<?php

use_helper('I18N', 'Validation', 'Javascript', 'Cryptographp', 'My');
special_append_to_page_title('Post Snippet');
?>

<h1><?php 
echo __('Post Snippet');
?>
</h1>

<?php 
echo form_tag('snippet/update', array('class' => 'form'));
?>
    <?php 
echo input_hidden_tag('id', $sf_params->get('id'));
?>
    <?php 
if (!$sf_user->isAuthenticated()) {
    ?>
    <div class="row">
        <?php 
    echo label_for('name', __('Name') . required());
    ?>
        <?php 
    echo input_tag('name', $sf_params->get('name'));
    ?>
        <?php 
    echo form_error('name');
    ?>
    </div>