function ep_update_exclusions($post_ID)
{
    // Bang (!) to reverse the polarity of the boolean, turning include into exclude
    $exclude_this_page = !(bool) @$_POST['ep_this_page_included'];
    // SWTODO: Also check for a hidden var, which confirms that this checkbox was present
    // If hidden var not present, then default to including the page in the nav (i.e. bomb out here rather
    // than add the page ID to the list of IDs to exclude)
    $ctrl_present = (bool) @$_POST['ep_ctrl_present'];
    if (!$ctrl_present) {
        return;
    }
    $excluded_ids = ep_get_excluded_ids();
    // If we need to EXCLUDE the page from the navigation...
    if ($exclude_this_page) {
        // Add the post ID to the array of excluded IDs
        array_push($excluded_ids, $post_ID);
        // De-dupe the array, in case it was there already
        $excluded_ids = array_unique($excluded_ids);
    }
    // If we need to INCLUDE the page in the navigation...
    if (!$exclude_this_page) {
        // Find the post ID in the array of excluded IDs
        $index = array_search($post_ID, $excluded_ids);
        // Delete any index found
        if ($index !== false) {
            unset($excluded_ids[$index]);
        }
    }
    $excluded_ids_str = implode(EP_OPTION_SEP, $excluded_ids);
    ep_set_option(EP_OPTION_NAME, $excluded_ids_str);
}
/**
 * SACK response function for toggling page exclusion status
 *
 * @since 2.1.0
 * @author scripts@schloebe.de
 * @link http://plugins.trac.wordpress.org/browser/exclude-pages/trunk/exclude_pages.php#L162
 */
function ame_toggle_excludestatus()
{
    $pageid = intval($_POST['pageid']);
    $statusid = intval($_POST['statusid']);
    $excluded_ids = ep_get_excluded_ids();
    if ($statusid == 1) {
        array_push($excluded_ids, $pageid);
        $excluded_ids = array_unique($excluded_ids);
    } else {
        $index = array_search($pageid, $excluded_ids);
        if ($index !== false) {
            unset($excluded_ids[$index]);
        }
    }
    $excluded_ids_str = implode(',', $excluded_ids);
    ep_set_option(EP_OPTION_NAME, $excluded_ids_str, "Comma separated list of post and page IDs to exclude when returning pages from the get_pages function.");
    if ($statusid == 0) {
        $e_status = 1;
        $e_img = '_off';
    } else {
        $e_status = 0;
        $e_img = '';
    }
    die("jQuery('#excludepagewrap{$pageid}').html('<a tip=\"" . __('Plugin: Exclude Pages - Exclude page from navigation', 'admin-management-xtended') . "\" href=\"javascript:void(0);\" onclick=\"ame_ajax_set_excludestatus(\\'" . $pageid . "\\', \\'" . $e_status . "\\');return false;\"><img src=\"" . AME_PLUGINFULLURL . "img/" . AME_IMGSET . "excludepages" . $e_img . ".gif\" border=\"0\" alt=\"" . __('Plugin: Exclude Pages - Exclude page from navigation', 'admin-management-xtended') . "\" title=\"" . __('Plugin: Exclude Pages - Exclude page from navigation', 'admin-management-xtended') . "\" /></a>');jQuery('#page-" . $pageid . " td, #page-" . $pageid . " th').animate( { backgroundColor: '#EAF3FA' }, 300).animate( { backgroundColor: '#F9F9F9' }, 300).animate( { backgroundColor: '#EAF3FA' }, 300).animate( { backgroundColor: '#F9F9F9' }, 300);");
}
/**
 * Adds content to the new 'Actions' column on the page management view
 *
 * @since 0.7
 * @author scripts@schloebe.de
 *
 * @param string $ame_column_name
 * @param int $ame_id
 */
function ame_custom_column_page_actions($ame_column_name, $ame_id)
{
    global $wpdb, $locale;
    if ($ame_column_name == 'ame_page_actions') {
        $post_status = get_post_status($ame_id);
        $q_post = get_post($ame_id);
        echo '<div style="width:105px;" class="ame_options">';
        // Visibility icon
        $visstatus = $post_status == 'publish' ? 'draft' : 'publish';
        echo '<div id="visicon' . $ame_id . '" style="padding:1px;float:left;"><a href="javascript:void(0);" onclick="ame_ajax_set_visibility(' . $ame_id . ', \'' . $visstatus . '\', \'post\');return false;"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . $visstatus . '.png" border="0" alt="' . __('Toggle visibility', 'admin-management-xtended') . '" title="' . __('Toggle visibility', 'admin-management-xtended') . '" /></a></div>';
        // Date icon
        echo '<div id="date' . $ame_id . '" style="padding:1px;float:left;"><a href="javascript:void(0);" class="date-pick" id="datepicker' . $ame_id . '"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'date.png" border="0" alt="' . __('Change Publication Date', 'admin-management-xtended') . '" title="' . __('Change Publication Date', 'admin-management-xtended') . '" /></a></div> ';
        // Slug edit icon
        echo '<div id="slug' . $ame_id . '" style="padding:1px;float:left;"><a href="javascript:void(0);" id="slugedit' . $ame_id . '" onclick="ame_slug_edit(' . $ame_id . ', \'post\');"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'slug_edit.png" border="0" alt="' . __('Edit Page Slug', 'admin-management-xtended') . '" title="' . __('Edit Page Slug', 'admin-management-xtended') . '" /></a></div>';
        // Comment open/closed status icon
        $comment_status = $q_post->comment_status;
        if ($comment_status == 'open') {
            $c_status = 0;
            $c_img = '_open';
        } else {
            $c_status = 1;
            $c_img = '_closed';
        }
        echo '<div id="commentstatus' . $ame_id . '" style="padding:1px;float:left;"><a tip="' . __('Toggle comment status open/closed', 'admin-management-xtended') . '" href="javascript:void(0);" onclick="ame_ajax_set_commentstatus(' . $ame_id . ', ' . $c_status . ', \'post\');return false;"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'comments' . $c_img . '.png" border="0" alt="' . __('Toggle comment status open/closed', 'admin-management-xtended') . '" title="' . __('Toggle comment status open/closed', 'admin-management-xtended') . '" /></a></div> ';
        // Plugin: Exclude Pages
        if (is_plugin_active('exclude-pages/exclude_pages.php')) {
            $excluded_pages = ep_get_excluded_ids();
            if (in_array($ame_id, $excluded_pages)) {
                $e_status = 0;
                $e_img = '';
            } else {
                $e_status = 1;
                $e_img = '_off';
            }
            echo '<div id="excludepagewrap' . $ame_id . '" style="padding:1px;float:left;"><a tip="' . __('Plugin: Exclude Pages - Exclude page from navigation', 'admin-management-xtended') . '" href="javascript:void(0);" onclick="ame_ajax_set_excludestatus(' . $ame_id . ', ' . $e_status . ');return false;"><img src="' . AME_PLUGINFULLURL . 'img/' . AME_IMGSET . 'excludepages' . $e_img . '.gif" border="0" alt="' . __('Plugin: Exclude Pages - Exclude page from navigation', 'admin-management-xtended') . '" title="' . __('Plugin: Exclude Pages - Exclude page from navigation', 'admin-management-xtended') . '" /></a></div>';
        }
        // Post revisions
        if (function_exists('wp_list_post_revisions') && wp_get_post_revisions($ame_id)) {
            echo '<div class="amehasrev" id="amerevisionwrap' . $ame_id . '" style="width:300px;height:165px;overflow:auto;display:none;">';
            wp_list_post_revisions($ame_id);
            echo '</div>';
        }
        echo '</div>';
    }
}
 public function is_excluded()
 {
     global $post;
     if (is_page() && $post->ID && $this->is_avail['expages'] == true && empty($this->options['buttons_on_ex_pages'])) {
         $excluded_ids = ep_get_excluded_ids();
         $delete_ids = array_unique($excluded_ids);
         if (in_array($post->ID, $delete_ids)) {
             return true;
         }
     }
     return false;
 }