summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Miles2009-08-05 23:45:48 (GMT)
committer Earl Miles2009-08-05 23:45:48 (GMT)
commitf76b834612373d470950d183da7c35306c7a3519 (patch)
tree6eeada5df5a3b89235af1b8eb646b4897ac80039
parentea43c32cfc8882a385a6dbc9d9d89679f42b64da (diff)
Show operations for each variant on summary.
-rw-r--r--page_manager/css/page-manager.css40
-rw-r--r--page_manager/page_manager.admin.inc50
-rw-r--r--page_manager/page_manager.module4
3 files changed, 56 insertions, 38 deletions
diff --git a/page_manager/css/page-manager.css b/page_manager/css/page-manager.css
index 8e86ab1..e71f0d5 100644
--- a/page_manager/css/page-manager.css
+++ b/page_manager/css/page-manager.css
@@ -90,7 +90,7 @@ body form#page-manager-list-pages-form {
#page-manager-edit .page-manager-edit-operations li.changed,
#page-manager-edit .page-manager-edit-operations li.changed-group .page-manager-group-title {
background-color: #ffe;
- font-weight: bold;
+ font-weight: bold;
}
/** provide a reset for non active stray paths */
@@ -129,11 +129,11 @@ body form#page-manager-list-pages-form {
text-decoration: none;
}
-#page-manager-edit .ctools-collapsible-container {
- display: inline-block;
- position: relative;
- *float: left;
- width: 100%;
+#page-manager-edit .ctools-collapsible-container {
+ display: inline-block;
+ position: relative;
+ *float: left;
+ width: 100%;
}
#page-manager-edit .page-manager-edit-operations li .ctools-collapsible-handle:hover {
@@ -152,7 +152,7 @@ body form#page-manager-list-pages-form {
#page-manager-edit .page-manager-group-title {
line-height: 2em;
- font-weight: bold;
+ font-weight: bold;
padding: 0 0 0 .5em;
}
@@ -193,7 +193,7 @@ body form#page-manager-list-pages-form {
#page-manager-edit .actions {
padding: 0 0 0 20px;
- height: 25px;
+ height: 26px;
}
#page-manager-edit .primary-actions li {
@@ -204,6 +204,10 @@ body form#page-manager-list-pages-form {
border-bottom: 1px solid #aaa;
}
+#page-manager-edit .handler-actions {
+ float: right;
+}
+
#page-manager-edit .actions .page-manager-group-title {
float: left;
padding-left: 0;
@@ -224,7 +228,7 @@ body form#page-manager-list-pages-form {
border-left: 1px solid #aaa;
margin: 0;
padding: 0;
- line-height: 200%;
+ line-height: 25px;
}
#page-manager-edit .actions li a:hover {
@@ -308,6 +312,20 @@ body form#page-manager-list-pages-form {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
background: #fafafa;
- padding: 3px;
+ padding: 0 0 0 5px;
margin-top: .5em;
-} \ No newline at end of file
+ line-height: 29px;
+ height: 30px;
+}
+
+.handler-summary .handler-title .title-label {
+ font-weight: bold;
+ font-size: 120%;
+}
+
+#page-manager-edit .handler-actions ul,
+#page-manager-edit .handler-actions li {
+ line-height: 30px;
+ height: 30px;
+}
+
diff --git a/page_manager/page_manager.admin.inc b/page_manager/page_manager.admin.inc
index a059806..788e0fd 100644
--- a/page_manager/page_manager.admin.inc
+++ b/page_manager/page_manager.admin.inc
@@ -80,11 +80,11 @@ function page_manager_list_page($js = NULL) {
$operations = '<div id="page-manager-links" class="links">' . theme('links', $pages['operations']) . '</div>';
drupal_add_css(drupal_get_path('module', 'page_manager') . '/css/page-manager.css');
-
+
if (!$js) {
return $form . $table . $operations;
}
-
+
ctools_include('ajax');
$commands = array();
$commands[] = ctools_ajax_command_replace('#page-manager-list-pages', $table);
@@ -183,7 +183,7 @@ function page_manager_get_pages($tasks, &$pages, $task_id = NULL) {
}
$row['data']['operations'] = array('data' => theme('links', $operations), 'class' => 'page-manager-page-operations');
-
+
$pages['disabled'][$task_name] = !empty($task['disabled']);
$pages['rows'][$task_name] = $row;
}
@@ -223,7 +223,7 @@ function page_manager_list_pages_form(&$form_state) {
'#options' => $all + array('0' => t('Enabled'), '1' => t('Disabled')),
'#default_value' => 'all',
);
-
+
$form['search'] = array(
'#type' => 'textfield',
'#title' => t('Search'),
@@ -455,7 +455,7 @@ function page_manager_get_operations($page, $operations = NULL) {
'children' => array(),
),
);
-
+
if (isset($page->subtask['operations'])) {
$operations += $page->subtask['operations'];
// add actions separately.
@@ -563,10 +563,10 @@ function page_manager_get_operations($page, $operations = NULL) {
foreach ($page->forms as $id) {
if (isset($plugin['add features'][$id])) {
- $result['actions']['children']['configure']['form']['order'][$id] = $plugin['add features'][$id];
+ $result['actions']['children']['configure']['form']['order'][$id] = $plugin['add features'][$id];
}
else if (isset($plugin['required forms'][$id])) {
- $result['actions']['children']['configure']['form']['order'][$id] = $plugin['required forms'][$id];
+ $result['actions']['children']['configure']['form']['order'][$id] = $plugin['required forms'][$id];
}
}
}
@@ -632,7 +632,7 @@ function page_manager_get_handler_operations(&$page) {
'title' => t('Summary'),
'description' => t('Get a summary of the information about this variant.'),
'form info' => array(
- 'no buttons' => TRUE,
+ 'no buttons' => TRUE,
),
'form' => 'page_manager_handler_summary',
);
@@ -640,7 +640,7 @@ function page_manager_get_handler_operations(&$page) {
if ($plugin && isset($plugin['operations'])) {
$operations[$id]['children'] += $plugin['operations'];
}
-
+
$actions = &$operations[$id]['children']['actions']['children'];
$actions['clone'] = array(
@@ -884,7 +884,7 @@ function _page_manager_get_operation_content($js, &$page, $active, $operation, $
if (isset($form_state['content'])) {
$return['content'] .= $form_state['content'];
}
-
+
// If the form wanted us to go somewhere else next, pass that along.
if (isset($form_state['new trail'])) {
$return['new trail'] = $form_state['new trail'];
@@ -923,7 +923,7 @@ function page_manager_edit_page_finish(&$form_state) {
$form_state['page']->handler_info[$form_state['handler_id']]['changed'] |= PAGE_MANAGER_CHANGED_CACHED;
}
- // While we make buttons go away on locked pages, it is still possible to
+ // While we make buttons go away on locked pages, it is still possible to
// have a lock a appear while you were editing, and have your changes
// disappear. This at least warns the user that this has happened.
if (!empty($page->locked)) {
@@ -960,16 +960,16 @@ function page_manager_edit_page_cancel(&$form_state) {
/**
* Render an operations array.
*
- * This renders an array of operations into a series of nested UL statements,
- * with ajax automatically on unless specified otherwise. Operations will
+ * This renders an array of operations into a series of nested UL statements,
+ * with ajax automatically on unless specified otherwise. Operations will
* automatically have the URLs generated nested.
*
- * Each operation should have a 'type', which tells the renderer how to deal
+ * Each operation should have a 'type', which tells the renderer how to deal
* with it:
* - 'operation': An AJAX link to render. This is the default and is
* assumed if a type is not specified. Other fields for the operation:
* - - 'title': The text to display. Can be an image. Must be pre-sanitized.
- * - - 'description': Text to place in the hover box over the link using the
+ * - - 'description': Text to place in the hover box over the link using the
* title attribute.
* - - 'arguments': Anything optional to put at the end of the URL.
* - - 'path': If set, overrides the default path.
@@ -979,11 +979,11 @@ function page_manager_edit_page_cancel(&$form_state) {
* - - 'ajax': If set to TRUE, ajax will be used. The default is TRUE.
* - - 'class': An optional class to specify for the link.
* - - 'form': The form to display for this operation, if using a single form.
- * - - 'forms': An array of forms that must be paired with 'order' of this
+ * - - 'forms': An array of forms that must be paired with 'order' of this
* operation uses multiple forms. See wizard tool for details.
* - - 'order': The form order to use for multiple forms. See wizard tool for
* details.
- * - - 'form info': Form info overrides for the wizard. See the wizard tool
+ * - - 'form info': Form info overrides for the wizard. See the wizard tool
* for available settings
* - 'group':
* - - 'title': The title of the link. May be HTML.
@@ -1258,7 +1258,7 @@ function page_manager_handler_add_finish(&$form_state) {
* Throw away a new handler and return to the add form
*/
function page_manager_handler_add_cancel(&$form_state) {
- $form_state['new trail'] = array('handlers', 'add');
+ $form_state['new trail'] = array('handlers', 'add');
// Remove the temporary page.
unset($page->new_handler);
@@ -1285,7 +1285,7 @@ function page_manager_handler_add_form(&$form, $form_state, $features = array())
'#description' => t('Administrative title of this variant. If you leave blank it will be automatically assigned.'),
);
}
-
+
$form['handler'] = array(
'#title' => t('Variant type'),
'#type' => 'select',
@@ -1390,7 +1390,7 @@ function page_manager_handler_rearrange(&$form, &$form_state) {
$form['handlers'][$id]['title'] = array(
'#value' => page_manager_get_handler_title($plugin, $handler, $page->task, $page->subtask_id),
);
-
+
$form['handlers'][$id]['weight'] = array(
'#type' => 'weight',
'#default_value' => $info['weight'],
@@ -1541,7 +1541,7 @@ function page_manager_handler_summary(&$form, &$form_state) {
$plugin = page_manager_get_task_handler($handler->handler);
$form['markup'] = array(
- '#value' => page_manager_get_handler_summary($plugin, $handler, $page->task, $page->subtask),
+ '#value' => page_manager_get_handler_summary($plugin, $handler, $page, FALSE),
);
}
@@ -1595,7 +1595,7 @@ function page_manager_enable_form_submit(&$form, &$form_state) {
}
$form_state['new trail'] = array('actions', 'disable');
- // We don't want to cause this to cache if it wasn't already. If it was
+ // We don't want to cause this to cache if it wasn't already. If it was
// cached, however, we want to update the enabled state.
if (empty($form_state['page']->changed)) {
$form_state['do not cache'] = TRUE;
@@ -1621,7 +1621,7 @@ function page_manager_disable_form_submit(&$form, &$form_state) {
menu_rebuild();
$form_state['new trail'] = array('actions', 'enable');
- // We don't want to cause this to cache if it wasn't already. If it was
+ // We don't want to cause this to cache if it wasn't already. If it was
// cached, however, we want to update the enabled state.
if (empty($form_state['page']->changed)) {
$form_state['do not cache'] = TRUE;
@@ -1640,7 +1640,7 @@ function page_manager_page_summary(&$form, &$form_state) {
if (isset($form_state['subtask']['admin title'])) {
$form_state['title'] = $form_state['subtask']['admin title'];
}
-
+
if (isset($form_state['subtask']['admin description'])) {
$output .= '<div class="description">' . $form_state['subtask']['admin description'] . '</div>';
}
@@ -1657,7 +1657,7 @@ function page_manager_page_summary(&$form, &$form_state) {
$plugin = page_manager_get_task_handler($handler->handler);
$output .= '<div class="handler-summary">';
- $output .= page_manager_get_handler_summary($plugin, $handler, $page->task, $page->subtask);
+ $output .= page_manager_get_handler_summary($plugin, $handler, $page);
$output .= '</div>';
}
diff --git a/page_manager/page_manager.module b/page_manager/page_manager.module
index 24ff705..e575618 100644
--- a/page_manager/page_manager.module
+++ b/page_manager/page_manager.module
@@ -783,9 +783,9 @@ function page_manager_get_handler_title($plugin, $handler, $task, $subtask_id) {
/**
* Get the admin summary (additional info) for a given handler.
*/
-function page_manager_get_handler_summary($plugin, $handler, $task, $subtask) {
+function page_manager_get_handler_summary($plugin, $handler, $page, $title = TRUE) {
if ($function = ctools_plugin_get_function($plugin, 'admin summary')) {
- return $function($handler, $task, $subtask);
+ return $function($handler, $page->task, $page->subtask, $page, $title);
}
}