Skip to content

Commit

Permalink
Ajout d'une variable smarty "xmcontent_page" sur la page viewcontent.php
Browse files Browse the repository at this point in the history
  • Loading branch information
GregMage committed Nov 11, 2019
1 parent b1c9e5c commit cbac30e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion viewcontent.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
$xoopsTpl->assign('content_dosocial', $content->getVar('content_dosocial'));
$xoopsTpl->assign('content_domail', $content->getVar('content_domail'));
$xoopsTpl->assign('content_dotitle', $content->getVar('content_dotitle'));

$xoopsTpl->assign('xmcontent_page', XOOPS_URL . 'modules/xmcontent/viewcontent.php?content_id=' . $content_id);

This comment has been minimized.

Copy link
@alain01

alain01 Nov 12, 2019

Contributor

Hello,
bug ?
le mode debug sur la page http://localhost/modules/xmcontent/viewcontent.php?content_id=3
affiche :
{$xmcontent_page} | http://localhostmodules/xmcontent/vie...

1 - Il manque un "/" pour obtenir
{$xmcontent_page} | http://localhost/modules/xmcontent/vie...

2- J'ai changé dans mon fichier viewcontent.php mais ce n'est pas très propre car on obtient l'URL complète :
http://localhost/modules/xmcontent/viewcontent.php?content_id=3

3 - Finalement, si on veut respecter la syntaxe de xoops_page,

$xoops_page contains a condensed version of the current page name.
For example,
for http://myurl/index.php, $xoops_page would be "index",
for http://myurl/modules/profile/edituser.php, $xoops_page would be "profile/edituser".

On devrait donc avoir la ligne suivante :

$xoopsTpl->assign('xmcontent_page', 'xmcontent/viewcontent.php?content_id=' . $content_id);

Et là, c'est top, voici mon code, dans mon thème :

	<{if $xmcontent_page == "xmcontent/viewcontent.php?content_id=1"}>  
		<li class="nav-item active">
			<a class="nav-link card" href="/modules/xmcontent/viewcontent.php?content_id=1">
				Modules
				<span style="font-size: 16px;" class="mx-auto xoopsmodules-color fas fa-cogs"></span>
			</a>
		</li>
	<{else}>	  
		<li class="nav-item">
			<a class="nav-link card" href="/modules/xmcontent/viewcontent.php?content_id=1">
				Modules
				<span style="font-size: 16px;" class="mx-auto xoopsinactive-color fas fa-cogs"></span>
			</a>
		</li>
	<{/if}>

    <{if $xmcontent_page == "xmcontent/viewcontent.php?content_id=3"}>  
		<li class="nav-item active">
			<a class="nav-link card" href="/modules/xmcontent/viewcontent.php?content_id=3">
				Thèmes
				<span style="font-size: 16px;" class="mx-auto xoopsthemes-color fas fa-money-check"></span>
			</a>
		</li>
	<{else}>
		<li class="nav-item">
			<a class="nav-link card" href="/modules/xmcontent/viewcontent.php?content_id=3">
				Thèmes
				<span style="font-size: 16px;" class="mx-auto xoopsinactive-color fas fa-money-check"></span>
			</a>
		</li>
	<{/if}>

//xmdoc
if (xoops_isActiveModule('xmdoc') && $helper->getConfig('options_xmdoc', 0) == 1) {
xoops_load('utility', 'xmdoc');
Expand Down

2 comments on commit cbac30e

@alain01
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capture

@GregMage
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merci pour ton retour:
5306087

Please sign in to comment.