function page_manager_theme

Implements hook_theme()

File

page_manager/page_manager.module, line 246

Code

function page_manager_theme() {
    // For some reason, some things can activate modules without satisfying
    // dependencies. I don't know how, but this helps prevent things from
    // whitescreening when this happens.
    if (!module_exists('ctools')) {
        return;
    }
    $base = array(
        'path' => drupal_get_path('module', 'page_manager') . '/theme',
        'file' => 'page_manager.theme.inc',
    );
    $items = array(
        'page_manager_handler_rearrange' => array(
            'render element' => 'form',
        ) + $base,
        'page_manager_edit_page' => array(
            'template' => 'page-manager-edit-page',
            'variables' => array(
                'page' => NULL,
                'save' => NULL,
                'operations' => array(),
                'content' => array(),
            ),
        ) + $base,
        'page_manager_lock' => array(
            'variables' => array(
                'page' => array(),
            ),
        ) + $base,
        'page_manager_changed' => array(
            'variables' => array(
                'text' => NULL,
                'description' => NULL,
            ),
        ) + $base,
    );
    // Allow task plugins to have theme registrations by passing through:
    $tasks = page_manager_get_tasks();
    // Provide menu items for each task.
    foreach ($tasks as $task_id => $task) {
        if ($function = ctools_plugin_get_function($task, 'hook theme')) {
            $function($items, $task);
        }
    }
    return $items;
}