Make WordPress Core


Ignore:
Timestamp:
11/02/2010 11:25:24 PM (15 years ago)
Author:
nacin
Message:

Tabs for internal linking. props koopersmith, see #11420.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/wp-mce-link.php

    r15943 r16159  
    5050    border-bottom: 1px solid #dfdfdf;
    5151}
     52    #link-header {
     53        padding-bottom: 0;
     54        background: #fff;
     55    }
     56    #link-panel-tab-bar li {
     57        font-weight: bold;
     58        border: #dfdfdf solid;
     59        margin-right: 5px;
     60        border-width: 1px 1px 0;
     61    }
     62    #link-panel-tab-bar .wp-tab-active {
     63        border-color:#ccc;
     64        background-color: #f1f1f1;
     65    }
     66
    5267#link-type {
    5368    width: 140px;
     
    156171</head>
    157172<?php
    158 
    159 $pts = get_post_types( array( 'public' => true ), 'objects' );
     173// @TODO: Support custom post types.
     174// $pts = get_post_types( array( 'public' => true ), 'objects' );
     175$pts = array( get_post_type_object( 'post' ), get_post_type_object( 'page' ) );
    160176$queries = array(
    161177    array( 'preset' => 'all', 'label' => __('View All') ),
     
    164180);
    165181
     182$tb = new WP_Tab_Bar();
     183$tb->id = 'link-panel-tab-bar';
     184$tb->add( 'link-panel-id-custom', __('External Link') );
     185foreach( $pts as $pt ) {
     186    $tb->add( "link-panel-id-pt-$pt->name", $pt->labels->singular_name );
     187}
     188
     189
    166190?>
    167191<body id="post-body">
    168192<div id="link-header">
    169     <label for="link-type">
    170         <span><strong><?php _e('Link Type:'); ?></strong>
    171         </span><select id="link-type">
    172             <option id="link-option-id-custom" class="link-custom"><?php _e('External Link'); ?></option>
    173         <?php
    174         foreach ( $pts as $pt ) {
    175             echo "<option id='link-option-id-pt-$pt->name' class='link-option-pt'>";
    176             echo $pt->labels->singular_name . '</option>';
    177         } ?>
    178         </select>
    179     </label>
     193    <?php $tb->render(); ?>
    180194</div>
    181195<div id="link-selector">
Note: See TracChangeset for help on using the changeset viewer.