Permalink
Browse files

* Revamp of content edit. I think it is starting to get there.....

* "Edit page", "Edit menu", even "edit component" links are inserted when
  you are logged in as admin.

* Complete cleanup of page/template/component parsing code, now perhaps
  someone besides me could understand it. 8-)

* File navigator only now used for pages, not for templates/components,
  retains context.

* Hooks are there for doing an entire edit session then pushing new content all
  at once. Theoreticially, you could create an entire new site, browse it
  and test it without the public seeing it, and then push one button to
  publish it all. I say theoretically because I haven't done it yet, but
  it should be there soon.

* Preview now holds true for browsing catalog.

* Now can create and edit pages that have no template wrapper.

* Closed all Bugzillas relating to it.
   -- New pages not creating properly
   -- Unable to edit in subdirectories
   -- Templates not written properly

* TODO:

	-- Allow alternate DSN for staging database tables.
	-- Document this puppy, finally.
	-- Change templates so that left-side/right-side components interchange,
	   and so that most class=content components can go vertical.
	-- Vet the new [menu][/menu] component so that left-hand side
	   menu can be directory/location sensitive.
	-- Build in the "use the index.html page in the current directory
	   as the template" functionality.
  • Loading branch information...
1 parent e6f71d7 commit 13dcf431683126dc0ab2fef865a9c5061081cb88 @perusionmike perusionmike committed Sep 13, 2002
Showing with 1,492 additions and 943 deletions.
  1. +0 −1 MANIFEST
  2. +14 −7 code/UI_Tag/auto_wizard.coretag
  3. +1 −64 code/UI_Tag/content_info.coretag
  4. +2 −2 code/UI_Tag/file_navigator.coretag
  5. +2 −1 code/UI_Tag/table_editor_tpl.coretag
  6. +2 −1 code/UserTag/component.tag
  7. +4 −1 dist/foundation/catalog.cfg
  8. +2 −2 dist/foundation/html/index.html
  9. +2 −1 dist/foundation/templates/blueyellow/regions/CATTOP_LEFTONLY_BOTTOM
  10. +4 −4 dist/foundation/templates/blueyellow/regions/CATTOP_LEFTONLY_TOP
  11. +3 −2 dist/foundation/templates/blueyellow/regions/CATTOP_LEFTRIGHT_BOTTOM
  12. +4 −4 dist/foundation/templates/blueyellow/regions/CATTOP_LEFTRIGHT_TOP
  13. +1 −0 dist/foundation/templates/blueyellow/regions/CATTOP_NOLEFT_BOTTOM
  14. +1 −1 dist/foundation/templates/blueyellow/regions/CATTOP_NOLEFT_TOP
  15. +2 −1 dist/foundation/templates/blueyellow/regions/LEFTONLY_BOTTOM
  16. +4 −4 dist/foundation/templates/blueyellow/regions/LEFTONLY_TOP
  17. +3 −2 dist/foundation/templates/blueyellow/regions/LEFTRIGHT_BOTTOM
  18. +4 −4 dist/foundation/templates/blueyellow/regions/LEFTRIGHT_TOP
  19. +1 −0 dist/foundation/templates/blueyellow/regions/NOLEFT_BOTTOM
  20. +1 −1 dist/foundation/templates/blueyellow/regions/NOLEFT_TOP
  21. +0 −2 dist/foundation/templates/components/affiliate_receptor
  22. +1 −3 dist/foundation/templates/components/best
  23. +1 −3 dist/foundation/templates/components/cart
  24. +1 −3 dist/foundation/templates/components/cart_display
  25. +1 −4 dist/foundation/templates/components/cart_tiny
  26. +1 −3 dist/foundation/templates/components/category_horizontal
  27. +5 −4 dist/foundation/templates/components/category_vert_toggle
  28. +1 −3 dist/foundation/templates/components/category_vertical
  29. +1 −3 dist/foundation/templates/components/cross
  30. +1 −3 dist/foundation/templates/components/fortune
  31. +0 −10 dist/foundation/templates/components/none
  32. +2 −4 dist/foundation/templates/components/product_flyout
  33. +2 −4 dist/foundation/templates/components/product_tree
  34. +1 −3 dist/foundation/templates/components/promo
  35. +1 −3 dist/foundation/templates/components/random
  36. +1 −3 dist/foundation/templates/components/saved_carts_list_small
  37. +1 −3 dist/foundation/templates/components/search_box_small
  38. +1 −3 dist/foundation/templates/components/search_box_small_top
  39. +1 −3 dist/foundation/templates/components/upsell
  40. +2 −2 dist/foundation/templates/fixedwidth/regions/CATTOP_LEFTONLY_BOTTOM
  41. +4 −4 dist/foundation/templates/fixedwidth/regions/CATTOP_LEFTONLY_TOP
  42. +3 −3 dist/foundation/templates/fixedwidth/regions/CATTOP_LEFTRIGHT_BOTTOM
  43. +4 −4 dist/foundation/templates/fixedwidth/regions/CATTOP_LEFTRIGHT_TOP
  44. +1 −1 dist/foundation/templates/fixedwidth/regions/CATTOP_NOLEFT_BOTTOM
  45. +1 −1 dist/foundation/templates/fixedwidth/regions/CATTOP_NOLEFT_TOP
  46. +2 −2 dist/foundation/templates/fixedwidth/regions/LEFTONLY_BOTTOM
  47. +4 −4 dist/foundation/templates/fixedwidth/regions/LEFTONLY_TOP
  48. +3 −3 dist/foundation/templates/fixedwidth/regions/LEFTRIGHT_BOTTOM
  49. +4 −4 dist/foundation/templates/fixedwidth/regions/LEFTRIGHT_TOP
  50. +1 −1 dist/foundation/templates/fixedwidth/regions/NOLEFT_BOTTOM
  51. +1 −1 dist/foundation/templates/fixedwidth/regions/NOLEFT_TOP
  52. +2 −2 dist/foundation/templates/foundation/regions/LEFTONLY_BOTTOM
  53. +4 −4 dist/foundation/templates/foundation/regions/LEFTONLY_TOP
  54. +5 −5 dist/foundation/templates/foundation/regions/LEFTRIGHT_BOTTOM
  55. +4 −4 dist/foundation/templates/foundation/regions/LEFTRIGHT_TOP
  56. +1 −1 dist/foundation/templates/foundation/regions/NOLEFT_BOTTOM
  57. +1 −1 dist/foundation/templates/foundation/regions/NOLEFT_TOP
  58. +2 −2 dist/foundation/templates/grayorange/regions/CATTOP_LEFTONLY_BOTTOM
  59. +4 −4 dist/foundation/templates/grayorange/regions/CATTOP_LEFTONLY_TOP
  60. +3 −3 dist/foundation/templates/grayorange/regions/CATTOP_LEFTRIGHT_BOTTOM
  61. +4 −4 dist/foundation/templates/grayorange/regions/CATTOP_LEFTRIGHT_TOP
  62. +1 −1 dist/foundation/templates/grayorange/regions/CATTOP_NOLEFT_BOTTOM
  63. +1 −1 dist/foundation/templates/grayorange/regions/CATTOP_NOLEFT_TOP
  64. +2 −2 dist/foundation/templates/grayorange/regions/LEFTONLY_BOTTOM
  65. +4 −4 dist/foundation/templates/grayorange/regions/LEFTONLY_TOP
  66. +3 −3 dist/foundation/templates/grayorange/regions/LEFTRIGHT_BOTTOM
  67. +4 −4 dist/foundation/templates/grayorange/regions/LEFTRIGHT_TOP
  68. +1 −1 dist/foundation/templates/grayorange/regions/NOLEFT_BOTTOM
  69. +1 −1 dist/foundation/templates/grayorange/regions/NOLEFT_TOP
  70. +2 −2 dist/foundation/templates/grayscale/regions/CATTOP_LEFTONLY_BOTTOM
  71. +4 −4 dist/foundation/templates/grayscale/regions/CATTOP_LEFTONLY_TOP
  72. +3 −3 dist/foundation/templates/grayscale/regions/CATTOP_LEFTRIGHT_BOTTOM
  73. +4 −4 dist/foundation/templates/grayscale/regions/CATTOP_LEFTRIGHT_TOP
  74. +1 −1 dist/foundation/templates/grayscale/regions/CATTOP_NOLEFT_BOTTOM
  75. +1 −1 dist/foundation/templates/grayscale/regions/CATTOP_NOLEFT_TOP
  76. +2 −2 dist/foundation/templates/grayscale/regions/LEFTONLY_BOTTOM
  77. +4 −4 dist/foundation/templates/grayscale/regions/LEFTONLY_TOP
  78. +3 −3 dist/foundation/templates/grayscale/regions/LEFTRIGHT_BOTTOM
  79. +4 −4 dist/foundation/templates/grayscale/regions/LEFTRIGHT_TOP
  80. +1 −1 dist/foundation/templates/grayscale/regions/NOLEFT_BOTTOM
  81. +1 −1 dist/foundation/templates/grayscale/regions/NOLEFT_TOP
  82. +2 −2 dist/foundation/templates/greens/regions/CATTOP_LEFTONLY_BOTTOM
  83. +4 −4 dist/foundation/templates/greens/regions/CATTOP_LEFTONLY_TOP
  84. +3 −3 dist/foundation/templates/greens/regions/CATTOP_LEFTRIGHT_BOTTOM
  85. +4 −4 dist/foundation/templates/greens/regions/CATTOP_LEFTRIGHT_TOP
  86. +1 −1 dist/foundation/templates/greens/regions/CATTOP_NOLEFT_BOTTOM
  87. +1 −1 dist/foundation/templates/greens/regions/CATTOP_NOLEFT_TOP
  88. +2 −2 dist/foundation/templates/greens/regions/LEFTONLY_BOTTOM
  89. +4 −4 dist/foundation/templates/greens/regions/LEFTONLY_TOP
  90. +3 −3 dist/foundation/templates/greens/regions/LEFTRIGHT_BOTTOM
  91. +4 −4 dist/foundation/templates/greens/regions/LEFTRIGHT_TOP
  92. +1 −1 dist/foundation/templates/greens/regions/NOLEFT_BOTTOM
  93. +1 −1 dist/foundation/templates/greens/regions/NOLEFT_TOP
  94. +1 −3 dist/foundation/templates/leftonly
  95. +2 −10 dist/foundation/templates/leftright
  96. +31 −4 dist/foundation/templates/noleft
  97. +2 −2 dist/foundation/templates/purpleyellow/regions/CATTOP_LEFTONLY_BOTTOM
  98. +4 −4 dist/foundation/templates/purpleyellow/regions/CATTOP_LEFTONLY_TOP
  99. +3 −3 dist/foundation/templates/purpleyellow/regions/CATTOP_LEFTRIGHT_BOTTOM
  100. +4 −4 dist/foundation/templates/purpleyellow/regions/CATTOP_LEFTRIGHT_TOP
  101. +1 −1 dist/foundation/templates/purpleyellow/regions/CATTOP_NOLEFT_BOTTOM
  102. +1 −1 dist/foundation/templates/purpleyellow/regions/CATTOP_NOLEFT_TOP
  103. +2 −2 dist/foundation/templates/purpleyellow/regions/LEFTONLY_BOTTOM
  104. +4 −4 dist/foundation/templates/purpleyellow/regions/LEFTONLY_TOP
  105. +3 −3 dist/foundation/templates/purpleyellow/regions/LEFTRIGHT_BOTTOM
  106. +4 −4 dist/foundation/templates/purpleyellow/regions/LEFTRIGHT_TOP
  107. +1 −1 dist/foundation/templates/purpleyellow/regions/NOLEFT_BOTTOM
  108. +1 −1 dist/foundation/templates/purpleyellow/regions/NOLEFT_TOP
  109. +960 −491 dist/lib/UI/ContentEditor.pm
  110. +21 −21 dist/lib/UI/pages/admin/content.html
  111. +6 −6 dist/lib/UI/pages/admin/content_editor.html
  112. +1 −1 dist/lib/UI/pages/admin/content_publish.html
  113. +16 −9 dist/lib/UI/pages/include/component_editor
  114. +88 −5 dist/lib/UI/pages/include/page_editor
  115. +74 −49 dist/lib/UI/pages/include/template_editor
  116. +35 −0 dist/lib/UI/ui.cfg
  117. +10 −7 lib/Vend/Util.pm
View
@@ -688,7 +688,6 @@ dist/foundation/templates/components/category_vert_toggle
dist/foundation/templates/components/category_vertical
dist/foundation/templates/components/cross
dist/foundation/templates/components/fortune
-dist/foundation/templates/components/none
dist/foundation/templates/components/product_flyout
dist/foundation/templates/components/product_tree
dist/foundation/templates/components/promo
@@ -179,14 +179,23 @@ sub {
return $Tmp->{auto_wizard} if $opt->{show} and ! $opt->{run};
+ if($opt->{compile} eq 'auto') {
+ $Session->{auto_wizard} ||= {};
+ undef $opt->{compile} if $wizname && $Session->{auto_wizard}{$wizname};
+ $opt->{show} = 1;
+ $opt->{run} = 1;
+ }
+
if($opt->{compile}) {
my $n;
$n = compile_wizard(@_)
or do {
- $Tmp->{auto_wizard} = errmsg(
- "Wizard %s failed to compile.",
- $wizname,
- );
+ ::logError(
+ $Tmp->{auto_wizard} = errmsg(
+ "Wizard %s failed to compile.",
+ $wizname,
+ )
+ );
return;
};
#Debug("compiler returned wizname=$n");
@@ -203,12 +212,10 @@ sub {
my $banner_var = $opt->{banner_scratch} || 'page_banner';
my $wiz;
- return unless $wiz = $Session->{auto_wizard};
-
$wizname ||= $CGI->{wizard_name} || 'default';
#Debug("wizname=$wizname");
- return unless $wiz = $wiz->{$wizname};
+ return unless $wiz = $Vend::Session->{auto_wizard}{$wizname};
#Debug("we have a wiz! wizname=$wizname");
my $beg = $wiz->[0];
@@ -3,69 +3,6 @@ UserTag content-info addAttr
UserTag content-info Routine <<EOR
use UI::ContentEditor;
sub {
- my ($dir, $opt) = @_;
- $opt->{dir} = $dir if $dir;
-
- my $delim = $opt->{delimiter} || ',';
- my $type;
- if( $opt->{templates} ) {
- $type = 'templates';
- }
- else {
- $type = 'components';
- }
-
- my $tpls;
- my $comps;
- my $things;
- my $labels;
- my $classes;
-
- if($Vend::caCompCache{$type}) {
- $things = $Vend::caCompCache{$type};
- $labels = $Vend::clCompCache{$type};
- $classes = $Vend::ccCompCache{$type};
- }
- else {
- my $o = { dir => $opt->{dir}, $type => 1, available => 1};
- $things = [];
- @$things = UI::ContentEditor::read_template(undef, $o);
- $Vend::caCompCache{$type} = $things;
- $labels = $Vend::clCompCache{$type} = {};
- $classes = $Vend::ccCompCache{$type} = {};
- for(@$things) {
- $Vend::clCompCache->{$_->[0]} = $_->[1];
- $Vend::ccCompCache->{$_->[0]} = $_->[2];
- }
- }
-
- if($opt->{label}) {
- return $Vend::clCompCache->{$opt->{code}};
- }
-
- if($opt->{structure}) {
- $opt->{type} = $opt->{ui_type} = 'component';
- return Vend::ContentEditor::read_template($opt->{code}, $opt);
- }
-
- if ($opt->{show_class}) {
- return $Vend::ccCompCache->{$opt->{code}};
- }
-
- ## Default is to return options
-
- my @out;
- if(my $class = $opt->{class}) {
- my $re = qr{\b(?:$class|ALL)\b};
- my @comps = grep $_->[2] =~ $re, @$things;
- $things = \@comps;
- }
-
- for(@$things) {
- $_->[1] =~ s/($delim)/'&#' . ord($1) . ';'/ge;
- push @out, join "=", $_->[0], $_->[1];
- }
- unshift @out, ($opt->{templates} ? "=No template" : "=No component");
- return join $delim, @out;
+ UI::ContentEditor::content_info(@_);
}
EOR
@@ -279,8 +279,8 @@ EOF
push @dir, [$fe, $fn, $dtmpl, $perms];
}
elsif ($opt->{edit_all} || ($opt->{edit_only} && /\.html?$/) ) {
- my $rn = '';
- ($rn = $fn) =~ s/$idir_re// if $idir_re;
+ my $rn = $curdir . "/$fn";
+ $rn =~ s{$idir_re}{} if $idir_re;
push @plain, [$fe, $fn, $ftmpl_ed, $perms, $rn];
}
else {
@@ -566,7 +566,7 @@ EOF
}
### end build of error checking
- $opt->{clear_image} = "bg.gif" if ! $opt->{clear_image};
+ $opt->{clear_image} ||= "bg.gif";
#::logDebug("table-editor opt: " . ::uneval($opt));
my $die = sub {
@@ -905,6 +905,7 @@ EOF
$opt_out{href} = $opt->{href};
$opt_out{method} = $opt->{method};
+ $opt_out{clear_image} = $opt->{clear_image};
$opt_out{tpl_sidstr} = $sidstr;
$opt_out{enctype} = $opt->{file_upload} ? ' ENCTYPE="multipart/form-data"' : '';
@@ -23,8 +23,9 @@ sub {
}
$name ||= $control->{component};
+ $name ||= $opt->{default};
- if (! $name) {
+ if (! $name or $name eq 'none') {
# Increment control_index so empty component has no side effect
$::Scratch->{control_index}++;
return;
@@ -26,7 +26,7 @@ Require module Safe::Hole
Require module SQL::Statement
Require module LWP::Simple
-Require UserTag email email_raw var loc table_editor button
+Require UserTag email email_raw var loc table_editor button component
#==========================================================================#
@@ -114,6 +114,9 @@ Variable STYLE default
endif
include templates/__STYLE__/theme.cfg
+# Provide some links for the admin to edit pages
+Autoload admin_links
+
#==========================================================================#
# Last locale specified is the default.
@@ -13,7 +13,7 @@
font-weight: bold;
}
A:link, A:active, A:visited {
- color: #CC3333;
+ color: #006699;
font-family: Helvetica;
font-size: 11px;
}
@@ -23,7 +23,7 @@
font-size: 11px;
}
.categorybar {
- background-color: #993333;
+ background-color: #006699
font-family: Helvetica;
font-size: 11px;
}
@@ -1,4 +1,4 @@
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
<center>
<p><a href="http://www.icdevgroup.org/"><img src="__THEME_IMG_DIR__poweredby.gif" border="0"></a></p>
@@ -11,5 +11,6 @@
</tr>
</table>
+__ADL_PAGE__
</body>
</html>
@@ -33,7 +33,7 @@
<tr>
<td width="100%" class="categorybar">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
</table>
</td>
</tr>
@@ -47,9 +47,9 @@
<tr>
<td width="20%" valign="top" align="left" class="menubar">
<table>
- [include file="templates/components/[control component none]" group=vertical][control]
+ [component group=vertical]
<tr><td><br></td></tr>
- [include file="templates/components/[control component none]" group=vertical][control]
+ [component group=vertical]
</table>
<!--Left Sidebar-->
<br>
@@ -72,5 +72,5 @@
<a href="[area aboutus]"><img alt="About Us" border="0" src="__THEME_IMG_DIR__about.gif"></a>
</td>
<td width="80%" valign="top" align="center" class="maincontent">
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
@@ -1,4 +1,4 @@
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
<center>
<p><a href="http://www.icdevgroup.org/"><img src="__THEME_IMG_DIR__poweredby.gif" border="0"></a></p>
@@ -12,10 +12,11 @@
<img src="__THEME_IMG_DIR__littlebar.gif" width="1" height="650">
</td>
<td width="15%" valign="top" align="right" class="maincontent">
- [include file="templates/components/[control component none]" group=vertical][control]
+ [component group=vertical]
</td>
</tr>
</table>
+__ADL_PAGE__
</body>
</html>
@@ -33,7 +33,7 @@
<tr>
<td width="100%" class="categorybar">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
</table>
</td>
</tr>
@@ -47,9 +47,9 @@
<tr>
<td width="20%" valign="top" align="left" class="menubar">
<table>
- [include file="templates/components/[control component none]" group=vertical][control]
+ [component group=vertical]
<tr><td><br></td></tr>
- [include file="templates/components/[control component none]" group=vertical][control]
+ [component group=vertical]
</table>
<!--Left Sidebar-->
<br>
@@ -72,5 +72,5 @@
<a href="[area aboutus]"><img alt="About Us" border="0" src="__THEME_IMG_DIR__about.gif"></a>
</td>
<td width="65%" valign="top" align="center" class="maincontent">
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
@@ -9,5 +9,6 @@
</tr>
</table>
+__ADL_PAGE__
</body>
</html>
@@ -61,5 +61,5 @@
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="95%" valign="top" align="center" class="maincontent">
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
@@ -1,4 +1,4 @@
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
<br><br>
<center>
@@ -14,5 +14,6 @@
</tr>
</table>
+__ADL_PAGE__
</body>
</html>
@@ -61,11 +61,11 @@
<td width="20%" valign="top" align="left" class="categorybar">
<!--Left Sidebar-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
- [include file="templates/components/[control component none]" group=vertical][control]
- [include file="templates/components/[control component none]" group=vertical][control]
- [include file="templates/components/[control component none]" group=vertical][control]
+ [component group=vertical]
+ [component group=vertical]
+ [component group=vertical]
</table>
</td>
<td width="80%" valign="top" align="center" class="maincontent">
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
@@ -1,4 +1,4 @@
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
<br><br>
<center>
@@ -15,10 +15,11 @@
<img src="__THEME_IMG_DIR__littlebar.gif" width="1" height="650">
</td>
<td width="15%" valign="top" align="right" class="maincontent">
- [include file="templates/components/[control component none]" group=vertical][control]
+ [component group=vertical]
</td>
</tr>
</table>
+__ADL_PAGE__
</body>
</html>
@@ -62,11 +62,11 @@
<td width="20%" valign="top" align="left" class="categorybar">
<!--Left Sidebar-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
- [include file="templates/components/[control component search_box_small]" group=vertical][control]
- [include file="templates/components/[control component category_vertical]" group=vertical][control]
- [include file="templates/components/[control component none]" group=vertical][control]
+ [component default=search_box_small group=vertical]
+ [component default=category_vertical group=vertical]
+ [component group=vertical]
</table>
</td>
<td width="65%" valign="top" align="center" class="maincontent">
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
@@ -12,5 +12,6 @@
</tr>
</table>
+__ADL_PAGE__
</body>
</html>
@@ -60,5 +60,5 @@
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="95%" valign="top" align="center" class="maincontent">
- [include file="templates/components/[control component none]" group=content][control]
+ [component group=content]
@@ -1,10 +1,8 @@
[comment]
-ui_component: affiliate_receptor
ui_type: component
ui_name: affiliate_receptor
ui_class: content
ui_label: Welcome affiliate program arrivals
-ui_source: templates/components/affiliate_receptor
coupon_allowed:
code: coupon_allowed
Oops, something went wrong.

0 comments on commit 13dcf43

Please sign in to comment.