Beispiel #1
0
$AdminUI->breadcrumbpath_add(T_('Emails'), $admin_url . '?ctrl=campaigns');
$AdminUI->breadcrumbpath_add(T_('Campaigns'), $admin_url . '?ctrl=campaigns');
// Set an url for manual page:
switch ($action) {
    case 'new':
    case 'edit':
        $AdminUI->set_page_manual_link('creating-an-email-campaign');
        break;
    default:
        $AdminUI->set_page_manual_link('email-campaigns');
        break;
}
if ($action == 'edit') {
    // Build special tabs in edit mode of the campaign
    $AdminUI->set_path('email', 'campaigns', $tab);
    $campaign_edit_modes = get_campaign_edit_modes($ecmp_ID);
    $AdminUI->add_menu_entries(array('email', 'campaigns'), $campaign_edit_modes);
    $AdminUI->breadcrumbpath_add(T_('Edit campaign'), $admin_url . '?ctrl=campaigns&action=edit&ecmp_ID=' . $ecmp_ID);
    if (!empty($campaign_edit_modes[$tab])) {
        $AdminUI->breadcrumbpath_add($campaign_edit_modes[$tab]['text'], $campaign_edit_modes[$tab]['href']);
    }
} else {
    // List of campaigns
    $AdminUI->set_path('email', 'campaigns');
}
// Display <html><head>...</head> section! (Note: should be done early if actions do not redirect)
$AdminUI->disp_html_head();
// Display title, menu, messages, etc. (Note: messages MUST be displayed AFTER the actions)
$AdminUI->disp_body_top();
// Begin payload block:
$AdminUI->disp_payload_begin();
/**
 * Get URL for current/next tab of edit campaign view
 *
 * @param string Current tab: 'info', 'html', 'text', 'send'
 * @param integer Campaign ID
 * @param string Type of tab: 'current', 'next'
 * @param string Glue
 * @return string URL
 */
function get_campaign_tab_url($current_tab, $campaign_ID, $type = 'current', $glue = '&')
{
    $modes = get_campaign_edit_modes($campaign_ID, $glue);
    switch ($type) {
        case 'current':
            // Get URL of current tab
            if (!empty($modes[$current_tab])) {
                return $modes[$current_tab]['href'];
            }
            break;
        case 'next':
        default:
            // Get URL of next tab
            $this_tab = false;
            foreach ($modes as $tab_name => $tab_info) {
                if ($this_tab) {
                    // We find URL for next tab
                    return $tab_info['href'];
                }
                if ($tab_name == $current_tab) {
                    // The next tab will be what we find
                    $this_tab = true;
                }
            }
            break;
    }
    return '';
}