Index: branches/5.0.x/core/kernel/nparser/nparser.php =================================================================== diff -u -r12277 -r12298 --- branches/5.0.x/core/kernel/nparser/nparser.php (.../nparser.php) (revision 12277) +++ branches/5.0.x/core/kernel/nparser/nparser.php (.../nparser.php) (revision 12298) @@ -1,6 +1,6 @@ CONTENT_OF_DESIGN: ' . $prepend; + if (EDITING_MODE == EDITING_MODE_DESIGN) { + $decorate = true; - if (EDITING_MODE == EDITING_MODE_INSIDES) { - $decorate = true; + if ($is_template) { + // content inside pair RenderElement tag } - } - else { - if (strpos($block_params['name'], '__capture_') === 0) { - // capture tag (usually inside pair RenderElement) -// $prepend = 'CAPTURE: ' . $prepend; - - if (EDITING_MODE == EDITING_MODE_INSIDES) { - $decorate = true; - } - } - elseif (array_key_exists('content', $block_params)) { - // pair RenderElement (on template, were it's used) -// $prepend = 'PAIR_RENDER_ELEMENT: ' . $prepend; - - if (EDITING_MODE == EDITING_MODE_DESIGN) { - $decorate = true; - } - } else { - // non-pair RenderElement -// $prepend = 'SINGLE_RENDER_ELEMENT: ' . $prepend; - - if (EDITING_MODE == EDITING_MODE_INSIDES) { - $decorate = true; + if (strpos($block_params['name'], '__capture_') === 0) { + // capture tag (usually inside pair RenderElement) } - - if (array_key_exists('layout_view', $block_params) && $block_params['layout_view'] && (EDITING_MODE == EDITING_MODE_LAYOUT)) { - $decorate = true; + elseif (array_key_exists('content', $block_params)) { + // pair RenderElement (on template, were it's used) + $design = true; } } } @@ -584,6 +563,14 @@ $block_name = $block_params['name']; $function_name = $is_template ? $block_name : $this->Elements[$block_name]; + $block_title = ''; + if (array_key_exists($function_name, $this->Application->Parser->ElementLocations)) { + $element_location = $this->Application->Parser->ElementLocations[$function_name]; + + $block_title .= $element_location['template'] . '.tpl'; + $block_title .= ' (' . $element_location['start_pos'] . ' - ' . $element_location['end_pos'] . ')'; + } + // ensure unique id for every div (used from print lists) $container_num = 1; $container_id = 'parser_block[' . $function_name . ']'; @@ -597,14 +584,24 @@ // prepare parameter string $param_string = $block_name . ':' . $function_name; + if ($design) { + $btn_text = 'Edit design'; + $btn_class = 'cms-edit-design-btn'; + $btn_container_class = 'block-edit-design-btn-container'; + } + else { + $btn_text = 'Edit block'; + $btn_class = 'cms-edit-block-btn'; + $btn_container_class = 'block-edit-block-btn-container'; + } $block_editor = ' -
-
+
+
-
Edit
+
' . $btn_text . '
%s