How to register new menu item to the conversation settings menu

  1. 6 years ago

    Im using the Answers plugin template to register new filter to the search menu.

    	public function handler_conversationsController_init($sender)
    		ETSearchModel::addGambit('return $term == strtolower(T("gambit.ootel"));', array($this, "ootelotsingufnc"));
    	public function handler_conversationsController_constructGambitsMenu($sender, &$gambits)
    		addToArrayString($gambits["main"], T("gambit.ootel"), array("gambit-ootel", "icon-headphones"));
    	public static function ootelotsingufnc(&$search, $term, $negate)
    		$search->sql->where("ootel=".($negate ? "0" : "1"));

    Simpel to understand and manipulate.
    To register menu item to the conversation settings menu is thru core/controllers/ETConversationController.class.php
    after the line 250:

    $controls->add("ootel", "<a href='".URL("conversation/ootele/".$conversation["conversationId"]."/?token=".ET::$session->token."&return=".urlencode($this->selfURL))."' id='control-lock'><i class='icon-lock'></i> <span>".T($conversation["ootel"] ? "Eemalda ootel" : "Pane ootele")."</span></a>");

    But how to do this via plugin.php properly?
    How to add functionality via plugin.php properly?

  2. 5 years ago

    @bitikas Have you ever figured this out?

  3. Yes and no, have look there, and plugin to be exact, is the very best to go further.

  4. @bitikas Ah thanks, not completely the way I was looking for but I will look into it more and let you know if I find a solution. I have emailed @Toby as well but he has yet to reply to me.

  5. You welcom ;)

  6. @bitikas I have tried every possible way I could think of to extend the "controlsMenu" button but I am unable to get it done :(

  7. Edited 5 years ago by bitikas

    In my site is the i did little writing to get at least something to use or to go further. Hope this helps.

  8. Edited 5 years ago by Tristan

    Thanks, let me check.

    Meh, this is not scalable.. I need a way to add them through a plugin instead of hacking the core code.

    Add in to file in the: if ($conversation["canModerate"]) row 251: core/controllers/ETConversationController.class.php:
    $controls->add("ootel", "<a href='".URL("conversation/ootele/".$conversation["conversationId"]."/?

    ps. You really have to write the comments and code in english :P I don't understand any of it haha!

  9. Yes, my english in so terrible and i try harder ;) , but as i say, my time is so limited in the moment, so a can help only as you see. To see the code and get some ideas.
    Agree, the examples i wrote is not absolutely ok at all. Hacking the core code is not solution, solution is the correct plugin and understanding the documented code, as you see i'm not the men for the job in the moment.
    But lets hope you achieve more success ;)

  10. No worries, you are doing a good job anyway. Keeping this software alive..


or Sign Up to reply!