Skip to content

Commit e035a91

Browse files
Merge pull request #30 from j0k3r/partial
port changes from Propel to Doctrine
2 parents 41994ec + d01c98b commit e035a91

File tree

5 files changed

+40
-26
lines changed

5 files changed

+40
-26
lines changed

data/generator/sfDoctrineModule/twitter/template/templates/_form.php

+36
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,29 @@
33

44
<div class="sf_admin_form">
55
[?php echo form_tag_for($form, '@<?php echo $this->params['route_prefix'] ?>') ?]
6+
7+
<?php if($this->configuration->hasNewPartial()) : ?>
8+
[?php if ($form->isNew()) : ?]
9+
<div class="sf_admin_right_column">
10+
<?php foreach($this->configuration->getNewPartial() as $partial): ?>
11+
[?php include_partial('<?php echo $partial ?>', array('form' => $form, '<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'helper' => $helper, 'configuration' => $configuration)) ?]
12+
<?php endforeach; ?>
13+
</div>
14+
<div class="sf_admin_with_right_colum">
15+
[?php endif; ?]
16+
<?php endif; ?>
17+
18+
<?php if($this->configuration->hasEditPartial()) : ?>
19+
[?php if (!$form->isNew()) : ?]
20+
<div class="sf_admin_right_column">
21+
<?php foreach($this->configuration->getEditPartial() as $partial): ?>
22+
[?php include_partial('<?php echo $partial ?>', array('form' => $form, '<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'helper' => $helper, 'configuration' => $configuration)) ?]
23+
<?php endforeach; ?>
24+
</div>
25+
<div class="sf_admin_with_right_colum">
26+
[?php endif; ?]
27+
<?php endif; ?>
28+
629
[?php echo $form->renderHiddenFields(false) ?]
730

831
[?php if ($form->hasGlobalErrors()): ?]
@@ -13,6 +36,19 @@
1336
[?php include_partial('<?php echo $this->getModuleName() ?>/form_fieldset', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'fields' => $fields, 'fieldset' => $fieldset)) ?]
1437
[?php endforeach; ?]
1538

39+
<?php if($this->configuration->hasEditPartial() && $this->configuration->hasNewPartial()) : ?>
40+
</div>
41+
<?php elseif ($this->configuration->hasNewPartial()) : ?>
42+
[?php if ($form->isNew()) : ?]
43+
</div>
44+
[?php endif; ?]
45+
<?php else : ?>
46+
[?php if (!$form->isNew()) : ?]
47+
</div>
48+
[?php endif; ?]
49+
<?php endif; ?>
50+
1651
[?php include_partial('<?php echo $this->getModuleName() ?>/form_actions', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?]
52+
1753
</form>
1854
</div>

data/generator/sfDoctrineModule/twitter/template/templates/editSuccess.php

+1-12
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33

44
<div id="sf_admin_container">
55

6-
<?php if($this->configuration->hasEditPartial()) : ?>
7-
<div class="sf_admin_right_column">
8-
<?php foreach($this->configuration->getEditPartial() as $partial): ?>
9-
[?php include_partial('<?php echo $partial ?>', array('form' => $form, '<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'helper' => $helper, 'configuration' => $configuration)) ?]
10-
<?php endforeach; ?>
11-
</div>
12-
<div class="sf_admin_with_right_colum">
13-
<?php endif; ?>
14-
156
<h2 class="mbl">
167
[?php echo <?php echo $this->getI18NString('edit.title') ?> ?]
178

@@ -38,7 +29,5 @@
3829
<div id="sf_admin_footer">
3930
[?php include_partial('<?php echo $this->getModuleName() ?>/form_footer', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration)) ?]
4031
</div>
41-
<?php if($this->configuration->hasEditPartial()) : ?>
42-
</div>
43-
<?php endif; ?>
32+
4433
</div>

data/generator/sfDoctrineModule/twitter/template/templates/newSuccess.php

+1-12
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33

44
<div id="sf_admin_container">
55

6-
<?php if($this->configuration->hasNewPartial()) : ?>
7-
<div class="sf_admin_right_column">
8-
<?php foreach($this->configuration->getNewPartial() as $partial): ?>
9-
[?php include_partial('<?php echo $partial ?>', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'helper' => $helper, 'configuration' => $configuration)) ?]
10-
<?php endforeach; ?>
11-
</div>
12-
<div class="sf_admin_with_right_colum">
13-
<?php endif; ?>
14-
156
<h2 class="mbl">
167
[?php echo <?php echo $this->getI18NString('new.title') ?> ?]
178

@@ -38,7 +29,5 @@
3829
<div id="sf_admin_footer">
3930
[?php include_partial('<?php echo $this->getModuleName() ?>/form_footer', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration)) ?]
4031
</div>
41-
<?php if($this->configuration->hasNewPartial()) : ?>
42-
</div>
43-
<?php endif; ?>
32+
4433
</div>

data/generator/sfPropelModule/twitter/template/templates/_form.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
[?php include_partial('<?php echo $this->getModuleName() ?>/form_fieldset', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'fields' => $fields, 'fieldset' => $fieldset)) ?]
3737
[?php endforeach; ?]
3838

39-
4039
<?php if($this->configuration->hasEditPartial() && $this->configuration->hasNewPartial()) : ?>
4140
</div>
4241
<?php elseif ($this->configuration->hasNewPartial()) : ?>
@@ -48,6 +47,7 @@
4847
</div>
4948
[?php endif; ?]
5049
<?php endif; ?>
50+
5151
[?php include_partial('<?php echo $this->getModuleName() ?>/form_actions', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?]
5252

5353
</form>

data/generator/sfPropelModule/twitter/template/templates/editSuccess.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
<div id="sf_admin_container">
55

6-
76
<h2 class="mbl">
87
[?php echo <?php echo $this->getI18NString('edit.title') ?> ?]
98

@@ -30,4 +29,5 @@
3029
<div id="sf_admin_footer">
3130
[?php include_partial('<?php echo $this->getModuleName() ?>/form_footer', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration)) ?]
3231
</div>
32+
3333
</div>

0 commit comments

Comments
 (0)