Plugin Directory

Changeset 633980


Ignore:
Timestamp:
12/04/2012 01:02:34 PM (13 years ago)
Author:
raido357
Message:

getResourceFolder html builder. Few more pages to go, then all the themes files will be cleaned up of duplicated code

Location:
dippler/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • dippler/trunk/classes/dippler-html-builder.php

    r633976 r633980  
    283283        }
    284284    }
     285   
     286    /*
     287     * Print resource folder contents
     288     */
     289   
     290    function getResourceFolder() {
     291        global $dipplerWP;
     292
     293        /* Load resources and print the table */
     294        $resources= new DipplerLearningResources();
     295        $rootFolder= $resources->getResourceFolder( DipplerUtils::getResourceID() );
     296       
     297        echo '<h2 style="font-weight: bold;">';
     298            if ( $rootFolder ) {
     299                echo $rootFolder->getTitle();
     300            } else {
     301                _e( 'No such folder', self::getTextdomain() );
     302            }
     303        echo '</h2>';
     304        echo '<table style="width: 100%; font-size: .85em;" class="dippler-learning-resource">';
     305        echo '<thead style="background-color: #ccc">';
     306        echo '<tr>';
     307        echo '<th style="width: 25px"><!-- for image --></th>';
     308        echo '<th>'.__( 'Title', self::getTextdomain() ).'</th>';
     309        echo '<th style="width: 100px">'.__( 'Author', self::getTextdomain() ).'</th>';
     310        echo '<th style="width: 160px">'.__( 'Published', self::getTextdomain() ).'</th>';
     311        echo '</tr>';
     312        echo '</thead>';
     313        echo '<tbody>';
     314        if ( $rootFolder && $rootFolder->hasResources() ) {
     315            echo $resources->buildHTML( $rootFolder );
     316        } else {
     317            echo '<tr><td colspan="4">'.__( 'No learning resources added', self::getTextdomain() ).'</td></tr>';
     318        }
     319        echo '</tbody>';
     320        echo '</table>';
     321    }
    285322}
    286323?>
  • dippler/trunk/themes/twentyeleven_dippler/dippler-resource-folder-page.php

    r628932 r633980  
    99
    1010get_header();
    11 global $dipplerWP;
    12 
    13 /* Load resources and print the table */
    14 $resources= new DipplerLearningResources();
    15 $rootFolder= $resources->getResourceFolder( DipplerUtils::getResourceID() );
    1611?>
    1712
    1813        <div id="primary">
    1914            <div id="content" role="main">
    20                 <h2 style="font-weight: bold;">
    21                 <?php
    22                     if ( $rootFolder ) {
    23                         echo $rootFolder->getTitle();
    24                     } else {
    25                         _e( 'No such folder', $dipplerWP->getTextdomain() );
    26                     }
    27                 ?>
    28                 </h2>
    29                 <table style="width: 100%; font-size: .85em;" class="dippler-learning-resource">
    30                     <thead style="background-color: #ccc">
    31                         <tr>
    32                             <th style="width: 25px"><!-- for image --></th>
    33                             <th><?php _e( 'Title', $dipplerWP->getTextdomain() ); ?></th>
    34                             <th style="width: 100px"><?php _e( 'Author', $dipplerWP->getTextdomain() ); ?></th>
    35                             <th style="width: 160px"><?php _e( 'Published', $dipplerWP->getTextdomain() ); ?></th>
    36                         </tr>
    37                     </thead>
    38                     <tbody>
    39                 <?php
    40                
    41                 if ( $rootFolder && $rootFolder->hasResources() ) {
    42                     echo $resources->buildHTML( $rootFolder );
    43                 } else {
    44                     echo '<tr><td colspan="4">'.__( 'No learning resources added', $dipplerWP->getTextdomain() ).'</td></tr>';
    45                 }
    46                 ?>
    47                     </tbody>
    48                 </table>
     15                <?php DipplerHTML::getResourceFolder(); ?>
    4916            </div><!-- #content -->
    5017        </div><!-- #primary -->
  • dippler/trunk/themes/twentyten_dippler/dippler-resource-folder-page.php

    r629015 r633980  
    99
    1010get_header();
    11 global $dipplerWP;
    12 
    13 /* Load resources and print the table */
    14 $resources= new DipplerLearningResources();
    15 $rootFolder= $resources->getResourceFolder( DipplerUtils::getResourceID() );
    1611?>
    1712
    1813        <div id="container">
    1914            <div id="content" role="main">
    20                 <h2 style="font-weight: bold;">
    21                 <?php
    22                     if ( $rootFolder ) {
    23                         echo $rootFolder->getTitle();
    24                     } else {
    25                         _e( 'No such folder', $dipplerWP->getTextdomain() );
    26                     }
    27                 ?>
    28                 </h2>
    29                 <table style="width: 100%; font-size: .85em;" class="dippler-learning-resource">
    30                     <thead style="background-color: #ccc">
    31                         <tr>
    32                             <th style="width: 25px"><!-- for image --></th>
    33                             <th><?php _e( 'Title', $dipplerWP->getTextdomain() ); ?></th>
    34                             <th style="width: 100px"><?php _e( 'Author', $dipplerWP->getTextdomain() ); ?></th>
    35                             <th style="width: 160px"><?php _e( 'Published', $dipplerWP->getTextdomain() ); ?></th>
    36                         </tr>
    37                     </thead>
    38                     <tbody>
    39                 <?php
    40                
    41                 if ( $rootFolder && $rootFolder->hasResources() ) {
    42                     echo $resources->buildHTML( $rootFolder );
    43                 } else {
    44                     echo '<tr><td colspan="4">'.__( 'No learning resources added', $dipplerWP->getTextdomain() ).'</td></tr>';
    45                 }
    46                 ?>
    47                     </tbody>
    48                 </table>
     15                <?php DipplerHTML::getResourceFolder(); ?>
    4916            </div><!-- #content -->
    5017        </div><!-- #primary -->
  • dippler/trunk/themes/twentytwelve_dippler/dippler-resource-folder-page.php

    r633418 r633980  
    99
    1010get_header();
    11 global $dipplerWP;
    12 
    13 /* Load resources and print the table */
    14 $resources= new DipplerLearningResources();
    15 $rootFolder= $resources->getResourceFolder( DipplerUtils::getResourceID() );
    1611?>
    1712
    1813        <div id="primary" class="site-content">
    1914            <div id="content" role="main">
    20                 <h2 style="font-weight: bold;">
    21                 <?php
    22                     if ( $rootFolder ) {
    23                         echo $rootFolder->getTitle();
    24                     } else {
    25                         _e( 'No such folder', $dipplerWP->getTextdomain() );
    26                     }
    27                 ?>
    28                 </h2>
    29                 <table style="width: 100%; font-size: .85em;" class="dippler-learning-resource">
    30                     <thead style="background-color: #ccc">
    31                         <tr>
    32                             <th style="width: 25px"><!-- for image --></th>
    33                             <th><?php _e( 'Title', $dipplerWP->getTextdomain() ); ?></th>
    34                             <th style="width: 100px"><?php _e( 'Author', $dipplerWP->getTextdomain() ); ?></th>
    35                             <th style="width: 160px"><?php _e( 'Published', $dipplerWP->getTextdomain() ); ?></th>
    36                         </tr>
    37                     </thead>
    38                     <tbody>
    39                 <?php
    40                
    41                 if ( $rootFolder && $rootFolder->hasResources() ) {
    42                     echo $resources->buildHTML( $rootFolder );
    43                 } else {
    44                     echo '<tr><td colspan="4">'.__( 'No learning resources added', $dipplerWP->getTextdomain() ).'</td></tr>';
    45                 }
    46                 ?>
    47                     </tbody>
    48                 </table>
     15                <?php DipplerHTML::getResourceFolder(); ?>
    4916            </div><!-- #content -->
    5017        </div><!-- #primary -->
Note: See TracChangeset for help on using the changeset viewer.