| 1 |
lars |
1 |
public function getListParams()
|
|
|
2 |
{
|
|
|
3 |
return <?php echo $this->asPhp(isset($this->config['list']['params']) ? $this->config['list']['params'] : '%%'.implode('%% - %%', isset($this->config['list']['display']) ? $this->config['list']['display'] : $this->getAllFieldNames(false)).'%%') ?>;
|
|
|
4 |
<?php unset($this->config['list']['params']) ?>
|
|
|
5 |
}
|
|
|
6 |
|
|
|
7 |
public function getListLayout()
|
|
|
8 |
{
|
|
|
9 |
return '<?php echo isset($this->config['list']['layout']) ? $this->config['list']['layout'] : 'tabular' ?>';
|
|
|
10 |
<?php unset($this->config['list']['layout']) ?>
|
|
|
11 |
}
|
|
|
12 |
|
|
|
13 |
public function getListTitle()
|
|
|
14 |
{
|
|
|
15 |
return '<?php echo $this->escapeString(isset($this->config['list']['title']) ? $this->config['list']['title'] : sfInflector::humanize($this->getModuleName()).' List') ?>';
|
|
|
16 |
<?php unset($this->config['list']['title']) ?>
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
public function getEditTitle()
|
|
|
20 |
{
|
|
|
21 |
return '<?php echo $this->escapeString(isset($this->config['edit']['title']) ? $this->config['edit']['title'] : 'Edit '.sfInflector::humanize($this->getModuleName())) ?>';
|
|
|
22 |
<?php unset($this->config['edit']['title']) ?>
|
|
|
23 |
}
|
|
|
24 |
|
|
|
25 |
public function getNewTitle()
|
|
|
26 |
{
|
|
|
27 |
return '<?php echo $this->escapeString(isset($this->config['new']['title']) ? $this->config['new']['title'] : 'New '.sfInflector::humanize($this->getModuleName())) ?>';
|
|
|
28 |
<?php unset($this->config['new']['title']) ?>
|
|
|
29 |
}
|
|
|
30 |
|
|
|
31 |
public function getFilterDisplay()
|
|
|
32 |
{
|
|
|
33 |
return <?php echo $this->asPhp(isset($this->config['filter']['display']) ? $this->config['filter']['display'] : array()) ?>;
|
|
|
34 |
<?php unset($this->config['filter']['display']) ?>
|
|
|
35 |
}
|
|
|
36 |
|
|
|
37 |
public function getFormDisplay()
|
|
|
38 |
{
|
|
|
39 |
return <?php echo $this->asPhp(isset($this->config['form']['display']) ? $this->config['form']['display'] : array()) ?>;
|
|
|
40 |
<?php unset($this->config['form']['display']) ?>
|
|
|
41 |
}
|
|
|
42 |
|
|
|
43 |
public function getEditDisplay()
|
|
|
44 |
{
|
|
|
45 |
return <?php echo $this->asPhp(isset($this->config['edit']['display']) ? $this->config['edit']['display'] : array()) ?>;
|
|
|
46 |
<?php unset($this->config['edit']['display']) ?>
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
public function getNewDisplay()
|
|
|
50 |
{
|
|
|
51 |
return <?php echo $this->asPhp(isset($this->config['new']['display']) ? $this->config['new']['display'] : array()) ?>;
|
|
|
52 |
<?php unset($this->config['new']['display']) ?>
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
public function getListDisplay()
|
|
|
56 |
{
|
|
|
57 |
<?php if (isset($this->config['list']['display'])): ?>
|
|
|
58 |
return <?php echo $this->asPhp($this->config['list']['display']) ?>;
|
|
|
59 |
<?php elseif (isset($this->config['list']['hide'])): ?>
|
|
|
60 |
return <?php echo $this->asPhp(array_diff($this->getAllFieldNames(false), $this->config['list']['hide'])) ?>;
|
|
|
61 |
<?php else: ?>
|
|
|
62 |
return <?php echo $this->asPhp($this->getAllFieldNames(false)) ?>;
|
|
|
63 |
<?php endif; ?>
|
|
|
64 |
<?php unset($this->config['list']['display'], $this->config['list']['hide']) ?>
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
public function getFieldsDefault()
|
|
|
68 |
{
|
|
|
69 |
return array(
|
|
|
70 |
<?php foreach ($this->getDefaultFieldsConfiguration() as $name => $params): ?>
|
|
|
71 |
'<?php echo $name ?>' => <?php echo $this->asPhp($params) ?>,
|
|
|
72 |
<?php endforeach; ?>
|
|
|
73 |
);
|
|
|
74 |
}
|
|
|
75 |
|
|
|
76 |
<?php foreach (array('list', 'filter', 'form', 'edit', 'new') as $context): ?>
|
|
|
77 |
public function getFields<?php echo ucfirst($context) ?>()
|
|
|
78 |
{
|
|
|
79 |
return array(
|
|
|
80 |
<?php foreach ($this->getFieldsConfiguration($context) as $name => $params): ?>
|
|
|
81 |
'<?php echo $name ?>' => <?php echo $this->asPhp($params) ?>,
|
|
|
82 |
<?php endforeach; ?>
|
|
|
83 |
);
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
<?php endforeach; ?>
|