本文整理汇总了PHP中FRoute::profile方法的典型用法代码示例。如果您正苦于以下问题:PHP FRoute::profile方法的具体用法?PHP FRoute::profile怎么用?PHP FRoute::profile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FRoute
的用法示例。
在下文中一共展示了FRoute::profile方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: revoke
/**
* Post processing once a user's access has been revoked
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function revoke()
{
FD::info()->set($this->getMessage());
$url = FRoute::profile(array('layout' => 'edit'), false);
$this->redirect($url);
$this->close();
}
示例2: __construct
public function __construct($config = array())
{
// We want to allow child classes to easily access theme configurations on the view
$this->themeConfig = FD::themes()->getConfig();
parent::__construct($config);
// Check if there is a method isFeatureEnabled exists. If it does, we should do a check all the time.
if (method_exists($this, 'isFeatureEnabled')) {
$this->isFeatureEnabled();
}
// // When the user doesn't have community access, ensure that they can only view selected views.
if (!$this->my->hasCommunityAccess()) {
// Get the current view
$view = $this->getName();
$layout = $this->input->get('layout', '', 'cmd');
// If this is an ajax call, we need to allow some ajax calls to go through
$allowedAjaxNamespaces = array('site/views/profile/showFormError');
if ($this->doc->getType() == 'ajax') {
$namespace = $this->input->get('namespace', '', 'default');
// If this is an ajax call, and the namespace is valid, skip checking below
if (in_array($namespace, $allowedAjaxNamespaces)) {
return;
}
}
// Define allowed views and layout
$allowedViews = array('profile');
$allowedLayouts = array('edit');
// views that we should redirect the user to profile edit page.
$redirectView = array('dashboard', 'profile');
// User should be allowed to logout from the site
$isLogout = $this->input->get('controller', '', 'cmd') == 'account' && $this->input->get('task', '', 'cmd') == 'logout' || $this->input->get('view', '', 'cmd') == 'login' && $this->input->get('layout', '', 'cmd') == 'logout';
// user should be allowed to save their profile details on the site.
$isProfileSaving = $this->input->get('controller', '', 'cmd') == 'profile' && $this->input->get('task', '', 'cmd') == 'save';
if (in_array($view, $redirectView) && !$layout && !$isLogout && !$isProfileSaving) {
// we need to redirect the user to profile edit page.
$this->redirect(FRoute::profile(array('layout' => 'edit'), false));
return;
}
// Ensure that the restricted user is not able to view other views
if (!in_array($view, $allowedViews) && !$isLogout && !$isProfileSaving) {
return JError::raiseError(500, JText::_('COM_EASYSOCIAL_NOT_ALLOWED_TO_VIEW_SECTION'));
}
// Ensure that the user is only viewing the allowed layouts
if (!in_array($layout, $allowedLayouts) && !$isLogout && !$isProfileSaving) {
return JError::raiseError(500, JText::_('COM_EASYSOCIAL_NOT_ALLOWED_TO_VIEW_SECTION'));
}
}
}
示例3: getLink
/**
* Provide a link to social profile.
*
* <code>
* $userId = 1;
*
* $profile = new Prism\Integration\Profile\EasySocial(\JFactory::getDbo());
* $profile->load($userId);
*
* $link = $profile->getLink();
* </code>
*
* @param bool $route Route or not the link.
*
* @return string Return a link to the profile.
*/
public function getLink($route = true)
{
$link = "";
if ($route) {
$options = array('id' => $this->getAlias());
$link = \FRoute::profile($options);
}
return $link;
}
示例4:
?>
<div>
<?php
echo $this->loadTemplate('site/profile/button.conversations.new');
?>
</div>
<?php
}
?>
<?php
} else {
?>
<div>
<a href="<?php
echo FRoute::profile(array('layout' => 'edit'));
?>
" class="btn btn-clean btn-block btn-sm">
<i class="ies-cog mr-5"></i>
<?php
echo JText::_('COM_EASYSOCIAL_PROFILE_UPDATE_PROFILE');
?>
</a>
</div>
<?php
}
?>
<?php
if ($this->template->get('profile_points', true) && $this->config->get('points.enabled')) {
?>
示例5:
<a href="javascript:void(0);">
<?php
echo JText::_("COM_EASYSOCIAL_USE_AS_PROFILE_AVATAR");
?>
</a>
</li>
<?php
}
?>
<?php
if ($lib->canSetProfileCover()) {
?>
<li data-photo-profileCover-button>
<a href="<?php
echo FRoute::profile(array('id' => $this->my->getAlias(), 'cover_id' => $photo->id));
?>
">
<?php
echo JText::_('COM_EASYSOCIAL_USE_AS_PROFILE_COVER');
?>
</a>
</li>
<li class="divider"></li>
<?php
}
?>
<?php
if ($lib->albumLib->editable() && $lib->isAlbumOwner()) {
示例6: getLink
/**
* Provide a link to social profile.
*
* <code>
* $userId = 1;
*
* $profile = new ITPrismIntegrateProfileEasySocial($userId);
* $link = $profile->getLink();
* </code>
*
* @return string Return a link to the profile.
*/
public function getLink()
{
$options = array('id' => $this->getAlias());
return FRoute::profile($options);
}
示例7: getPasswordAndProfileLinks
function getPasswordAndProfileLinks()
{
$registerType = $this->params->get('register_type');
$this->forgotLink = '';
if ($registerType == "jomsocial" && file_exists(JPATH_BASE . '/components/com_community/libraries/core.php')) {
$jspath = JPATH_BASE . '/components/com_community';
include_once $jspath . '/libraries/core.php';
$this->registerLink = CRoute::_('index.php?option=com_community&view=register');
$user = JFactory::getUser();
$this->profileLink = CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id);
} else {
if ($registerType == 'easysocial' && file_exists(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php')) {
include_once JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php';
$this->registerLink = FRoute::registration();
if (method_exists('FRoute', 'getDefaultItemId')) {
$Itemid = '&Itemid=' . FRoute::getDefaultItemId('account');
} else {
$Itemid = '';
}
$this->forgotUsernameLink = JRoute::_('index.php?option=com_easysocial&view=account&layout=forgetUsername' . $Itemid);
$this->forgotPasswordLink = JRoute::_('index.php?option=com_easysocial&view=account&layout=forgetpassword' . $Itemid);
$this->profileLink = FRoute::profile();
} else {
if ($registerType == "communitybuilder" && file_exists(JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php')) {
$this->registerLink = JRoute::_("index.php?option=com_comprofiler&task=registers", false);
$this->forgotLink = JRoute::_("index.php?option=com_comprofiler&task=lostPassword");
$this->forgotUsernameLink = $this->forgotLink;
$this->forgotPasswordLink = $this->forgotLink;
$this->profileLink = JRoute::_("index.php?option=com_comprofiler", false);
} else {
if ($registerType == "virtuemart" && file_exists(JPATH_ADMINISTRATOR . '/components/com_virtuemart/version.php')) {
require_once JPATH_ADMINISTRATOR . '/components/com_virtuemart/version.php';
if (class_exists('vmVersion') && property_exists('vmVersion', 'RELEASE')) {
if (version_compare('1.99', vmVersion::$RELEASE)) {
// -1 if ver1, 1 if 2.0+
$this->registerLink = JRoute::_("index.php?option=com_virtuemart&view=user", false);
} else {
if (file_exists(JPATH_SITE . '/components/com_virtuemart/virtuemart_parser.php')) {
require_once JPATH_SITE . '/components/com_virtuemart/virtuemart_parser.php';
global $sess;
$this->registerLink = $sess->url(SECUREURL . 'index.php?option=com_virtuemart&page=shop.registration');
}
}
}
$this->profileLink = '';
} else {
if ($registerType == 'kunena' && JFolder::exists(JPATH_SITE . '/components/com_kunena')) {
$this->profileLink = JRoute::_('index.php?option=com_kunena&view=user', false);
$this->registerLink = JRoute::_('index.php?option=com_users&view=registration', false);
} else {
if ($registerType == 'custom') {
$this->profileLink = '';
$this->registerLink = $this->getLoginRedirect('registrationlink', false);
} else {
$this->profileLink = '';
$this->registerLink = JRoute::_('index.php?option=com_users&view=registration', false);
}
}
}
}
}
}
// common for J!, JomSocial, and Virtuemart
if (!$this->forgotUsernameLink) {
$this->forgotUsernameLink = JRoute::_('index.php?option=com_users&view=remind', false);
}
if (!$this->forgotPasswordLink) {
$this->forgotPasswordLink = JRoute::_('index.php?option=com_users&view=reset', false);
}
}
示例8: getLink
/**
* Get a link to user profile.
*
* <code>
* $ids = array(1, 2, 3, 4);
* $userId = 1;
*
* $profiles = new Prism\Integration\Profiles\EasySocial(\JFactory::getDbo());
* $profiles->load($ids);
*
* $link = $profiles->getLink($userId);
* </code>
*
* @param int $userId
* @param bool $route Route or not the link.
*
* @return string
*/
public function getLink($userId, $route = true)
{
$link = '';
if (array_key_exists($userId, $this->profiles) and $route) {
$options = array('id' => $this->getAlias($this->profiles[$userId]));
$link = \FRoute::profile($options);
}
return $link;
}
示例9: getUserPermalink
/**
* Gets the user permalink for the app
*
* @since 1.0
* @access public
* @param string
* @return
*/
public function getUserPermalink($userAlias)
{
// Get the profile view
$view = $this->getViews('profile');
$type = $view->type;
// The app is embedded on the page
if ($type == 'embed') {
$url = FRoute::profile(array('id' => $userAlias, 'appId' => $this->getAlias()));
return $url;
}
// If it's a canvas view
$url = FRoute::apps(array('id' => $this->getAlias(), 'layout' => 'canvas', 'type' => 'user', 'uid' => $userAlias));
return $url;
}
示例10:
<?php
echo JText::_('COM_EASYSOCIAL_PROFILE_LAST_SEEN');
?>
, <strong><?php
echo $user->getLastVisitDate('lapsed');
?>
</strong>
</li>
<?php
}
?>
</ul>
<div class="fd-small">
<a href="<?php
echo FRoute::profile(array('id' => $user->getAlias(), 'layout' => 'about'));
?>
"><?php
echo JText::_('COM_EASYSOCIAL_PROFILE_MORE_INFO');
?>
</a>
<?php
if ($this->access->allowed('reports.submit')) {
?>
•
<?php
echo FD::reports()->getForm('com_easysocial', SOCIAL_TYPE_USER, $user->id, $user->getName(), JText::_('COM_EASYSOCIAL_PROFILE_REPORT_USER'), '', JText::_('COM_EASYSOCIAL_PROFILE_REPORT_USER_DESC'), $user->getPermalink(true, true));
?>
<?php
}
示例11: processUsersRedirection
/**
* Redirects users view to easysocial
*
* @since 1.0
* @access public
* @return
*/
public function processUsersRedirection()
{
$doc = JFactory::getDocument();
if ($doc->getType() != 'html') {
return;
}
// Check if the admin wants to enable this
if (!$this->params->get('redirection', true)) {
return;
}
// If this is registration from com_users, redirect to the appropriate page.
if ($this->isUserRegistration()) {
// Redirect to EasySocial's registration
$url = FRoute::registration(array(), false);
return $this->app->redirect($url);
}
// If this is username reminder, redirect to the appropriate page.
if ($this->isUserRemind()) {
// Redirect to EasySocial's registration
$url = FRoute::account(array('layout' => 'forgetUsername'), false);
return $this->app->redirect($url);
}
// If this is password reset, redirect to the appropriate page.
if ($this->isUserReset()) {
// Redirect to EasySocial's registration
$url = FRoute::account(array('layout' => 'forgetPassword'), false);
return $this->app->redirect($url);
}
// If this is password reset, redirect to the appropriate page.
if ($this->isUserLogin()) {
// Determine if there's any "return" url in the query string
$return = JRequest::getVar('return');
if ($return) {
FD::setCallback(base64_decode($return));
}
// Redirect to EasySocial's registration
$url = FRoute::login(array(), false);
return $this->app->redirect($url);
}
// If this is password reset, redirect to the appropriate page.
if ($this->isUserProfile()) {
// Redirect to EasySocial's registration
$url = FRoute::profile(array(), false);
return $this->app->redirect($url);
}
}
示例12: getEditURL
public function getEditURL()
{
return FRoute::profile(array('layout' => 'edit'));
}
示例13: get_user_profile_url
/**
* Gets the user profile url of selected <code>system</code>. Currently supported systems are <br><br>
*
* JomSocial - jomsocial, Community Builder - cb, Touch - touch, Kunena - kunena, Alpha User Points - aup
*
* @param string $system User profile system
* @param int $userid user id
* @param string $username User name to be used to display with link
* @param array $links array of links for mighty touch
* @param path_only boolean want to retrive just the url or the full html hyperlink markup?
*
* @return string user profile url
*/
public static function get_user_profile_url($system, $userid = 0, $username = 'Guest', $path_only = true, $attribs = array())
{
$link = null;
switch ($system) {
case 'cjforum':
$api = JPATH_ROOT . '/components/com_cjforum/helpers/api.php';
if (file_exists($api)) {
require_once $api;
$link = CjForumApi::get_user_profile_url($userid, $path_only, $attribs);
}
break;
case 'cjblog':
$api = JPATH_ROOT . DS . 'components' . DS . 'com_cjblog' . DS . 'api.php';
if (file_exists($api)) {
require_once $api;
$link = CjBlogApi::get_user_profile_url($userid, 'name', $path_only, $attribs);
}
break;
case 'jomsocial':
$jspath = JPATH_BASE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php';
if (file_exists($jspath)) {
include_once $jspath;
if ($path_only) {
$link = CRoute::_('index.php? option=com_community&view=profile&userid=' . $userid);
} else {
$link = JHtml::link(CRoute::_('index.php? option=com_community&view=profile&userid=' . $userid), $username, $attribs);
}
}
break;
case 'cb':
global $_CB_framework, $_CB_database, $ueConfig, $mainframe;
$api = JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php';
if (!is_file($api)) {
return;
}
require_once $api;
cbimport('cb.database');
cbimport('cb.tables');
cbimport('language.front');
cbimport('cb.field');
$url = cbSef('index.php?option=com_comprofiler&task=userProfile&user=' . (int) $userid . getCBprofileItemid(true, false));
if ($path_only) {
$link = $url;
} else {
$link = JHtml::link($url, $username, $attribs);
}
break;
case 'kunena':
if (CJFunctions::_initialize_kunena() && $userid > 0) {
$user = KunenaFactory::getUser($userid);
if ($user === false) {
break;
}
if ($path_only) {
$link = KunenaRoute::_('index.php?option=com_kunena&func=profile&userid=' . $user->userid, true);
} else {
$link = JHtml::link(KunenaRoute::_('index.php?option=com_kunena&func=profile&userid=' . $user->userid, true), $user->name, $attribs);
}
}
break;
case 'aup':
$api_AUP = JPATH_SITE . DS . 'components' . DS . 'com_alphauserpoints' . DS . 'helper.php';
if (file_exists($api_AUP)) {
require_once $api_AUP;
if ($path_only) {
$link = AlphaUserPointsHelper::getAupLinkToProfil($userid);
} else {
$link = JHtml::link(AlphaUserPointsHelper::getAupLinkToProfil($userid), $username, $attribs);
}
}
break;
case 'easysocial':
$api = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_easysocial' . DS . 'includes' . DS . 'foundry.php';
if (file_exists($api)) {
require_once $api;
$my = Foundry::user($userid);
$link = FRoute::profile(array('id' => $my->getAlias()));
if (!$path_only) {
$username = $my->getName();
$link = JHtml::link($link, $username, $attribs);
}
}
break;
}
return null == $link ? $username : $link;
}
示例14: checkCompleteProfile
public static function checkCompleteProfile()
{
$config = FD::config();
$my = FD::user();
// If user is not registered, or no profile id, or settings is not enabled, we cannot do anything to check
if (empty($my->id) || empty($my->profile_id) || !$config->get('user.completeprofile.required', false)) {
return true;
}
$total = $my->getProfile()->getTotalFields(SOCIAL_PROFILES_VIEW_EDIT);
$filled = $my->completed_fields;
// Avoid using maintenance script to do this because it is possible that a site might have >1000 users
// Using this method instead so that every user will at least get executed once during login
// Won't happen on subsequent logins
if (empty($filled)) {
$fields = FD::model('Fields')->getCustomFields(array('profile_id' => $my->getProfile()->id, 'data' => true, 'dataId' => $my->id, 'dataType' => SOCIAL_TYPE_USER, 'visible' => SOCIAL_PROFILES_VIEW_EDIT, 'group' => SOCIAL_FIELDS_GROUP_USER));
$args = array(&$my);
$completedFields = FD::fields()->trigger('onProfileCompleteCheck', SOCIAL_FIELDS_GROUP_USER, $fields, $args);
$table = FD::table('Users');
$table->load(array('user_id' => $my->id));
$table->completed_fields = count($completedFields);
$table->store();
$filled = $table->completed_fields;
}
if ($total == $filled) {
return true;
}
$percentage = (int) ($filled / $total * 100);
if ($percentage < 100) {
$action = $config->get('user.completeprofile.action', 'info');
if ($action === 'redirect') {
$mainframe = JFactory::getApplication();
$mainframe->redirect(FRoute::profile(array('layout' => 'edit')));
}
if ($action === 'info' || $action === 'infoprofile' && JRequest::getVar('view') === 'profile') {
$incompleteMessage = JText::sprintf('COM_EASYSOCIAL_PROFILE_YOUR_PROFILE_IS_INCOMPLETE', $percentage, FRoute::profile(array('layout' => 'edit')));
FD::info()->set(false, $incompleteMessage, SOCIAL_MSG_WARNING, 'easysocial.profilecompletecheck');
}
return false;
}
return true;
}
示例15: getEditProfileLink
public static function getEditProfileLink()
{
$default = EBR::_('index.php?option=com_easyblog&view=dashboard&layout=profile');
$config = EasyBlogHelper::getConfig();
if ($config->get('integrations_easysocial_editprofile')) {
$easysocial = EasyBlogHelper::getHelper('EasySocial');
if ($easysocial->exists()) {
$default = FRoute::profile(array('layout' => 'edit'));
}
}
return $default;
}