1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02: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) function sc_user_update_link($parm)
{ {
$url = e107::getUrl(); $label = null;
if (USERID == $this->var['user_id']) if (USERID == $this->var['user_id'])
{ {
//return "<a href='".$url->create('user/myprofile/edit')."'>".LAN_USER_38."</a>"; $label = LAN_USER_38;
//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
} }
else if(ADMIN && getperms("4") && !$this->var['user_admin']) else if(ADMIN && getperms("4") && !$this->var['user_admin'])
{ {
$editUrl = e_ADMIN_ABS."users.php?mode=main&action=edit&id=".$this->var['user_id']; $label = LAN_USER_39;
}
return "<a class='btn btn-default' href='".$editUrl."'>".LAN_USER_39."</a>"; if(empty($label))
{
return null;
}
// 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>"; 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

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