1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

New user page shortcode {USER_SETTINGS_URL}

This commit is contained in:
Cameron 2018-09-18 16:45:26 -07:00
parent b0306a1909
commit a4ca72cd8f
2 changed files with 41 additions and 21 deletions

View File

@ -524,23 +524,40 @@ function sc_user_email($parm='')
function sc_user_update_link($parm)
{
$url = e107::getUrl();
$label = null;
if (USERID == $this->var['user_id'])
{
//return "<a href='".$url->create('user/myprofile/edit')."'>".LAN_USER_38."</a>";
//return "<a class='btn btn-default' href='".e_HTTP."usersettings.php'>".LAN_USER_38."</a>"; // TODO: repair dirty fix for usersettings
return "<a class='btn btn-default' href='".$url->create('user/myprofile/edit')."'>".LAN_USER_38."</a>"; // TODO: repair dirty fix for usersettings
$label = LAN_USER_38;
}
else if(ADMIN && getperms("4") && !$this->var['user_admin'])
{
$editUrl = e_ADMIN_ABS."users.php?mode=main&action=edit&id=".$this->var['user_id'];
return "<a class='btn btn-default' href='".$editUrl."'>".LAN_USER_39."</a>";
// return "<a class='btn btn-default' href='".$url->create('user/profile/edit', array('id' => $this->var['user_id'], 'name' => $this->var['user_name']))."'>".LAN_USER_39."</a>";
$label = LAN_USER_39;
}
if(empty($label))
{
return null;
}
return "<a class='btn btn-default' href='".$this->sc_user_settings_url()."'>".$label."</a>";
}
function sc_user_settings_url($parm=null)
{
if (USERID == $this->var['user_id'])
{
return e107::getUrl()->create('user/myprofile/edit');
}
else if(ADMIN && getperms("4") && !$this->var['user_admin'])
{
return e_ADMIN_ABS."users.php?mode=main&action=edit&id=".$this->var['user_id'];
}
}

View File

@ -257,6 +257,9 @@ class eFront
* @var eRouter
*/
protected $_router;
protected $_response;
/**
* @var string path to file to include - the old deprecated way of delivering content
@ -391,7 +394,7 @@ class eFront
$router = new eRouter();
$this->setRouter($router);
// $response = new eResponse();
/** @var eResponse $response */
$response = e107::getSingleton('eResponse');
$this->setResponse($response);
@ -1626,9 +1629,9 @@ class eRouter
*/
public function getAliases($lanCode = null)
{
if($lan)
if($lanCode)
{
return e107::findPref('url_aliases/'.$lan, array());
return e107::findPref('url_aliases/'.$lanCode, array());
}
return $this->_aliases;
}
@ -4133,7 +4136,7 @@ class eResponse
/**
* Get content
* @param str $ns
* @param string $ns
* @param boolean $reset
* @return string
*/
@ -4150,8 +4153,8 @@ class eResponse
}
/**
* @param str $title
* @param str $ns
* @param string $title
* @param string $ns
* @return eResponse
*/
function setTitle($title, $ns = 'default')
@ -4169,8 +4172,8 @@ class eResponse
}
/**
* @param str $title
* @param str $ns
* @param string $title
* @param string $ns
* @return eResponse
*/
function appendTitle($title, $ns = 'default')
@ -4192,8 +4195,8 @@ class eResponse
}
/**
* @param str $title
* @param str $ns
* @param string $title
* @param string $ns
* @return eResponse
*/
function prependTitle($title, $ns = 'default')
@ -4216,7 +4219,7 @@ class eResponse
/**
* Assemble title
* @param str $ns
* @param string $ns
* @param bool $reset
* @return string
*/