tinybrowser.userpage.inc in TinyBrowser 7
File
tinybrowser.userpage.inc
View source
<?php
function tinybrowser_user_page_access($account, $user = FALSE) {
if ($user === FALSE) {
global $user;
}
if ($user->uid == 1) {
return TRUE;
}
if ($account->uid == $user->uid && tinybrowser_access($user)) {
$profile = tinybrowser_get_user_profile($user);
if ($profile['permissions']['userpage']) {
return TRUE;
}
}
return FALSE;
}
function tinybrowser_user_page($account) {
tinybrowser_set_js_variables();
drupal_add_js(drupal_get_path('module', 'tinybrowser') . '/tinybrowser/tb_standalone.js');
$win_height = tinybrowser_get_window_height();
$content = '<p>';
$content .= '<div id="tabs">';
$content .= t('Please use the link below to browse files') . '<br/>';
$content .= '<ul class="tabs secondary">';
$content .= '<li><a href="" onclick="tinyBrowserInlineFrame(\'image\', \'tinybrowser-out\'); return false;" id="tinybrowser-out">Image</a></li>';
$content .= '<li><a href="" onclick="tinyBrowserInlineFrame(\'media\', \'tinybrowser-out\'); return false;" id="tinybrowser-out">Media</a></li>';
$content .= '<li><a href="" onclick="tinyBrowserInlineFrame(\'file\', \'tinybrowser-out\'); return false;" id="tinybrowser-out">File</a></li>';
$content .= '</ul>';
$content .= '</div>';
$content .= '<iframe name="tbframe" id="tbframe" width="100%" height="' . $win_height . '" style="border: solid 1px #ddd;></iframe>';
$content .= '</p>';
return $content;
}