コード例 #1
0
ファイル: shortcodes.php プロジェクト: alvarpoon/anbig
 static function report($attr)
 {
     global $user_ID;
     $content = '';
     watupro_vc_scripts();
     // reports for who?
     $user_id = @$attr[1];
     if (empty($user_id)) {
         $user_id = $user_ID;
     }
     if (empty($user_id)) {
         return __('This content is only for logged in users', 'watupro');
     }
     $type = @$attr[0];
     $type = strtolower($type);
     if (!in_array($type, array("overview", "tests", "skills", "history"))) {
         $type = 'overview';
     }
     ob_start();
     switch ($type) {
         case 'overview':
             WTPReports::overview($user_id, false);
             break;
         case 'tests':
             WTPReports::tests($user_id, false);
             break;
         case 'skills':
             WTPReports::skills($user_id, false);
             break;
         case 'history':
             WTPReports::history($user_id, false);
             break;
     }
     $content = ob_get_contents();
     ob_end_clean();
     return $content;
 }