Index: context_ui/context_ui-list-contexts.tpl.php
===================================================================
RCS file: context_ui/context_ui-list-contexts.tpl.php
diff -N context_ui/context_ui-list-contexts.tpl.php
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ context_ui/context_ui-list-contexts.tpl.php 30 May 2009 22:25:45 -0000
@@ -0,0 +1,53 @@
+
+
+
namespace ?> > attribute ?>
+ namespace-$context->attribute"] = TRUE; ?>
+
+
+
+
+
+ |
+
+ @type context: @context', array('@type' => $context->type, '@context' => $context->name)); ?>
+ tag)): ?>
+ (tag; ?>)
+
+ |
+ ops ?> |
+
+
+
+ conditions): ?>
+ $context->conditions)); ?>
+
+ reactions): ?>
+ $context->reactions)); ?>
+
+
+ |
+
+ description; ?>
+ |
+
+
+
+
+
+
+
+
Index: context_ui/context_ui-list.css
===================================================================
RCS file: context_ui/context_ui-list.css
diff -N context_ui/context_ui-list.css
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ context_ui/context_ui-list.css 31 May 2009 00:28:55 -0000
@@ -0,0 +1,100 @@
+/* $Id$ */
+
+div.context-namespace {
+ margin-top: 1em;
+ background: #eee;
+ border: 2px solid #ddd;
+}
+
+div.context-namespace-title {
+ margin: 2px;
+ padding-left: 10px;
+ font-weight: bold;
+ background: #fff;
+ line-height: 1.8;
+ border: 1px solid #ddd;
+}
+
+table.contexts-entry {
+ margin: 3px 0;
+ border: 1px solid #ddd;
+ background-color: white;
+ color: #494949; /* matches garland */
+ clear: left; /* LTR */
+ width: 97%;
+ margin-left: 2%;
+}
+
+table.contexts-entry tbody {
+ border: none;
+}
+
+table.contexts-entry td.context-ops {
+ width: 45%;
+ text-align: right; /* LTR */
+ background-color: #eee;
+}
+
+table.contexts-entry td.context-name {
+ background-color: #eee;
+}
+
+table.contexts-entry .description {
+ vertical-align: top;
+}
+
+body form#contexts-ui-list-contexts-form {
+ margin: 0 0 1.5em 0;
+}
+
+#contexts-ui-list-contexts-form .form-item {
+ padding-right: 1em; /* LTR */
+ float: left; /* LTR */
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+#edit-order-wrapper {
+ clear: left; /* LTR */
+}
+
+#edit-contexts-apply,
+#edit-contexts-reset {
+ margin-top: 1.65em;
+ float: left; /* LTR */
+}
+
+.contexts-entry .advanced-help-link {
+ position: relative;
+ top: 2px;
+ padding-right: 3px; /* LTR */
+}
+
+table.context-disabled {
+ color: #999;
+}
+
+table.contexts-entry td {
+ line-height: 1.4;
+ padding-bottom: 10px;
+}
+table.context-disabled td {
+ line-height: 1.4;
+ padding-bottom: 10px;
+ background: none;
+}
+table.context-enabled td.context-name,
+table.context-enabled td.context-ops,
+table.context-disabled td.context-name,
+table.context-disabled td.context-ops {
+ line-height: 1.6;
+ padding-bottom: 0.3em;
+}
+table.contexts-entry td.context-name,
+table.contexts-entry td.context-ops {
+ background: #eee;
+}
+table.context-enabled td.context-name,
+table.context-enabled td.context-ops {
+ background: #E4F0F8;
+}
Index: context_ui/context_ui.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/context/context_ui/Attic/context_ui.admin.inc,v
retrieving revision 1.1.2.7.2.3
diff -u -p -r1.1.2.7.2.3 context_ui.admin.inc
--- context_ui/context_ui.admin.inc 26 May 2009 04:49:36 -0000 1.1.2.7.2.3
+++ context_ui/context_ui.admin.inc 30 May 2009 21:56:04 -0000
@@ -4,40 +4,107 @@
/**
* Page callback for context_ui admin landing page.
*/
-function context_ui_admin() {
- // Add css
- drupal_add_css(drupal_get_path("module", "context_ui") ."/context_ui.css");
-
+function context_ui_list_contexts() {
// rebuild blocks
_block_rehash();
// rebuild context cache
context_invalidate_cache();
- // user defined contexts
- $output = "". t('Please !add_context to get started.', array('!add_context' => l(t('add a context'), 'admin/build/context/add'))) ."
";
+
+ $getting_started = theme('advanced_help_topic', 'context_ui', 'getting-started', 'title');
+ if (!$getting_started) {
+ $getting_started = t('Install the advanced help module for the getting started');
}
- return $output;
+ $vars['help'] = t('Not sure what to do? Try the "!getting-started" page.', array('!getting-started' => $getting_started));
+ $vars['help_type_icon'] = theme('advanced_help_topic', 'context_ui', 'type');
+
+ drupal_add_css(drupal_get_path("module", "context_ui") ."/context_ui-list.css");
}
/**
* Recursive function that intelligently populates default values in a
* form from a provided array of data.
- *
+ *
* @param $form
* A form API element to populate with default values.
* @param $data
* A keyed array of data that matches the tree structure of the
* form API branch it should populate.
- *
+ *
* @return
* A form API element populated with default values.
*/
@@ -690,89 +757,7 @@ function theme_context_ui_bulk_export_ta
return $output;
}
-/**
- * Generates the main context_ui admin page with a tiered context listing.
- */
-function theme_context_ui_admin($contexts) {
- $rows = $headings = array();
- foreach ($contexts as $key => $context) {
- $row = array();
-
- $namespace = $context->namespace;
- $attribute = $context->attribute;
- $value = $context->value;
- if (isset($context->cid) && $context->cid) {
- $identifier = $context->cid;
- }
- else {
- $identifier = $key;
- }
-
- // If no heading has been printed for this n/a pair, do so
- if (!isset($rows["$namespace-$attribute"])) {
- $row = array(array('data' => "'. filter_xss_admin($context->description) .'
' : '';
- ksort($links);
- $rows[$key] = array(
- 'data' => array(
- array(
- 'data' => $data . $description,
- 'class' => 'context-name '. ($icon? 'icon' : 'no-icon'),
- ),
- implode(' | ', $links),
- ),
- 'class' => 'context-table-row ' . $class,
- );
- }
- return theme('table', array(t('Context'), t('Operations')), $rows, array('class' => 'context-ui-overview'));
-}
/**
* Generates the AJAX enabled block administration portion of the context_ui admin form.
Index: context_ui/context_ui.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/context/context_ui/context_ui.css,v
retrieving revision 1.6.2.7
diff -u -p -r1.6.2.7 context_ui.css
--- context_ui/context_ui.css 8 Mar 2009 04:34:10 -0000 1.6.2.7
+++ context_ui/context_ui.css 30 May 2009 21:37:28 -0000
@@ -36,48 +36,6 @@
* Context admin listing page =========================================
*/
-table.context-ui-overview a.advanced-help-link {
- position: relative;
- top: 3px;
- margin-left: 3px;
- }
-
-table.context-ui-overview span.context-namespace {
- font-weight:bold;
- }
-
-table.context-ui-overview td.context-name {
- padding-left:30px;
- }
-
-table.context-ui-overview tr.disabled td.context-name {
- color:#999;
- }
-
-table.context-ui-overview tr.context-table-row td.icon strong,
-table.context-ui-overview tr.context-table-row td.icon em,
-table.context-ui-overview tr.context-table-row td.icon span {
- display: block;
- float: left;
- padding-right: 2px;
- }
-
-table.context-ui-overview tr.context-table-row td div.description {
- margin-bottom: 0;
- }
-
-table.context-ui-overview tr.context-table-row td div.description {
- margin-bottom: 0;
- }
-
-table.context-ui-overview tr.context-table-row td.icon strong {
- padding-right: 4px;
- }
-
-table.context-ui-overview tr.context-table-row td.icon a span {
- display: none;
- }
-
h3.context-space small {
display:inline;
padding:.1em .5em; margin-left:1em;
Index: context_ui/context_ui.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/context/context_ui/context_ui.module,v
retrieving revision 1.13.2.48.2.1
diff -u -p -r1.13.2.48.2.1 context_ui.module
--- context_ui/context_ui.module 14 May 2009 03:55:26 -0000 1.13.2.48.2.1
+++ context_ui/context_ui.module 30 May 2009 21:36:31 -0000
@@ -5,30 +5,29 @@
* Implementation of hook_theme().
*/
function context_ui_theme() {
- $items['context_ui_export_form'] = array(
- 'arguments' => array('form' => array()),
- 'file' => 'context_ui.admin.inc',
- );
- $items['context_ui_item_display'] = array(
- 'arguments' => array('form' => array()),
- 'file' => 'context_ui.admin.inc',
- );
- $items['context_ui_form'] = array(
- 'arguments' => array('form' => array()),
- 'file' => 'context_ui.admin.inc',
- );
- $items['context_ui_block_ui'] = array(
- 'arguments' => array('form' => array()),
- 'file' => 'context_ui.admin.inc',
- );
- $items['context_ui_admin'] = array(
+ $path = drupal_get_path('module', 'context_ui');
+
+ // This is only required for the preprocess function.
+ require_once "./$path/context_ui.admin.inc";
+
+ // Minor code reduction technique.
+ $base = array(
'arguments' => array('form' => array()),
'file' => 'context_ui.admin.inc',
);
- $items['context_ui_bulk_export_table'] = array(
- 'arguments' => array('form' => array()),
- 'file' => 'context_ui.admin.inc',
+
+ $items['context_ui_export_form'] = $base;
+ $items['context_ui_item_display'] = $base;
+ $items['context_ui_form'] = $base;
+ $items['context_ui_block_ui'] = $base;
+ $items['context_ui_bulk_export_table'] = $base;
+
+ // list contexts (admin landing page)
+ $items['context_ui_list_contexts'] = array(
+ 'template' => 'context_ui-list-contexts',
+ 'path' => $path,
);
+
$items['context_devel'] = array(
'arguments' => array('form' => array()),
);
@@ -72,12 +71,11 @@ function context_ui_menu() {
$items['admin/build/context'] = array(
'title' => 'Context',
'description' => 'Associate menus, views, blocks, etc. with different contexts to structure your site.',
- 'page callback' => 'context_ui_admin',
+ 'page callback' => 'context_ui_list_contexts',
'type' => MENU_NORMAL_ITEM,
);
$items['admin/build/context/list'] = array(
'title' => 'List',
- 'page callback' => 'context_ui_admin',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => 0,
);
cvs diff: Diffing context_ui/help
Index: context_ui/help/context_ui.help.ini
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/context/context_ui/help/Attic/context_ui.help.ini,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 context_ui.help.ini
--- context_ui/help/context_ui.help.ini 9 Feb 2009 02:36:35 -0000 1.1.2.1
+++ context_ui/help/context_ui.help.ini 30 May 2009 21:34:48 -0000
@@ -2,5 +2,10 @@
[advanced help settings]
line break = TRUE
+[getting-started]
+title = "Getting started"
+weight = -45
+
[type]
-title = "Types"
+title = "Context types"
+
Index: context_ui/help/getting-started.html
===================================================================
RCS file: context_ui/help/getting-started.html
diff -N context_ui/help/getting-started.html
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ context_ui/help/getting-started.html 30 May 2009 21:30:44 -0000
@@ -0,0 +1,2 @@
+
+TODO: write documentation