Removed direct references to $_REQUEST and $_POST
This commit is contained in:
@@ -20,11 +20,11 @@ class Controller_Admin_Email extends Controller_Email {
|
||||
public function action_ajaxtemplatetranslate() {
|
||||
$eto = ORM::factory('Email_Template',$this->request->param('id'));
|
||||
|
||||
if (! $eto->loaded() OR ! isset($_REQUEST['key'])) {
|
||||
if (! $eto->loaded() OR ! $this->request->query('key')) {
|
||||
$output = _('Unable to find translate data');
|
||||
|
||||
} else {
|
||||
$eto = $eto->translate->where('language_id','=',$_REQUEST['key'])->find();
|
||||
$eto = $eto->translate->where('language_id','=',$this->request->query('key'))->find();
|
||||
|
||||
$output = View::factory('email/admin/ajaxtemplatetranslate')
|
||||
->set('o',$eto);
|
||||
@@ -83,7 +83,7 @@ class Controller_Admin_Email extends Controller_Email {
|
||||
private function add_edit_template($id=NULL,$output='') {
|
||||
$eto = ORM::factory('Email_Template',$id);
|
||||
|
||||
if ($_POST) {
|
||||
if ($this->request->post()) {
|
||||
// @todo To update the setup ID
|
||||
$eto->email_setup_id = '1';
|
||||
|
||||
|
@@ -37,13 +37,13 @@ class Model_Email_Template extends ORM_OSB {
|
||||
parent::save();
|
||||
|
||||
// Save our Translated Message
|
||||
if ($x = array_diff_key($_POST,$this->_object) AND ! empty($_POST['language_id']) AND ! empty($_POST['translate']) AND is_array($_POST['translate'])) {
|
||||
$to = $this->translate->where('language_id','=',$_POST['language_id'])->find();
|
||||
if ($x = array_diff_key($_POST,$this->_object) AND Arr::get($_POST,'language_id']) AND is_array(Arr::get($_POST,'translate'))) {
|
||||
$to = $this->translate->where('language_id','=',Arr::get($_POST,'language_id'))->find();
|
||||
|
||||
// For a new entry, we need to set the product_id
|
||||
if (! $to->loaded()) {
|
||||
$to->product_id = $this->id;
|
||||
$to->language_id = $_POST['language_id'];
|
||||
$to->language_id = Arr::get($_POST,'language_id');
|
||||
}
|
||||
|
||||
$to->values($x['translate'])->save();
|
||||
|
Reference in New Issue
Block a user