Multiple updates in the back-end widgets and styles

This commit is contained in:
alekseybobkov 2014-10-16 20:47:23 -07:00
parent 0b8af1f505
commit 12175b29db
13 changed files with 321 additions and 27 deletions

View File

@ -12894,6 +12894,99 @@ div.popover-overlay {
-o-transform: scale(1, 1);
transform: scale(1, 1);
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs {
background: #f9f9f9;
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li {
margin-left: -19px;
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li:first-child,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li:first-child {
margin-left: 0;
padding-left: 8px;
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a {
padding: 8px 16px 0 16px;
font-weight: 400;
color: #2b3e50;
opacity: 0.6;
filter: alpha(opacity=60);
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title {
position: relative;
display: inline-block;
padding: 4px 5px 9px 5px;
font-size: 13px;
z-index: 100;
height: 25px!important;
background-color: transparent;
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title:before,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title:before,
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title:after,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title:after {
content: ' ';
position: absolute;
background: transparent url(../images/secondary-tab-shape-content.svg) no-repeat left top;
width: 15px;
height: 25px;
top: 0;
z-index: 100;
display: none;
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title:before,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title:before {
left: -15px;
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title:after,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title:after {
right: -15px;
background-position: -60px 0;
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title span,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li a > span.title span {
height: 18px;
font-size: 12px;
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li.active a,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li.active a {
opacity: 1;
filter: alpha(opacity=100);
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li.active a > span.title,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li.active a > span.title {
background-color: white;
}
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li.active a > span.title:before,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li.active a > span.title:before,
.fancy-layout .control-tabs.secondary.content-tabs > div > ul.nav-tabs > li.active a > span.title:after,
.fancy-layout.control-tabs.secondary.content-tabs > div > ul.nav-tabs > li.active a > span.title:after {
display: block;
}
.fancy-layout .control-tabs.secondary.content-tabs .tab-collapse-icon.primary,
.fancy-layout.control-tabs.secondary.content-tabs .tab-collapse-icon.primary {
color: #808c8d;
}
.fancy-layout .control-tabs.secondary.content-tabs.primary-collapsed .tab-collapse-icon.primary,
.fancy-layout.control-tabs.secondary.content-tabs.primary-collapsed .tab-collapse-icon.primary {
color: white;
}
.fancy-layout .control-tabs.secondary.content-tabs.primary-collapsed > div > ul.nav-tabs,
.fancy-layout.control-tabs.secondary.content-tabs.primary-collapsed > div > ul.nav-tabs {
background: #e67e22;
}
.fancy-layout .control-tabs.secondary.content-tabs.primary-collapsed > div > ul.nav-tabs > li a,
.fancy-layout.control-tabs.secondary.content-tabs.primary-collapsed > div > ul.nav-tabs > li a {
color: white;
}
.fancy-layout .control-tabs.secondary.content-tabs.primary-collapsed > div > ul.nav-tabs > li.active a,
.fancy-layout.control-tabs.secondary.content-tabs.primary-collapsed > div > ul.nav-tabs > li.active a {
color: #2b3e50;
}
.fancy-layout .control-tabs.primary > div > ul.nav-tabs,
.fancy-layout.control-tabs.primary > div > ul.nav-tabs {
background: #7f8c8d;
@ -13167,6 +13260,12 @@ div.popover-overlay {
border-top-right-radius: 0;
border-top-left-radius: 0;
}
.fancy-layout .content-tabs .field-richeditor .redactor-box .redactor-toolbar {
margin: 20px 20px 0 20px!important;
-webkit-border-radius: 3px !important;
-moz-border-radius: 3px !important;
border-radius: 3px !important;
}
body.side-panel-not-fixed .fancy-layout .field-richeditor {
border-left: none;
}

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]>
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
x="0px" y="0px" width="77px" height="25px" viewBox="0 -0.167 77 25" enable-background="new 0 -0.167 77 25"
xml:space="preserve">
<defs>
</defs>
<path fill="#FFFFFF" d="M60,25h15c-5.037,0-5-25-15-25V25z"/>
<g>
<path fill="#FFFFFF" d="M15,25H0C5.037,25,5,0,15,0V25z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 704 B

View File

@ -150,6 +150,8 @@
return false
}))
pane.data('tab', li)
this.$el.trigger('initTab.oc.tab', [{'pane': pane, 'tab': li}])
}

View File

@ -214,6 +214,98 @@
.scaleAxes(1, 1);
}
}
&.content-tabs {
> div > ul.nav-tabs {
background: @color-body-bg;
> li {
margin-left: -19px;
&:first-child {
margin-left: 0;
padding-left: 8px;
}
a {
padding: 8px 16px 0 16px;
font-weight: 400;
color: #2b3e50;
.opacity(0.6);
> span.title {
position: relative;
display: inline-block;
padding: 4px 5px 9px 5px;
font-size: 13px;
z-index: 100;
height: 25px!important;
background-color: transparent;
&:before, &:after {
content: ' ';
position: absolute;
background: transparent url(../images/secondary-tab-shape-content.svg) no-repeat left top;
width: 15px;
height: 25px;
top: 0;
z-index: 100;
display: none;
}
&:before {
left: -15px;
}
&:after {
right: -15px;
background-position: -60px 0;
}
span {
height: 18px;
font-size: 12px;
}
}
}
&.active a {
.opacity(1);
> span.title {
background-color: white;
&:before, &:after {
display: block;
}
}
}
}
}
.tab-collapse-icon.primary {
color: #808c8d;
}
&.primary-collapsed {
.tab-collapse-icon.primary {
color: white;
}
> div > ul.nav-tabs {
background: @color-fancy-form-tabless-fields-bg;
> li {
a {
color: white;
}
&.active a {
color: #2b3e50;
}
}
}
}
}
}
&.primary {
@ -459,6 +551,13 @@
.border-top-radius(0);
}
}
.content-tabs .field-richeditor {
.redactor-box .redactor-toolbar {
margin: 20px 20px 0 20px!important;
.border-radius(3px)!important;
}
}
}
body.side-panel-not-fixed {

View File

@ -88,7 +88,7 @@ class CodeEditor extends FormWidgetBase
}
/**
* Prepares the list data
* Prepares the widget data
*/
public function prepareVars()
{

View File

@ -1303,12 +1303,12 @@ body .redactor-box-fullscreen {
}
.redactor-toolbar,
.redactor-dropdown {
z-index: 1350 !important;
z-index: 410 !important;
}
#redactor-modal-overlay,
#redactor-modal-box,
#redactor-modal {
z-index: 1351 !important;
z-index: 420 !important;
}
.redactor-toolbar {
background: #dddddd;

View File

@ -99,7 +99,7 @@
return
if (this.$el.hasClass('stretch')) {
var height = $toolbar.height()
var height = $toolbar.outerHeight(true)
$editor.css('top', height+1)
$codeEditor.css('top', height)
}

View File

@ -51,12 +51,12 @@
}
.redactor-toolbar,
.redactor-dropdown {
z-index: @richeditor-zindex + 1050 !important;
z-index: @richeditor-zindex + 110 !important;
}
#redactor-modal-overlay,
#redactor-modal-box,
#redactor-modal {
z-index: @richeditor-zindex + 1051 !important;
z-index: @richeditor-zindex + 120 !important;
}
.redactor-toolbar {

View File

@ -60,6 +60,8 @@ class CmsCompoundObject extends CmsObject
protected $viewBagCache = false;
protected $originalData = [];
protected static $objectComponentPropertyMap = null;
/**
@ -82,6 +84,10 @@ class CmsCompoundObject extends CmsObject
$obj->code = $parsedData['code'];
$obj->markup = $parsedData['markup'];
$obj->originalData['settings'] = $obj->settings;
$obj->originalData['code'] = $obj->code;
$obj->originalData['markup'] = $obj->markup;
$obj->parseComponentSettings();
$obj->parseSettings();
@ -207,11 +213,14 @@ class CmsCompoundObject extends CmsObject
$content[] = FileHelper::formatIniString($this->settings);
if ($this->code) {
$code = preg_replace('/^\<\?php/', '', $this->code);
$code = preg_replace('/^\<\?/', '', $code);
$code = preg_replace('/\?>$/', '', $code);
if ($this->wrapCodeToPhpTags() && $this->originalData['code'] != $this->code) {
$code = preg_replace('/^\<\?php/', '', $this->code);
$code = preg_replace('/^\<\?/', '', $code);
$code = preg_replace('/\?>$/', '', $code);
$content[] = '<?php'.PHP_EOL.$this->code.PHP_EOL.'?>';
$content[] = '<?php'.PHP_EOL.$this->code.PHP_EOL.'?>';
} else
$content[] = $this->code;
}
$content[] = $this->markup;
@ -358,16 +367,18 @@ class CmsCompoundObject extends CmsObject
* This method is used by the system internally and shouldn't
* participate in the front-end request processing.
* @link http://twig.sensiolabs.org/doc/internals.html Twig internals
* @param mixed $markup Specifies the markup content.
* Use FALSE to load the content from the markup section.
* @return Twig_Node_Module A node tree
*/
public function getTwigNodeTree()
public function getTwigNodeTree($markup = false)
{
$loader = new TwigLoader();
$twig = new Twig_Environment($loader, []);
$twig->addExtension(new CmsTwigExtension());
$twig->addExtension(new SystemTwigExtension);
$stream = $twig->tokenize($this->markup, 'getTwigNodeTree');
$stream = $twig->tokenize($markup === false ? $this->markup : $markup, 'getTwigNodeTree');
return $twig->parse($stream);
}
@ -417,4 +428,13 @@ class CmsCompoundObject extends CmsObject
throw new ValidationException($validation);
}
}
/**
* Determines if the content of the code section should be wrapped to PHP tags.
* @return boolean
*/
protected function wrapCodeToPhpTags()
{
return true;
}
}

View File

@ -250,11 +250,17 @@ class Controller extends BaseController
/*
* Render the page
*/
CmsException::mask($this->page, 400);
$this->loader->setObject($this->page);
$template = $this->twig->loadTemplate($this->page->getFullPath());
$this->pageContents = $template->render($this->vars);
CmsException::unmask();
Event::fire('cms.page.beforeTwigRender', [$page, $this->loader, $this->twig], true);
$apiResult = Event::fire('cms.page.getRenderedContents', [$this->page], true);
if (!strlen($apiResult)) {
CmsException::mask($this->page, 400);
$this->loader->setObject($this->page);
$template = $this->twig->loadTemplate($this->page->getFullPath());
$this->pageContents = $template->render($this->vars);
CmsException::unmask();
} else
$this->pageContents = $apiResult;
/*
* Render the layout

View File

@ -13,6 +13,11 @@ use Lang;
*/
class Page extends CmsCompoundObject
{
/**
* @var array The API bag allows the API handler code to bind arbitrary data to the page object.
*/
public $apiBag = [];
protected $settingsValidationRules = [
'title' => 'required',
'url' => ['required', 'regex:/^\/[a-z0-9\/\:_\-\*\[\]\+\?\|\.]*$/i']

View File

@ -12,13 +12,16 @@ use Twig_NodeInterface;
*/
class PlaceholderNode extends Twig_Node
{
public function __construct($name, $body, $lineno, $tag = 'placeholder')
public function __construct($name, $paramValues, $body, $lineno, $tag = 'placeholder')
{
$nodes = [];
if ($body)
$nodes['default'] = $body;
$attributes = $paramValues;
$attributes['name'] = $name;
parent::__construct($nodes, ['name'=>$name], $lineno, $tag);
parent::__construct($nodes, $attributes, $lineno, $tag);
}
/**
@ -46,14 +49,26 @@ class PlaceholderNode extends Twig_Node
->raw("] = ob_get_clean();");
}
$isText = $this->hasAttribute('type') && $this->getAttribute('type') == 'text';
$compiler->addDebugInfo($this);
if (!$isText)
$compiler->write("echo \$this->env->getExtension('CMS')->displayBlock(");
else
$compiler->write("echo twig_escape_filter(\$this->env, \$this->env->getExtension('CMS')->displayBlock(");
$compiler
->addDebugInfo($this)
->write("echo \$this->env->getExtension('CMS')->displayBlock(")
->raw("'".$this->getAttribute('name')."', ")
->raw("\$context[")
->raw("'".$varId."'")
->raw("]")
->raw(");\n")
->raw(")");
if (!$isText)
$compiler->raw(";\n");
else
$compiler->raw(");\n");
;
$compiler

View File

@ -1,7 +1,9 @@
<?php namespace Cms\Twig;
use Twig_Node;
use Twig_Token;
use Twig_TokenParser;
use Twig_Error_Syntax;
/**
* Parser for the {% placeholder %} Twig tag.
@ -33,17 +35,18 @@ class PlaceholderTokenParser extends Twig_TokenParser
$stream = $this->parser->getStream();
$name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
$body = null;
$params = [];
if ($stream->test(Twig_Token::NAME_TYPE, 'default')) {
$stream->next();
$stream->expect(Twig_Token::BLOCK_END_TYPE);
$params = $this->loadParams($stream);
$body = $this->parser->subparse([$this, 'decidePlaceholderEnd'], true);
$stream->expect(Twig_Token::BLOCK_END_TYPE);
} else {
$stream->expect(Twig_Token::BLOCK_END_TYPE);
}
} else
$params = $this->loadParams($stream);
return new PlaceholderNode($name, $body, $token->getLine(), $this->getTag());
return new PlaceholderNode($name, $params, $body, $token->getLine(), $this->getTag());
}
public function decidePlaceholderEnd(Twig_Token $token)
@ -51,6 +54,35 @@ class PlaceholderTokenParser extends Twig_TokenParser
return $token->test('endplaceholder');
}
protected function loadParams($stream)
{
$params = [];
$end = false;
while (!$end) {
$current = $stream->next();
switch ($current->getType()) {
case Twig_Token::NAME_TYPE:
$paramName = $current->getValue();
$stream->expect(Twig_Token::OPERATOR_TYPE, '=');
$current = $stream->next();
$params[$paramName] = $current->getValue();
break;
case Twig_Token::BLOCK_END_TYPE:
$end = true;
break;
default:
throw new Twig_Error_Syntax(sprintf('Invalid syntax in the placeholder tag. Line %s', $lineno), $stream->getCurrent()->getLine(), $stream->getFilename());
break;
}
}
return $params;
}
/**
* Gets the tag name associated with this token parser.
*