コード例 #1
0
ファイル: default.php プロジェクト: mined-gatech/hubzero-cms
	<table class="related-resources">
		<tbody>
		<?php 
    foreach ($this->related as $line) {
        if ($line->section != 'Topic') {
            $class = \Components\Resources\Helpers\Html::getRatingClass($line->rating);
            $resourceEx = new \Components\Resources\Helpers\Helper($line->id, $database);
            $resourceEx->getContributors();
            // If the user is logged in, get their rating for this resource
            if (!User::isGuest()) {
                $mr = new \Components\Resources\Tables\Review($database);
                $myrating = $mr->loadUserRating($line->id, User::get('id'));
            } else {
                $myrating = 0;
            }
            $myclass = \Components\Resources\Helpers\Html::getRatingClass($myrating);
            // Get the SEF for the resource
            if ($line->alias) {
                $sef = Route::url('index.php?option=' . $this->option . '&alias=' . $line->alias);
            } else {
                $sef = Route::url('index.php?option=' . $this->option . '&id=' . $line->id);
            }
        } else {
            if ($line->group_cn != '' && $line->scope != '') {
                $sef = Route::url('index.php?option=com_groups&scope=' . $line->scope . '&pagename=' . $line->alias);
            } else {
                $sef = Route::url('index.php?option=com_wiki&scope=' . $line->scope . '&pagename=' . $line->alias);
            }
        }
        // Make sure we have an SEF, otherwise it's a querystring
        $d = strstr($sef, 'option=') ? '&' : '?';