From 9f108dd1a969473375341d92a7b1252fa2cedc9a Mon Sep 17 00:00:00 2001 From: mszulecki Date: Thu, 14 Jun 2007 17:09:01 +0000 Subject: Initial import. git-svn-id: http://svn.sukimashita.com/repos/mailadmin/trunk@2 4281df72-ff29-0410-8fee-2d9ac0c5f5a7 --- .../mailadmin/template/actions/actions.class.php | 435 +++++++++++++++++++++ .../mailadmin/template/templates/_edit_actions.php | 13 + .../mailadmin/template/templates/_edit_footer.php | 0 .../mailadmin/template/templates/_edit_form.php | 93 +++++ .../mailadmin/template/templates/_edit_header.php | 0 .../template/templates/_edit_messages.php | 5 + .../mailadmin/template/templates/_filters.php | 36 ++ .../mailadmin/template/templates/_list.php | 18 + .../mailadmin/template/templates/_list_actions.php | 10 + .../mailadmin/template/templates/_list_footer.php | 0 .../mailadmin/template/templates/_list_header.php | 0 .../template/templates/_list_messages.php | 13 + .../template/templates/_list_td_actions.php | 5 + .../template/templates/_list_td_stacked.php | 16 + .../template/templates/_list_td_tabular.php | 30 ++ .../template/templates/_list_th_stacked.php | 1 + .../template/templates/_list_th_tabular.php | 28 ++ .../mailadmin/template/templates/_pager.php | 13 + .../mailadmin/template/templates/editSuccess.php | 20 + .../mailadmin/template/templates/listSuccess.php | 38 ++ 20 files changed, 774 insertions(+) create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/actions/actions.class.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_actions.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_footer.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_form.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_header.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_messages.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_filters.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_list.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_list_actions.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_list_footer.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_list_header.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_list_messages.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_actions.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_stacked.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_tabular.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_list_th_stacked.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_list_th_tabular.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/_pager.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/editSuccess.php create mode 100644 data/generator/sfPropelAdmin/mailadmin/template/templates/listSuccess.php (limited to 'data/generator/sfPropelAdmin/mailadmin') diff --git a/data/generator/sfPropelAdmin/mailadmin/template/actions/actions.class.php b/data/generator/sfPropelAdmin/mailadmin/template/actions/actions.class.php new file mode 100644 index 0000000..70f94f0 --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/actions/actions.class.php @@ -0,0 +1,435 @@ +[?php + +/** + * getGeneratedModuleName() ?> actions. + * + * @package ##PROJECT_NAME## + * @subpackage getGeneratedModuleName() ?> + + * @author Fabien Potencier + * @version SVN: $Id: actions.class.php 3501 2007-02-18 10:28:17Z fabien $ + */ +class getGeneratedModuleName() ?>Actions extends sfActions +{ + public function executeIndex() + { + return $this->forward('getModuleName() ?>', 'list'); + } + + public function executeList() + { + $this->processSort(); + + $this->processFilters(); + +getParameterValue('list.filters')): ?> + $this->filters = $this->getUser()->getAttributeHolder()->getAll('sf_admin/getSingularName() ?>/filters'); + + + // pager + $this->pager = new sfPropelPager('getClassName() ?>', getParameterValue('list.max_per_page', 20) ?>); + $c = new Criteria(); + $this->addSortCriteria($c); + $this->addFiltersCriteria($c); + $this->pager->setCriteria($c); + $this->pager->setPage($this->getRequestParameter('page', 1)); +getParameterValue('list.peer_method')): ?> + $this->pager->setPeerMethod('getParameterValue('list.peer_method') ?>'); + +getParameterValue('list.peer_count_method')): ?> + $this->pager->setPeerCountMethod('getParameterValue('list.peer_count_method') ?>'); + + $this->pager->init(); + } + + public function executeCreate() + { + return $this->forward('getModuleName() ?>', 'edit'); + } + + public function executeSave() + { + return $this->forward('getModuleName() ?>', 'edit'); + } + + public function executeEdit() + { + $this->getSingularName() ?> = $this->getgetClassName() ?>OrCreate(); + + if ($this->getRequest()->getMethod() == sfRequest::POST) + { + $this->updategetClassName() ?>FromRequest(); + + $this->savegetClassName() ?>($this->getSingularName() ?>); + + $this->setFlash('notice', 'Your modifications have been saved'); + + if ($this->getRequestParameter('save_and_add')) + { + return $this->redirect('getModuleName() ?>/create'); + } + else if ($this->getRequestParameter('save_and_list')) + { + return $this->redirect('getModuleName() ?>/list'); + } + else + { + return $this->redirect('getModuleName() ?>/edit?getPrimaryKeyUrlParams('this->') ?>); + } + } + else + { + $this->labels = $this->getLabels(); + } + } + + public function executeDelete() + { + $this->getSingularName() ?> = getClassName() ?>Peer::retrieveByPk(getRetrieveByPkParamsForAction(40) ?>); + $this->forward404Unless($this->getSingularName() ?>); + + try + { + $this->deletegetClassName() ?>($this->getSingularName() ?>); + } + catch (PropelException $e) + { + $this->getRequest()->setError('delete', 'Could not delete the selected getSingularName()) ?>. Make sure it does not have any associated items.'); + return $this->forward('getModuleName() ?>', 'list'); + } + +getColumnCategories('edit.display') as $category): ?> +getColumns('edit.display', $category) as $name => $column): ?> +getParameterValue('edit.fields.'.$column->getName().'.type') ?> + +replaceConstants($this->getParameterValue('edit.fields.'.$column->getName().'.upload_dir')) ?> + $currentFile = sfConfig::get('sf_upload_dir')."//".$this->getSingularName() ?>->getgetPhpName() ?>(); + if (is_file($currentFile)) + { + unlink($currentFile); + } + + + + + return $this->redirect('getModuleName() ?>/list'); + } + + public function handleErrorEdit() + { + $this->preExecute(); + $this->getSingularName() ?> = $this->getgetClassName() ?>OrCreate(); + $this->updategetClassName() ?>FromRequest(); + + $this->labels = $this->getLabels(); + + return sfView::SUCCESS; + } + + protected function savegetClassName() ?>($getSingularName() ?>) + { + $getSingularName() ?>->save(); + +getColumnCategories('edit.display') as $category): ?> +getColumns('edit.display', $category) as $name => $column): $type = $column->getCreoleType(); ?> +getName() ?> +isPrimaryKey()) continue ?> +getParameterValue('edit.fields.'.$column->getName().'.credentials') ?> +getParameterValue('edit.fields.'.$column->getName().'.type') ?> +getParameterValue('edit.fields.'.$column->getName().'.params'); +$user_params = is_array($user_params) ? $user_params : sfToolkit::stringToArray($user_params); +$through_class = isset($user_params['through_class']) ? $user_params['through_class'] : ''; + +?> + +getClassName(); +$related_class = sfPropelManyToMany::getRelatedClass($class, $through_class); +$related_table = constant($related_class.'Peer::TABLE_NAME'); +$middle_table = constant($through_class.'Peer::TABLE_NAME'); +$this_table = constant($class.'Peer::TABLE_NAME'); + +$related_column = sfPropelManyToMany::getRelatedColumn($class, $through_class); +$column = sfPropelManyToMany::getColumn($class, $through_class); + +?> + + + if ($this->getUser()->hasCredential()) + { + + // Update many-to-many for "" + $c = new Criteria(); + $c->add(Peer::getColumnName()) ?>, $getSingularName() ?>->getPrimaryKey()); + Peer::doDelete($c); + + $ids = $this->getRequestParameter('associated_'); + if (is_array($ids)) + { + foreach ($ids as $id) + { + $ = new (); + $->setgetPhpName() ?>($getSingularName() ?>->getPrimaryKey()); + $->setgetPhpName() ?>($id); + $->save(); + } + } + + + } + + + + + + } + + protected function deletegetClassName() ?>($getSingularName() ?>) + { + $getSingularName() ?>->delete(); + } + + protected function updategetClassName() ?>FromRequest() + { + $getSingularName() ?> = $this->getRequestParameter('getSingularName() ?>'); + +getColumnCategories('edit.display') as $category): ?> +getColumns('edit.display', $category) as $name => $column): $type = $column->getCreoleType(); ?> +getName() ?> +isPrimaryKey()) continue ?> +getParameterValue('edit.fields.'.$column->getName().'.credentials') ?> +getParameterValue('edit.fields.'.$column->getName().'.type') ?> + + if ($this->getUser()->hasCredential()) + { + + +replaceConstants($this->getParameterValue('edit.fields.'.$column->getName().'.upload_dir')) ?> + $currentFile = sfConfig::get('sf_upload_dir')."//".$this->getSingularName() ?>->getgetPhpName() ?>(); + if (!$this->getRequest()->hasErrors() && isset($getSingularName() ?>['_remove'])) + { + $this->getSingularName() ?>->setgetPhpName() ?>(''); + if (is_file($currentFile)) + { + unlink($currentFile); + } + } + + if (!$this->getRequest()->hasErrors() && $this->getRequest()->getFileSize('getSingularName() ?>[]')) + { + + if (isset($getSingularName() ?>[''])) + { + + +getParameterValue('edit.fields.'.$column->getName().'.filename')): ?> + $fileName = "replaceConstants($this->getParameterValue('edit.fields.'.$column->getName().'.filename'))) ?>"; + + $fileName = md5($this->getRequest()->getFileName('getSingularName() ?>[]').time().rand(0, 99999)); + + $ext = $this->getRequest()->getFileExtension('getSingularName() ?>[]'); + if (is_file($currentFile)) + { + unlink($currentFile); + } + $this->getRequest()->moveFile('getSingularName() ?>[]', sfConfig::get('sf_upload_dir')."//".$fileName.$ext); + $this->getSingularName() ?>->setgetPhpName() ?>($fileName.$ext); + + if ($getSingularName() ?>['']) + { + try + { + $dateFormat = new sfDateFormat($this->getUser()->getCulture()); + + + if (!is_array($getSingularName() ?>[''])) + { + $value = $dateFormat->format($getSingularName() ?>[''], '', $dateFormat->getInputPattern('')); + } + else + { + $value_array = $getSingularName() ?>['']; + $value = $value_array['year'].'-'.$value_array['month'].'-'.$value_array['day'].(isset($value_array['hour']) ? ' '.$value_array['hour'].':'.$value_array['minute'].(isset($value_array['second']) ? ':'.$value_array['second'] : '') : ''); + } + $this->getSingularName() ?>->setgetPhpName() ?>($value); + } + catch (sfException $e) + { + // not a date + } + } + else + { + $this->getSingularName() ?>->setgetPhpName() ?>(null); + } + + $this->getSingularName() ?>->setgetPhpName() ?>(isset($getSingularName() ?>['']) ? $getSingularName() ?>[''] : 0); +isForeignKey()): ?> + $this->getSingularName() ?>->setgetPhpName() ?>($getSingularName() ?>[''] ? $getSingularName() ?>[''] : null); + + $this->getSingularName() ?>->setgetPhpName() ?>($getSingularName() ?>['']); + + + } + + + } + + + + } + + protected function getgetClassName() ?>OrCreate(getMethodParamsForGetOrCreate() ?>) + { + if (getTestPksForGetOrCreate() ?>) + { + $getSingularName() ?> = new getClassName() ?>(); + } + else + { + $getSingularName() ?> = getClassName() ?>Peer::retrieveByPk(getRetrieveByPkParamsForGetOrCreate() ?>); + + $this->forward404Unless($getSingularName() ?>); + } + + return $getSingularName() ?>; + } + + protected function processFilters() + { +getParameterValue('list.filters')): ?> + if ($this->getRequest()->hasParameter('filter')) + { + $filters = $this->getRequestParameter('filters'); +getColumns('list.filters') as $column): $type = $column->getCreoleType() ?> + + if (isset($filters['getName() ?>']['from']) && $filters['getName() ?>']['from'] !== '') + { + $filters['getName() ?>']['from'] = sfI18N::getTimestampForCulture($filters['getName() ?>']['from'], $this->getUser()->getCulture()); + } + if (isset($filters['getName() ?>']['to']) && $filters['getName() ?>']['to'] !== '') + { + $filters['getName() ?>']['to'] = sfI18N::getTimestampForCulture($filters['getName() ?>']['to'], $this->getUser()->getCulture()); + } + + + + $this->getUser()->getAttributeHolder()->removeNamespace('sf_admin/getSingularName() ?>/filters'); + $this->getUser()->getAttributeHolder()->add($filters, 'sf_admin/getSingularName() ?>/filters'); + } + + } + + protected function processSort() + { + if ($this->getRequestParameter('sort')) + { + $this->getUser()->setAttribute('sort', $this->getRequestParameter('sort'), 'sf_admin/getSingularName() ?>/sort'); + $this->getUser()->setAttribute('type', $this->getRequestParameter('type', 'asc'), 'sf_admin/getSingularName() ?>/sort'); + } + + if (!$this->getUser()->getAttribute('sort', null, 'sf_admin/getSingularName() ?>/sort')) + { +getParameterValue('list.sort')): ?> + + $this->getUser()->setAttribute('sort', '', 'sf_admin/getSingularName() ?>/sort'); + $this->getUser()->setAttribute('type', '', 'sf_admin/getSingularName() ?>/sort'); + + $this->getUser()->setAttribute('sort', '', 'sf_admin/getSingularName() ?>/sort'); + $this->getUser()->setAttribute('type', 'asc', 'sf_admin/getSingularName() ?>/sort'); + + + } + } + + protected function addFiltersCriteria($c) + { +getParameterValue('list.filters')): ?> +getColumns('list.filters') as $column): $type = $column->getCreoleType() ?> +isPartial() || $column->isComponent()) && $this->getParameterValue('list.fields.'.$column->getName().'.filter_criteria_disabled')) continue ?> + if (isset($this->filters['getName() ?>_is_empty'])) + { + $criterion = $c->getNewCriterion(getPeerClassName() ?>::getName()) ?>, ''); + $criterion->addOr($c->getNewCriterion(getPeerClassName() ?>::getName()) ?>, null, Criteria::ISNULL)); + $c->add($criterion); + } + + else if (isset($this->filters['getName() ?>'])) + { + if (isset($this->filters['getName() ?>']['from']) && $this->filters['getName() ?>']['from'] !== '') + { + + $criterion = $c->getNewCriterion(getPeerClassName() ?>::getName()) ?>, date('Y-m-d', $this->filters['getName() ?>']['from']), Criteria::GREATER_EQUAL); + + $criterion = $c->getNewCriterion(getPeerClassName() ?>::getName()) ?>, $this->filters['getName() ?>']['from'], Criteria::GREATER_EQUAL); + + } + if (isset($this->filters['getName() ?>']['to']) && $this->filters['getName() ?>']['to'] !== '') + { + if (isset($criterion)) + { + + $criterion->addAnd($c->getNewCriterion(getPeerClassName() ?>::getName()) ?>, date('Y-m-d', $this->filters['getName() ?>']['to']), Criteria::LESS_EQUAL)); + + $criterion->addAnd($c->getNewCriterion(getPeerClassName() ?>::getName()) ?>, $this->filters['getName() ?>']['to'], Criteria::LESS_EQUAL)); + + } + else + { + + $criterion = $c->getNewCriterion(getPeerClassName() ?>::getName()) ?>, date('Y-m-d', $this->filters['getName() ?>']['to']), Criteria::LESS_EQUAL); + + $criterion = $c->getNewCriterion(getPeerClassName() ?>::getName()) ?>, $this->filters['getName() ?>']['to'], Criteria::LESS_EQUAL); + + } + } + + if (isset($criterion)) + { + $c->add($criterion); + } + } + + else if (isset($this->filters['getName() ?>']) && $this->filters['getName() ?>'] !== '') + { + + $c->add(getPeerClassName() ?>::getName()) ?>, strtr($this->filters['getName() ?>'], '*', '%'), Criteria::LIKE); + + $c->add(getPeerClassName() ?>::getName()) ?>, $this->filters['getName() ?>']); + + } + + + + } + + protected function addSortCriteria($c) + { + if ($sort_column = $this->getUser()->getAttribute('sort', null, 'sf_admin/getSingularName() ?>/sort')) + { + $sort_column = getClassName() ?>Peer::translateFieldName($sort_column, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_COLNAME); + if ($this->getUser()->getAttribute('type', null, 'sf_admin/getSingularName() ?>/sort') == 'asc') + { + $c->addAscendingOrderByColumn($sort_column); + } + else + { + $c->addDescendingOrderByColumn($sort_column); + } + } + } + + protected function getLabels() + { + return array( +getColumnCategories('edit.display') as $category): ?> +getColumns('edit.display', $category) as $name => $column): ?> + 'getSingularName() ?>{getName() ?>}' => 'getParameterValue('edit.fields.'.$column->getName().'.name')); echo $label_name ?>:', + + + ); + } +} diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_actions.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_actions.php new file mode 100644 index 0000000..1d0d720 --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_actions.php @@ -0,0 +1,13 @@ + diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_footer.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_footer.php new file mode 100644 index 0000000..e69de29 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('getModuleName() ?>/'.$sf_context->getActionName(), array( + 'id' => 'sf_admin_edit_form', + 'name' => 'sf_admin_edit_form', + 'multipart' => true, +getColumnCategories('edit.display') as $category): ?> +getColumns('edit.display', $category) as $name => $column): ?> +getParameterValue('edit.fields.'.$column->getName().'.type')): ?> + 'onsubmit' => 'double_list_submit(); return true;' + + + + +)) ?] + +getPrimaryKey() as $pk): ?> +[?php echo object_input_hidden_tag($getSingularName() ?>, 'getgetPhpName() ?>') ?] + + + +getColumnCategories('edit.display') as $category): ?> + +
+

[?php echo __('') ?]

+ + + +getParameterValue('edit.hide', array()) ?> +getColumns('edit.display', $category) as $name => $column): ?> +getName(), $hides)) continue ?> +isPrimaryKey()) continue ?> +getParameterValue('edit.fields.'.$column->getName().'.credentials') ?> + + [?php if ($sf_user->hasCredential()): ?] + +getParameterValue('edit.fields.'.$column->getName().'.only_for'); if($only_for): ?> +[?php if($sf_context->getActionName()==''): ?] + +
+ [?php echo label_for('getParameterValue("edit.fields.".$column->getName().".label_for", $this->getSingularName()."[".$column->getName()."]") ?>', __($labels['getSingularName() ?>{getName() ?>}']), 'isNotNull()): ?>class="required" ') ?] +
+ [?php if ($sf_request->hasError('getSingularName() ?>{getName() ?>}')): ?] + [?php echo form_error('getSingularName() ?>{getName() ?>}', array('class' => 'form-error-msg')) ?] + [?php endif; ?] + [?php $value = getColumnEditTag($column); ?>; echo $value ? $value : ' ' ?] + getHelp($column, 'edit') ?> +
+
+ + +[?php endif; ?] + + + + [?php endif; ?] + + + +
+ + +[?php include_partial('edit_actions', array('getSingularName() ?>' => $getSingularName() ?>)) ?] + + + + diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_header.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_header.php new file mode 100644 index 0000000..e69de29 diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_messages.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_messages.php new file mode 100644 index 0000000..2306f05 --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_edit_messages.php @@ -0,0 +1,5 @@ +[?php if ($sf_flash->has('notice')): ?] +
+

[?php echo __($sf_flash->get('notice')) ?]

+
+[?php endif; ?] diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_filters.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_filters.php new file mode 100644 index 0000000..76be382 --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_filters.php @@ -0,0 +1,36 @@ +[?php use_helper('Object') ?] + +getParameterValue('list.filters')): ?> + + diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_list.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list.php new file mode 100644 index 0000000..cc85625 --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list.php @@ -0,0 +1,18 @@ + + +getParameterValue('list.object_actions')): ?> +[?php $c = 0; ?] +getParameterValue('list.object_actions') as $actionName => $params): ?> + addCredentialCondition('[?php $c++; ?]', $params) ?> + + + +[?php include_partial('list_th_getParameterValue('list.layout', 'tabular') ?>') ?] + +[?php $i = 1; foreach ($pager->getResults() as $getSingularName() ?>): $odd = fmod(++$i, 2) ?] + +[?php include_partial('list_td_actions', array('getSingularName() ?>' => $getSingularName() ?>)) ?] +[?php include_partial('list_td_getParameterValue('list.layout', 'tabular') ?>', array('getSingularName() ?>' => $getSingularName() ?>)) ?] + +[?php endforeach; ?] +
[?php echo __('Actions') ?]
diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_actions.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_actions.php new file mode 100644 index 0000000..a13263c --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_actions.php @@ -0,0 +1,10 @@ + diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_footer.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_footer.php new file mode 100644 index 0000000..e69de29 diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_header.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_header.php new file mode 100644 index 0000000..e69de29 diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_messages.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_messages.php new file mode 100644 index 0000000..c2eb7c7 --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_messages.php @@ -0,0 +1,13 @@ +[?php if ($sf_request->getError('delete')): ?] +
+

Could not delete the selected getSingularName()) ?>

+ +
+[?php endif; ?] +[?php if ($sf_flash->has('notice')): ?] +
+

[?php echo image_tag("information.gif","alt=[?]")?] [?php echo __($sf_flash->get('notice')) ?]

+
+[?php endif; ?] diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_actions.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_actions.php new file mode 100644 index 0000000..fcaca78 --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_actions.php @@ -0,0 +1,5 @@ +getParameterValue('list.object_actions')): ?> +getParameterValue('list.object_actions') as $actionName => $params): ?> + addCredentialCondition("", $params) ?> + + diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_stacked.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_stacked.php new file mode 100644 index 0000000..0d9e274 --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_stacked.php @@ -0,0 +1,16 @@ + +getParameterValue('list.params')): ?> + getI18NString('list.params') ?> + +getParameterValue('list.hide', array()) ?> +getColumns('list.display') as $column): ?> +getName(), $hides)) continue ?> + isLink()): ?> + [?php echo link_to(getColumnListTag($column) ?> ? getColumnListTag($column) ?> : __('-'), 'getModuleName() ?>/edit?getPrimaryKeyUrlParams() ?>) ?] + + [?php echo getColumnListTag($column) ?> ?] + + - + + + \ No newline at end of file diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_tabular.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_tabular.php new file mode 100644 index 0000000..e4e50bb --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_td_tabular.php @@ -0,0 +1,30 @@ +getParameterValue('list.hide', array()) ?> +getColumns('list.display') as $column): ?> +getName(), $hs)) continue ?> +getParameterValue('list.fields.'.$column->getName().'.credentials') ?> + + [?php if ($sf_user->hasCredential()): ?] + + getParameterValue('list.fields.'.$column->getName().'.params'); + $user_params = is_array($user_params) ? sfToolkit::stringToArray($user_params) : $user_params; + ?> + isLink()): ?> + + getParameterValue('list.object_actions.edit.credentials'); ?> + + [?php if ($sf_user->hasCredential()): ?] + + [?php echo tag('td', , true) ?][?php echo link_to(getColumnListTag($column) ?> ? getColumnListTag($column) ?> : __('-'), 'getModuleName() ?>/edit?getPrimaryKeyUrlParams() ?>) ?] + + [?php else: ?] + [?php echo tag('td', , true) ?][?php echo getColumnListTag($column) ?> ?] + [?php endif; ?] + + + [?php echo tag('td', , true) ?][?php echo getColumnListTag($column) ?> ?] + + + [?php endif; ?] + + diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_th_stacked.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_th_stacked.php new file mode 100644 index 0000000..305bdcf --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_th_stacked.php @@ -0,0 +1 @@ +[?php include_partial('list_th_tabular') ?] diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_th_tabular.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_th_tabular.php new file mode 100644 index 0000000..4a48eca --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_list_th_tabular.php @@ -0,0 +1,28 @@ +getParameterValue('list.hide', array()) ?> +getColumns('list.display') as $column): ?> +getName(), $hides)) continue ?> +getParameterValue('list.fields.'.$column->getName().'.credentials') ?> + + [?php if ($sf_user->hasCredential()): ?] + + getParameterValue('list.fields.'.$column->getName().'.params'); + $user_params = is_array($user_params) ? $user_params : sfToolkit::stringToArray($user_params); + $user_params['id'] = "sf_admin_list_th_".$column->getName(); + ?> + [?php echo tag('th', , true) ?] + isReal()): ?> + [?php if ($sf_user->getAttribute('sort', null, 'sf_admin/getSingularName() ?>/sort') == 'getName() ?>'): ?] + [?php echo link_to(__('getParameterValue('list.fields.'.$column->getName().'.name')) ?>'), 'getModuleName() ?>/list?sort=getName() ?>&type='.($sf_user->getAttribute('type', 'asc', 'sf_admin/getSingularName() ?>/sort') == 'asc' ? 'desc' : 'asc')) ?][?php $sorttype = $sf_user->getAttribute('type', 'asc','sf_admin/getSingularName() ?>/sort'); if($sorttype=='images') $sorttype = 'desc'; ?][?php echo image_tag('sort-'.$sorttype.'.gif', array('alt' => __($sorttype), 'border' => 0)) ?] + [?php else: ?] + [?php echo link_to(__('getParameterValue('list.fields.'.$column->getName().'.name')) ?>'), 'getModuleName() ?>/list?sort=getName() ?>&type=asc') ?] + [?php endif; ?] + + [?php echo __('getParameterValue('list.fields.'.$column->getName().'.name')) ?>') ?] + + getHelpAsIcon($column, 'list') ?> + + + [?php endif; ?] + + diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/_pager.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/_pager.php new file mode 100644 index 0000000..818d925 --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/_pager.php @@ -0,0 +1,13 @@ +[?php if($pager->getNbResults() > 25 || $pager->haveToPaginate()): ?] +
+ +
+[?php endif; ?] diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/editSuccess.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/editSuccess.php new file mode 100644 index 0000000..2727a2c --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/editSuccess.php @@ -0,0 +1,20 @@ +[?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?] + +
+ +

[?php echo ($sf_context->getActionName()=='create' ? getI18NString('create.title', 'create '.$this->getModuleName(), false) ?>: getI18NString('edit.title', 'edit '.$this->getModuleName(), false) ?>) ?]

+ +
+[?php include_partial('getModuleName() ?>/edit_header', array('getSingularName() ?>' => $getSingularName() ?>)) ?] +
+ +
+[?php include_partial('getModuleName() ?>/edit_messages', array('getSingularName() ?>' => $getSingularName() ?>, 'labels' => $labels)) ?] +[?php include_partial('getModuleName() ?>/edit_form', array('getSingularName() ?>' => $getSingularName() ?>, 'labels' => $labels)) ?] +
+ + + +
diff --git a/data/generator/sfPropelAdmin/mailadmin/template/templates/listSuccess.php b/data/generator/sfPropelAdmin/mailadmin/template/templates/listSuccess.php new file mode 100644 index 0000000..c92aaf4 --- /dev/null +++ b/data/generator/sfPropelAdmin/mailadmin/template/templates/listSuccess.php @@ -0,0 +1,38 @@ +[?php use_helper('I18N', 'Date', 'Tag', 'Javascript') ?] + +
+ +

getI18NString('list.title', $this->getModuleName().' list') ?>

+ +
+[?php include_partial('getModuleName() ?>/list_header', array('pager' => $pager)) ?] +[?php include_partial('getModuleName() ?>/list_messages', array('pager' => $pager)) ?] +
+ +
+[?php echo __('Results') ?]: [?php echo $pager->getNbResults() ?]Entries per Page: [?php echo select_tag("resultsperpage", options_for_select(getParameterValue('list.max_per_page_options', array(10,25,50,100)); var_export(@array_combine($opt,$opt)); ?>, $pager->getMaxPerPage()), array("onchange" => "document.location.href = '".url_for('getModuleName() ?>/list')."?max_per_page='+this.value")) ?]getParameterValue('list.filters')): ?>[?php echo link_to_function(__('Toggle Filter Settings'), visual_effect('toggle_blind', 'sf_admin_filters' )) ?] + + +getParameterValue('list.filters')): ?> +
+[?php include_partial('filters', array('filters' => $filters)) ?] +
+ + +[?php include_partial('pager', array('pager' => $pager, 'location' => 'top')) ?] +
+[?php if (!$pager->getNbResults()): ?] +[?php echo __('no result') ?] +[?php else: ?] +[?php include_partial('getModuleName() ?>/list', array('pager' => $pager)) ?] +[?php endif; ?] +
+[?php include_partial('pager', array('pager' => $pager, 'location' => 'bottom')) ?] +[?php include_partial('list_actions') ?] +
+ + + +
-- cgit v1.1-32-gdbae