public static function display_certifications()
 {
     $action = '';
     $data = '';
     $view = 'list';
     $certifications = self::getCertifications();
     if (isset($_POST['action'])) {
         $action = $_POST['action'];
         $data = $_POST;
     } else {
         if (isset($_GET['action'])) {
             $action = $_GET['action'];
             $data = $_GET;
         }
     }
     switch ($action) {
         case 'add':
             TauchTerminal::view('certifications/edit', array('action' => 'save-new'));
             break;
         case 'save-new':
             $id = self::addCertifications($data);
             $certifications = self::getCertifications(array($id));
             TauchTerminal::view('certifications/edit', array('certification' => $certifications[0], 'action' => 'save-edit'));
             break;
         case 'edit':
             $certifications = self::getCertifications($data["post"]);
             TauchTerminal::view('certifications/edit', array('certification' => $certifications[0], 'action' => 'save-edit'));
             break;
         case 'save-edit':
             $id = self::updateCertifications($data);
             $certifications = self::getCertifications(array($id));
             TauchTerminal::view('certifications/edit', array('certification' => $certifications[0], 'action' => 'save-edit'));
             break;
         case 'trash':
         default:
             if ($action == 'trash') {
                 TauchTerminal_Certifications::deleteCertifications($data["post"]);
             }
             wp_enqueue_style('tauch-terminal-styles', plugins_url('css/edit.css', __FILE__));
             TauchTerminal::view('certifications/list', array('certifications' => $certifications));
             break;
     }
 }
Пример #2
0
    </div>

    <?php 
    $certifications = TauchTerminal_Certifications::getCertifications();
    ?>
    <?php 
    if ($certifications) {
        ?>
    <div class="container">
        <h2 class="sr-only"><?php 
        echo __('Our Certifications', 'tauchterminal');
        ?>
</h2>
        <ul class="list-unstyled list-inline certifications">
            <?php 
        foreach (TauchTerminal_Certifications::getCertifications() as $certification) {
            ?>
                <li class="item col-xs-3 col-sm-3 col-md-2">
                    <img src="<?php 
            echo $certification->url;
            ?>
" alt="<?php 
            echo $certification->name;
            ?>
">
                </li>
            <?php 
        }
        ?>
                <li>
                    <div id="TA_excellent283" class="TA_excellent">