summaryrefslogtreecommitdiffstats
path: root/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_form.php
diff options
context:
space:
mode:
authorGravatar mszulecki2007-06-14 17:09:01 +0000
committerGravatar mszulecki2007-06-14 17:09:01 +0000
commit9f108dd1a969473375341d92a7b1252fa2cedc9a (patch)
treed5f2e35ec0bd2d52dab0ee3282fc6751e0fa8dba /data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_form.php
parente35884d11b81e4e4bbd73e1882e2b8011e85d118 (diff)
downloadmailadmin-9f108dd1a969473375341d92a7b1252fa2cedc9a.tar.gz
mailadmin-9f108dd1a969473375341d92a7b1252fa2cedc9a.tar.bz2
Initial import.
git-svn-id: http://svn.sukimashita.com/repos/mailadmin/trunk@2 4281df72-ff29-0410-8fee-2d9ac0c5f5a7
Diffstat (limited to 'data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_form.php')
-rw-r--r--data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_form.php93
1 files changed, 93 insertions, 0 deletions
diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_form.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_form.php
new file mode 100644
index 0000000..47c385e
--- /dev/null
+++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_form.php
@@ -0,0 +1,93 @@
+[?php echo form_tag('<?php echo $this->getModuleName() ?>/'.$sf_context->getActionName(), array(
+ 'id' => 'sf_admin_edit_form',
+ 'name' => 'sf_admin_edit_form',
+ 'multipart' => true,
+<?php foreach ($this->getColumnCategories('edit.display') as $category): ?>
+<?php foreach ($this->getColumns('edit.display', $category) as $name => $column): ?>
+<?php if ('admin_double_list' == $this->getParameterValue('edit.fields.'.$column->getName().'.type')): ?>
+ 'onsubmit' => 'double_list_submit(); return true;'
+<?php break 2; ?>
+<?php endif; ?>
+<?php endforeach; ?>
+<?php endforeach; ?>
+)) ?]
+
+<?php foreach ($this->getPrimaryKey() as $pk): ?>
+[?php echo object_input_hidden_tag($<?php echo $this->getSingularName() ?>, 'get<?php echo $pk->getPhpName() ?>') ?]
+<?php endforeach; ?>
+
+<?php $first = true ?>
+<?php foreach ($this->getColumnCategories('edit.display') as $category): ?>
+<?php
+ if ($category[0] == '-')
+ {
+ $category_name = substr($category, 1);
+ $collapse = true;
+
+ if ($first)
+ {
+ $first = false;
+ echo "[?php use_javascript(sfConfig::get('sf_prototype_web_dir').'/js/prototype') ?]\n";
+ echo "[?php use_javascript(sfConfig::get('sf_admin_web_dir').'/js/collapse') ?]\n";
+ }
+ }
+ else
+ {
+ $category_name = $category;
+ $collapse = false;
+ }
+?>
+<fieldset id="sf_fieldset_<?php echo preg_replace('/[^a-z0-9_]/', '_', strtolower($category_name)) ?>" class="<?php if ($collapse): ?> collapse<?php endif; ?>">
+<?php if ($category != 'NONE'): ?><h2>[?php echo __('<?php echo $category_name ?>') ?]</h2>
+
+<?php endif; ?>
+
+<?php $hides = $this->getParameterValue('edit.hide', array()) ?>
+<?php foreach ($this->getColumns('edit.display', $category) as $name => $column): ?>
+<?php if (in_array($column->getName(), $hides)) continue ?>
+<?php if ($column->isPrimaryKey()) continue ?>
+<?php $credentials = $this->getParameterValue('edit.fields.'.$column->getName().'.credentials') ?>
+<?php if ($credentials): $credentials = str_replace("\n", ' ', var_export($credentials, true)) ?>
+ [?php if ($sf_user->hasCredential(<?php echo $credentials ?>)): ?]
+<?php endif; ?>
+<?php $only_for = $this->getParameterValue('edit.fields.'.$column->getName().'.only_for'); if($only_for): ?>
+[?php if($sf_context->getActionName()=='<?php echo $only_for ?>'): ?]
+<?php endif; ?>
+<div class="form-row">
+ [?php echo label_for('<?php echo $this->getParameterValue("edit.fields.".$column->getName().".label_for", $this->getSingularName()."[".$column->getName()."]") ?>', __($labels['<?php echo $this->getSingularName() ?>{<?php echo $column->getName() ?>}']), '<?php if ($column->isNotNull()): ?>class="required" <?php endif; ?>') ?]
+ <div class="content[?php if ($sf_request->hasError('<?php echo $this->getSingularName() ?>{<?php echo $column->getName() ?>}')): ?] form-error[?php endif; ?]">
+ [?php if ($sf_request->hasError('<?php echo $this->getSingularName() ?>{<?php echo $column->getName() ?>}')): ?]
+ [?php echo form_error('<?php echo $this->getSingularName() ?>{<?php echo $column->getName() ?>}', array('class' => 'form-error-msg')) ?]
+ [?php endif; ?]
+ [?php $value = <?php echo $this->getColumnEditTag($column); ?>; echo $value ? $value : '&nbsp;' ?]
+ <?php echo $this->getHelp($column, 'edit') ?>
+ </div>
+</div>
+
+<?php if($only_for): ?>
+[?php endif; ?]
+<?php endif; ?>
+
+<?php if ($credentials): ?>
+ [?php endif; ?]
+<?php endif; ?>
+
+<?php endforeach; ?>
+</fieldset>
+<?php endforeach; ?>
+
+[?php include_partial('edit_actions', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>)) ?]
+
+</form>
+
+<ul class="sf_admin_actions">
+<?php
+/*
+ * WARNING: delete is a form, it must be outside the main form
+ */
+ $editActions = $this->getParameterValue('edit.actions');
+?>
+ <?php if (null === $editActions || (null !== $editActions && array_key_exists('_delete', $editActions))): ?>
+ <?php echo $this->addCredentialCondition($this->getButtonToAction('_delete', $editActions['_delete'], true), $editActions['_delete']) ?>
+ <?php endif; ?>
+</ul>