private function build_pods_json($pod_list = false) { if (!$pod_list || !is_array($pod_list)) { return false; } global $poddb; $jsonData = array(); $pods = $poddb->get_pods(); foreach ($pods as $podname => $pod) { if (in_array($podname, $pod_list)) { $podh = load_pod($pod); $jsonData[] = $podh->gen_pod(); } else { continue; } } if (count($jsonData)) { if (isset($new_js)) { $fullData = array('Pods' => $jsonData); $fullData['filters'] = $filters; $fullData['groups'] = $groups; return json_encode($fullData); } else { return json_encode($jsonData); } } }
public function load() { global $filters; global $groups; $jsonData = array(); $pods = $this->db->get_pods(); foreach ($pods as $podname => $pod) { $podh = load_pod($pod); $jsonData[] = $podh->gen_pod(); } if (count($jsonData)) { if ($new_js) { $fullData = array('Pods' => $jsonData); $fullData['filters'] = $filters; $fullData['groups'] = $groups; echo json_encode($fullData); } else { echo json_encode($jsonData); } } else { } $this->skip_render = true; }
if (check_auth($ctrl, $action) === false) { set_flash(array('error' => 'You are not authorized to visit that page.')); redirect(); } // This will setup the appropriate db class for you group/admin $db = init_db($ctrl, $action); /* LOAD POD SETTINGS */ $podid = isset($_REQUEST['pod']) ? $_REQUEST['pod'] : false; $view = isset($_REQUEST['view']) ? $_REQUEST['view'] : false; $pod_action = isset($_REQUEST['pod_action']) ? $_REQUEST['pod_action'] : 'index'; if ($podid && !is_numeric($podid) && preg_match('/^pod([0-9]+)$/', $podid, $match)) { $podid = $match[1]; } if ($podid) { $podData = $poddb->get_pod($podid); $pod = load_pod($podData); if ($pod_action == 'load_item') { echo $pod->{$pod_action}($id, $view); } else { if ($pod_action == 'load_all') { echo $pod->{$pod_action}($view); } else { if ($pod_action == 'load_statistics') { echo $pod->{$pod_action}($view, $params); } else { echo $pod->{$pod_action}($view); } } } exit; }