Loading


Advertisement:

Author Topic: How to add action in admin Manage listings drop down menu?  (Read 395 times)

Syed

  • Jr. Member
  • **
  • Posts: 87
How to add action in admin Manage listings drop down menu?
« on: January 12, 2017, 09:51:44 am »

Is there any  filter like more_actions_manage_items to add action in admin Manage listings drop down menu?

Regards,


Liath

  • Sr. Member
  • ****
  • Posts: 435
  • #Kurt_Cobain { margin-bottom: -6.5ft; }
Re: How to add action in admin Manage listings drop down menu?
« Reply #1 on: January 12, 2017, 06:40:31 pm »
there are only actions_manage_items and more_actions_manage_items  to modify the menu on items page


actions_manage_items adds actions to the visible menu
more_actions_manage_items  adds actions to the hidden menu, visible when you click on "Show more"

Syed

  • Jr. Member
  • **
  • Posts: 87
Re: How to add action in admin Manage listings drop down menu?
« Reply #2 on: January 12, 2017, 07:01:13 pm »

Is there any way to apply same action on more then one item at a time in admin manage listings?

Regards,

Liath

  • Sr. Member
  • ****
  • Posts: 435
  • #Kurt_Cobain { margin-bottom: -6.5ft; }
Re: How to add action in admin Manage listings drop down menu?
« Reply #3 on: January 12, 2017, 08:05:08 pm »
when you use this hooks
Code: [Select]
osc_add_hook('actions_manage_items', 'your_function');
Code: [Select]
osc_add_hook('more_actions_manage_items ', 'your_function');

all items are affected
Code: [Select]
//here you can place your function
function your_function($options, $item) {
    //$options contains all other actions used in this hook, it is important to add this also to your function
    //$item contains information about the affected item

    $return = $options;

    //example to see how it works
    if ($item['b_enabled'] == '1') {       
        $return[] = '<a href="your link here">Disable Item</a>';
    }
    return $return;
}


personal note:
i've learned alot, while looking in another plugins, how they do some things, study the Docs and try and error... most things you can find by yourself, if you take a look into the code ;)
« Last Edit: January 12, 2017, 08:19:54 pm by Liath »

Syed

  • Jr. Member
  • **
  • Posts: 87
Re: How to add action in admin Manage listings drop down menu?
« Reply #4 on: January 13, 2017, 07:46:07 am »
Thank you Laith for reply and personal note,

I do the same what you suggested me in personal note, but when I can not find solution to my question in Docs, Forum and studding other developers code, I ask from seniors here on this forum, and they help me.

Currently I am talking about this drop down menu, please see the attached image.


Syed

  • Jr. Member
  • **
  • Posts: 87
Re: How to add action in admin Manage listings drop down menu?
« Reply #5 on: February 11, 2017, 07:56:53 am »


I am still waiting for solution to my question.

Regards

teseo

  • Hero Member
  • *****
  • Posts: 5598
Re: How to add action in admin Manage listings drop down menu?
« Reply #6 on: February 11, 2017, 01:18:20 pm »
Hi,

There's a filter in oc-admin/items.php:

Code: [Select]
$bulk_options = osc_apply_filter("item_bulk_filter", $bulk_options);
Above that line you can see the standard array of bulk options.

Regards

Sergio Morais

  • Jr. Member
  • **
  • Posts: 51
Re: How to add action in admin Manage listings drop down menu?
« Reply #7 on: February 21, 2017, 10:25:15 pm »
Hi,

I am also interested in creating a "Bulk action" entry in order to republish multiple listings at once.

Does anybody have the code to enable such a feature and how could one implement this?

Thank you,