Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

  • Beginning Developers

    Beginning Developers

    This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking

Activity

  • pnmoore replied on the discussion topic Restricting Blog posting to Admin
    Thank you so much!  That put me on the right track and looking the right areas to accomplish what I needed. view reply
  • pnmoore added a new discussion topic Restricting Blog posting to Admin in the group Beginning Developers
    I am pretty new to Elgg, but have been able to do most of what I have needed to either on my own or from posts on here.  I have an issue that I can't seem to get past, and can't find a suitable answer on here or anywhere else. On a site I am...
    • isadminloggedin() has been replaced by elgg_is_admin_logged_in()

      There are two things to do:

      1. Get rid of the button

      2. Restrict the edit form to admins (your users could still access the edit form even though there is no button)

       

      1. The button in the blog plugin is registered using:

      elgg_register_title_button();

      which in turn creates a "title:add" menu item.

      You should be able to use elgg_unregister_menu_item('title', 'add') in a specific context = 'blog'. If that doesn't work, create a custom plugin hook handler for 'register', 'menu:title' and return an empty array if the logged in user is not an admin. 

      2. You an extend the view 'forms/blog/save' with another view with a low priority, e.g.

      elgg_extend_view('forms/blog/save', 'my/view/before/the/blog/form', 1);

      Prirority of 1 will put your view before the form view. In your custom view, you can put something like admin_gatekeeper(); or if (!elgg_is_admin_logged_in()) forward();

       

       

    • Thank you so much!  That put me on the right track and looking the right areas to accomplish what I needed.

  • pnmoore joined the group Beginning Developers