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

    • ideascurator
      By ideascurator+
      Hello Pagelines,   I no longer use pagelines services. I have deactivated the automatic annual payment. But it already charged to my credit card. Since I cancelled my contract before the end, Can I request to refund?
    • Anthony King
      By Anthony King+
      Hello,
      I am wanting to know what the status of the Pagelines Platform.
      I have noticed that there has been absolutely no updates on Platform 5 for over 8 months.
      Please tell me you haven't gone off on another tangent and going to build the next great solution
      and then leave all of us to have to completely rebuild our sites like we did for
      Pagelines, then DMS, then Pagelines Platform.
      I like what you build, but what you need to do is build one product and then make it better, rather than 
      abandoning it and building something else.
      You haven't done anything for so long that even WordPress is providing a warning.
      "Warning: This plugin has not been tested with your current version of WordPress."
      So what is the Status. I mean if I am going to pay a monthly fee for a product, I don't want to pay for one
      that is no longer being supported. You have a great product, I'm not bashing it, I'm just wondering what 
      your next move is because I have business decisions to make for myself, and whether of not this is something
      I should stick with.

      Please be kind enough to respond.

      Thank You,
      Anthony
    • Steve Webb
      By Steve Webb+
      I am having an issue with DMS editor not loading.  Just keeps spinning and spinning.
      Have tried several things - Logged in and out, cleared cache, deactivated all plugins, but the issue persists.
      I even had our host restore from a backup a few weeks ago, when I know it WAS working, as I edited a text box on the homepage.  The restore from backup didn't help either.
      Also, the front end of the site shows that the site is framed, or boxed now (whatever you call it), instead of full width as it was previously (last week).
      Dev console shows that there are php errors in Google maps - file is attached.
      Can someone please help?  Not sure what else I can do here...
      Thanks in advance.
      -Matt

    • tuciudadenred
      By tuciudadenred+
      Hi everyone, what happens is that the web page metrosalarmas.com has a google tags which I have not attacked where I can look to remove those tags and be able to locate the correct ones.
×