Beispiel #1
0
 /**
  * Get the member's image
  *
  * @return  string
  */
 public function image()
 {
     if (!isset($this->_image)) {
         $this->_image = \Hubzero\User\Profile\Helper::getMemberPhoto($this->_obj, 0);
     }
     return $this->_image;
 }
Beispiel #2
0
        }
        ?>
			<?php 
        if (!$row->original()) {
            //if ($item->get('created_by') != $this->member->get('uidNumber')) {
            ?>
				<div class="convo attribution reposted clearfix">
					<a href="<?php 
            echo Route::url('index.php?option=com_members&id=' . $row->get('created_by'));
            ?>
" title="<?php 
            echo $this->escape(stripslashes($row->creator()->get('name')));
            ?>
" class="img-link">
						<img src="<?php 
            echo \Hubzero\User\Profile\Helper::getMemberPhoto($this->member, 0);
            ?>
" alt="Profile picture of <?php 
            echo $this->escape(stripslashes($row->creator()->get('name')));
            ?>
" />
					</a>
					<p>
						<a href="<?php 
            echo Route::url('index.php?option=com_members&id=' . $row->get('created_by'));
            ?>
">
							<?php 
            echo $this->escape(stripslashes($row->creator()->get('name')));
            ?>
						</a>
Beispiel #3
0
						(<?php 
                    echo Lang::txt('COM_WISHLIST_PLAN_NOT_STARTED');
                    ?>
)
					<?php 
                }
                ?>
				</h3>
				<form action="<?php 
                echo Route::url('index.php?option=' . $this->option);
                ?>
" method="post" id="planform" enctype="multipart/form-data">
					<p class="plan-member-photo">
						<span class="plan-anchor"></span>
						<img src="<?php 
                echo \Hubzero\User\Profile\Helper::getMemberPhoto(User::getRoot(), 0);
                ?>
" alt="<?php 
                echo Lang::txt('COM_WISHLIST_MEMBER_PICTURE');
                ?>
" />
					</p>
					<fieldset>
				<?php 
                if ($this->wish->get('action') == 'editplan') {
                    ?>
						<div class="grid">
							<div class="col span6">
								<label>
									<?php 
                    echo Lang::txt('COM_WISHLIST_WISH_ASSIGNED_TO');
Beispiel #4
0
 if ($i + $this->start >= count($this->groupusers)) {
     break;
 }
 $guser = $this->groupusers[$i + $this->start];
 $u = \Hubzero\User\Profile::getInstance($guser);
 if (!$u) {
     $u = new \Hubzero\User\Profile();
 }
 if (preg_match("/^[_\\.\\%0-9a-zA-Z-]+@([0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}\$/i", $guser)) {
     $inviteemail = true;
     $pic = rtrim(Request::base(true), '/') . '/core/components/com_groups/site/assets/img/emailthumb.png';
 } else {
     if (!is_object($u)) {
         continue;
     } else {
         $pic = \Hubzero\User\Profile\Helper::getMemberPhoto($u, 0);
     }
 }
 switch ($this->filter) {
     case 'invitees':
         $status = Lang::txt('PLG_GROUPS_MEMBERS_STATUS_INVITEE');
         break;
     case 'pending':
         $status = Lang::txt('PLG_GROUPS_MEMBERS_STATUS_PENDING');
         break;
     case 'managers':
         $status = Lang::txt('PLG_GROUPS_MEMBERS_STATUS_MANAGER');
         $cls .= ' manager';
         break;
     case 'members':
     default:
Beispiel #5
0
 /**
  * Get progress data
  *
  * @return void
  **/
 private function getprogressrows()
 {
     // Only allow for instructors
     if (!$this->course->offering()->section()->access('manage')) {
         echo json_encode(array('success' => false));
         exit;
     }
     // Get our limit and limitstart
     $limit = Request::getInt('limit', '10');
     $start = Request::getInt('limitstart', 0);
     // Get all section members
     $members = $this->course->offering()->section()->members(array('student' => 1, 'limit' => $limit, 'start' => $start));
     $member_ids = array();
     $mems = array();
     $grades = null;
     $progress = null;
     $passing = null;
     $recognitions = null;
     if (count($members) > 0) {
         foreach ($members as $m) {
             $member_ids[] = $m->get('id');
             $mems[] = array('id' => $m->get('id'), 'user_id' => $m->get('user_id'), 'name' => User::getInstance($m->get('user_id'))->get('name'), 'thumb' => ltrim(\Hubzero\User\Profile\Helper::getMemberPhoto($m->get('user_id'), 0, true), DS), 'full' => ltrim(\Hubzero\User\Profile\Helper::getMemberPhoto($m->get('user_id'), 0, false), DS), 'enrolled' => $m->get('enrolled') != '0000-00-00 00:00:00' ? Date::of($m->get('enrolled'))->format('M j, Y') : 'unknown', 'lastvisit' => User::getInstance($m->get('user_id'))->get('lastvisitDate') != '0000-00-00 00:00:00' ? Date::of(User::getInstance($m->get('user_id'))->get('lastvisitDate'))->format('M j, Y') : 'never');
         }
         // Refresh the grades
         $this->course->offering()->gradebook()->refresh($member_ids);
         // Get the grades
         $grades = $this->course->offering()->gradebook()->grades(array('unit', 'course'));
         $progress = $this->course->offering()->gradebook()->progress($member_ids);
         $passing = $this->course->offering()->gradebook()->passing($member_ids);
         $recognitions = $this->course->offering()->gradebook()->isEligibleForRecognition($member_ids);
     }
     echo json_encode(array('members' => $mems, 'grades' => $grades, 'progress' => $progress, 'passing' => $passing, 'recognitions' => $recognitions));
     exit;
 }
Beispiel #6
0
 /**
  * Get a user's picture
  *
  * @param   integer  $anonymous  Is user anonymous?
  * @param   boolean  $thumbit    Show thumbnail or full picture?
  * @return  string
  */
 public function getPicture($anonymous = 0, $thumbit = true, $serveFile = true)
 {
     return ProfileHelper::getMemberPhoto($this, $anonymous, $thumbit, $serveFile);
 }
Beispiel #7
0
		</a>
	</div>

	<div class="item-sub" >
		<span tabindex="-1"><?php 
echo $this->page->url();
?>
</span>
	</div>

	<?php 
if ($this->checkout) {
    ?>
		<div class="item-checkout">
			<img width="15" src="<?php 
    echo \Hubzero\User\Profile\Helper::getMemberPhoto($this->checkout->userid);
    ?>
" />
			<?php 
    $user = \Hubzero\User\Profile::getInstance($this->checkout->userid);
    echo Lang::txt('COM_GROUPS_PAGES_PAGE_CHECKED_OUT', $user->get('uidNumber'), $user->get('name'));
    ?>
		</div>
	<?php 
}
?>

	<?php 
if ($this->version->get('approved') == 0) {
    ?>
		<div class="item-approved">
Beispiel #8
0
						</h3>
						<?php 
            if (!User::isGuest()) {
                ?>
							<form action="<?php 
                echo Route::url('index.php?option=' . $this->option);
                ?>
" method="post" id="commentform">
								<p class="comment-member-photo">
									<span class="comment-anchor"></span>
									<?php 
                $jxuser = \Hubzero\User\Profile::getInstance(User::get('id'));
                $anon = !User::isGuest() ? 0 : 1;
                ?>
									<img src="<?php 
                echo \Hubzero\User\Profile\Helper::getMemberPhoto($jxuser, $anon);
                ?>
" alt="<?php 
                echo Lang::txt('COM_ANSWERS_MEMBER_PICTURE');
                ?>
" />
								</p>
								<fieldset>
									<input type="hidden" name="option" value="<?php 
                echo $this->option;
                ?>
" />
									<input type="hidden" name="controller" value="<?php 
                echo $this->controller;
                ?>
" />
Beispiel #9
0
            echo $span_title;
            ?>
			</span>
		<?php 
        }
        ?>
	<?php 
    }
    ?>
</header>

<div class="innerwrap">
	<div id="page_container">
		<div id="page_sidebar">
			<?php 
    $src = \Hubzero\User\Profile\Helper::getMemberPhoto($this->profile, 0, false);
    $link = Route::url($this->profile->getLink());
    ?>
			<div id="page_identity">
				<?php 
    $title = $this->profile->get('uidNumber') == User::get('id') ? Lang::txt('COM_MEMBERS_GO_TO_MY_DASHBOARD') : Lang::txt('COM_MEMBERS_GO_TO_MEMBER_PROFILE', $this->profile->get('name'));
    ?>
				<a href="<?php 
    echo Route::url($this->profile->getLink());
    ?>
" id="page_identity_link" title="<?php 
    echo $title;
    ?>
">
					<img src="<?php 
    echo $this->profile->getPicture(0, false);
 /**
  * Get user profile info
  *
  * @apiMethod GET
  * @apiUri    /members/{id}
  * @apiParameter {
  * 		"name":        "id",
  * 		"description": "Member identifier",
  * 		"type":        "integer",
  * 		"required":    true,
  * 		"default":     null
  * }
  * @return  void
  */
 public function readTask()
 {
     $userid = Request::getInt('id', 0);
     $result = \Hubzero\User\Profile::getInstance($userid);
     if ($result === false) {
         throw new Exception(Lang::txt('COM_MEMBERS_ERROR_USER_NOT_FOUND'), 404);
     }
     // Get any request vars
     $format = Request::getVar('format', 'json');
     $profile = array('id' => $result->get('uidNumber'), 'username' => $result->get('username'), 'name' => $result->get('name'), 'first_name' => $result->get('givenName'), 'middle_name' => $result->get('middleName'), 'last_name' => $result->get('surname'), 'bio' => $result->getBio('clean'), 'email' => $result->get('email'), 'phone' => $result->get('phone'), 'url' => $result->get('url'), 'gender' => $result->get('gender'), 'organization' => $result->get('organization'), 'organization_type' => $result->get('orgtype'), 'country_resident' => $result->get('countryresident'), 'country_origin' => $result->get('countryorigin'), 'member_since' => $result->get('registerDate'), 'orcid' => $result->get('orcid'), 'picture' => array('thumb' => \Hubzero\User\Profile\Helper::getMemberPhoto($result, 0, true), 'full' => \Hubzero\User\Profile\Helper::getMemberPhoto($result, 0, false)));
     /* Is this correct ? */
     //corrects image path, API application breaks Route::url() in the Helper::getMemberPhoto() method.
     $profile['picture']['thumb'] = str_replace('/api', '', $profile['picture']['thumb']);
     $profile['picture']['full'] = str_replace('/api', '', $profile['picture']['full']);
     // Encode and return result
     $object = new stdClass();
     $object->profile = $profile;
     $this->send($object);
 }
Beispiel #11
0
     }
 }
 $name = $row->surname ? stripslashes($row->surname) : '';
 if ($row->givenName) {
     $name .= $row->surname ? ', ' : '';
     $name .= stripslashes($row->givenName);
     $name .= $row->middleName ? ' ' . stripslashes($row->middleName) : '';
 }
 if (!trim($name)) {
     $name = Lang::txt('COM_MEMBERS_UNKNOWN') . ' (' . $row->username . ')';
 }
 $profile = new \Hubzero\User\Profile();
 $profile->set('uidNumber', $row->uidNumber);
 $profile->set('email', $row->email);
 $profile->set('picture', $row->picture);
 $p = \Hubzero\User\Profile\Helper::getMemberPhoto($profile);
 // User messaging
 $messageuser = false;
 if ($messaging && $row->uidNumber > 0 && $row->uidNumber != User::get('id')) {
     switch ($this->config->get('user_messaging')) {
         case 1:
             // Get the groups of the profile
             $pgroups = \Hubzero\User\Helper::getGroups($row->uidNumber, 'all');
             // Get the groups the user has access to
             $profilesgroups = array();
             if (!empty($pgroups)) {
                 foreach ($pgroups as $group) {
                     if ($group->regconfirmed) {
                         $profilesgroups[] = $group->cn;
                     }
                 }
Beispiel #12
0
    ?>
</span>
								<?php 
    echo $approved_on;
    ?>
							</div>
							<div class="col span3 omega">
								<span><?php 
    echo Lang::txt('COM_GROUPS_PAGES_VERSIONS_APPROVED_BY');
    ?>
</span>
								<?php 
    if ($approved_by != 'n/a' && $approved_by != 'System') {
        ?>
									<img align="left" width="20" src="<?php 
        echo \Hubzero\User\Profile\Helper::getMemberPhoto($profile->get('uidNumber'));
        ?>
" />
								<?php 
    }
    ?>
								<?php 
    echo $approved_by;
    ?>
							</div>
						</div>
						<div class="version-content">
							<?php 
    echo \Components\Groups\Helpers\Pages::generatePreview($this->page, $pageVersion->get('version'), true);
    ?>
						</div>
Beispiel #13
0
			<?php 
    }
    ?>

			<h3 class="post-comment-title">
				<?php 
    echo Lang::txt('COM_KB_POST_COMMENT');
    ?>
			</h3>
			<form method="post" action="<?php 
    echo Route::url($this->article->link());
    ?>
" id="commentform">
				<p class="comment-member-photo">
					<img src="<?php 
    echo \Hubzero\User\Profile\Helper::getMemberPhoto(User::getRoot(), !User::isGuest() ? 0 : 1);
    ?>
" alt="" />
				</p>
				<fieldset>
					<?php 
    $replyto = \Components\Kb\Models\Comment::oneOrNew(Request::getInt('replyto'));
    if (!User::isGuest()) {
        if (!$replyto->isNew()) {
            $name = Lang::txt('COM_KB_ANONYMOUS');
            if (!$replyto->get('anonymous')) {
                $name = $this->escape(stripslashes($replyto->creator()->get('name')));
                if ($replyto->creator()->get('public')) {
                    $name = '<a href="' . Route::url($replyto->creator()->getLink()) . '">' . $name . '</a>';
                }
            }