Plugin Directory

Changeset 634018


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

getLearningResource html method. Only assignments page to go

Location:
dippler/trunk
Files:
4 edited

Legend:

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

    r634007 r634018  
    318318        $rootFolder= $resources->getRootFolder();
    319319       
     320        echo '<tbody>';
    320321        if ( $rootFolder->hasResources() ) {
    321322            echo $resources->buildHTML( $rootFolder );
     
    324325        }
    325326       
     327        echo '</tbody>';
     328        echo '</table>';
     329    }
     330   
     331    /*
     332     * Get learning resource
     333     */
     334   
     335    public static function getLearningResource() {         
     336        /* Load resources and print the table */
     337        $resources = new DipplerLearningResources();
     338        $resource = $resources->getResource( DipplerUtils::getResourceID() );
     339       
     340        self::getResourceTableHead( $resource );
     341       
     342        echo '<tbody>';
     343        if ( $resource ) {
     344            echo $resources->buildResourceHTML( $resource );
     345        } else {
     346            echo '<tr><td colspan="4">'.__( 'No such resource', self::getTextdomain() ).'</td></tr>';
     347        }
    326348        echo '</tbody>';
    327349        echo '</table>';
     
    340362                    echo $resource;
    341363                }
    342             } else {
    343                 _e( 'No such resource', self::getTextdomain() );
    344364            }
    345365        echo '</h2>';
    346366        echo '<table style="width: 100%; font-size: .85em;" class="dippler-learning-resource">';
     367        //Single learning resource youtube video etc. then don't output extra thead node
     368        if ( $resource instanceOf DipplerResource || !$resource ) {
     369            return;
     370        }
    347371        echo '<thead style="background-color: #ccc">';
    348372        echo '<tr>';
  • dippler/trunk/themes/twentyeleven_dippler/dippler-resource-page.php

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

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

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