Jump to content

Archived

This topic is now archived and is closed to further replies.

sticktrix1

How do i remove "Custom Scripts"

Recommended Posts

sticktrix1

Hey guys, 

I'm using pagelines 1.1.5 at the moment,

 

How can i remove the "Custom Scripts" menu item or feature.

I don't want to allow users to add their own custom javascript or HTML for security reasons.

I've tried editing the panel.code.php file and also used the "PageLines DMS Toolbar Customizer" which didn't work.

Pagelines doesn't load when unsetting the custom design menu item with this plugin either.

 

How can i do this whilst still having custom css/less.

 

Thanks guys

 

Share this post


Link to post
Share on other sites
James B

Hi Casey

 

Did you use the latest version of that plugin, there is an older one still available on the website as well. This is the newer one - http://www.pagelinestheme.com/remove-dms-editor-toolbar-items-2/

 

If you want them to still have access to the DMS control panel, just not the css/less tab, then looking at the code on the plugin site you can use a hook. http://www.pagelinestheme.com/remove-dms-editor-toolbar-items-2/

 

add_filter('pl_toolbar_config','pagelines_dms_toolbar_customizer',11, 2);
function pagelines_dms_toolbar_customizer( $toolbar ){
if(
        !current_user_can('manage_options') // the uncommented items below only get removed for non-Administrators who also have access to the PageLines DMS Editor
        //&& get_current_user_id() !== '1' // could also choose to limit to certain Administrators via user ID
    ){

unset( $toolbar['pl-design']['panel']['user_less']);

    }
 
    return $toolbar;
}

Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
sticktrix1

I did try that but couldn't manage to get it working,

My users are all Administrators, i think that plugin only 'works' when a non-admin tries to access the dms editor? 

 

How could i make it work for all user privileges including Administrator? 

 

Thanks for all your help mate :)

Really appreciate it!

Share this post


Link to post
Share on other sites
sticktrix1

Update:

 

So i managed to get it working by removing 

 

 if(
		!current_user_can('manage_options') // the uncommented items below only get removed for non-Administrators who also have access to the PageLines DMS Editor
		//&& get_current_user_id() !== '1' // could also choose to limit to certain Administrators via user ID
	){

When unsetting the Custom scripts tab/menu, pagelines never loads, it just stalls on the loading screen.

Share this post


Link to post
Share on other sites
Danny

Can you paste the code you have which causes DMS to never load please.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
sticktrix1
unset($toolbar['pl-design']);		//Custom Code
			unset( $toolbar['pl-design']['panel']['user_less']);		// Custom -- Custom LESS/CSS
			unset( $toolbar['pl-design']['panel']['user_scripts']);		// Custom -- Custom Scripts

That's the lines there that cause Pagelines to not load.

Everything else can be unset with no problems. Just this menu item. Which is fine if it weren't such a security risk with JS n html

Share this post


Link to post
Share on other sites

  • Similar Content

    • Bleuy
      By Bleuy+
      How can I get support on pagelines DMS? The product isn't that old and my skeleton themes aren't working and I can't get support in the same way? 
    • Bleuy
      By Bleuy+
      I have a number of legacy websites that are running on the above version of Pagelines DMS, where the template has stopped working. I am using a skeleton theme to all of them. What do I need to do to rectify this.
       
       
    • Anthony King
      By Anthony King+
      It is with much sorrow that I have to say goodbye to a product that had such great potential.
      There has been no acknowledgement from anybody as to whether or not Pagelines will continue
      or even if they are going to hand it over to someone that would keep the project going. I can't
      keep shelling out money every month to a company that either no longer exists or has chosen to 
      abandoned their customer base. Well it has been a nice 5 years.

       
×