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
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
Sounds like you would need to hack into the
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
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
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!!
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!!
is there a back end that explains how $a->setBlockLimit(1)works
maybe I could pull on git for this
maybe I could pull on git for this
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:
to this:
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.
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.
juliandale's post did the trick ... after I cleared the concrete5 cache !
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.