<?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); ?>
$header_prefix = "Edit"; $operation_type = "edit"; if ($id == -1) { $header_prefix = "Add"; $operation_type = "add"; } // Get The Data Of The Current Pod + Record Id $record_author = -1; if ($id == -1) { $mypod = pods($podname); } else { $mypod = pods($podname, $id); $record_author = $mypod->field("author"); } // Set Page Title core_utilities::set_page_title($header_prefix . " " . $pods_info['label']); $use_tabs = FALSE; // Get Related Pods From The Settings $related_pods = pods("pods_gui_related_pods", array("where" => "t.name = '{$podname}'", "orderby" => "display_order")); $ui_param = array(); $save_txt = "Save"; $after_save_url = $return_url; $same_page_url = pods_related::get_pod_url($podname, "edit", $id, $use_dialog, $return_url); // Operation Settings $operation_settings_pod = pods("jomiz_dms_gui_settings", array("where" => "t.pod_name = '{$podname}' AND (operation='add' OR operation='edit')")); $operation_settings = null; $extra_js = ""; if ($operation_settings_pod->total() > 0) { $operation_settings = json_decode($operation_settings_pod->field("settings")); $extra_js = $operation_settings_pod->field("extra_javascript"); }