Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some functionality to Doctrine generator #1

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
web/css/boxie/
web/js/ddpng.js
.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ public function preExecute()
<?php include dirname(__FILE__).'/../../parts/paginationAction.php' ?>

<?php include dirname(__FILE__).'/../../parts/sortingAction.php' ?>

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
<?php endif; ?>
[?php use_stylesheet('/doBoxieAdminGeneratorThemePlugin/css/boxie.css') ?]
[?php use_javascript('/doBoxieAdminGeneratorThemePlugin/js/boxie.js') ?]
[?php use_javascript('/doBoxieAdminGeneratorThemePlugin/js/ddpng.js') ?]
[?php use_javascript('/doBoxieAdminGeneratorThemePlugin/js/ddpng.js') ?]
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
[?php use_helper('Boxie') ?]
[?php use_stylesheets_for_form($form) ?]
[?php use_javascripts_for_form($form) ?]

<div class="sf_admin_form">
[?php echo form_tag_for($form, '@<?php echo $this->params['route_prefix'] ?>',array('class'=>'fields')) ?]
[?php echo $form->renderHiddenFields(false) ?]

[?php if ($form->hasGlobalErrors()): ?]
[?php echo $form->renderGlobalErrors() ?]
[?php endif; ?]

[?php include_partial('<?php echo $this->getModuleName() ?>/flashes') ?]

[?php foreach ($configuration->getFormFields($form, $form->isNew() ? 'new' : 'edit') as $fieldset => $fields): ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/form_fieldset', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'fields' => $fields, 'fieldset' => $fieldset)) ?]
[?php endforeach; ?]

[?php include_partial(
'<?php echo $this->getModuleName() ?>/form_fieldset',
array(
'<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>,
'form' => $form,
'fields' => $fields,
'fieldset' => $fieldset
)) ?]

[?php endforeach ?]

[?php include_partial('<?php echo $this->getModuleName() ?>/form_actions', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?]
</form>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[?php use_helper('Boxie') ?]
[?php foreach ($configuration->getFormFields($form, $form->isNew() ? 'new' : 'edit') as $fieldset => $fields): ?]
<div id="[?php echo slugString($fieldset) ?]" class="content tabbed_admin" style="[?php echo ($visible = !isset($visible)) ? '' : 'display:none' ?]">
[?php if ($form->hasGlobalErrors()): ?]
[?php echo $form->renderGlobalErrors() ?]
[?php endif; ?]

[?php include_partial('<?php echo $this->getModuleName() ?>/flashes') ?]


[?php include_partial('<?php echo $this->getModuleName() ?>/form_fieldset', array(
'<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>,
'form' => $form,
'fields' => $fields,
'fieldset' => 'NONE'
)) ?]
</div>
[?php endforeach ?]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div class="content">

<div id="sf_admin_header">
[?php include_partial('<?php echo $this->getModuleName() ?>/form_header', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration)) ?]
</div>

<div id="sf_admin_content">
[?php include_partial('<?php echo $this->getModuleName() ?>/form', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?]
</div>

<div id="sf_admin_footer">
[?php include_partial('<?php echo $this->getModuleName() ?>/form_footer', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration)) ?]
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,25 +1,57 @@
[?php if ($field->isPartial()): ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/'.$name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?]
[?php
if (strpos($field->getName(), '/'))
{
$elements = explode('/', $field->getName());

$module = $elements[0];
$action = $elements[1];
}
else
{
$module = $this->getModuleName();
$action = $name;
}
?]
[?php include_partial("$module/".$action, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?]
[?php elseif ($field->isComponent()): ?]
[?php include_component('<?php echo $this->getModuleName() ?>', $name, array('form' => $form, 'attributes' => $attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes)) ?]
[?php else: ?]
<div class="[?php echo $class ?][?php $form[$name]->hasError() and print ' errors' ?]">
[?php echo $form[$name]->renderError() ?]
<div>
[?php if($form[$name]->getWidget() instanceof sfWidgetFormInputCheckbox): ?]
[?php $className='check'; ?]
[?php else: ?>
[?php $className=''; ?]
[?php endif; ?>
[?php echo $form[$name]->renderLabel($label,array('class'=>$className)) ?]
[?php else:
if($form[$name]->getWidget() instanceof sfWidgetFormInputCheckbox):
$className='check';
else:
$className='';
endif;

[?php echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : $attributes) ?]
if ( $show_label ):
if ( $form->getWidget($name) instanceof sfWidgetFormInputCheckbox ) echo '<br>';
echo $form[$name]->renderLabel($label,array('class'=>$className));
endif;

unset($className);

$new_classes = array();?]
[?php if ($form[$name]->hasError()): ?]
[?php $new_classes = array('class' => 'error') ?]
[?php endif ?]

[?php if (in_array($name, array_keys($form->getEmbeddedForms()))):
$embedded = $form->getEmbeddedForm($name);
$embedded->renderUsing('list');
echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : array_merge($attributes, $new_classes)) ?]
[?php else: ?]
[?php echo $form[$name]->render($attributes instanceof sfOutputEscaper ? $attributes->getRawValue() : array_merge($attributes, $new_classes)) ?]
[?php endif; ?]

[?php if ( $show_help ): ?]
<br>
<small>
[?php if ($help): ?]
[?php echo __($help, array(), '<?php echo $this->getI18nCatalogue() ?>') ?]
[?php elseif ($help = $form[$name]->renderHelp()): ?]
[?php echo $help ?]
[?php endif; ?]
</small>
[?php endif ?]

[?php if ($help): ?]
<small>[?php echo __($help, array(), '<?php echo $this->getI18nCatalogue() ?>') ?]</small>
[?php elseif ($help = $form[$name]->renderHelp()): ?]
<small>[?php echo $help ?]</small>
[?php endif; ?]
</div>
</div>
[?php endif; ?]
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
<fieldset id="sf_fieldset_[?php echo preg_replace('/[^a-z0-9_]/', '_', strtolower($fieldset)) ?]">
[?php use_helper('Boxie') ?]
<fieldset id="sf_fieldset_[?php echo slugString($fieldset) ?]">
[?php if ('NONE' != $fieldset): ?]
<legend><strong>[?php echo __($fieldset, array(), '<?php echo $this->getI18nCatalogue() ?>') ?]</strong></legend>
[?php endif; ?]
[?php endif;

[?php foreach ($fields as $name => $field): ?]
[?php if ((isset($form[$name]) && $form[$name]->isHidden()) || (!isset($form[$name]) && $field->isReal())) continue ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/form_field', array(
'name' => $name,
'attributes' => $field->getConfig('attributes', array()),
'label' => $field->getConfig('label'),
'help' => $field->getConfig('help'),
'form' => $form,
'field' => $field,
'class' => 'sf_admin_form_row sf_admin_'.strtolower($field->getType()).' sf_admin_form_field_'.$name,
)) ?]
[?php endforeach; ?]
$next_field_names = array_keys($fields);
array_shift($next_field_names);
?]

[?php
foreach ($fields as $name => $field):
if ((isset($form[$name]) && $form[$name]->isHidden()) || (!isset($form[$name]) && $field->isReal())) continue;

$show_label = !preg_match('/^'.sfConfig::get('app_boxie_admin_hide_labels_prefix', '_').'/', $name);
$next_field = array_shift($next_field_names);
$show_help = !preg_match('/^'.sfConfig::get('app_boxie_admin_hide_labels_prefix', '_').'/', $next_field);

include_partial('<?php echo $this->getModuleName() ?>/form_field', array(
'name' => $name,
'attributes' => $field->getConfig('attributes', array()),
'label' => $field->getConfig('label'),
'help' => $field->getConfig('help'),
'show_label' => $show_label,
'show_help' => $show_help,
'form' => $form,
'field' => $field,
'class' => 'sf_admin_form_row sf_admin_'.strtolower($field->getType()).' sf_admin_form_field_'.$name,
));

endforeach;
?]
</fieldset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[?php if (count($fields) > 0): ?]
<ul>
[?php foreach ($fields as $fieldset => $fields): ?]
<li><a rel="[?php echo slugString($fieldset) ?]" href="#" class="[?php echo ($active = !isset($active)) ? 'active' : '' ?]">[?php echo $fieldset ?></a></li>
[?php endforeach?]
</ul>
[?php endif ?]
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php foreach ($this->configuration->getValue('list.display') as $name => $field): ?>
<?php echo $this->addCredentialCondition(sprintf(<<<EOF
<td class="sf_admin_%s sf_admin_list_td_%s">
[?php echo %s ?]
</td>
<?php echo $this->addCredentialCondition(sprintf(<<<EOF
<td class="sf_admin_%s sf_admin_list_td_%s">
[?php echo %s ?]
</td>

EOF
, strtolower($field->getType()), $name, $this->renderField($field)), $field->getConfig()) ?>
, strtolower($field->getType()), $name, $this->renderField($field), $field->getConfig())) ?>
<?php endforeach; ?>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<th class="sf_admin_<?php echo strtolower($field->getType()) ?> sf_admin_list_th_<?php echo $name ?>">
<?php if ($field->isReal()): ?>
[?php if ('<?php echo $name ?>' == $sort[0]): ?]
<div class="sort_container">
[?php echo image_tag(sfConfig::get('sf_admin_module_web_dir').'/images/'.$sort[1].'.png', array('alt' => __($sort[1], array(), 'sf_admin'), 'title' => __($sort[1], array(), 'sf_admin'))) ?]
</div>
[?php echo link_to(__('<?php echo $field->getConfig('label', '', true) ?>', array(), '<?php echo $this->getI18nCatalogue() ?>'), '@<?php echo $this->getUrlForAction('list') ?>', array('query_string' => 'sort=<?php echo $name ?>&sort_type='.($sort[1] == 'asc' ? 'desc' : 'asc'))) ?]
[?php echo image_tag('/css/boxie/img/'.$sort[1].'.png', array('alt' => __($sort[1], array(), 'sf_admin'), 'title' => __($sort[1], array(), 'sf_admin'))) ?]
[?php else: ?]
[?php echo link_to(__('<?php echo $field->getConfig('label', '', true) ?>', array(), '<?php echo $this->getI18nCatalogue() ?>'), '@<?php echo $this->getUrlForAction('list') ?>', array('query_string' => 'sort=<?php echo $name ?>&sort_type=asc')) ?]
[?php endif; ?]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
[?php use_helper('I18N', 'Date') ?]
[?php use_helper('I18N', 'Date', 'Boxie') ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/assets') ?]

<div id="sf_admin_container">

<div id="box1" class="box box-100"><!-- box full-width -->
<div class="boxin">
<div class="header">
<h3>[?php echo <?php echo $this->getI18NString('edit.title') ?> ?]</h3>
</div>
<div class="content">


[?php include_partial('<?php echo $this->getModuleName() ?>/flashes') ?]

<div id="sf_admin_header">
[?php include_partial('<?php echo $this->getModuleName() ?>/form_header', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration)) ?]
</div>

<div id="sf_admin_content">
[?php include_partial('<?php echo $this->getModuleName() ?>/form', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?]
</div>

<div id="sf_admin_footer">
[?php include_partial('<?php echo $this->getModuleName() ?>/form_footer', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration)) ?]
</div>
</div>
<div id="box1" class="box box-100"><!-- box full-width -->
[?php echo form_tag_for($form, '@<?php echo $this->params['route_prefix'] ?>',array('class'=>'fields sf_admin_form')) ?]
[?php echo $form->renderHiddenFields(false) ?]
<div class="boxin">
<div class="header">
<h3>[?php echo <?php echo $this->getI18NString('edit.title') ?> ?]</h3>

[?php if (sfConfig::get('app_boxie_admin_show_tabs', false)): ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/header_tabs', array('fields' => $configuration->getFormFields($form, $form->isNew() ? 'new' : 'edit'))) ?]
[?php endif ?]
</div>

[?php if (sfConfig::get('app_boxie_admin_show_tabs', false)): ?]

[?php include_partial(
'<?php echo $this->getModuleName() ?>/form_containers',
array(
'<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>,
'form' => $form,
'configuration' => $configuration,
'helper' => $helper
)) ?]

[?php include_partial('<?php echo $this->getModuleName() ?>/form_actions', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?]
[?php else: ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/form_content', compact('<?php echo $this->getSingularName() ?>', 'form', 'configuration', 'helper')); ?]
[?php endif ?]

</div>

</form>
</div>
</div>

</div>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>
<div class="content">
<?php if ($this->configuration->getValue('list.batch_actions')): ?>
<form action="[?php echo url_for('<?php echo $this->getUrlForAction('collection') ?>', array('action' => 'batch')) ?]" method="post">
<form action="[?php echo url_for('<?php echo $this->getUrlForAction('collection') ?>', array('action' => 'batch')) ?]" method="post" class="list_form">
<?php endif; ?>
[?php include_partial('<?php echo $this->getModuleName() ?>/list', array('pager' => $pager, 'sort' => $sort, 'helper' => $helper)) ?]
<ul class="actions">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
[?php use_helper('I18N', 'Date') ?]
[?php use_helper('I18N', 'Date', 'Boxie') ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/assets') ?]

<div id="sf_admin_container">

<div id="box1" class="box box-100"><!-- box full-width -->
[?php echo form_tag_for($form, '@<?php echo $this->params['route_prefix'] ?>',array('class'=>'fields sf_admin_form')) ?]
[?php echo $form->renderHiddenFields(false) ?]
<div class="boxin">
<div class="header">
<h3>[?php echo <?php echo $this->getI18NString('new.title') ?> ?]</h3>

<div id="box1" class="box box-100"><!-- box full-width -->
<div class="boxin">
<div class="header">
<h3>[?php echo <?php echo $this->getI18NString('new.title') ?> ?]</h3>
</div>
<div class="content">
[?php if (sfConfig::get('app_boxie_admin_show_tabs', false)): ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/header_tabs', array('fields' => $configuration->getFormFields($form, $form->isNew() ? 'new' : 'edit'))) ?]
[?php endif ?]
</div>

[?php include_partial('<?php echo $this->getModuleName() ?>/flashes') ?]
[?php if (sfConfig::get('app_boxie_admin_show_tabs', false)): ?]

<div id="sf_admin_header">
[?php include_partial('<?php echo $this->getModuleName() ?>/form_header', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration)) ?]
</div>
[?php include_partial(
'<?php echo $this->getModuleName() ?>/form_containers',
array(
'<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>,
'form' => $form,
'configuration' => $configuration,
'helper' => $helper
)) ?]

<div id="sf_admin_content">
[?php include_partial('<?php echo $this->getModuleName() ?>/form', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?]
</div>
[?php include_partial('<?php echo $this->getModuleName() ?>/form_actions', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration, 'helper' => $helper)) ?]
[?php else: ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/form_content', compact('<?php echo $this->getSingularName() ?>', 'form', 'configuration', 'helper')); ?]
[?php endif ?]

<div id="sf_admin_footer">
[?php include_partial('<?php echo $this->getModuleName() ?>/form_footer', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration)) ?]
</div>
</div>
</div>

</form>
</div>
</div>

</div>
Loading