Here is the pods module (pods.php), however I have not got it to work yet. Need a bit help from you.
<?php
/**
* @package Content Aware Sidebars
* @author Joachim Jensen <[email protected]>
*/
/**
*
* Pods Module
*
* Detects if current content is:
* a) any or specific pods pages
*
*/
class CASModule_pods extends CASModule {
/**
* Constructor
*/
public function __construct() {
parent::__construct('pods',__('Pods Pages',ContentAwareSidebars::DOMAIN));
$this->type_display = false;
//$this->id = 'pods';
}
/**
* Get pods pages
* @return array
*/
protected function _get_content($args = array()) {
if (function_exists('pods_api')) {
// Get PodsAPI
$api = pods_api();
// Get Pod Pages
$pod_pages = $api->load_pages();
$pod_page_list = array();
foreach ( $pod_pages as $pod_page ) {
$pod_page_list[$pod_page[ 'slug' ]] = $pod_page[ 'name' ];
}
}
return $pod_page_list;
}
//public function db_where() {
//$pods_name = pods_url_variable('first', uri);
//return "(pods.meta_value IS NULL OR pods.meta_value = '".$pods_name."')";
//return is_pod_page($pod_page[ 'slug' ]);
//}
public function in_context() {
return is_pod_page();
}
public function get_context_data() {
$val = 'principle';
//$pod_page = is_pod_page();
//return $pod_page;
return array($val);
}
}