<?php /* Template Name: List Pods */ $podname = isset($_GET['type']) ? $_GET['type'] : ""; $limit = isset($_GET['size']) ? $_GET['size'] : core_utilities::get_default_page_size(); $offset = isset($_GET['offset']) ? $_GET['offset'] : 0; $offset = $offset * $limit; if ($podname == '') { echo core_utilities::get_error_message("No Type Avaliable"); return; } $PodsAPI = pods_api(); $pods_info = $PodsAPI->load_pod(array('name' => $podname)); core_utilities::set_page_title("Listing - " . $pods_info['label']); get_header(); // CONTENT GOES HERE ?> <div class="row"> <div class="col-xs-12"> <div class="page-title-row"> <div class="row"> <div class="col-xs-12 col-sm-9"><h1 class="page-title">Listing - <?php echo $pods_info['label']; ?> </h1></div> <div class="col-xs-12 col-sm-3 text-right toolbar-top"> <?php echo pods_related::build_toolbar($podname, $pods_info['label'], false, null, $pods_info['options']['ui_filters'] != null); ?>
$return_url = isset($_GET['return-to']) ? urldecode($_GET['return-to']) : get_home_url(); //dms_debug::add_database_message("1", "Action Exectiopn", "ACTION API PAGE"); if ($action_id < 0 || $action_id == "") { echo core_utilities::get_error_message("No Action"); return; } //dms_debug::add_database_message("2", "Action Exectiopn", "ACTION API PAGE"); if ($record_id < 0 || $record_id == "") { echo core_utilities::get_error_message("No Record"); return; } //dms_debug::add_database_message("3", "Action Exectiopn", "ACTION API PAGE"); $action_on_pod = pods("jomiz_dms_actions", array('where' => "t.id = {$action_id}")); //dms_debug::add_database_message(var_export($action_on_pod, TRUE), "Action Exectiopn", "ACTION API PAGE"); if ($action_on_pod->total() == 0) { echo core_utilities::get_error_message("The Action Is Not Registered"); return; } if (dms_data::is_record_sealed($action_on_pod->field("pod_name"), $record_id)) { // Record Is Sealed //wp_redirect($return_url); //return; } $arguments = array(); $arguments["record_id"] = $record_id; $arguments["podname"] = $action_on_pod->field("pod_name"); $arguments["built_in_action"] = ""; $arguments["built_in_parameters"] = ""; $arguments["custom_php"] = $action_on_pod->field("custom_php"); $arguments["stop_on_error_messages"] = $action_on_pod->field("stop_on_error_messages"); $action = new dms_action($arguments);
<?php /* Template Name: Delete Pods */ $podname = isset($_GET['type']) ? $_GET['type'] : ""; $id = isset($_GET['id']) ? $_GET['id'] : -1; if ($podname == '') { echo core_utilities::get_error_message("No Type Avaliable"); return; } if ($id < 0 || !is_numeric($id)) { echo core_utilities::get_error_message("Record Id Type Avaliable"); return; } $return_url = isset($_GET['return-to']) ? urldecode($_GET['return-to']) : pods_related::get_pod_url($podname, "list"); if ($_GET['confirm-delete'] == 1) { $pod_to_delete = pods($podname, $id); $pod_to_delete->delete(); wp_redirect($return_url); return; } settype($id, "integer"); $PodsAPI = pods_api(); $pods_info = $PodsAPI->load_pod(array('name' => $podname)); $record_sealed = dms_data::is_record_sealed($podname, $id); $notification_message = ""; $notification_css_class = ""; if ($record_sealed) { if (dms_security::is_allowed($podname, "delete_sealed")) { $notification_message = '<span class="glyphicon glyphicon-lock"></span> This document is locked. Are you sure you want to delete it?';