<?php

$button = [
    "type"      => "button",
    "name"      => "sp_syncmailingtemplates",
    "label"     => "LBL_SP_SYNCMAILINGTEMPLATES",
    "css_class" => "btn-primary",
    "events"    => [
        "click" => "button:sp_syncmailingtemplates:click"
    ]
];

array_unshift($viewdefs["SP_MailingTemplates"]["base"]["view"]["list-headerpane"]["buttons"], $button);
array_splice($viewdefs["SP_MailingTemplates"]["base"]["view"]["list-headerpane"]["buttons"], 1, 1);
