Beispiel #1
0
 public function perform()
 {
     $this->go_to_url = "";
     if ($this->stop_on_error_messages == 1 && dms_messages::does_pod_record_has_error_messages($this->podname, $this->record_id)) {
         return;
     }
     $data = array();
     // Custom PHP
     if ($this->custom_php != "") {
         dms_debug::add_database_message($this->custom_php, "Code To Execute", "DMS ACTION");
         $eval_result = eval($this->custom_php);
         dms_debug::add_database_message($eval_result, "Evaluate Result | {$this->podname} | {$this->record_id} |", "DMS ACTION");
     }
     $author = $this->current_pod->field("author");
     if (!isset($author) || $author <= 0 || $author == "") {
         global $current_user;
         $data["author"] = $current_user->ID;
     }
     dms_debug::add_database_message(var_export($data, TRUE), "Array Size", "DMS ACTION Data To Save");
     if (sizeof($data) > 0) {
         $this->current_pod->save($data);
     }
     if ($this->go_to_url != "") {
         wp_redirect($this->go_to_url);
     }
 }
Beispiel #2
0
function jomiz_dms_pod_save($pieces, $is_new_item, $id)
{
    $podname = $pieces['params']->pod;
    if (pods_related::is_dms_pod($podname)) {
        return;
    }
    dms_debug::add_database_message("Anything {$podname} | {$id}", "Action Found", "pods-actions");
    execute_actions('auto-after-save', $podname, $pieces, $is_new_item, $id);
}