Skip to content

Commit

Permalink
Save custom code through tab only, not everytime app is inserted to DB (
Browse files Browse the repository at this point in the history
  • Loading branch information
jegelstaff authored May 8, 2024
1 parent 6173dbd commit 6554ca8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
10 changes: 2 additions & 8 deletions modules/formulize/admin/save/application_code_save.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,5 @@
return;
}

$application_handler = xoops_getmodulehandler('applications', 'formulize');
$appObject = $application_handler->get($_POST['formulize_admin_key']);

foreach($processedValues['applications'] as $property=>$value) {
$appObject->setVar($property, $value);
}

$application_handler->insert($appObject);
$filename=XOOPS_ROOT_PATH."/modules/formulize/custom_code/application_custom_code_".intval($_POST['formulize_admin_key']).".php";
file_put_contents($filename,$processedValues['applications']['custom_code']);
4 changes: 0 additions & 4 deletions modules/formulize/class/applications.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,6 @@ function insert(&$appObject, $force=false) {
$sql = "UPDATE ".$this->db->prefix("formulize_applications") . " SET `name` = ".$this->db->quoteString($name).", `description` = ".$this->db->quoteString($description).", `custom_code` = ".$this->db->quoteString($custom_code)." WHERE appid = ".intval($appid);
}

//after executing insertion or updating, we put file in the following path with custom_code
$filename=XOOPS_ROOT_PATH."/modules/formulize/custom_code/application_custom_code_".$appid.".php";
file_put_contents($filename,$custom_code);

if( false != $force ){
$result = $this->db->queryF($sql);
}else{
Expand Down

0 comments on commit 6554ca8

Please sign in to comment.