Plugin Directory

Changeset 642688


Ignore:
Timestamp:
12/21/2012 01:30:42 AM (13 years ago)
Author:
Bit51
Message:

Updated Bit51 Library

Location:
multi-site-site-list-shortcode/trunk/lib/bit51
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • multi-site-site-list-shortcode/trunk/lib/bit51/bit51.css

    r500527 r642688  
    5757    list-style-image: url(images/bit51-small.png);
    5858}
     59
     60table.bit51sorttable {
     61    border: 1px solid #ddd;
     62    padding: 0;
     63}
     64
     65table.bit51sorttable tr,
     66table.bit51sorttable td {
     67    margin: 0;
     68    padding: 0;
     69}
     70
     71table.bit51sorttable tr.odd {
     72    background-color: #fff;
     73}
     74
     75table.bit51sorttable tr.even {
     76    background-color: #eee;
     77}
     78
     79table.bit51sorttable td {
     80    border: 1px solid #ddd;
     81}
     82
     83table.bit51sorttable tr.thead {
     84    background: #F1F1F1;
     85    background-image: -webkit-gradient(linear,left bottom,left top,from(#ECECEC),to(#F9F9F9));
     86    background-image: -webkit-linear-gradient(bottom,#ECECEC,#F9F9F9);
     87    background-image: -moz-linear-gradient(bottom,#ECECEC,#F9F9F9);
     88    background-image: -o-linear-gradient(bottom,#ECECEC,#F9F9F9);
     89    background-image: linear-gradient(to top,#ECECEC,#F9F9F9);
     90}
     91
     92table.bit51sorttable tr td {
     93    padding: 10px 5px 3px 10px;
     94}
     95
  • multi-site-site-list-shortcode/trunk/lib/bit51/bit51.php

    r549371 r642688  
    4444                wp_enqueue_style( 'global' );
    4545                wp_enqueue_style( 'wp-admin' );
    46                 wp_enqueue_style( 'bit51-css', plugin_dir_url( __FILE__ ). 'bit51.css' );
     46                wp_enqueue_style( 'bit51-css', plugin_dir_url( $this->pluginbase, __FILE__ ). 'lib/bit51/bit51.css' );
    4747               
    4848            }
     
    241241            <?php
    242242        }
     243
     244        function admin_tabs( $tabs, $current = NULL, $page = true ) {
     245            if ( $current == NULL ) {
     246                $current = $this->hook;
     247            }
     248            $tabs = $tabs;
     249            echo '<div id="icon-themes" class="icon32"><br></div>';
     250            echo '<h2 class="nav-tab-wrapper">';
     251            foreach( $tabs as $location => $tabname ){
     252                if ( is_array( $tabname ) ) {
     253                    $class = ( $location == $current ) ? ' nav-tab-active' : '';
     254                    echo '<a class="nav-tab' . $class. '" href="?page=' . $tabname[1] . '&tab='. $location . '">' . $tabname[0] . '</a>';
     255                } else {
     256                    $class = ( $location == $current ) ? ' nav-tab-active' : '';
     257                    echo '<a class="nav-tab' . $class. '" href="?page=' . $location . '">' . $tabname . '</a>';
     258                }
     259            }
     260            echo '</h2>';
     261        }
    243262       
    244263        /**
     
    250269         * @param object $boxes array of primary content boxes in postbox form
    251270         * @param string $icon[optional] icon file to display
    252          *
    253          **/
    254         function admin_page( $title, $boxes, $icon = '' ) {
     271         * @param object $tabs[optional] array of tabs to display
     272         * @param boolean $page[optional] true if stand-alone page, false otherwise
     273         *
     274         **/
     275        function admin_page( $title, $boxes, $icon = '', $tabs = NULL, $page = true ) {
     276
     277            if ( ( $page != true && !isset( $_GET['tab'] ) ) || ( $page == true && isset( $_GET['tab'] ) ) ) {
     278                return;
     279            }
     280
    255281            ?>
    256282                <div class="wrap">
    257283                    <?php if ( $icon == '' ) { ?>
    258                         <a href="http://bit51.com/"><div id="bit51-icon" style="background: url(<?php echo plugin_dir_url( __FILE__ ); ?>images/bit51.png) no-repeat;" class="icon32"><br /></div></a>
     284                        <a href="http://bit51.com/"><div id="bit51-icon" style="background: url(<?php echo plugin_dir_url( $this->pluginbase, __FILE__ ); ?>lib/bit51/images/bit51.png) no-repeat;" class="icon32"><br /></div></a>
    259285                    <?php } else { ?>
    260286                        <a href="http://bit51.com/"><div id="bit51-icon" style="background: url(<?php echo $icon; ?>) no-repeat;" class="icon32"><br /></div></a>
    261287                    <?php } ?>
    262288                    <h2><?php _e( $title, $this->hook ) ?></h2>
     289                    <?php
     290                        if ( $tabs != NULL ) {
     291                            if ( isset ( $_GET['tab'] ) ) {
     292                                $this->admin_tabs( $tabs, filter_var( $_GET['tab'], FILTER_SANITIZE_STRING ), false );
     293                            } elseif( isset( $_GET['page'] ) ) {
     294                                $this->admin_tabs( $tabs, filter_var( $_GET['page'], FILTER_SANITIZE_STRING ) );
     295                            } else {
     296                                $this->admin_tabs( $tabs );
     297                            }
     298                        }
     299                    ?>
    263300                    <div class="postbox-container" style="width:65%;">
    264301                        <div class="metabox-holder">   
     
    382419            $content .= '<li class="twitter"><a href="http://twitter.com/Bit51" target="_blank">' . __( 'Follow Bit51 on Twitter', $this->hook ) . '</a></li>';
    383420           
    384             $content .= '<li class="google"><a href="https://plus.google.com/104513012839087985497" target="_blank">' . __( 'Find Bit51 on Google+', $this->hook ) . '</a></li>';
     421            $content .= '<li class="google"><a href="https://plus.google.com/104513012839087985497" target="_blank">' . __( 'Circle Bit51 on Google+', $this->hook ) . '</a></li>';
    385422           
    386423            $content .= '<li class="subscribe"><a href="http://bit51.com/subscribe" target="_blank">' . __( 'Subscribe with RSS or Email', $this->hook ) . '</a></li>';
     
    417454           
    418455            //display the notifcation if they haven't turned it off and they've been using the plugin at least 30 days
    419             if ( ! isset( $options['no-nag'] ) && $options['activatestamp'] < ( time() - 2952000 ) ) {
     456            if ( ! isset( $options['no-nag'] ) && $options['activatestamp'] < ( current_time( 'timestamp' ) - 2952000 ) ) {
    420457           
    421458                if ( ! function_exists( 'bit51_plugin_donate_notice' ) ) {
Note: See TracChangeset for help on using the changeset viewer.