Ejemplo n.º 1
0
 function addons_help()
 {
     ob_start();
     include_once popover_dir('popoverincludes/help/popoveraddons.help.php');
     $help = ob_get_clean();
     $this->screen->add_help_tab(array('id' => 'addons', 'title' => __('Add-ons', 'popover'), 'content' => $help));
 }
Ejemplo n.º 2
0
 function load_textdomain()
 {
     $locale = apply_filters('popover_locale', get_locale());
     $mofile = popover_dir("popoverincludes/languages/popover-{$locale}.mo");
     if (file_exists($mofile)) {
         load_textdomain('popover', $mofile);
     }
 }
Ejemplo n.º 3
0
        function handle_addons_panel()
        {
            global $action, $page;
            wp_reset_vars(array('action', 'page'));
            $messages = array();
            $messages[1] = __('Add-on updated.', 'popover');
            $messages[2] = __('Add-on not updated.', 'popover');
            $messages[3] = __('Add-on activated.', 'popover');
            $messages[4] = __('Add-on not activated.', 'popover');
            $messages[5] = __('Add-on deactivated.', 'popover');
            $messages[6] = __('Add-on not deactivated.', 'popover');
            $messages[7] = __('Add-on activation toggled.', 'popover');
            ?>
            <div class='wrap'>
                <div class="icon32" id="icon-plugins"><br></div>
                <h2><?php 
            _e('Edit Add-ons', 'popover');
            ?>
</h2>

            <?php 
            if (isset($_GET['msg'])) {
                echo '<div id="message" class="updated fade"><p>' . $messages[(int) $_GET['msg']] . '</p></div>';
                $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
            }
            ?>

                <form method="get" action="?page=<?php 
            echo esc_attr($page);
            ?>
" id="posts-filter">

                    <input type='hidden' name='page' value='<?php 
            echo esc_attr($page);
            ?>
' />

                    <div class="tablenav">

                        <div class="alignleft actions">
                            <select name="action">
                                <option selected="selected" value=""><?php 
            _e('Bulk Actions', 'popover');
            ?>
</option>
                                <option value="toggle"><?php 
            _e('Toggle activation', 'popover');
            ?>
</option>
                            </select>
                            <input type="submit" class="button-secondary action" id="doaction" name="doaction" value="<?php 
            _e('Apply', 'popover');
            ?>
">

                        </div>

                        <div class="alignright actions"></div>

                        <br class="clear">
                    </div>

                    <div class="clear"></div>

            <?php 
            wp_original_referer_field(true, 'previous');
            wp_nonce_field('bulk-addons');
            $columns = array("name" => __('Add-on Name', 'popover'), "file" => __('Add-on File', 'popover'), "active" => __('Active', 'popover'));
            $columns = apply_filters('popover_addoncolumns', $columns);
            $addons = get_popover_addons();
            $active = get_option('popover_activated_addons', array());
            ?>

                    <table cellspacing="0" class="widefat fixed">
                        <thead>
                            <tr>
                                <th style="" class="manage-column column-cb check-column" id="cb" scope="col"><input type="checkbox"></th>
            <?php 
            foreach ($columns as $key => $col) {
                ?>
                                    <th style="" class="manage-column column-<?php 
                echo $key;
                ?>
" id="<?php 
                echo $key;
                ?>
" scope="col"><?php 
                echo $col;
                ?>
</th>
                        <?php 
            }
            ?>
                            </tr>
                        </thead>

                        <tfoot>
                            <tr>
                                <th style="" class="manage-column column-cb check-column" scope="col"><input type="checkbox"></th>
                    <?php 
            reset($columns);
            foreach ($columns as $key => $col) {
                ?>
                                    <th style="" class="manage-column column-<?php 
                echo $key;
                ?>
" id="<?php 
                echo $key;
                ?>
" scope="col"><?php 
                echo $col;
                ?>
</th>
                <?php 
            }
            ?>
                            </tr>
                        </tfoot>

                        <tbody>
                                <?php 
            if ($addons) {
                foreach ($addons as $key => $addon) {
                    $default_headers = array('Name' => 'Addon Name', 'Author' => 'Author', 'Description' => 'Description', 'AuthorURI' => 'Author URI');
                    $addon_data = get_file_data(popover_dir('popoverincludes/addons/' . $addon), $default_headers, 'plugin');
                    if (empty($addon_data['Name'])) {
                        continue;
                    }
                    ?>
                                    <tr valign="middle" class="alternate" id="addon-<?php 
                    echo $addon;
                    ?>
">
                                        <th class="check-column" scope="row"><input type="checkbox" value="<?php 
                    echo esc_attr($addon);
                    ?>
" name="addoncheck[]"></th>
                                        <td class="column-name">
                                            <strong><?php 
                    echo esc_html($addon_data['Name']) . "</strong>" . __(' by ', 'popover') . "<a href='" . esc_attr($addon_data['AuthorURI']) . "'>" . esc_html($addon_data['Author']) . "</a>";
                    ?>
                    <?php 
                    if (!empty($addon_data['Description'])) {
                        ?>
<br/><?php 
                        echo esc_html($addon_data['Description']);
                    }
                    $actions = array();
                    if (in_array($addon, $active)) {
                        $actions['toggle'] = "<span class='edit activate'><a href='" . wp_nonce_url("?page=" . $page . "&amp;action=deactivate&amp;addon=" . $addon . "", 'toggle-addon-' . $addon) . "'>" . __('Deactivate', 'popover') . "</a></span>";
                    } else {
                        $actions['toggle'] = "<span class='edit deactivate'><a href='" . wp_nonce_url("?page=" . $page . "&amp;action=activate&amp;addon=" . $addon . "", 'toggle-addon-' . $addon) . "'>" . __('Activate', 'popover') . "</a></span>";
                    }
                    ?>
                                                <br><div class="row-actions"><?php 
                    echo implode(" | ", $actions);
                    ?>
</div>
                                        </td>

                                        <td class="column-name">
                                    <?php 
                    echo esc_html($addon);
                    ?>
                                        </td>
                                        <td class="column-active">
                    <?php 
                    if (in_array($addon, $active)) {
                        echo "<strong>" . __('Active', 'popover') . "</strong>";
                    } else {
                        echo __('Inactive', 'popover');
                    }
                    ?>
                                        </td>
                                    </tr>
                                                <?php 
                }
            } else {
                $columncount = count($columns) + 1;
                ?>
                                <tr valign="middle" class="alternate" >
                                    <td colspan="<?php 
                echo $columncount;
                ?>
" scope="row"><?php 
                _e('No Add-ons where found for this install.', 'popover');
                ?>
</td>
                                </tr>
                <?php 
            }
            ?>

                        </tbody>
                    </table>


                    <div class="tablenav">

                        <div class="alignleft actions">
                            <select name="action2">
                                <option selected="selected" value=""><?php 
            _e('Bulk Actions', 'popover');
            ?>
</option>
                                <option value="toggle"><?php 
            _e('Toggle activation', 'popover');
            ?>
</option>
                            </select>
                            <input type="submit" class="button-secondary action" id="doaction2" name="doaction2" value="<?php 
            _e('Apply', 'popover');
            ?>
">
                        </div>
                        <div class="alignright actions"></div>
                        <br class="clear">
                    </div>

                </form>

            </div> <!-- wrap -->
                            <?php 
        }
Ejemplo n.º 4
0
function P_style_dirs()
{
    $styles['Default'] = popover_dir('popoverincludes/css/default');
    $styles['Default Fixed'] = popover_dir('popoverincludes/css/fixed');
    $styles['Dark Background Fixed'] = popover_dir('popoverincludes/css/fullbackground');
    return $styles;
}