Beispiel #1
0
function select_profile_image($id, $hasimage)
{
    if ($hasimage) {
        return profile_image($id);
    } else {
        return profile_default_image();
    }
}
 /**
  * Get the current logged in user, requires the user library to be available and the user is logged in
  * @author  Minh Duc Nguyen <*****@*****.**>
  * @return [type] [description]
  */
 public function getCurrentUser()
 {
     $this->identifier = $this->user->localIdentifier();
     $this->name = $this->user->name();
     $this->authMethod = $this->user->authMethod();
     $this->function = $this->user->functions();
     $this->user_data = $this->getUserData($this->identifier);
     // $this->oauth_data = $this->getOauthData($this->identifier);
     $this->profile_image = profile_image();
     unset($this->portal_db);
     //prevent portal_db Active Record Object from returning with the obj
     unset($this->role_db);
     //prevent portal_db Active Record Object from returning with the obj
     return $this;
 }
Beispiel #3
0
                         </div>
                     </div>
               </div>\n";        
     } else {
         $user_id = (int) trim($str_1[1]);
         $str_2 = explode(' - ', $str_1[0]);
         $datetime = $str_2[0];
         $str_3 = explode(' : ', $str_2[1]);
         $username = $str_3[0];
         $usertext = $str_3[1];
         $token = token_generate($user_id, true);
         echo "<div class='row margin-right-thin margin-left-thin margin-top-thin'>
                     <div class='col-xs-12'>
                         <div class='media'>
                             <a class='media-left' href='{$urlServer}main/profile/display_profile.php?id=$user_id&amp;token=$token'>
                                 ". profile_image($user_id, IMAGESIZE_SMALL) ."
                             </a>
                             <div class='media-body bubble'>
                                 <div class='label label-success media-heading'>$datetime</div>
                                 <small>$langBlogPostUser ". display_user($user_id, false, false) ."</small>    
                                 <div class='margin-top-thin'>
                                     " . $usertext . "
                                 </div>
                             </div>    
                         </div>
                     </div>
               </div>\n";
     }
 } else { //prior to version 3.0 generated conferences
         echo "<div class='row margin-right-thin margin-left-thin margin-top-thin'>
                     <div class='col-xs-12'>
Beispiel #4
0
             <div class='col-xs-12 col-sm-10 profile-pers-info'>
                 <div class='profile-pers-info-name'>" . q("$userdata->givenname $userdata->surname") . "</div>"; // Name & Surname
                 if (!empty($userdata->email) and allow_access($userdata->email_public)) { // E-mail
                     $tool_content .= "<div class='profile-pers-info'><span class='tag'>$langEmail :</span> <span class='tag-value'>" . mailto($userdata->email) . "</span></div>";}
                 if (!empty($userdata->phone) and allow_access($userdata->phone_public)) { // Phone Number
                     $tool_content .= "<div class='profile-pers-info'><span class='tag'>$langPhone :</span> <span class='tag-value'>" . q($userdata->phone) . "</span></div>";}
                 if (!empty($userdata->am) and allow_access($userdata->am_public)) { // Register Number
                     $tool_content .= "<div class='profile-pers-info-data'><span class='tag'>$langAm :</span> <span class='tag-value'>" . q($userdata->am) . "</span></div>";}
 */$tool_content .= "
     <div class='row'>
         <div class='col-sm-12'>
             <div class='panel panel-default'>
             <div class='panel-body'>
                 <div id='pers_info' class='row'>
                     <div class='col-xs-12 col-sm-2'>
                         <div id='profile-avatar'>" . profile_image($id, IMAGESIZE_LARGE, 'img-responsive img-circle') . "</div>
                     </div>
                     <div class='col-xs-12 col-sm-10 profile-pers-info'>
                         <div class='row profile-pers-info-name'>
                             <div class='col-xs-12'>
                                 <div>" . q("$userdata->givenname $userdata->surname") . "</div>
                                 <div class='not_visible'>(".q($userdata->username).")</div>
                             </div>
                         </div>
                         $perso_blog_html
                         <div class='row'>
                             <div class='col-xs-6'>
                                 <h4>$langProfilePersInfo</h4>
                                 <div class='profile-pers-info'>
                                     <span class='tag'>$langEmail :</span>";
             if (!empty($userdata->email) and allow_access($userdata->email_public)) { 
     $post_actions = '<div class="pull-right">';
     $post_actions .= '<a href="javascript:void(0)" onclick="xmlhttpPost(\''.$urlServer.'modules/comments/comments_perso_blog.php\', \'editLoad\', '.$_POST['rid'].', \''.$_POST['rtype'].'\', \'\', '.$comment->getId().')">';
     $post_actions .= icon('fa-edit', $langModify).'</a> ';
     $post_actions .= '<a href="javascript:void(0)" onclick="xmlhttpPost(\''.$urlServer.'modules/comments/comments_perso_blog.php\', \'delete\', '.$_POST['rid'].', \''.$_POST['rtype'].'\', \''.$langCommentsDelConfirm.'\', '.$comment->getId().')">';
     $post_actions .= icon('fa-times', $langDelete).'</a>';
     $post_actions .='</div>';   
     
     $response[0] = 'OK';
     $response[1] = "<div class='alert alert-success'>".$langCommentsSaveSuccess."</div>";
     $response[2] = $comment->getId();
     $response[3] = "
      <div class='row margin-bottom-thin margin-top-thin comment' id='comment-".$comment->getId()."'>
         <div class='col-xs-12'>
             <div class='media'>
                 <a class='media-left' href='#'>
                     ". profile_image($comment->getAuthor(), IMAGESIZE_SMALL) ."
                 </a>
                 <div class='media-body bubble'>
                     <div class='label label-success media-heading'>".nice_format($comment->getTime(), true).'</div>'.
                         "<small>".$langBlogPostUser.display_user($comment->getAuthor(), false, false)."</small>".
                         $post_actions
                         ."<div class='margin-top-thin' id='comment_content-".$comment->getId()."'>". q($comment->getContent()) ."</div>
                 </div>
             </div>
         </div>
     </div>                    
     ";
 } else {
     $response[0] = 'ERROR';
     $response[1] = "<div class='alert alert-warning'>".$langCommentsSaveFail."</div>";
 }
Beispiel #6
0
 //[0] -> status, [1] -> message, other positions -> other data
 $response = array();
 if ($_POST['action'] == 'new') {
     if (Commenting::permCreate($is_editor, $uid, $course_id)) {
         $comment = new Comment();
         if ($comment->create($_POST['commentText'], $uid, $_POST['rtype'], intval($_POST['rid']))) {
             $post_actions = '<div class="pull-right">';
             $post_actions .= '<a href="javascript:void(0)" onclick="xmlhttpPost(\'' . $urlServer . 'modules/comments/comments.php?course=' . $course_code . '\', \'editLoad\', ' . $_POST['rid'] . ', \'' . $_POST['rtype'] . '\', \'\', ' . $comment->getId() . ')">';
             $post_actions .= icon('fa-edit', $langModify) . '</a> ';
             $post_actions .= '<a href="javascript:void(0)" onclick="xmlhttpPost(\'' . $urlServer . 'modules/comments/comments.php?course=' . $course_code . '\', \'delete\', ' . $_POST['rid'] . ', \'' . $_POST['rtype'] . '\', \'' . $langCommentsDelConfirm . '\', ' . $comment->getId() . ')">';
             $post_actions .= icon('fa-times', $langDelete) . '</a>';
             $post_actions .= '</div>';
             $response[0] = 'OK';
             $response[1] = "<div class='alert alert-success'>" . $langCommentsSaveSuccess . "</div>";
             $response[2] = $comment->getId();
             $response[3] = "\r\n         <div class='row margin-bottom-thin margin-top-thin comment' id='comment-" . $comment->getId() . "'>\r\n                    <div class='col-xs-12'>\r\n                        <div class='media'>\r\n                            <a class='media-left' href='#'>\r\n                                " . profile_image($comment->getAuthor(), IMAGESIZE_SMALL) . "\r\n                            </a>\r\n                            <div class='media-body bubble'>\r\n                                <div class='label label-success media-heading'>" . nice_format($comment->getTime(), true) . '</div>' . "<small>" . $langBlogPostUser . display_user($comment->getAuthor(), false, false) . "</small>" . $post_actions . "<div class='margin-top-thin' id='comment_content-" . $comment->getId() . "'>" . q($comment->getContent()) . "</div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>                    \r\n                ";
         } else {
             $response[0] = 'ERROR';
             $response[1] = "<div class='alert alert-warning'>" . $langCommentsSaveFail . "</div>";
         }
     } else {
         $response[0] = 'ERROR';
         $response[1] = "<div class='alert alert-warning'>" . $langCommentsNewNoPerm . "</div>";
     }
     echo json_encode($response);
 } else {
     if ($_POST['action'] == 'delete') {
         $comment = new Comment();
         if ($comment->loadFromDB(intval($_POST['cid']))) {
             if ($comment->permEdit($is_editor, $uid)) {
                 if ($comment->delete()) {
Beispiel #7
0
function display_user($user, $print_email = false, $icon = true, $class = "")
{
    global $langAnonymous, $urlAppend;
    if (count($user) == 0) {
        return '-';
    } elseif (is_array($user)) {
        $begin = true;
        $html = '';
        foreach ($user as $user_data) {
            if (!isset($user->user_id)) {
                if ($begin) {
                    $begin = false;
                } else {
                    $html .= '<br>';
                }
                $html .= display_user($user_data->user_id, $print_email);
            }
        }
        return $html;
    } elseif (!is_array($user)) {
        $r = Database::get()->querySingle("SELECT id, surname, givenname, username, email, has_icon FROM user WHERE id = ?d", $user);
        if ($r) {
            $user = $r;
        } else {
            if ($icon) {
                return profile_image(0, IMAGESIZE_SMALL) . '&nbsp;' . $langAnonymous;
            } else {
                return $langAnonymous;
            }
        }
    }
    if ($print_email) {
        $email = trim($user->email);
        $print_email = $print_email && !empty($email);
    }
    if ($icon) {
        $icon = profile_image($user->id, IMAGESIZE_SMALL, 'img-circle') . '&nbsp;';
    }
    if (!empty($class)) {
        $class_str = "class='{$class}'";
    } else {
        $class_str = "";
    }
    $token = token_generate($user->id, true);
    $student_name = $user->surname || $user->givenname ? q($user->surname) . " " . q($user->givenname) : $user->username;
    return "{$icon}<a {$class_str} href='{$urlAppend}main/profile/display_profile.php?id={$user->id}&amp;token={$token}'>" . $student_name . "</a>" . ($print_email ? ' (' . mailto(trim($user->email), 'e-mail address hidden') . ')' : '');
}
Beispiel #8
0
            break;
    }
    $tool_content .= "<div class='form-group'><label for='mailstatus' class='col-sm-2 control-label'>{$langVerifiedMail}</label>\n                        {$message}</div>";
}
if (!get_config('restrict_owndep')) {
    $tool_content .= "<div class='form-group'><label for='faculty' class='col-sm-2 control-label'>{$langFaculty}:</label>";
    $tool_content .= "<div class='col-sm-10'>";
    list($js, $html) = $tree->buildUserNodePicker(array('defaults' => $userObj->getDepartmentIds($uid)));
    $head_content .= $js;
    $tool_content .= $html;
    $tool_content .= "</div></div>";
}
$tool_content .= "<div class='form-group'><label for='language' class='col-sm-2 control-label'>{$langLanguage}:</label>\n                      <div class='col-sm-10'>" . lang_select_options('userLanguage', "class='form-control'") . "</div>\n                  </div>";
if ($icon) {
    $message_pic = $langReplacePicture;
    $picture = profile_image($uid, IMAGESIZE_SMALL) . "&nbsp;&nbsp;";
    $delete = '&nbsp;' . icon('fa-times', $langDelete, '#', 'id="delete"') . '&nbsp;';
} else {
    $picture = $delete = '';
    $message_pic = $langAddPicture;
}
$tool_content .= "<div class='form-group'>\n        <label for='picture' class='col-sm-2 control-label'>{$message_pic}</label>\n            <div class='col-sm-10'><span>{$picture}{$delete}</span><input type='file' name='userimage' size='30'></div>\n        </div>\n        <div class='form-group'>      \n          <label for='desription' class='col-sm-2 control-label'>{$langDescription}:</label>\n          <div class='col-sm-10'>" . rich_text_editor('desc_form', 5, 20, $desc_form) . "</div>\n        </div>\n        <div class='col-sm-offset-2 col-sm-10'>        \n          <input class='btn btn-primary' type='submit' name='submit' value='{$langSubmit}'>\n          <a href='display_profile.php' class='btn btn-default'>{$langCancel}</a>\n        </div>      \n      </fieldset>\n      </form>\n      </div>";
draw($tool_content, 1, null, $head_content);
/**
 * 
 * @param type $val
 * @return int
 */
function valid_access($val)
{
    $val = intval($val);
Beispiel #9
0
    /**
     * Injects all commenting module code in other subsystems
     * @param courseCode the course code
     * @param $isEditor
     * @param $uid the user id
     * @return string
     */
    public function put($courseCode, $isEditor, $uid, $always_open = false) {
        global $langComments, $langBlogPostUser, $langSubmit, $themeimg, $langModify, $langDelete,
        $langCommentsDelConfirm, $langCommentsSaveConfirm, $urlServer, $head_content;
        
        //$head_content .= '<link rel="stylesheet" type="text/css" href="'.$urlServer.'modules/comments/style.css">';
        
        $commentsNum = $this->getCommentsNum();

        if (!$always_open) {
            $comments_title = "<button type='button' class='btn btn-primary' data-toggle='modal' data-target='#commentArea-$this->rid'>$langComments (<span id='commentsNum-$this->rid'>$commentsNum</span>)</button>";
            $out = "$comments_title
                    <div class='modal fade' id='commentArea-$this->rid' role='dialog'>
                      <div class='modal-dialog modal-lg'>
                        <div class='modal-content' style='padding:1%'>
                          <div class='modal-header'>
                            <button type='button' class='close' data-dismiss='modal'>&times;</button>
                              <h4 class='modal-title'>$langComments</h4>
                          </div>
                          <div class='modal-body' id='comments-$this->rid'>";
        } else {
            $comments_title = "<h3 id='comments_title'>$langComments (<span id='commentsNum-$this->rid'>$commentsNum</span>)</h3><br>";
            $out = "<div class='commenting'>
                        $comments_title
                    <div class='commentArea' id='commentArea-$this->rid'>
                    <div id='comments-$this->rid'>";
        }
        
        if ($commentsNum != 0) {
            //retrieve comments
            $comments = $this->getCommentsDB();
            foreach ($comments as $comment) {
                if (is_null($courseCode)) { //for the case of personal blog posts comments
                    if (isset($_SESSION['uid']) && ($isEditor || ($comment->getAuthor() == $uid))) { //$isEditor corresponds to blog editor
                        $post_actions = '<div class="pull-right">';
                        $post_actions .= '<a href="javascript:void(0)" onclick="xmlhttpPost(\''.$urlServer.'modules/comments/comments_perso_blog.php\', \'editLoad\', '.$this->rid.', \''.$this->rtype.'\', \'\', '.$comment->getId().')">';
                        $post_actions .= icon('fa-edit', $langModify).'</a> ';
                        $post_actions .= '<a href="javascript:void(0)" onclick="xmlhttpPost(\''.$urlServer.'modules/comments/comments_perso_blog.php\', \'delete\', '.$this->rid.', \''.$this->rtype.'\', \''.$langCommentsDelConfirm.'\', '.$comment->getId().')">';
                        $post_actions .= icon('fa-times', $langDelete).'</a>';
                        $post_actions .='</div>';
                    } else {
                        $post_actions = '';
                    }
                } else {
                    if ($comment->permEdit($isEditor, $uid)) {
                        $post_actions = '<div class="pull-right">';
                        $post_actions .= '<a href="javascript:void(0)" onclick="xmlhttpPost(\''.$urlServer.'modules/comments/comments.php?course='.$courseCode.'\', \'editLoad\', '.$this->rid.', \''.$this->rtype.'\', \'\', '.$comment->getId().')">';
                        $post_actions .= icon('fa-edit', $langModify).'</a> ';
                        $post_actions .= '<a href="javascript:void(0)" onclick="xmlhttpPost(\''.$urlServer.'modules/comments/comments.php?course='.$courseCode.'\', \'delete\', '.$this->rid.', \''.$this->rtype.'\', \''.$langCommentsDelConfirm.'\', '.$comment->getId().')">';
                        $post_actions .= icon('fa-times', $langDelete).'</a>';
                
                        if (abuse_report_show_flag('comment', $comment->getId(), course_code_to_id($courseCode), $isEditor)) {
                            $post_actions .= abuse_report_icon_flag ('comment', $comment->getId(), course_code_to_id($courseCode)); 
                        }
                
                        $post_actions .='</div>';
                    } else {
                        if (abuse_report_show_flag('comment', $comment->getId(), course_code_to_id($courseCode), $isEditor)) {
                            $post_actions = '<div class="pull-right">'.abuse_report_icon_flag ('comment', $comment->getId(), course_code_to_id($courseCode)).'</div>';
                        } else {
                            $post_actions = '';
                        }
                    }
                }           
                $out .= "<div class='row margin-bottom-thin margin-top-thin comment' id='comment-".$comment->getId()."'>
                          <div class='col-xs-12'>
                           <div class='media'>
                            <a class='media-left' href='#'>
                            ". profile_image($comment->getAuthor(), IMAGESIZE_SMALL) ."
                            </a>
                            <div class='media-body bubble'>
                             <div class='label label-success media-heading'>".nice_format($comment->getTime(), true).'</div>'.
                              "<small>".$langBlogPostUser.display_user($comment->getAuthor(), false, false)."</small>".
                               $post_actions
                               ."<div class='margin-top-thin' id='comment_content-".$comment->getId()."'>". q($comment->getContent()) ."</div>
                               </div>
                            </div>
                          </div>
                         </div>";              
            }
        }
        $out .= "</div>";
        
        if (is_null($courseCode)) { //for the case of personal blog posts comments
            if (isset($_SESSION['uid'])) {
                $out .= '<form action="" onsubmit="xmlhttpPost(\''.$urlServer.'modules/comments/comments_perso_blog.php\', \'new\','.$this->rid.', \''.$this->rtype.'\', \''.$langCommentsSaveConfirm.'\'); return false;">';
                $out .= '<textarea class="form-control" name="textarea" id="textarea-'.$this->rid.'" rows="5"></textarea><br/>';
                $out .= '<input class="btn btn-primary" name="send_button" type="submit" value="'.$langSubmit.'" />';
                $out .= '</form>';
            } 
        } else {
            if (Commenting::permCreate($isEditor, $uid, course_code_to_id($courseCode))) {
                $out .= '<form action="" onsubmit="xmlhttpPost(\''.$urlServer.'modules/comments/comments.php?course='.$courseCode.'\', \'new\','.$this->rid.', \''.$this->rtype.'\', \''.$langCommentsSaveConfirm.'\'); return false;">';
                $out .= '<textarea class="form-control" name="textarea" id="textarea-'.$this->rid.'" rows="5"></textarea><br/>';
                $out .= '<input class="btn btn-primary" name="send_button" type="submit" value="'.$langSubmit.'" />';
                $out .= '</form>';
            }
        }
        
        if (!$always_open) {
            $out .= '<div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                     </div>';
            $out .= '</div>';
        }
        
        $out .= '</div>';
        $out .= '</div>';
        
        return $out;
    }
Beispiel #10
0
        if (trim($str_1[1]) == "systemMsgClear" || trim($str_1[1]) == "systemMsgSave") {
            if (trim($str_1[1]) == "systemMsgClear") {
                $class = 'alert-success';
            } else {
                $class = 'alert-info';
            }
            echo "<div class='row margin-right-thin margin-left-thin margin-top-thin'>\n                            <div class='col-xs-12'>\n                                <div class='alert {$class} text-center'>\n                                    {$str_1['0']}\n                                </div>\n                            </div>\n                      </div>\n";
        } else {
            $user_id = (int) trim($str_1[1]);
            $str_2 = explode(' - ', $str_1[0]);
            $datetime = $str_2[0];
            $str_3 = explode(' : ', $str_2[1]);
            $username = $str_3[0];
            $usertext = $str_3[1];
            $token = token_generate($user_id, true);
            echo "<div class='row margin-right-thin margin-left-thin margin-top-thin'>\n                            <div class='col-xs-12'>\n                                <div class='media'>\n                                    <a class='media-left' href='{$urlServer}main/profile/display_profile.php?id={$user_id}&token={$token}'>\n                                        " . profile_image($user_id, IMAGESIZE_SMALL) . "\n                                    </a>\n                                    <div class='media-body bubble'>\n                                        <div class='label label-success media-heading'>{$datetime}</div>\n                                        <small>{$langBlogPostUser} " . display_user($user_id, false, false) . "</small>    \n                                        <div class='margin-top-thin'>\n                                            " . $usertext . "\n                                        </div>\n                                    </div>    \n                                </div>\n                            </div>\n                      </div>\n";
        }
    } else {
        //prior to version 3.0 generated conferences
        echo "<div class='row margin-right-thin margin-left-thin margin-top-thin'>\n                            <div class='col-xs-12'>\n                                <div class='alert alert-default'>\n                                    {$str_1['0']}\n                                </div>\n                            </div>\n                      </div>\n";
    }
}
echo "</body></html>\n";
/*
 * For performance reason, buffer the content
 * in a temporary archive file
 * once the chat file is too large
 */
if ($FileNbLine > MAX_LINE_IN_FILE) {
    buffer(implode('', $tmp), $tmpArchiveFile);
    // clean the original file
 /**
  * Injects all commenting module code in other subsystems
  * @param courseCode the course code
  * @param $isEditor
  * @param $uid the user id
  * @return string
  */
 public function put($courseCode, $isEditor, $uid, $always_open = false)
 {
     global $langComments, $langBlogPostUser, $langSubmit, $themeimg, $langModify, $langDelete, $langCommentsDelConfirm, $langCommentsSaveConfirm, $urlServer, $head_content;
     //$head_content .= '<link rel="stylesheet" type="text/css" href="'.$urlServer.'modules/comments/style.css">';
     $commentsNum = $this->getCommentsNum();
     if (!$always_open) {
         $comments_title = "<a id='comments_title' href='javascript:void(0)' onclick='showComments(\"{$this->rid}\")'>{$langComments} (<span id='commentsNum-{$this->rid}'>{$commentsNum}</span>)</a><br>";
         $comments_display = "style='display:none'";
     } else {
         $comments_title = "<h3 id='comments_title'>{$langComments} (<span id='commentsNum-{$this->rid}'>{$commentsNum}</span>)</h3><br>";
         $comments_display = "";
     }
     //the array is declared in commenting.js
     $out = "<script type='text/javascript'>showCommentArea[{$this->rid}] = false;</script>\r\n                <div class='commenting'>\r\n                    {$comments_title}\r\n                <div class='commentArea' id='commentArea-{$this->rid}' {$comments_display}>\r\n                <div id='comments-{$this->rid}'>";
     if ($commentsNum != 0) {
         //retrieve comments
         $comments = $this->getCommentsDB();
         foreach ($comments as $comment) {
             if ($comment->permEdit($isEditor, $uid)) {
                 $post_actions = '<div class="pull-right">';
                 $post_actions .= '<a href="javascript:void(0)" onclick="xmlhttpPost(\'' . $urlServer . 'modules/comments/comments.php?course=' . $courseCode . '\', \'editLoad\', ' . $this->rid . ', \'' . $this->rtype . '\', \'\', ' . $comment->getId() . ')">';
                 $post_actions .= icon('fa-edit', $langModify) . '</a> ';
                 $post_actions .= '<a href="javascript:void(0)" onclick="xmlhttpPost(\'' . $urlServer . 'modules/comments/comments.php?course=' . $courseCode . '\', \'delete\', ' . $this->rid . ', \'' . $this->rtype . '\', \'' . $langCommentsDelConfirm . '\', ' . $comment->getId() . ')">';
                 $post_actions .= icon('fa-times', $langDelete) . '</a>';
                 $post_actions .= '</div>';
             } else {
                 $post_actions = '';
             }
             $out .= "<div class='row margin-bottom-thin margin-top-thin comment' id='comment-" . $comment->getId() . "'>\r\n            <div class='col-xs-12'>\r\n                <div class='media'>\r\n                    <a class='media-left' href='#'>\r\n                        " . profile_image($comment->getAuthor(), IMAGESIZE_SMALL) . "\r\n                    </a>\r\n                    <div class='media-body bubble'>\r\n                        <div class='label label-success media-heading'>" . nice_format($comment->getTime(), true) . '</div>' . "<small>" . $langBlogPostUser . display_user($comment->getAuthor(), false, false) . "</small>" . $post_actions . "<div class='margin-top-thin' id='comment_content-" . $comment->getId() . "'>" . q($comment->getContent()) . "</div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>";
         }
     }
     $out .= "</div>";
     if (Commenting::permCreate($isEditor, $uid, course_code_to_id($courseCode))) {
         $out .= '<form action="" onsubmit="xmlhttpPost(\'' . $urlServer . 'modules/comments/comments.php?course=' . $courseCode . '\', \'new\',' . $this->rid . ', \'' . $this->rtype . '\', \'' . $langCommentsSaveConfirm . '\'); return false;">';
         $out .= '<textarea class="form-control" name="textarea" id="textarea-' . $this->rid . '" rows="5"></textarea><br/>';
         $out .= '<input class="btn btn-primary" name="send_button" type="submit" value="' . $langSubmit . '" />';
         $out .= '</form>';
     }
     $out .= '</div>';
     $out .= '</div>';
     return $out;
 }
       <div class='row'>
           <div class='col-sm-12'>
           <div class='row'>
               <div class='col-xs-12 col-sm-2'>
                   <div id='profile-avatar'>" . profile_image($id, IMAGESIZE_LARGE, 'img-responsive img-circle') . "</div>
               </div>
               <div class='col-xs-12 col-sm-10 profile-pers-info'>
                   <div class='profile-pers-info-name'>" . q("$userdata->givenname $userdata->surname") . "</div>"; // Name & Surname
                   if (!empty($userdata->email) and allow_access($userdata->email_public)) { // E-mail
                       $tool_content .= "<div class='profile-pers-info'><span class='tag'>$langEmail :</span> <span class='tag-value'>" . mailto($userdata->email) . "</span></div>";}
                   if (!empty($userdata->phone) and allow_access($userdata->phone_public)) { // Phone Number
                       $tool_content .= "<div class='profile-pers-info'><span class='tag'>$langPhone :</span> <span class='tag-value'>" . q($userdata->phone) . "</span></div>";}
                   if (!empty($userdata->am) and allow_access($userdata->am_public)) { // Register Number
                       $tool_content .= "<div class='profile-pers-info-data'><span class='tag'>$langAm :</span> <span class='tag-value'>" . q($userdata->am) . "</span></div>";}
   */
 $tool_content .= "\n        <div class='row'>\n            <div class='col-sm-12'>\n            <div id='pers_info' class='row'>\n                <div class='col-xs-12 col-sm-2'>\n                    <div id='profile-avatar'>" . profile_image($id, IMAGESIZE_LARGE, 'img-responsive img-circle') . "</div>\n                </div>\n                <div class='col-xs-12 col-sm-10 profile-pers-info'>\n                    <div class='row profile-pers-info-name'><div class='col-xs-12'><div>" . q("{$userdata->givenname} {$userdata->surname}") . "</div>\n                        <div class='not_visible'>(" . $userdata->username . ")</div>\n            </div></div>";
 // Name & Surname
 $tool_content .= "<div class='row'><div class='col-xs-6'>";
 $tool_content .= "<h4>{$langProfilePersInfo}</h4><div class='profile-pers-info'><span class='tag'>{$langEmail} :</span>";
 if (!empty($userdata->email) and allow_access($userdata->email_public)) {
     // E-mail
     $tool_content .= " <span class='tag-value'>" . mailto($userdata->email) . "</span>";
 } else {
     $tool_content .= " <span class='tag-value not_visible'> - {$langProfileNotAvailable} - </span>";
 }
 $tool_content .= "</div>";
 $tool_content .= "<div class='profile-pers-info'><span class='tag'>{$langPhone} :</span>";
 if (!empty($userdata->phone) and allow_access($userdata->phone_public)) {
     // Phone Number
     $tool_content .= " <span class='tag-value'>" . q($userdata->phone) . "</span>";
 } else {
            </button>
            <div>
                <a href="{{portal_url()}}" class="navbar-brand">
					<img width="32" border="0" height="32" alt="" src="/assets/core/images/header_logo.png" />
                    <span>RD-Switchboard</span> Browser (BETA)
                </a>
            </div>
            @if(current_url()!=base_url())
        	<div class="clear"><small>Research Data Switchboard</small></div>
            @endif
        </div>
        <nav class="collapse navbar-collapse main-navbar" role="navigation">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="{{portal_url('page/about')}}">About</a></li>
                <?php 
$profile_image = profile_image();
?>
                @if(isset($ro) && $ro->core['id'])
                    <li class="cat-item"> <a href="{{base_url('registry/registry_object/view/')}}/<?php 
echo $this->ro->id;
?>
" title="">Registry View</a> </li>
                @endif
                @if($profile_image)
                   <li><a href="{{portal_url('profile')}}"><img src="{{ $profile_image }}" alt="" class="profile_image_small"></a></li>
                @endif
            </ul>
        </nav>
    </div>
</div>
<button class="yellow_button feedback_button">Feedback</button>
						  <li><a href="#">User account</a></li>
						  <li class="active">Profile</li>
						</ol>
						</div>
					</div>
					<?php 
if (isset($_FILES['profile']) === true) {
    if (empty($_FILES['profile']['name']) == true) {
        echo "Please Choose a file";
    } else {
        $allowed = array('jpg', 'jpeg', 'gif', 'png');
        $file_name = $_FILES['profile']['name'];
        $file_extn = strtolower(end(explode('.', $file_name)));
        $file_temp = $_FILES['profile']['tmp_name'];
        if (in_array($file_extn, $allowed) == true) {
            profile_image($session_user_id, $file_temp, $file_extn);
            header('Location:' . $current_file);
        } else {
            echo 'Incorrect file type. Allowed:';
            echo implode(',', $allowed);
        }
    }
}
if (empty($user_data['profile']) === false) {
    echo '<img src="' . $user_data['profile'] . '"alt="' . $user_data['first_name'] . '">';
}
?>
					<form action="" method="post" class="form-horizontal" enctype="multipart/form-data" >
														  <div class="form-group">
														    <label for="inputPassword3" class="col-sm-2 control-label">Profile Picture&nbsp;&nbsp; </label>
														    <div class="col-sm-9">
Beispiel #15
0
    // list available learning paths
    $learningPathList = Database::get()->queryArray("SELECT learnPath_id FROM lp_learnPath WHERE course_id = ?d", $course_id);

    $iterator = 1;
    $globalprog = 0;
    
    $tool_content .= "  <tr>";
    foreach ($learningPathList as $learningPath) {
        // % progress
        $prog = get_learnPath_progress($learningPath->learnPath_id, $user->id);
        if ($prog >= 0) {
            $globalprog += $prog;
        }
        $iterator++;
    }
    $total = round($globalprog / ($iterator - 1));
    $tool_content .= 
            '    <td><a href="detailsUser.php?course=' . $course_code . '&amp;uInfo=' . $user->id . '&amp;uName=' . $user->givenname . '">' .  profile_image($user->id, IMAGESIZE_SMALL, 'img-circle')."&nbsp;". q($user->surname) . ' ' . q($user->givenname) . '</a></td>'
            . '    <td class="text-center">' . q(uid_to_am($user->id)) . '</td>'
            . '    <td class="text-left">' . user_groups($course_id, $user->id) . '</td>'
            . '    <td class="text-right" width=\'120\'>'
            . disp_progress_bar($total, 1)
            . '</td>'
            . '</tr>';
    $k++;
}
// foot of table
$tool_content .= '</table></div>';

draw($tool_content, 2, null, $head_content);