Permalink
Browse files

Update AG

  • Loading branch information...
1 parent ca6805d commit 685ddf1e8e02be63fc5e27272bef370f8e5c6e64 @vincentchalamon committed Dec 28, 2011
@@ -42,19 +42,19 @@ public function getFilterDisplay()
public function getEditTemplate()
{
- return '<?php echo $this->escapeString(isset($this->config['edit']['template']) ? $this->config['edit']['template'] : (isset($this->config['form']['template']) ? $this->config['form']['template'] : 'default')) ?>';
+ return sfContext::hasInstance() && sfContext::getInstance()->getRequest()->isXmlHttpRequest() ? 'default' : '<?php echo $this->escapeString(isset($this->config['edit']['template']) ? $this->config['edit']['template'] : (isset($this->config['form']['template']) ? $this->config['form']['template'] : 'default')) ?>';
<?php unset($this->config['edit']['template']) ?>
}
public function getNewTemplate()
{
- return '<?php echo $this->escapeString(isset($this->config['new']['template']) ? $this->config['new']['template'] : (isset($this->config['form']['template']) ? $this->config['form']['template'] : 'default')) ?>';
+ return sfContext::hasInstance() && sfContext::getInstance()->getRequest()->isXmlHttpRequest() ? 'default' : '<?php echo $this->escapeString(isset($this->config['new']['template']) ? $this->config['new']['template'] : (isset($this->config['form']['template']) ? $this->config['form']['template'] : 'default')) ?>';
<?php unset($this->config['new']['template']) ?>
}
public function getFormTemplate()
{
- return '<?php echo $this->escapeString(isset($this->config['form']['template']) ? $this->config['form']['template'] : 'default') ?>';
+ return sfContext::hasInstance() && sfContext::getInstance()->getRequest()->isXmlHttpRequest() ? 'default' : '<?php echo $this->escapeString(isset($this->config['form']['template']) ? $this->config['form']['template'] : 'default') ?>';
<?php unset($this->config['form']['template']) ?>
}
@@ -2,7 +2,7 @@
[?php use_javascripts_for_form($form) ?]
<div class="sf_admin_form">
- [?php echo form_tag_for($form, '@<?php echo $this->params['route_prefix'] ?>', array('id' => $form->getName().'_form')) ?]
+ [?php if($configuration->{$form->isNew() ? "getNewTemplate" : "getEditTemplate"}() == "default") echo form_tag_for($form, '@<?php echo $this->params['route_prefix'] ?>', array('id' => $form->getName().'_form')) ?]
[?php echo $form->renderHiddenFields(false) ?]
[?php if ($form->hasGlobalErrors()): ?]
@@ -14,5 +14,5 @@
[?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>
+ [?php if($configuration->{$form->isNew() ? "getNewTemplate" : "getEditTemplate"}() == "default"): ?]</form>[?php endif ?]
</div>
@@ -1,5 +1,5 @@
<div class="contentbox sf_admin_form">
- [?php echo form_tag_for($form, '@article') ?]
+ [?php echo form_tag_for($form, '@<?php echo $this->params['route_prefix'] ?>', array('id' => $form->getName().'_form')) ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/form_header', array('<?php echo $this->getSingularName() ?>' => $<?php echo $this->getSingularName() ?>, 'form' => $form, 'configuration' => $configuration)) ?]
[?php echo $form->renderHiddenFields(false) ?]
<div class="left">
@@ -7,14 +7,15 @@ public function configure() {
// Use admin theme
if(preg_match(sprintf('/^(%s)/i', implode('|', sfConfig::get('app_sf_admin_template_templates', array('admin', 'clean')))), $this->getDecoratorTemplate(), $matches)) {
$response = $this->context->getResponse();
+ $request = $this->context->getRequest();
if($response->getStatusCode() != 200) {
$this->decoratorTemplate = "clean".$this->getExtension();
}
$this->decoratorDirectory = sfConfig::get('sf_app_template_dir');
if(!is_file($this->decoratorDirectory.DIRECTORY_SEPARATOR.$this->getDecoratorTemplate())) {
$this->decoratorDirectory = sfConfig::get('sf_plugins_dir').DIRECTORY_SEPARATOR."sfAdminTemplatePlugin".DIRECTORY_SEPARATOR."templates";
}
- $this->decorator = true;
+ $this->setDecorator(true);
// Stylesheets
$stylesheets = array('/sfAdminTemplatePlugin/css/layout.css', '/sfAdminTemplatePlugin/css/styles.css', '/sfAdminTemplatePlugin/js/jqtransformplugin/jqtransform.css', '/sfAdminTemplatePlugin/css/jquery.fancybox-1.3.4.css', '/sfAdminTemplatePlugin/js/validationEngine/validationEngine.jquery.css');
foreach($stylesheets as $css) {
@@ -34,6 +35,9 @@ public function configure() {
if($this->decoratorTemplate == "clean".$this->getExtension()) {
$response->addStylesheet('/sfAdminTemplatePlugin/css/login.css', '', array('media' => 'all'));
}
+ if($request->isXmlHttpRequest()) {
+ $this->setDecorator(false);
+ }
}
}
}
View
@@ -145,13 +145,12 @@ tr.sf_admin_row:hover {background: #ddd;}
/* Input/Form Styles */
fieldset {border: thin solid #aaa; margin-bottom: 10px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px;}
fieldset legend {background: #353535; padding: 5px 10px; color: white; text-transform: uppercase; font-weight: bold; font-size: 1.2em; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px;}
-.right .jqTransformInputWrapper {width: 100% !important;}
+#fancybox-content .jqTransformInputWrapper, .right .jqTransformInputWrapper {width: 100% !important;}
.jqTransformInputWrapper input {width: 100% !important;}
/*form .jqTransformSelectWrapper {float: left; margin: 0 2px;}*/
select {padding: 7px 10px; border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;}
-#container label {cursor: pointer; padding-right: 20px; display: block; padding-bottom: 10px; font-weight: bold;}
+#fancybox-content label, #container label {cursor: pointer; padding-right: 20px; display: block; padding-bottom: 10px; font-weight: bold;}
.right label {width: 200px;}
-/*.sf_admin_form label {clear: both;}*/
input, textarea {font-family: Arial, Helvetica, sans-serif;}
.inputbox, form input[type="text"], form input[type="password"] {border: 1px solid #999; padding: 3%; width: 94%; -moz-border-radius: 3px; border-radius: 3px; -webkit-border-radius: 3px; margin-bottom: 5px; color: #666; background: url(../images/bg_fade_sml.png) repeat-x top;}
.errorbox {border: 1px solid #CC0000; background: #FCF0EF url(../images/bg_fade_red_sml.png) repeat-x top; color: #CC0000; margin-right: 5px;}
@@ -274,6 +273,7 @@ a.enhanced_toggleResult {display: none;}
.sf_admin_boolean .jqTransformCheckboxWrapper {display: inline-block;}
.sf_admin_enum li {float: left; width: auto;}
.sf_admin_enum li .jqTransformRadioWrapper {float: left;}
+.sf_admin_enum .jqTransformSelectWrapper li {width: 100%;}
.sf_admin_enum li label {float: left; width: auto; line-height: 30px;}
.radio_list {margin-bottom: 25px; clear: both;}
.radio_list li {float: left;}
View
@@ -60,7 +60,6 @@ $(document).ready(function(){
$(".sf_admin_form input:visible:radio:not(.noTransform)").jqTransRadio();
$(".sf_admin_form input:visible:checkbox:not(.noTransform)").jqTransCheckBox();
$('input:visible:text:not(.noTransform), input:visible:password:not(.noTransform)').jqTransInputText();
- $('textarea:visible:not(.ckeditorDone, .noTransform)').autoResize();
- //$('textarea:visible:not(.ckeditorDone, .noTransform, [id$=_autoresize])').jqTransTextarea();
+ $('textarea:visible:not(.ckeditorDone, .noTransform)').autoResize().width(624).jqTransTextarea();
$('input:visible:submit:not(.btn, .btnalt, .noTransform), input:visible:reset:not(.btn, .btnalt, .noTransform), input:visible:button:not(.btn, .btnalt, .noTransform)').jqTransInputButton();
});

0 comments on commit 685ddf1

Please sign in to comment.