Area menu

Permalink
So when I click on CCM-highlighter this menu appears, I need that menu to stop pulling links to everything except edit.

I have been all over the C5 directory world but am having trouble finding the file that controls that function. Would someone be able to point me in the right direction?

p.s. I know I can also do the same using advanced permissions, but I need this to also affect the super user which I don't think advanced permissions can do

1 Attachment

sambrody24
 
juliandale replied on at Permalink Reply
juliandale
Without using advanced permissions, you might be able to use some JQuery to hide the options from all but the superadmin. The menu options are all contained in a DIV with the class popover, so it would be something like this:

<?php
global $u;
if (!$u->isSuperUser()){
  ?>
  <script type="text/javascript">
  $(document).ready(function() {
    $(".popover a:contains('Copy to Clipboard')").hide();
    $(".popover a:contains('Delete')").hide();
    $(".popover a:contains('Custom Template')").hide();
  });
  </script>
  <?php
}
?>


I have tried it out and it didn't work, but I think that is because the popover menus are built after the page loads, but hopefully it will give you another idea of how to get it to work.
jasteele12 replied on at Permalink Best Answer Reply
jasteele12
Sounds like you would need to hack into the

ccm_areaMenuObj<?php echo $a->getAreaID(); ?>


object which contains variables such as .canDesign, .canDelete, etc.

Some files to look at:
concrete/elements/block_area_footer.php
concrete/elements/block_area_permissions_js.php
concrete/elements/block_controls.php
concrete/js/ccm.app.js
concrete/js/ccm_app/ui.js

I asked something similar in the last Totally Random if there could be a $a->disableDesignMenu() like we can now use $a->setBlockLimit(1)

I don't have time to try something like this, but I hope that gives you a possible direction...

John
sambrody24 replied on at Permalink Reply
sambrody24
Thanks John!

Just so everyone knows for future use, if for whatever reason permissions are not cutting it and you need to hack that menu, The file to do it in is

concrete/elements/block_controls.php

The code you are looking for starts at line 64

It is basically just a bunch of jquery & PHP if statements

if(you want to delete the links in the menu) {
echo "delete the if statements that have their title in them";
}

PHP humor!!
sambrody24 replied on at Permalink Reply
sambrody24
is there a back end that explains how $a->setBlockLimit(1)works

maybe I could pull on git for this
juliandale replied on at Permalink Reply
juliandale
For me, the $a->setBlockLimit(1) doesn't work as the logic in my mind would expect it to work, so I changed it by doing this:

copy the file at /concrete/elements/block_area_footer.php
and paste it to /elements/block_area_footer.php

Then around line 25, change this:

if (!$c->isArrangeMode()) { ?>

to this:
if (!$c->isArrangeMode() && $a->areaAcceptsBlocks()) { ?>


That removes the "Add to AreaName" bit when an area has the specified limit of blocks in it. The only issue is when you move a block out of that area and into another, you cannot add something else to that area without refreshing the page. That's a small price to pay for the block limiting functionality that I want.
webseitenfachmann replied on at Permalink Reply
juliandale's post did the trick ... after I cleared the concrete5 cache !