}
if (!($user = get_record("user", "id", $item->userid))) {
    print_error("nouserforid", "block_exabis_eportfolio");
}
// Set THEME (nadavkav)
theme_setup($view->theme);
if ($item->access->page == 'view') {
    if ($item->access->request == 'intern') {
        block_exabis_eportfolio_print_header("views");
    } else {
        print_header(get_string("externaccess", "block_exabis_eportfolio"), get_string("externaccess", "block_exabis_eportfolio") . " " . fullname($user, $user->id));
    }
} elseif ($item->access->page == 'portfolio') {
    if ($item->access->request == 'intern') {
        if ($backtype && $item->userid == $USER->id) {
            block_exabis_eportfolio_print_header("bookmarks" . block_exabis_eportfolio_get_plural_item_type($backtype));
        } else {
            block_exabis_eportfolio_print_header("sharedbookmarks");
        }
    } else {
        print_header(get_string("externaccess", "block_exabis_eportfolio"), get_string("externaccess", "block_exabis_eportfolio") . " " . fullname($user, $user->id));
    }
}
echo "<div class='block_eportfolio_center'>\n";
block_exabis_eportfolio_print_extern_item($item, $access);
if ($item->allowComments) {
    if ($deletecomment == 1) {
        if (!confirm_sesskey()) {
            print_error("badsessionkey", "block_exabis_eportfolio");
        }
        if (count_records("block_exabeporitemcomm", "id", $commentid, "userid", $USER->id, "itemid", $itemid) == 1) {
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
require_once dirname(__FILE__) . '/inc.php';
$courseid = optional_param('courseid', 0, PARAM_INT);
$sort = optional_param('sort', '', PARAM_RAW);
$type = optional_param('type', 'all', PARAM_ALPHA);
$type = block_exabis_eportfolio_check_item_type($type, true);
// Needed for Translations
$type_plural = block_exabis_eportfolio_get_plural_item_type($type);
$strbookmarks = get_string("mybookmarks", "block_exabis_eportfolio");
$strheadline = get_string("bookmarks" . $type_plural, "block_exabis_eportfolio");
$context = get_context_instance(CONTEXT_SYSTEM);
require_login($courseid);
require_capability('block/exabis_eportfolio:use', $context);
if (!($course = get_record("course", "id", $courseid))) {
    error("That's an invalid course id");
}
block_exabis_eportfolio_print_header("bookmarks" . $type_plural);
if (isset($USER->realuser)) {
    error("You can't access portfolios in 'Login As'-Mode.");
}
echo "<div class='block_eportfolio_center'>";
print_simple_box(text_to_html(get_string("explaining" . $type, "block_exabis_eportfolio")), "center");
echo "</div>";