remove all content_actions for people not loged in?

Use this forum to ask questions about how to do things in GuMax skin.
Post Reply
User avatar
aapezzuto
Rank 0
Rank 0
Posts: 3
Joined: March 26th, 2008, 2:05 pm

remove all content_actions for people not loged in?

Post by aapezzuto »

I have found the section in GuMax.php

Code: Select all

    <div id="gumax-content-actions">
        <ul>
            <?php $lastkey = end(array_keys($this->data['content_actions'])) ?>
            <?php foreach($this->data['content_actions'] as $key => $action) if($this->data['loggedin']==1) { ?>
               <li id="ca-<?php echo Sanitizer::escapeId($key) ?>" <?php
                   if($action['class']) { ?>class="<?php echo htmlspecialchars($action['class']) ?>"<?php } ?>
               ><a href="<?php echo htmlspecialchars($action['href']) ?>"><?php
                   echo htmlspecialchars($action['text']) ?></a> <?php
                   // if($key != $lastkey) echo "&#8226;" ?></li>
            <?php } ?>
        </ul>
    </div>
But I dont see how that is leaving some content_actions and not others... is there an array somewhere that I am not finding?

I want to hide everything in the content actions group from users who are not logged in.
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: remove all content_actions for people not loged in?

Post by Paul »

Move this: if($this->data['loggedin']==1) outside of the <div id="gumax-content-actions">, it will do the job.

It will look similar like this:

<?php if($this->data['loggedin']==1) { ?>

<div id="gumax-content-actions">
......
</div>

<?php } ?>

That's it.
User avatar
aapezzuto
Rank 0
Rank 0
Posts: 3
Joined: March 26th, 2008, 2:05 pm

Re: remove all content_actions for people not loged in?

Post by aapezzuto »

You have some strange magical css power... What a strange super hero you are!
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: remove all content_actions for people not loged in?

Post by Paul »

Thank you. :D
User avatar
mediawikinewb
Rank 0
Rank 0
Posts: 2
Joined: January 12th, 2012, 2:58 am

Re: remove all content_actions for people not loged in?

Post by mediawikinewb »

Im not sure I understand Paul, sorry to open an old topic. I have tried to figure this out and I can not seem to hide the gumax-content-actions tab "pages" for anonymous users. If I remove everything between <gumax-content-actions Begin> and <end> it removes it, but then users logged in can not edit pages as the edit tab becomes missing. I am using mw v1.16 and gumax v3.4.5
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: remove all content_actions for people not loged in?

Post by Paul »

Here is the change for GuMax 3.4.5

Find this in GuMax.php:

Code: Select all

<!-- gumax-content-actions -->
<?php //if($this->data['loggedin']==1) { ?>
...
<?php //} ?>
You will see the code is there, just remove the "//" and it will look like this:

Code: Select all

<?php if($this->data['loggedin']==1) { ?>
...
<?php } ?>
or use the attachment to replace the origin file
Attachments
GuMax.zip
(5.98 KiB) Downloaded 999 times
User avatar
mediawikinewb
Rank 0
Rank 0
Posts: 2
Joined: January 12th, 2012, 2:58 am

Re: remove all content_actions for people not loged in?

Post by mediawikinewb »

Paul, I tried out your response when I recieved it. It worked great! I have never before posted in a forum and appreciate your swift reply and professional conduct. Thank you for helping me with my problem.
User avatar
vagabondlives
Rank 0
Rank 0
Posts: 3
Joined: May 20th, 2012, 3:01 pm

Re: remove all content_actions for people not loged in?

Post by vagabondlives »

Is it possible to hide content actions from none admin or sysop?
User avatar
jemozkelon
Rank 0
Rank 0
Posts: 1
Joined: August 8th, 2012, 7:42 am
Location: Jersey City, NJ 07305 0, UNITED STATES

Re: remove all content_actions for people not loged in?

Post by jemozkelon »

Paul wrote:Here is the change for GuMax 3.4.5

Find this in GuMax.php:

Code: Select all

<!-- gumax-content-actions -->
<?php //if($this->data['loggedin']==1) { ?>
...
<?php //} ?>
You will see the code is there, just remove the "//" and it will look like this:

Code: Select all

<?php if($this->data['loggedin']==1) { ?>
...
<?php } ?>
or use the attachment to replace the origin file

This means that for logged in users status 1 and for logged off users status 0. Binary operation.
Post Reply