Example #1
0
             $sql = "\n                SELECT\n                    p.id AS pod_id, p.tbl_row_id, t.id, t.name AS datatype, t.id AS datatype_id\n                FROM\n                    @wp_pod p\n                INNER JOIN\n                    @wp_pod_types t ON t.id = p.datatype\n                WHERE\n                    p.id = {$params->pod_id}\n                LIMIT\n                    1\n                ";
         }
         $result = pod_query($sql);
         $row = mysql_fetch_assoc($result);
         $priv_val = 'pod_' . $row['datatype'];
         $params->datatype = $row['datatype'];
         $params->datatype_id = $row['datatype_id'];
     }
     if (!pods_access($priv_val) && !pods_access('manage_content')) {
         die('<e>Access denied');
     }
 }
 // Check permissions (convert to array to support multiple)
 if (!empty($priv)) {
     foreach ((array) $priv as $priv_val) {
         if (!pods_access($priv_val)) {
             die('<e>Access denied');
         }
     }
 }
 // Call any processors
 if (null !== $processor && 0 < strlen($processor) && function_exists($processor)) {
     $params = $processor($params, $api);
 }
 $params = apply_filters('pods_api_' . $action, $params);
 $output = '';
 if ('security_settings' == $action) {
     delete_option('pods_disable_file_browser');
     add_option('pods_disable_file_browser', isset($params->disable_file_browser) ? $params->disable_file_browser : 0);
     delete_option('pods_files_require_login');
     add_option('pods_files_require_login', isset($params->files_require_login) ? $params->files_require_login : 0);
Example #2
0
<?php

ob_start();
require_once preg_replace("/wp-content.*/", "wp-load.php", __FILE__);
require_once preg_replace("/wp-content.*/", "/wp-admin/includes/admin.php", __FILE__);
require_once realpath(dirname(__FILE__) . '/init.php');
ob_end_clean();
if ((!isset($_POST['_wpnonce']) || !pods_access('manage_settings') || false === wp_verify_nonce($_POST['_wpnonce'], 'pods-uninstall')) && !defined('WP_UNINSTALL_PLUGIN')) {
    die('Error: Access denied');
}
$result = pod_query("SHOW TABLES LIKE '@wp_pod%'");
if (0 < mysql_num_rows($result)) {
    while ($row = mysql_fetch_array($result)) {
        pod_query("DROP TABLE {$row[0]}");
    }
}
pod_query("DELETE FROM @wp_options WHERE option_name LIKE 'pods_%'");
Example #3
0
function dropHelper() {
    if (confirm("Do you really want to drop this helper?")) {
        jQuery.ajax({
            type: "post",
            url: api_url,
            data: "action=drop_helper&_wpnonce=<?php 
echo wp_create_nonce('pods-drop_helper');
?>
&id="+helper_id,
            success: function(msg) {
                if (!is_error(msg)) {
                    jQuery(".select-helper > option[value='"+helper_id+"']").remove();
                    jQuery(".select-helper").change();
<?php 
if (pods_access('manage_pods')) {
    ?>
                    jQuery("div.helper#"+helper_name).remove();
                    jQuery("#pre_save_helpers option[value='"+helper_name+"']").remove();
                    jQuery("#pre_drop_helpers option[value='"+helper_name+"']").remove();
                    jQuery("#post_save_helpers option[value='"+helper_name+"']").remove();
                    jQuery("#post_drop_helpers option[value='"+helper_name+"']").remove();
<?php 
}
?>
                }
            }
        });
    }
}
</script>
Example #4
0
    ?>
" />-->
                <input type="hidden" name="page" value="<?php 
    echo pods_var('page', 'get');
    ?>
" />
                <input type="submit" class="button" value="  Browse Pod  " />
            </form>
        </div>
<?php 
    if (0 < strlen($dtname)) {
        pods_ui_manage('pod=' . $dtname . '&sort=p.modified DESC&session_filters=false');
    } else {
        echo "<p>Select a Pod from above to begin managing content.</p>";
    }
} elseif (pods_access('pod_' . $dtname)) {
    pods_ui_manage('pod=' . $dtname . '&sort=p.modified DESC' . ('top-level-manage' != $manage_action ? '&session_filters=false' : ''));
} else {
    echo "<p>You do not have access to manage this Pod's content.</p>";
}
/* Using Pods UI now
?>
        <table class="widefat">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Type</th>
                    <th>Date</th>
                </tr>
            </thead>
            <tfoot>
Example #5
0
 function admin_menu()
 {
     $submenu = array();
     $result = pod_query("SELECT name, label, is_toplevel FROM @wp_pod_types ORDER BY label, name");
     while ($row = mysql_fetch_array($result)) {
         $name = apply_filters('pods_admin_menu_name', $row['name'], $row);
         $label = trim($row['label']);
         $label = '' != $label ? $label : $name;
         $label = apply_filters('pods_admin_menu_label', $label, $row);
         $row['name'] = $name;
         $row['label'] = $label;
         if (pods_access("pod_{$name}")) {
             if (1 == $row['is_toplevel']) {
                 add_object_page($label, $label, 'read', "pods-manage-{$name}");
                 add_submenu_page("pods-manage-{$name}", 'Edit', 'Edit', 'read', "pods-manage-{$name}", array($this, 'pods_content_page'));
                 add_submenu_page("pods-manage-{$name}", 'Add New', 'Add New', 'read', "pods-add-{$name}", array($this, 'pods_content_page'));
             } else {
                 $submenu[trim($row['label'] . $row['name'])] = $row;
             }
         }
     }
     $priv_check = array('manage_pods', 'manage_templates', 'manage_pod_pages', 'manage_helpers', 'manage_roles', 'manage_settings', 'manage_content', 'manage_packages');
     if ((!defined('PODS_DISABLE_ADMIN_MENU') || !PODS_DISABLE_ADMIN_MENU) && (!empty($submenu) || pods_access($priv_check))) {
         add_object_page('Pods', 'Pods', 'read', 'pods', null, PODS_URL . '/ui/images/icon16.png');
         if (pods_access(array('manage_pods', 'manage_templates', 'manage_pod_pages', 'manage_helpers', 'manage_roles', 'manage_settings'))) {
             add_submenu_page('pods', 'Setup', 'Setup', 'read', 'pods', array($this, 'pods_setup_page'));
         }
         if (pods_access('manage_packages')) {
             add_submenu_page('pods', 'Package Manager', 'Package Manager', 'read', 'pods-package', array($this, 'pods_packages_page'));
         }
         if (pods_access('manage_content')) {
             add_submenu_page('pods', 'Manage Content', 'Manage Content', 'read', 'pods-manage', array($this, 'pods_content_page'));
         }
         ksort($submenu);
         foreach ($submenu as $item) {
             $name = apply_filters('pods_admin_submenu_name', $item['name'], $item);
             $label = trim($item['label']);
             $label = '' != $label ? $label : $name;
             $label = apply_filters('pods_admin_submenu_label', $label, $item);
             add_submenu_page('pods', "Add {$label}", "Add {$label}", 'read', "pod-{$name}", array($this, 'pods_content_page'));
         }
     }
 }
Example #6
0
<?php 
if (pods_access('manage_pod_pages') && apply_filters('pods_manage_pod_pages', true)) {
    include PODS_DIR . '/ui/manage_pages.php';
}
?>
    </div>

    <div id="helperArea" class="area">
<?php 
if (pods_access('manage_helpers') && apply_filters('pods_manage_helpers', true)) {
    include PODS_DIR . '/ui/manage_helpers.php';
}
?>
    </div>

    <div id="roleArea" class="area">
<?php 
if (pods_access('manage_roles') && apply_filters('pods_manage_roles', true)) {
    include PODS_DIR . '/ui/manage_roles.php';
}
?>
    </div>

    <div id="settingsArea" class="area">
<?php 
if (pods_access('manage_settings') && apply_filters('pods_manage_settings', true)) {
    include PODS_DIR . '/ui/manage_settings.php';
}
?>
    </div>
</div>