diff --git a/modules/layout/conf/module.xml b/modules/layout/conf/module.xml index cb4ad7377..6b8e20df0 100644 --- a/modules/layout/conf/module.xml +++ b/modules/layout/conf/module.xml @@ -18,16 +18,16 @@ - - + + - + - + - + diff --git a/modules/layout/layout.admin.controller.php b/modules/layout/layout.admin.controller.php index af5ea1e0f..05cb1a49b 100644 --- a/modules/layout/layout.admin.controller.php +++ b/modules/layout/layout.admin.controller.php @@ -33,12 +33,20 @@ $this->initLayout($args->layout_srl, $args->layout); // Return result $this->add('layout_srl', $args->layout_srl); + + if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) { + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispLayoutAdminContent'); + header('location:'.$returnUrl); + return; + } } + // Insert layout information into the DB function insertLayout($args) { $output = executeQuery("layout.insertLayout", $args); return $output; } + // Initiate if it is faceoff layout function initLayout($layout_srl, $layout_name){ $oLayoutModel = &getModel('layout'); @@ -162,10 +170,15 @@ $output = $this->updateLayout($args); if(!$output->toBool()) return $output; - $this->setLayoutPath('./common/tpl'); - $this->setLayoutFile('default_layout.html'); - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile("top_refresh.html"); + //$this->setLayoutPath('./common/tpl'); + //$this->setLayoutFile('default_layout.html'); + //$this->setTemplatePath($this->module_path.'tpl'); + //$this->setTemplateFile("top_refresh.html"); + if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) { + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispLayoutAdminModify', 'layout_srl', Context::get('layout_srl')); + header('location:'.$returnUrl); + return; + } } function updateLayout($args) { @@ -221,12 +234,12 @@ $layout_css_file = $oLayoutModel->getUserLayoutCss($layout_srl); FileHandler::writeFile($layout_css_file, $code_css); - if($is_post) { - if(!$return_url) $return_url = getUrl('module','admin','act','dispLayoutAdminEdit', 'layout_srl', $layout_srl); - header('Location: '.$return_url); - } else { - $this->setMessage('success_updated'); + if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) { + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispLayoutAdminEdit', 'layout_srl', $layout_srl); + header('location:'.$returnUrl); + return; } + $this->setMessage('success_updated'); } /** @@ -266,13 +279,15 @@ $layout_srl = Context::get('layout_srl'); if(!is_uploaded_file($image['tmp_name'])) exit(); - if(!preg_match('/\.(gif|jpg|jpeg|gif|png|swf|flv)$/i', $image['name'])){ - return false; - } - $this->insertUserLayoutImage($layout_srl, $image); $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile("top_refresh.html"); + + if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) { + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispLayoutAdminEdit', 'layout_srl', Context::get('layout_srl')); + header('location:'.$returnUrl); + return; + } } /** diff --git a/modules/layout/ruleset/codeUpdate.xml b/modules/layout/ruleset/codeUpdate.xml new file mode 100644 index 000000000..0c7e5501a --- /dev/null +++ b/modules/layout/ruleset/codeUpdate.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/modules/layout/ruleset/imageUpload.xml b/modules/layout/ruleset/imageUpload.xml new file mode 100644 index 000000000..0c7e5501a --- /dev/null +++ b/modules/layout/ruleset/imageUpload.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/modules/layout/ruleset/insertLayout.xml b/modules/layout/ruleset/insertLayout.xml new file mode 100644 index 000000000..5db177373 --- /dev/null +++ b/modules/layout/ruleset/insertLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/modules/layout/ruleset/updateLayout.xml b/modules/layout/ruleset/updateLayout.xml new file mode 100644 index 000000000..5db177373 --- /dev/null +++ b/modules/layout/ruleset/updateLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/modules/layout/ruleset/userLayoutImport.xml b/modules/layout/ruleset/userLayoutImport.xml new file mode 100644 index 000000000..d763de99a --- /dev/null +++ b/modules/layout/ruleset/userLayoutImport.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/modules/layout/tpl/insert_layout.html b/modules/layout/tpl/insert_layout.html index e3ed8e83a..583305050 100644 --- a/modules/layout/tpl/insert_layout.html +++ b/modules/layout/tpl/insert_layout.html @@ -1,8 +1,8 @@ - - -
+

{$XE_VALIDATOR_ERROR}

+ + diff --git a/modules/layout/tpl/layout_edit.html b/modules/layout/tpl/layout_edit.html index 536c92968..f458f9f20 100644 --- a/modules/layout/tpl/layout_edit.html +++ b/modules/layout/tpl/layout_edit.html @@ -16,7 +16,9 @@

{$lang->layout_image_repository}

{nl2br($lang->about_layout_image_repository)}

- + +

{$XE_VALIDATOR_ERROR}

+ @@ -70,7 +72,7 @@ diff --git a/modules/layout/tpl/layout_modify.html b/modules/layout/tpl/layout_modify.html index 9e4cb4a08..78b434c85 100644 --- a/modules/layout/tpl/layout_modify.html +++ b/modules/layout/tpl/layout_modify.html @@ -10,7 +10,8 @@ - +

{$XE_VALIDATOR_ERROR}

+ @@ -176,5 +177,6 @@ {$lang->cmd_back} +
{$lang->layout_import}
- + @@ -84,7 +86,7 @@ - + @@ -109,9 +111,11 @@
- + +