Skip to content
Snippets Groups Projects
Commit a3a39665 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

fix RT

parent afbcf508
Branches
Tags
5 merge requests!529Hotline 6.56,!512Master,!500Hotline 6.55,!494Dev#7832 profils url rewriting,!436Dev#7832 profils url rewriting
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Systeme_ModulesMenu_Profil extends Class_Systeme_ModulesMenu_Null{
/** @var string */
......@@ -24,11 +24,11 @@ class Class_Systeme_ModulesMenu_Profil extends Class_Systeme_ModulesMenu_Null{
/** @var string */
protected $_type_module = 'PROFIL';
/** @var int */
protected $_popupWidth = 550;
protected $_libelle = "Lien vers un profil du portail";
protected $_libelle = 'Lien vers un profil du portail';
/** @var int */
protected $_popupHeight = 290;
......@@ -36,27 +36,26 @@ class Class_Systeme_ModulesMenu_Profil extends Class_Systeme_ModulesMenu_Null{
protected $_action = 'lienprofil';
protected $_defaultValues = array('clef_profil' => '1');// Par defaut profil portail
protected $_defaultValues = ['clef_profil' => '1'];// Par defaut profil portail
public function getUrl($preferences=[]) {
return $this->_url = Class_Url::assemble( $this->_getUrlParams($preferences),
null,
true);
return $this->_url = Class_Url::assemble($this->_getUrlParams($preferences),
null, true);
}
protected function _getUrlParams($preferences) {
if (!$profil = Class_Profil::find($preferences["clef_profil"]))
if (!$profil = Class_Profil::find($preferences['clef_profil']))
return [];
if (!$profil->hasRewriteUrl())
return ['id_profil' => $preferences["clef_profil"]];
return ['id_profil' => $profil->getId()];
if (!$profil->hasParentProfil())
return ['module' => $profil->getRewriteUrl()];
if (!$profil->getParentProfil()->hasRewriteUrl())
return ['id_profil' => $preferences["clef_profil"]];
return ['id_profil' => $profil->getId()];
return ['module' => $profil->getParentProfil()->getRewriteUrl(),
'controller' => $profil->getRewriteUrl()];
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment