Merge remote-tracking branch 'origin/3.1'

This commit is contained in:
Ingo Schommer 2013-04-11 11:42:04 +02:00
commit 0343a77d30
78 changed files with 2608 additions and 1820 deletions

View File

@ -154,7 +154,7 @@ class CMSMenu extends Object implements IteratorAggregate, i18nEntityProvider
$menuPriority = array();
$menuTitle = array();
foreach($menuItems as $key => $menuItem) {
$menuPriority[$key] = $menuItem->priority;
$menuPriority[$key] = is_numeric($menuItem->priority) ? $menuItem->priority : 0;
$menuTitle[$key] = $menuItem->title;
}
array_multisort($menuPriority, SORT_DESC, $menuTitle, SORT_ASC, $menuItems);

View File

@ -120,12 +120,27 @@ class LeftAndMain extends Controller implements PermissionProvider {
* Used mainly to work around the missing "lazy loading" functionality
* for getting css/javascript required after an ajax-call (e.g. loading the editform).
*
* YAML configuration example:
* <code>
* LeftAndMain:
* extra_requirements_javascript:
* mysite/javascript/myscript.js:
* </code>
*
* @config
* @var array
*/
private static $extra_requirements_javascript = array();
/**
* YAML configuration example:
* <code>
* LeftAndMain:
* extra_requirements_css:
* mysite/css/mystyle.css:
* media: screen
* </code>
*
* @config
* @var array See {@link extra_requirements_javascript}
*/
@ -193,7 +208,8 @@ class LeftAndMain extends Controller implements PermissionProvider {
CMSMenu::add_link(
'Help',
_t('LeftAndMain.HELP', 'Help', 'Menu title'),
$this->config()->help_link
$this->config()->help_link,
-2
);
// Allow customisation of the access check by a extension
@ -251,7 +267,7 @@ class LeftAndMain extends Controller implements PermissionProvider {
// Use theme from the site config
if(class_exists('SiteConfig') && ($config = SiteConfig::current_site_config()) && $config->Theme) {
$theme = $config->Theme;
} elseif(Config::inst()->get('SSViewer', 'theme')) {
} elseif(Config::inst()->get('SSViewer', 'theme_enabled') && Config::inst()->get('SSViewer', 'theme')) {
$theme = Config::inst()->get('SSViewer', 'theme');
} else {
$theme = false;
@ -372,9 +388,8 @@ class LeftAndMain extends Controller implements PermissionProvider {
$dummy = null;
$this->extend('init', $dummy);
// The user's theme shouldn't affect the CMS, if, for example, they have replaced
// TableListField.ss or Form.ss.
Config::inst()->update('SSViewer', 'theme', null);
// The user's theme shouldn't affect the CMS, if, for example, they have replaced TableListField.ss or Form.ss.
Config::inst()->update('SSViewer', 'theme_enabled', false);
}
public function handleRequest(SS_HTTPRequest $request, DataModel $model = null) {
@ -765,15 +780,54 @@ class LeftAndMain extends Controller implements PermissionProvider {
$link = Controller::join_links($recordController->Link("show"), $child->ID);
return LeftAndMain_TreeNode::create($child, $link, $controller->isCurrentPage($child))->forTemplate();
};
$html = $obj->getChildrenAsUL(
"",
$titleFn,
singleton('CMSPagesController'),
true,
$childrenMethod,
$numChildrenMethod,
$nodeCountThreshold
);
// Limit the amount of nodes shown for performance reasons.
// Skip the check if we're filtering the tree, since its not clear how many children will
// match the filter criteria until they're queried (and matched up with previously marked nodes).
$nodeThresholdLeaf = Config::inst()->get('Hierarchy', 'node_threshold_leaf');
if($nodeThresholdLeaf && !$filterFunction) {
$nodeCountCallback = function($parent, $numChildren) use($controller, $className, $nodeThresholdLeaf) {
if($className == 'SiteTree' && $parent->ID && $numChildren > $nodeThresholdLeaf) {
return sprintf(
'<ul><li class="readonly"><span class="item">'
. '%s (<a href="%s" class="cms-panel-link" data-pjax-target="Content">%s</a>)'
. '</span></li></ul>',
_t('LeftAndMain.TooManyPages', 'Too many pages'),
Controller::join_links(
$controller->LinkWithSearch($controller->Link()), '
?view=list&ParentID=' . $parent->ID
),
_t(
'LeftAndMain.ShowAsList',
'show as list',
'Show large amount of pages in list instead of tree view'
)
);
}
};
} else {
$nodeCountCallback = null;
}
// If the amount of pages exceeds the node thresholds set, use the callback
$html = null;
if($obj->ParentID && $nodeCountCallback) {
$html = $nodeCountCallback($obj, $obj->$numChildrenMethod());
}
// Otherwise return the actual tree (which might still filter leaf thresholds on children)
if(!$html) {
$html = $obj->getChildrenAsUL(
"",
$titleFn,
singleton('CMSPagesController'),
true,
$childrenMethod,
$numChildrenMethod,
$nodeCountThreshold,
$nodeCountCallback
);
}
// Wrap the root if needs be.
if(!$rootID) {

View File

@ -62,6 +62,8 @@ abstract class ModelAdmin extends LeftAndMain {
* @var float
*/
private static $menu_priority = -0.5;
private static $menu_icon = 'framework/admin/images/menu-icons/16x16/db.png';
private static $allowed_actions = array(
'ImportForm',

View File

@ -107,23 +107,23 @@ fieldset.switch-states .switch input.state-name { margin-left: -20px; }
.ui-state-default .btn-icon-unpublish_disabled, .ui-widget-content .btn-icon-unpublish_disabled { background-position: 0 -176px; }
.icon { text-indent: -9999px; border: none; outline: none; }
.icon.icon-24 { width: 24px; height: 24px; background: url('../images/menu-icons/24x24-sedfac01ed1.png'); }
.icon.icon-24 { width: 24px; height: 24px; background: url('../images/menu-icons/24x24-s391afdd013.png'); }
.icon.icon-24.icon-assetadmin { background-position: 0 -120px; }
.icon.icon-24.icon-cmsmain { background-position: 0 -48px; }
.icon.icon-24.icon-cmspagescontroller { background-position: 0 -192px; }
.icon.icon-24.icon-cmspagescontroller { background-position: 0 -216px; }
.icon.icon-24.icon-cmssettingscontroller { background-position: 0 0; }
.icon.icon-24.icon-securityadmin { background-position: 0 -24px; }
.icon.icon-24.icon-reportadmin { background-position: 0 -72px; }
.icon.icon-24.icon-commentadmin { background-position: 0 -168px; }
.icon.icon-24.icon-commentadmin { background-position: 0 -192px; }
.icon.icon-24.icon-help { background-position: 0 -96px; }
.icon.icon-16 { width: 16px; height: 16px; background: url('../images/menu-icons/16x16-sb173d358c2.png'); }
.icon.icon-16 { width: 16px; height: 16px; background: url('../images/menu-icons/16x16-sf5b94bb49b.png'); }
.icon.icon-16.icon-assetadmin { background-position: 0 -80px; }
.icon.icon-16.icon-cmsmain { background-position: 0 -16px; }
.icon.icon-16.icon-cmspagescontroller { background-position: 0 -112px; }
.icon.icon-16.icon-cmssettingscontroller { background-position: 0 0; }
.icon.icon-16.icon-securityadmin { background-position: 0 -48px; }
.icon.icon-16.icon-reportadmin { background-position: 0 -32px; }
.icon.icon-16.icon-commentadmin { background-position: 0 -128px; }
.icon.icon-16.icon-commentadmin { background-position: 0 -144px; }
.icon.icon-16.icon-help { background-position: 0 -64px; }
html { overflow: hidden; }

View File

@ -90,23 +90,23 @@ Used in side panels and action tabs
.ui-state-default .btn-icon-unpublish_disabled, .ui-widget-content .btn-icon-unpublish_disabled { background-position: 0 -176px; }
.icon { text-indent: -9999px; border: none; outline: none; }
.icon.icon-24 { width: 24px; height: 24px; background: url('../images/menu-icons/24x24-sedfac01ed1.png'); }
.icon.icon-24 { width: 24px; height: 24px; background: url('../images/menu-icons/24x24-s391afdd013.png'); }
.icon.icon-24.icon-assetadmin { background-position: 0 -120px; }
.icon.icon-24.icon-cmsmain { background-position: 0 -48px; }
.icon.icon-24.icon-cmspagescontroller { background-position: 0 -192px; }
.icon.icon-24.icon-cmspagescontroller { background-position: 0 -216px; }
.icon.icon-24.icon-cmssettingscontroller { background-position: 0 0; }
.icon.icon-24.icon-securityadmin { background-position: 0 -24px; }
.icon.icon-24.icon-reportadmin { background-position: 0 -72px; }
.icon.icon-24.icon-commentadmin { background-position: 0 -168px; }
.icon.icon-24.icon-commentadmin { background-position: 0 -192px; }
.icon.icon-24.icon-help { background-position: 0 -96px; }
.icon.icon-16 { width: 16px; height: 16px; background: url('../images/menu-icons/16x16-sb173d358c2.png'); }
.icon.icon-16 { width: 16px; height: 16px; background: url('../images/menu-icons/16x16-sf5b94bb49b.png'); }
.icon.icon-16.icon-assetadmin { background-position: 0 -80px; }
.icon.icon-16.icon-cmsmain { background-position: 0 -16px; }
.icon.icon-16.icon-cmspagescontroller { background-position: 0 -112px; }
.icon.icon-16.icon-cmssettingscontroller { background-position: 0 0; }
.icon.icon-16.icon-securityadmin { background-position: 0 -48px; }
.icon.icon-16.icon-reportadmin { background-position: 0 -32px; }
.icon.icon-16.icon-commentadmin { background-position: 0 -128px; }
.icon.icon-16.icon-commentadmin { background-position: 0 -144px; }
.icon.icon-16.icon-help { background-position: 0 -64px; }
/** ----------------------------- CMS Components ------------------------------ */
@ -120,7 +120,7 @@ body, html { font-size: 12px; line-height: 16px; font-family: Arial, sans-serif;
.cms h5 { font-size: 12px; }
.cms p { line-height: 16px; margin-bottom: 16px; }
.cms em { font-style: italic; }
.cms code { font-family: 'Bitstream Vera Sans Mono','Courier', monospace; }
.cms code { font-family: "Bitstream Vera Sans Mono", "Courier", monospace; }
/** This file defines CMS-specific customizations to the jQuery UI theme. Every rule should contain ONLY overwritten jQuery UI rules (with 'ui-' prefix). This file should be fairly short, as we're using our own custom jQuery UI theme already. TODO Add theme reference Use _style.scss to add more generic style information, and read the jQuery UI theming API: http://jqueryui.com/docs/Theming/API */
.ui-widget-content, .ui-widget { color: #444444; font-size: 12px; font-family: Arial, sans-serif; border: 0; }
@ -431,7 +431,7 @@ body.cms { overflow: hidden; }
.cms-content-actions, .cms-preview-controls { margin: 0; padding: 12px 12px; z-index: 0; border-top: 1px solid #cacacc; -webkit-box-shadow: 1px 0 0 #eceff1, rgba(248, 248, 248, 0.9) 0 1px 0px inset, rgba(201, 205, 206, 0.8) 0 0 1px; -moz-box-shadow: 1px 0 0 #eceff1, rgba(248, 248, 248, 0.9) 0 1px 0px inset, rgba(201, 205, 206, 0.8) 0 0 1px; box-shadow: 1px 0 0 #eceff1, rgba(248, 248, 248, 0.9) 0 1px 0px inset, rgba(201, 205, 206, 0.8) 0 0 1px; height: 28px; background-color: #eceff1; }
/** -------------------------------------------- Messages -------------------------------------------- */
.message { display: block; clear: both; margin: 8px 0; padding: 10px 12px; font-weight: normal; border: 1px #ccc solid; background: #fff; background: rgba(255, 255, 255, 0.5); text-shadow: none; -webkit-border-radius: 3px 3px 3px 3px; -moz-border-radius: 3px 3px 3px 3px; -ms-border-radius: 3px 3px 3px 3px; -o-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; }
.message { display: block; clear: both; margin: 8px 0; padding: 10px 12px; font-weight: normal; border: 1px #cccccc solid; background: #fff; background: rgba(255, 255, 255, 0.5); text-shadow: none; -webkit-border-radius: 3px 3px 3px 3px; -moz-border-radius: 3px 3px 3px 3px; -ms-border-radius: 3px 3px 3px 3px; -o-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; }
.message.notice { background-color: #f0f8fc; border-color: #93cde8; }
.message.warning { background-color: #fefbde; border-color: #e9d104; }
.message.error, .message.bad, .message.required, .message.validation { background-color: #fae8e9; border-color: #e68288; }
@ -462,7 +462,7 @@ body.cms { overflow: hidden; }
#PageType ul li { float: none; width: 100%; padding: 9px 0 9px 15px; overflow: hidden; border-bottom-width: 2px; border-bottom: 2px groove rgba(255, 255, 255, 0.8); -webkit-border-image: url(../images/textures/bg_fieldset_elements_border.png) 2 stretch stretch; border-image: url(../images/textures/bg_fieldset_elements_border.png) 2 stretch stretch; }
#PageType ul li:last-child { border-bottom: none; }
#PageType ul li:hover, #PageType ul li.selected { background-color: rgba(255, 255, 102, 0.3); }
#PageType ul li.disabled { color: #aaaaaa; }
#PageType ul li.disabled { color: #aaaaaa; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); opacity: 0.5; }
#PageType ul li.disabled:hover { background: none; }
#PageType ul li input { margin: inherit; }
#PageType ul li label { padding-left: 0; padding-bottom: 0; }
@ -515,7 +515,7 @@ body.cms { overflow: hidden; }
/** CMS Batch actions */
.cms-content-batchactions { float: left; position: relative; display: block; }
.cms-content-batchactions .view-mode-batchactions-wrapper { height: 18px; float: left; padding: 4px 6px; border: 1px solid #aaa; margin-bottom: 8px; background-color: #D9D9D9; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q5ZDlkOSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #d9d9d9)); background-image: -webkit-linear-gradient(top, #ffffff, #d9d9d9); background-image: -moz-linear-gradient(top, #ffffff, #d9d9d9); background-image: -o-linear-gradient(top, #ffffff, #d9d9d9); background-image: linear-gradient(top, #ffffff, #d9d9d9); border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.cms-content-batchactions .view-mode-batchactions-wrapper { height: 18px; float: left; padding: 4px 6px; border: 1px solid #aaaaaa; margin-bottom: 8px; background-color: #D9D9D9; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q5ZDlkOSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ffffff), color-stop(100%, #d9d9d9)); background-image: -webkit-linear-gradient(top, #ffffff, #d9d9d9); background-image: -moz-linear-gradient(top, #ffffff, #d9d9d9); background-image: -o-linear-gradient(top, #ffffff, #d9d9d9); background-image: linear-gradient(top, #ffffff, #d9d9d9); border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.cms-content-batchactions .view-mode-batchactions-wrapper input { vertical-align: middle; }
.cms-content-batchactions .view-mode-batchactions-wrapper label { vertical-align: middle; display: none; }
.cms-content-batchactions .view-mode-batchactions-wrapper fieldset, .cms-content-batchactions .view-mode-batchactions-wrapper .Actions { display: inline-block; }
@ -544,9 +544,9 @@ form.member-profile-form #FavouritePageID { margin-top: 8px; }
form.member-profile-form #CsvFile .middleColumn { background: none !important; }
form.member-profile-form .advanced h4 { margin-bottom: .5em; }
form.member-profile-form .Actions { text-align: left; border: 0; }
form.member-profile-form input.customFormat { width: 80px; border: 1px solid #ccc !important; padding: 3px; display: inline-block; margin-left: 1em; }
form.member-profile-form input.customFormat { width: 80px; border: 1px solid #cccccc !important; padding: 3px; display: inline-block; margin-left: 1em; }
form.member-profile-form .formattingHelpToggle { display: block; font-size: 11px; }
form.member-profile-form .formattingHelpText { margin: 5px 0 0 -5px; color: #333; padding: 5px 10px; background: #fff; border: 1px solid #ccc; }
form.member-profile-form .formattingHelpText { margin: 5px 0 0 -5px; color: #333; padding: 5px 10px; background: #fff; border: 1px solid #cccccc; }
form.member-profile-form .formattingHelpText ul { padding: 0; }
form.member-profile-form .formattingHelpText li { font-size: 11px; color: #333; margin-bottom: 2px; padding-bottom: 0; float: none; width: auto; }
form.member-profile-form #Groups .middleColumn { margin-left: 0; width: 100%; }
@ -556,7 +556,7 @@ form.member-profile-form #Permissions .optionset li { float: none; width: auto;
.memberdatetimeoptionset .description { font-style: normal; }
.memberdatetimeoptionset .toggle { font-size: 11px; }
.cms .cms-content { border-right: 1px solid #BBB; -webkit-border-radius: 0; -moz-border-radius: 0; -ms-border-radius: 0; -o-border-radius: 0; border-radius: 0; background: #eceff1; width: 800px; z-index: 40; }
.cms .cms-content { border-right: 1px solid #bbbbbb; -webkit-border-radius: 0; -moz-border-radius: 0; -ms-border-radius: 0; -o-border-radius: 0; border-radius: 0; background: #eceff1; width: 800px; z-index: 40; }
.cms .cms-content-fields { overflow-y: auto; overflow-x: auto; background: #e6eaed; width: 100%; }
.cms .cms-content-fields #Root_Main .confirmedpassword { border-bottom: none; box-shadow: none; }
.cms .cms-content-fields #Root_Main .customFormat { max-width: 80px; }
@ -608,7 +608,7 @@ form.member-profile-form #Permissions .optionset li { float: none; width: auto;
.cms .ui-dialog .htmleditorfield-dialog { min-width: 570px; }
.cms .ui-dialog .ss-ui-dialog.ui-dialog-content { padding-top: 0px; }
.ui-dialog { background: url("../images/textures/bg_cms_main_content.png") repeat left top #f0f3f4; border: 3px solid #000 !important; border-radius: 8px; overflow: visible; padding: 0; }
.ui-dialog { background: url("../images/textures/bg_cms_main_content.png") repeat left top #f0f3f4; border: 3px solid black !important; border-radius: 8px; overflow: visible; padding: 0; }
.ui-dialog .ui-dialog-titlebar.ui-widget-header { font-size: 14px; padding: 0; border: none; background-color: transparent; background-image: url(../images/textures/cms_content_header.png); background-repeat: repeat; -webkit-box-shadow: rgba(107, 120, 123, 0.5) 0 0 4px inset; -moz-box-shadow: rgba(107, 120, 123, 0.5) 0 0 4px inset; box-shadow: rgba(107, 120, 123, 0.5) 0 0 4px inset; }
.ui-dialog .ui-dialog-titlebar.ui-widget-header .ui-dialog-title { position: absolute; }
.ui-dialog .cms-dialog-content { background: url("../images/textures/bg_cms_main_content.png") repeat left top #f0f3f4; padding-bottom: 8px; padding-top: 0px; }
@ -623,16 +623,16 @@ body.cms-dialog { overflow: auto; background: url("../images/textures/bg_cms_mai
/** -------------------------------------------- "Insert X" forms -------------------------------------------- */
.htmleditorfield-dialog.ui-dialog-content { padding: 0; position: relative; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb .CompositeField { overflow: hidden; *zoom: 1; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb #RemoteURL { border: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; width: 55%; max-width: 512px; float: left; position: relative; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb #RemoteURL label { position: absolute; left: 8px; top: 13px; font-weight: normal; color: #888; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb #RemoteURL .middleColumn { margin-left: 0; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb #RemoteURL input.remoteurl { padding-left: 40px; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url { margin-top: 13px; padding-top: 15px; overflow: hidden; *zoom: 1; border: none; background: none; opacity: 0.8; cursor: hand; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url .btn-icon-addMedia { width: 20px; height: 20px; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url:hover, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url:active { border: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; opacity: 1; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled:hover, .htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb button.add-url.ui-state-disabled:active { opacity: 0.35; filter: Alpha(Opacity=35); }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_Fromtheweb .loading button.add-url .ui-icon { background-image: url(../images/throbber.gif); background-position: 50% 50%; background-repeat: no-repeat; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb .CompositeField { overflow: hidden; *zoom: 1; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb #RemoteURL { border: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; width: 55%; max-width: 512px; float: left; position: relative; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb #RemoteURL label { position: absolute; left: 8px; top: 13px; font-weight: normal; color: #888; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb #RemoteURL .middleColumn { margin-left: 0; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb #RemoteURL input.remoteurl { padding-left: 40px; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb button.add-url { margin-top: 13px; padding-top: 15px; overflow: hidden; *zoom: 1; border: none; background: none; opacity: 0.8; cursor: hand; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb button.add-url .btn-icon-addMedia { width: 20px; height: 20px; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb button.add-url:hover, .htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb button.add-url:active { border: none; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; opacity: 1; }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb button.add-url.ui-state-disabled, .htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb button.add-url.ui-state-disabled:hover, .htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb button.add-url.ui-state-disabled:active { opacity: 0.35; filter: Alpha(Opacity=35); }
.htmleditorfield-dialog #MediaFormInsertMediaTabs_FromWeb .loading button.add-url .ui-icon { background-image: url(../images/throbber.gif); background-position: 50% 50%; background-repeat: no-repeat; }
.htmleditorfield-dialog .cms-content-header { padding: 0; width: 100%; height: 40px; }
.htmleditorfield-dialog .cms-content-header h3 { padding: 0 8px; margin: 10px; }
.htmleditorfield-dialog .ss-insert-media, .htmleditorfield-dialog .Actions, .htmleditorfield-dialog .ss-insert-link { padding: 8px 16px; }
@ -723,7 +723,7 @@ form.import-form label.left { width: 250px; }
.cms .jstree li.disabled > a, .TreeDropdownField .treedropdownfield-panel .jstree li.disabled > a { color: #aaaaaa; }
.cms .jstree li > .jstree-icon, .TreeDropdownField .treedropdownfield-panel .jstree li > .jstree-icon { cursor: pointer; }
.cms .jstree ins, .TreeDropdownField .treedropdownfield-panel .jstree ins { display: inline-block; text-decoration: none; width: 18px; height: 18px; margin: 0 0 0 0; padding: 0; float: left; }
.cms .jstree a, .TreeDropdownField .treedropdownfield-panel .jstree a { display: inline-block; line-height: 16px; height: 16px; color: black; white-space: nowrap; text-decoration: none; padding: 1px 2px; margin: 0; border: 1px solid #fff; }
.cms .jstree a, .TreeDropdownField .treedropdownfield-panel .jstree a { display: inline-block; line-height: 16px; height: 16px; color: black; white-space: nowrap; text-decoration: none; padding: 1px 2px; margin: 0; border: 1px solid white; }
.cms .jstree a:focus, .cms .jstree a:active, .cms .jstree a:hover, .TreeDropdownField .treedropdownfield-panel .jstree a:focus, .TreeDropdownField .treedropdownfield-panel .jstree a:active, .TreeDropdownField .treedropdownfield-panel .jstree a:hover { outline: none; text-decoration: none; cursor: pointer; text-shadow: none; }
.cms .jstree a > ins, .TreeDropdownField .treedropdownfield-panel .jstree a > ins { height: 16px; width: 16px; }
.cms .jstree a > ins.jstree-checkbox, .TreeDropdownField .treedropdownfield-panel .jstree a > ins.jstree-checkbox { height: 19px; }
@ -753,10 +753,10 @@ form.import-form label.left { width: 250px; }
.cms .jstree-themeroller .jstree-no-icon, .TreeDropdownField .treedropdownfield-panel .jstree-themeroller .jstree-no-icon { display: none; }
.cms #jstree-marker, .cms .TreeDropdownField .treedropdownfield-panel #jstree-marker, .TreeDropdownField .treedropdownfield-panel .cms #jstree-marker, .cms #jstree-marker-line, .cms .TreeDropdownField .treedropdownfield-panel #jstree-marker-line, .TreeDropdownField .treedropdownfield-panel .cms #jstree-marker-line, .TreeDropdownField .treedropdownfield-panel .cms #jstree-marker, .cms .TreeDropdownField .treedropdownfield-panel #jstree-marker, .TreeDropdownField .treedropdownfield-panel #jstree-marker, .TreeDropdownField .treedropdownfield-panel .cms #jstree-marker-line, .cms .TreeDropdownField .treedropdownfield-panel #jstree-marker-line, .TreeDropdownField .treedropdownfield-panel #jstree-marker-line { padding: 0; margin: 0; overflow: hidden; position: absolute; top: -30px; background-repeat: no-repeat; display: none; }
.cms #jstree-marker, .TreeDropdownField .treedropdownfield-panel #jstree-marker { line-height: 10px; font-size: 12px; height: 12px; width: 8px; z-index: 10001; background-color: transparent; text-shadow: 1px 1px 1px white; color: black; }
.cms #jstree-marker-line, .TreeDropdownField .treedropdownfield-panel #jstree-marker-line { line-height: 0%; font-size: 1px; height: 1px; width: 100px; z-index: 10000; background-color: #456c43; cursor: pointer; border: 1px solid #eeeeee; border-left: 0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; -moz-border-radius: 1px; border-radius: 1px; -webkit-border-radius: 1px; }
.cms #jstree-marker-line, .TreeDropdownField .treedropdownfield-panel #jstree-marker-line { line-height: 0%; font-size: 1px; height: 1px; width: 100px; z-index: 10000; background-color: #456c43; cursor: pointer; border: 1px solid #eeeeee; border-left: 0; -moz-box-shadow: 0px 0px 2px #666666; -webkit-box-shadow: 0px 0px 2px #666666; box-shadow: 0px 0px 2px #666666; -moz-border-radius: 1px; border-radius: 1px; -webkit-border-radius: 1px; }
.cms #vakata-contextmenu, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu { display: block; visibility: hidden; left: 0; top: -200px; position: absolute; margin: 0; padding: 0; min-width: 180px; background: #FFF; border: 1px solid silver; z-index: 10000; *width: 180px; -webkit-box-shadow: 0 0 10px #cccccc; -moz-box-shadow: 0 0 10px #cccccc; box-shadow: 0 0 10px #cccccc; }
.cms #vakata-contextmenu::before, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu::before { content: ""; display: block; /* reduce the damage in FF3.0 */ position: absolute; top: -10px; left: 24px; width: 0; border-width: 0 6px 10px 6px; border-color: #FFF transparent; border-style: solid; z-index: 10000; }
.cms #vakata-contextmenu::after, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu::after { content: ""; display: block; /* reduce the damage in FF3.0 */ position: absolute; top: -11px; left: 23px; width: 0; border-width: 0 7px 11px 7px; border-color: #CCC transparent; border-style: solid; }
.cms #vakata-contextmenu::before, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu::before { content: ""; display: block; /* reduce the damage in FF3.0 */ position: absolute; top: -10px; left: 24px; width: 0; border-width: 0 6px 10px 6px; border-color: white transparent; border-style: solid; z-index: 10000; }
.cms #vakata-contextmenu::after, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu::after { content: ""; display: block; /* reduce the damage in FF3.0 */ position: absolute; top: -11px; left: 23px; width: 0; border-width: 0 7px 11px 7px; border-color: #cccccc transparent; border-style: solid; }
.cms #vakata-contextmenu ul, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu ul { min-width: 180px; *width: 180px; }
.cms #vakata-contextmenu ul, .cms #vakata-contextmenu li, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu ul, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li { margin: 0; padding: 0; list-style-type: none; display: block; }
.cms #vakata-contextmenu li, .TreeDropdownField .treedropdownfield-panel #vakata-contextmenu li { line-height: 20px; min-height: 23px; position: relative; padding: 0px; }
@ -784,16 +784,19 @@ form.import-form label.left { width: 250px; }
.tree-holder.jstree-apple li.Root > a .jstree-icon, .cms-tree.jstree-apple li.Root > a .jstree-icon { background-position: -56px -36px; }
.tree-holder.jstree-apple li.deletedonlive .text, .cms-tree.jstree-apple li.deletedonlive .text { text-decoration: line-through; }
.tree-holder.jstree-apple li.jstree-checked > a, .tree-holder.jstree-apple li.jstree-checked > a:link, .cms-tree.jstree-apple li.jstree-checked > a, .cms-tree.jstree-apple li.jstree-checked > a:link { background-color: #efe999; }
.tree-holder.jstree-apple li.readonly, .cms-tree.jstree-apple li.readonly { color: #aaaaaa; padding-left: 18px; }
.tree-holder.jstree-apple li.readonly a, .tree-holder.jstree-apple li.readonly a:link, .cms-tree.jstree-apple li.readonly a, .cms-tree.jstree-apple li.readonly a:link { margin: 0; padding: 0; }
.tree-holder.jstree-apple li.readonly .jstree-icon, .cms-tree.jstree-apple li.readonly .jstree-icon { display: none; }
.tree-holder.jstree-apple a, .tree-holder.jstree-apple a:link, .cms-tree.jstree-apple a, .cms-tree.jstree-apple a:link { color: #0073c1; padding: 3px 6px 3px 3px; border: none; display: inline-block; margin-right: 5px; }
.tree-holder.jstree-apple ins, .cms-tree.jstree-apple ins { background-color: transparent; background-image: url(../images/sitetree_ss_default_icons.png); }
.tree-holder.jstree-apple span.badge, .cms-tree.jstree-apple span.badge { clear: both; text-transform: uppercase; display: inline-block; padding: 0px 3px; font-size: 0.75em; line-height: 1em; margin-left: 3px; margin-right: 6px; margin-top: -1px; -webkit-border-radius: 2px 2px; -moz-border-radius: 2px / 2px; border-radius: 2px / 2px; }
.tree-holder.jstree-apple span.badge.modified, .tree-holder.jstree-apple span.badge.addedtodraft, .cms-tree.jstree-apple span.badge.modified, .cms-tree.jstree-apple span.badge.addedtodraft { color: #7E7470; border: 1px solid #C9B800; background-color: #FFF0BC; }
.tree-holder.jstree-apple span.badge.deletedonlive, .tree-holder.jstree-apple span.badge.removedfromdraft, .cms-tree.jstree-apple span.badge.deletedonlive, .cms-tree.jstree-apple span.badge.removedfromdraft { color: #636363; border: 1px solid #E49393; background-color: #F2DADB; }
.tree-holder.jstree-apple span.badge.workflow-approval, .cms-tree.jstree-apple span.badge.workflow-approval { color: #56660C; border: 1px solid #7C8816; background-color: #DAE79A; }
.tree-holder.jstree-apple span.comment-count, .cms-tree.jstree-apple span.comment-count { clear: both; position: relative; text-transform: uppercase; display: inline-block; overflow: visible; padding: 0px 3px; font-size: 0.75em; line-height: 1em; margin-left: 3px; margin-right: 6px; -webkit-border-radius: 2px 2px; -moz-border-radius: 2px / 2px; border-radius: 2px / 2px; color: #7E7470; border: 1px solid #C9B800; background-color: #FFF0BC; }
.tree-holder.jstree-apple span.badge.modified, .tree-holder.jstree-apple span.badge.addedtodraft, .cms-tree.jstree-apple span.badge.modified, .cms-tree.jstree-apple span.badge.addedtodraft { color: #7E7470; border: 1px solid #c9b800; background-color: #FFF0BC; }
.tree-holder.jstree-apple span.badge.deletedonlive, .tree-holder.jstree-apple span.badge.removedfromdraft, .cms-tree.jstree-apple span.badge.deletedonlive, .cms-tree.jstree-apple span.badge.removedfromdraft { color: #636363; border: 1px solid #e49393; background-color: #F2DADB; }
.tree-holder.jstree-apple span.badge.workflow-approval, .cms-tree.jstree-apple span.badge.workflow-approval { color: #56660C; border: 1px solid #7c8816; background-color: #DAE79A; }
.tree-holder.jstree-apple span.comment-count, .cms-tree.jstree-apple span.comment-count { clear: both; position: relative; text-transform: uppercase; display: inline-block; overflow: visible; padding: 0px 3px; font-size: 0.75em; line-height: 1em; margin-left: 3px; margin-right: 6px; -webkit-border-radius: 2px 2px; -moz-border-radius: 2px / 2px; border-radius: 2px / 2px; color: #7E7470; border: 1px solid #c9b800; background-color: #FFF0BC; }
.tree-holder.jstree-apple span.comment-count span.comment-count:before, .tree-holder.jstree-apple span.comment-count .cms-tree.jstree-apple span.comment-count:before, .cms-tree.jstree-apple .tree-holder.jstree-apple span.comment-count span.comment-count:before, .tree-holder.jstree-apple span.comment-count span.comment-count:after, .tree-holder.jstree-apple span.comment-count .cms-tree.jstree-apple span.comment-count:after, .cms-tree.jstree-apple .tree-holder.jstree-apple span.comment-count span.comment-count:after, .cms-tree.jstree-apple span.comment-count .tree-holder.jstree-apple span.comment-count:before, .tree-holder.jstree-apple .cms-tree.jstree-apple span.comment-count span.comment-count:before, .cms-tree.jstree-apple span.comment-count span.comment-count:before, .cms-tree.jstree-apple span.comment-count .tree-holder.jstree-apple span.comment-count:after, .tree-holder.jstree-apple .cms-tree.jstree-apple span.comment-count span.comment-count:after, .cms-tree.jstree-apple span.comment-count span.comment-count:after { content: ""; position: absolute; border-style: solid; /* reduce the damage in FF3.0 */ display: block; width: 0; }
.tree-holder.jstree-apple span.comment-count:before, .cms-tree.jstree-apple span.comment-count:before { bottom: -4px; /* value = - border-top-width - border-bottom-width */ left: 3px; /* controls horizontal position */ border-width: 4px 4px 0; border-color: #C9B800 transparent; }
.tree-holder.jstree-apple span.comment-count:after, .cms-tree.jstree-apple span.comment-count:after { bottom: -3px; /* value = - border-top-width - border-bottom-width */ left: 4px; /* value = (:before left) + (:before border-left) - (:after border-left) */ border-width: 3px 3px 0; border-color: #FFF0BC transparent; }
.tree-holder.jstree-apple span.comment-count:before, .cms-tree.jstree-apple span.comment-count:before { bottom: -4px; /* value = - border-top-width - border-bottom-width */ left: 3px; /* controls horizontal position */ border-width: 4px 4px 0; border-color: #c9b800 transparent; }
.tree-holder.jstree-apple span.comment-count:after, .cms-tree.jstree-apple span.comment-count:after { bottom: -3px; /* value = - border-top-width - border-bottom-width */ left: 4px; /* value = (:before left) + (:before border-left) - (:after border-left) */ border-width: 3px 3px 0; border-color: #fff0bc transparent; }
.tree-holder.jstree-apple .jstree-hovered, .cms-tree.jstree-apple .jstree-hovered { text-shadow: none; text-decoration: none; }
.tree-holder.jstree-apple .jstree-closed > ins, .cms-tree.jstree-apple .jstree-closed > ins { background-position: 0 0; }
.tree-holder.jstree-apple .jstree-open > ins, .cms-tree.jstree-apple .jstree-open > ins { background-position: -20px 0; }
@ -802,7 +805,7 @@ a .jstree-pageicon { float: left; margin-right: 4px; }
li.class-HomePage > a .jstree-pageicon { background-position: 0 -48px; }
li.class-RedirectorPage > a .jstree-pageicon { background-position: 0 -16px; }
li.class-VirtualPage > a .jstree-pageicon { background-position: 0 -32px; }
li.class-ErrorPage > a a .jstree-pageicon { background-position: 0 -112px; }
li.class-ErrorPage > a .jstree-pageicon { background-position: 0 -112px; }
.cms-tree { visibility: hidden; }
.cms-tree.multiple li > a > .jstree-icon { display: none; }
@ -895,10 +898,10 @@ li.class-ErrorPage > a a .jstree-pageicon { background-position: 0 -112px; }
.cms-content-controls .preview-selector .chzn-drop .chzn-results { width: 135px; }
.cms-content-controls .preview-selector .chzn-drop .chzn-results .result-selected { background: #eceff1; }
.cms-content-controls .preview-selector .chzn-container { width: auto !important; }
.cms-content-controls .preview-selector .chzn-container.chzn-with-rise .chzn-drop { padding: 0; border-bottom: 1px solid #aaa; margin-top: -5px; width: auto !important; }
.cms-content-controls .preview-selector .chzn-container.chzn-with-rise .chzn-drop { padding: 0; border-bottom: 1px solid #aaaaaa; margin-top: -5px; width: auto !important; }
.cms-content-controls .preview-selector .chzn-container.chzn-with-rise .chzn-drop .chzn-search { display: none; }
.cms-content-controls .preview-selector .chzn-container.chzn-with-rise .chzn-drop ul { padding: 0; margin: 0; }
.cms-content-controls .preview-selector .chzn-container.chzn-with-rise .chzn-drop ul li { font-size: 12px; line-height: 16px; padding: 7px 16px 7px 6px; color: #0073c1; border-bottom: 1px solid #DDD; background-color: #FFF; /* Description styling */ }
.cms-content-controls .preview-selector .chzn-container.chzn-with-rise .chzn-drop ul li { font-size: 12px; line-height: 16px; padding: 7px 16px 7px 6px; color: #0073c1; border-bottom: 1px solid #dddddd; background-color: #FFF; /* Description styling */ }
.cms-content-controls .preview-selector .chzn-container.chzn-with-rise .chzn-drop ul li:before { margin-right: 2px; }
.cms-content-controls .preview-selector .chzn-container.chzn-with-rise .chzn-drop ul li.description { padding-top: 5px; padding-bottom: 5px; }
.cms-content-controls .preview-selector .chzn-container.chzn-with-rise .chzn-drop ul li.description:before { margin-top: 5px; }
@ -920,7 +923,7 @@ li.class-ErrorPage > a a .jstree-pageicon { background-position: 0 -112px; }
/* Styling for the preview screen sizes */
.cms-preview { background-color: #eceff1; height: 100%; width: 100%; }
.cms-preview .cms-preview-overlay { width: 100%; height: 100%; }
.cms-preview .preview-note { color: #CDD7DC; display: block; font-size: 22px; font-weight: bold; height: 82px; margin-top: -50px; margin-left: -150px; /* half of width */ position: absolute; text-align: center; text-shadow: 0 1px 0 #fff; top: 50%; left: 50%; width: 300px; }
.cms-preview .preview-note { color: #CDD7DC; display: block; font-size: 22px; font-weight: bold; height: 82px; margin-top: -50px; margin-left: -150px; /* half of width */ position: absolute; text-align: center; text-shadow: 0 1px 0 white; top: 50%; left: 50%; width: 300px; }
.cms-preview .preview-note span { background: url('../images/sprites-64x64-s88957ee578.png') 0 0 no-repeat; display: block; height: 41px; margin: 0 auto 20px; width: 50px; }
.cms-preview .preview-scroll { height: 100%; overflow: auto; position: relative; width: 100%; }
.cms-preview .preview-scroll .preview-device-outer { height: 100%; width: 100%; }
@ -965,7 +968,7 @@ visible. Added and removed with js in TabSet.js */ /***************************
.cms .ss-ui-action-tabset.multi { /* Style the tab panels */ }
.cms .ss-ui-action-tabset.multi ul.ui-tabs-nav { -webkit-border-radius: 3px; -moz-border-radius: 3px; -ms-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; overflow: hidden; *zoom: 1; border: 1px solid #b3b3b3; float: left; overflow: visible; padding: 0; }
.cms .ss-ui-action-tabset.multi ul.ui-tabs-nav:active { outline: none; box-shadow: none; -webkit-box-shadow: none; }
.cms .ss-ui-action-tabset.multi ul.ui-tabs-nav li { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y4ZjhmOCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q5ZDlkOSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f8f8f8), color-stop(100%, #d9d9d9)); background-image: -webkit-linear-gradient(top, #f8f8f8, #d9d9d9); background-image: -moz-linear-gradient(top, #f8f8f8, #d9d9d9); background-image: -o-linear-gradient(top, #f8f8f8, #d9d9d9); background-image: linear-gradient(top, #f8f8f8, #d9d9d9); -webkit-border-radius: 0; -moz-border-radius: 0; -ms-border-radius: 0; -o-border-radius: 0; border-radius: 0; background: #eaeaea; border: none; border-right: 1px solid #eee; border-left: 1px solid #b3b3b3; margin: 0; overflow: visible; min-width: 110px; }
.cms .ss-ui-action-tabset.multi ul.ui-tabs-nav li { background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Y4ZjhmOCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iI2Q5ZDlkOSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f8f8f8), color-stop(100%, #d9d9d9)); background-image: -webkit-linear-gradient(top, #f8f8f8, #d9d9d9); background-image: -moz-linear-gradient(top, #f8f8f8, #d9d9d9); background-image: -o-linear-gradient(top, #f8f8f8, #d9d9d9); background-image: linear-gradient(top, #f8f8f8, #d9d9d9); -webkit-border-radius: 0; -moz-border-radius: 0; -ms-border-radius: 0; -o-border-radius: 0; border-radius: 0; background: #eaeaea; border: none; border-right: 1px solid #eeeeee; border-left: 1px solid #b3b3b3; margin: 0; overflow: visible; min-width: 110px; }
.cms .ss-ui-action-tabset.multi ul.ui-tabs-nav li:active { outline: none; box-shadow: none; -webkit-box-shadow: none; }
.cms .ss-ui-action-tabset.multi ul.ui-tabs-nav li.ui-state-active { -moz-border-radius-bottomleft: 0px; -webkit-border-bottom-left-radius: 0px; border-bottom-left-radius: 0px; -moz-border-radius-bottomright: 0px; -webkit-border-bottom-right-radius: 0px; border-bottom-right-radius: 0px; background: #f8f8f8; border-bottom: none !important; }
.cms .ss-ui-action-tabset.multi ul.ui-tabs-nav li.ui-state-active a { -moz-border-radius-bottomleft: 0px; -webkit-border-bottom-left-radius: 0px; border-bottom-left-radius: 0px; -moz-border-radius-bottomright: 0px; -webkit-border-bottom-right-radius: 0px; border-bottom-right-radius: 0px; }
@ -1033,7 +1036,7 @@ visible. Added and removed with js in TabSet.js */ /***************************
.cms .ss-ui-action-tabset.action-menus.ss-tabset ul.ui-tabs-nav li a:hover:after { background: url('../images/sprites-32x32-sf6890c994e.png') 0 -1163px no-repeat; }
.cms .ss-ui-action-tabset.action-menus.ss-tabset ul.ui-tabs-nav li.ui-state-active a:after { background: url('../images/sprites-32x32-sf6890c994e.png') 0 -1215px no-repeat; }
.cms .ss-ui-action-tabset.action-menus.ss-tabset ul.ui-tabs-nav li.ui-state-active a:hover:after { background: url('../images/sprites-32x32-sf6890c994e.png') 0 -1137px no-repeat; }
.cms .ss-ui-action-tabset.action-menus.ss-tabset .ui-tabs-panel { overflow: hidden; *zoom: 1; -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; border-bottom-left-radius: 0; -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0; border-bottom-right-radius: 0; /* Restyle for smaller area*/ clear: both; display: block; background-color: #eceff1; border: 1px solid #ccc; border-bottom: 1px solid #eceff1; margin: 0; margin-top: 2px; max-width: 250px; padding: 8px 0 2px; position: absolute; z-index: 1; min-width: 190px; }
.cms .ss-ui-action-tabset.action-menus.ss-tabset .ui-tabs-panel { overflow: hidden; *zoom: 1; -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; -moz-border-radius-bottomleft: 0; -webkit-border-bottom-left-radius: 0; border-bottom-left-radius: 0; -moz-border-radius-bottomright: 0; -webkit-border-bottom-right-radius: 0; border-bottom-right-radius: 0; /* Restyle for smaller area*/ clear: both; display: block; background-color: #eceff1; border: 1px solid #cccccc; border-bottom: 1px solid #eceff1; margin: 0; margin-top: 2px; max-width: 250px; padding: 8px 0 2px; position: absolute; z-index: 1; min-width: 190px; }
.cms .ss-ui-action-tabset.action-menus.ss-tabset .ui-tabs-panel h3, .cms .ss-ui-action-tabset.action-menus.ss-tabset .ui-tabs-panel h4, .cms .ss-ui-action-tabset.action-menus.ss-tabset .ui-tabs-panel h5 { font-weight: bold; line-height: 16px; }
.cms .ss-ui-action-tabset.action-menus.ss-tabset .ui-tabs-panel h3 { font-size: 13px; }
.cms .ss-ui-action-tabset.action-menus.ss-tabset .ui-tabs-panel h4 { font-size: 12px; margin: 5px 0; }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

View File

@ -1029,7 +1029,7 @@ jQuery.noConflict();
this._super();
},
onremove: function() {
this.tabs('destroy');
if (this.data('tabs')) this.tabs('destroy');
this._super();
},
redrawTabs: function() {

View File

@ -554,6 +554,9 @@ body.cms {
&.disabled {
color: $color-text-disabled;
@include opacity(0.5);
&:hover {
background: none;
}
@ -1323,7 +1326,7 @@ body.cms-dialog {
position:relative;
}
#MediaFormInsertMediaTabs_Fromtheweb{
#MediaFormInsertMediaTabs_FromWeb{
.CompositeField{
@include clearfix;
}

View File

@ -418,6 +418,19 @@
background-color: $color-cms-batchactions-menu-selected-background;
}
}
&.readonly {
color: $color-text-disabled;
padding-left: 18px;
// Don't show drag icons or required spacing
a, a:link {
margin: 0;
padding: 0;
}
.jstree-icon {
display: none;
}
}
}
a, a:link {
color: $color-text-blue-link;
@ -441,6 +454,7 @@
margin-right: 6px;
margin-top: -1px;
@include border-radius(2px, 2px);
&.modified, &.addedtodraft {
color: #7E7470;
border: 1px solid #C9B800;
@ -524,7 +538,7 @@ a .jstree-pageicon {
li.class-VirtualPage > & {
background-position: 0 -32px;
}
li.class-ErrorPage > a & {
li.class-ErrorPage > & {
background-position: 0 -112px;
}
}

View File

@ -200,6 +200,8 @@ class Director implements TemplateGlobalProvider {
public static function test($url, $postVars = null, $session = null, $httpMethod = null, $body = null,
$headers = null, $cookies = null, &$request = null) {
Config::nest();
// These are needed so that calling Director::test() doesnt muck with whoever is calling it.
// Really, it's some inappropriate coupling and should be resolved by making less use of statics
$oldStage = Versioned::current_stage();
@ -217,7 +219,6 @@ class Director implements TemplateGlobalProvider {
$existingCookies = isset($_COOKIE) ? $_COOKIE : array();
$existingServer = isset($_SERVER) ? $_SERVER : array();
$existingCookieReportErrors = Config::inst()->get('Cookie', 'report_errors');
$existingRequirementsBackend = Requirements::backend();
Config::inst()->update('Cookie', 'report_errors', false);
@ -268,12 +269,13 @@ class Director implements TemplateGlobalProvider {
$_COOKIE = $existingCookies;
$_SERVER = $existingServer;
Config::inst()->update('Cookie', 'report_errors', $existingCookieReportErrors);
Requirements::set_backend($existingRequirementsBackend);
// These are needed so that calling Director::test() doesnt muck with whoever is calling it.
// Really, it's some inappropriate coupling and should be resolved by making less use of statics
Versioned::reading_stage($oldStage);
Config::unnest();
return $result;
}
@ -331,6 +333,9 @@ class Director implements TemplateGlobalProvider {
}
}
}
// No URL rules matched, so return a 404 error.
return new SS_HTTPResponse('No URL rule was matched', 404);
}
/**
@ -693,15 +698,23 @@ class Director implements TemplateGlobalProvider {
* if(Director::isLive()) Director::forceSSL(array('/^admin/', '/^Security/'));
* </code>
*
* If you want certain parts of your site protected under a different domain, you can specify
* the domain as an argument:
* <code>
* if(Director::isLive()) Director::forceSSL(array('/^admin/', '/^Security/'), 'secure.mysite.com');
* </code>
*
* Note that the session data will be lost when moving from HTTP to HTTPS.
* It is your responsibility to ensure that this won't cause usability problems.
*
* CAUTION: This does not respect the site environment mode. You should check this
* as per the above examples using Director::isLive() or Director::isTest() for example.
*
* @param array $patterns Array of regex patterns to match URLs that should be HTTPS
* @param string $secureDomain Secure domain to redirect to. Defaults to the current domain
* @return boolean|string String of URL when unit tests running, boolean FALSE if patterns don't match request URI
*/
public static function forceSSL($patterns = null) {
public static function forceSSL($patterns = null, $secureDomain = null) {
if(!isset($_SERVER['REQUEST_URI'])) return false;
$matched = false;
@ -710,8 +723,9 @@ class Director implements TemplateGlobalProvider {
// Calling from the command-line?
if(!isset($_SERVER['REQUEST_URI'])) return;
// protect portions of the site based on the pattern
$relativeURL = self::makeRelative(Director::absoluteURL($_SERVER['REQUEST_URI']));
// protect portions of the site based on the pattern
foreach($patterns as $pattern) {
if(preg_match($pattern, $relativeURL)) {
$matched = true;
@ -727,7 +741,14 @@ class Director implements TemplateGlobalProvider {
&& !(isset($_SERVER['HTTP_X_FORWARDED_PROTOCOL'])
&& strtolower($_SERVER['HTTP_X_FORWARDED_PROTOCOL']) == 'https')) {
$destURL = str_replace('http:', 'https:', Director::absoluteURL($_SERVER['REQUEST_URI']));
// if an domain is specified, redirect to that instead of the current domain
if($secureDomain) {
$url = 'https://' . $secureDomain . $_SERVER['REQUEST_URI'];
} else {
$url = $_SERVER['REQUEST_URI'];
}
$destURL = str_replace('http:', 'https:', Director::absoluteURL($url));
// This coupling to SapphireTest is necessary to test the destination URL and to not interfere with tests
if(class_exists('SapphireTest', false) && SapphireTest::is_running_test()) {

View File

@ -180,15 +180,13 @@ class RequestHandler extends ViewableData {
$className = get_class($this);
if(!$this->hasAction($action)) {
return new SS_HTTPResponse("Action '$action' isn't available on class $className.", 404);
}
if(!$this->checkAccessAction($action) || in_array(strtolower($action), array('run', 'init'))) {
return new SS_HTTPResponse("Action '$action' isn't allowed on class $className.", 403);
}
try {
if(!$this->hasAction($action)) {
return $this->httpError(404, "Action '$action' isn't available on class $className.");
}
if(!$this->checkAccessAction($action) || in_array(strtolower($action), array('run', 'init'))) {
return $this->httpError(403, "Action '$action' isn't allowed on class $className.");
}
$result = $this->handleAction($request, $action);
}
catch (SS_HTTPResponse_Exception $e) {

View File

@ -440,18 +440,29 @@ abstract class Object {
/**
* Add an extension to a specific class.
*
* The preferred method for adding extensions is through YAML config,
* since it avoids autoloading the class, and is easier to override in
* more specific configurations.
*
* As an alternative, extensions can be added to a specific class
* directly in the {@link Object::$extensions} array.
* See {@link SiteTree::$extensions} for examples.
* Keep in mind that the extension will only be applied to new
* instances, not existing ones (including all instances created through {@link singleton()}).
*
* @see http://doc.silverstripe.org/framework/en/trunk/reference/dataextension
* @param string $class Class that should be extended - has to be a subclass of {@link Object}
* @param string $extension Subclass of {@link Extension} with optional parameters
* as a string, e.g. "Versioned" or "Translatable('Param')"
*/
public static function add_extension($extension) {
$class = get_called_class();
public static function add_extension($classOrExtension, $extension = null) {
if(func_num_args() > 1) {
$class = $classOrExtension;
} else {
$class = get_called_class();
$extension = $classOrExtension;
}
if(!preg_match('/^([^(]*)/', $extension, $matches)) {
return false;
@ -492,6 +503,7 @@ abstract class Object {
/**
* Remove an extension from a class.
*
* Keep in mind that this won't revert any datamodel additions
* of the extension at runtime, unless its used before the
* schema building kicks in (in your _config.php).
@ -509,6 +521,20 @@ abstract class Object {
$class = get_called_class();
Config::inst()->remove($class, 'extensions', Config::anything(), $extension);
// remove any instances of the extension with parameters
$config = Config::inst()->get($class, 'extensions');
if($config) {
foreach($config as $k => $v) {
// extensions with parameters will be stored in config as
// ExtensionName("Param").
if(preg_match(sprintf("/^(%s)\(/", preg_quote($extension, '/')), $v)) {
Config::inst()->remove($class, 'extensions', Config::anything(), $v);
}
}
}
Config::inst()->extraConfigSourcesChanged($class);
// unset singletons to avoid side-effects

View File

@ -6,6 +6,40 @@
* @return string Path to temp
*/
function getTempFolder($base = null) {
$parent = getTempParentFolder($base);
// The actual temp folder is a subfolder of getTempParentFolder(), named by username
$subfolder = $parent . DIRECTORY_SEPARATOR . getTempFolderUsername();
if(!@file_exists($subfolder)) {
mkdir($subfolder);
}
return $subfolder;
}
/**
* Returns as best a representation of the current username as we can glean.
*/
function getTempFolderUsername() {
$user = getenv('APACHE_RUN_USER');
if(!$user) $user = getenv('USER');
if(!$user) $user = getenv('USERNAME');
if(!$user && function_exists('posix_getuid')) {
$userDetails = posix_getpwuid(posix_getuid());
$user = $userDetails['name'];
}
if(!$user) $user = 'unknown';
$user = preg_replace('/[^A-Za-z0-9_\-]/', '', $user);
return $user;
}
/**
* Return the parent folder of the temp folder.
* The temp folder will be a subfolder of this, named by username.
* This structure prevents permission problems.
*/
function getTempParentFolder($base = null) {
if(!$base && defined('BASE_PATH')) $base = BASE_PATH;
$tempPath = '';
@ -14,6 +48,9 @@ function getTempFolder($base = null) {
// first, try finding a silverstripe-cache dir built off the base path
$tempPath = $base . '/silverstripe-cache';
if(@file_exists($tempPath)) {
if((fileperms($tempPath) & 0777) != 0777) {
@chmod($tempPath, 0777);
}
return $tempPath;
}
@ -21,7 +58,15 @@ function getTempFolder($base = null) {
$cacheFolder = '/silverstripe-cache' . str_replace(array(' ', '/', ':', '\\'), '-', $base);
$tempPath = sys_get_temp_dir() . $cacheFolder;
if(!@file_exists($tempPath)) {
$worked = @mkdir($tempPath);
$oldUMask = umask(0);
$worked = @mkdir($tempPath, 0777);
umask($oldUMask);
// if the folder already exists, correct perms
} else {
if((fileperms($tempPath) & 0777) != 0777) {
@chmod($tempPath, 0777);
}
}
// failing to use the system path, attempt to create a local silverstripe-cache dir
@ -29,7 +74,9 @@ function getTempFolder($base = null) {
$worked = true;
$tempPath = $base . '/silverstripe-cache';
if(!@file_exists($tempPath)) {
$worked = @mkdir($tempPath);
$oldUMask = umask(0);
$worked = @mkdir($tempPath, 0777);
umask($oldUMask);
}
}
@ -42,5 +89,4 @@ function getTempFolder($base = null) {
}
return $tempPath;
}
}

View File

@ -1,9 +1,9 @@
.SelectionGroup { padding: 0px; clear: both; }
.SelectionGroup li { list-style-type: none; float: left; width: 100%; clear: both; }
.SelectionGroup li input.selector { width: 20px; float: left; }
.SelectionGroup li div.field { display: none; font-size: 1em; }
.SelectionGroup li > div.selectiongroup_item { display: none; font-size: 1em; }
.SelectionGroup li input, .SelectionGroup .right .SelectionGroup li label { display: block; }
.SelectionGroup li.selected div.field { margin-left: 30px; display: block; margin-bottom: 1em; }
.SelectionGroup li.selected > div.selectiongroup_item { margin-left: 30px; display: block; margin-bottom: 1em; }
.SelectionGroup li.selected label.selector { font-weight: bold; }
.mainblock.allassets ul { padding: 0 0 0 10px; height: 100px; overflow-y: scroll; }

View File

@ -94,7 +94,6 @@ $locales = array(
'it_IT' => 'Italian (Italy)',
'ja_JP' => 'Japanese (Japan)',
'km_KH' => 'Khmer (Cambodia)',
'lc_XX' => 'LOLCAT',
'lv_LV' => 'Latvian (Latvia)',
'lt_LT' => 'Lithuanian (Lithuania)',
'ms_MY' => 'Malay (Malaysia)',
@ -1339,7 +1338,14 @@ TEXT;
<requestFiltering>
<hiddenSegments applyToWebDAV="false">
<add segment="silverstripe-cache" />
<add segment="vendor" />
<add segment="composer.json" />
<add segment="composer.lock" />
</hiddenSegments>
<fileExtensions allowUnlisted="true" >
<add fileExtension=".ss" allowed="false"/>
<add fileExtension=".yml" allowed="false"/>
</fileExtensions>
</requestFiltering>
</security>
<rewrite>

View File

@ -16,6 +16,9 @@
### Framework
* Static properties are immutable and private, you must use Config API
* Statics in custom Page classes need to be "private"
* `$default_cast` is now `Text` instead of `HTMLText`, to secure templates from XSS by default
* Shortcodes are no longer supported in template files. They continue to work in DB fields and other
HTMLText-cast fields.
* `DataList` and `ArrayList` are now immutable, they'll return cloned instances on modification
@ -427,4 +430,23 @@ you can enable those warnings and future-proof your code already.
`YearlyTask` are deprecated, please extend from `BuildTask` or `CliController`,
and invoke them in self-defined frequencies through Unix cronjobs etc.
* `i18n::$common_locales` and `i18n::$common_languages` are now accessed via the Config API, and contain associative rather than indexed arrays.
Before: `array('de_DE' => array('German', 'Deutsch'))`, after: `array('de_DE' => array('name' => 'German', 'native' => 'Deutsch'))`.
Before: `array('de_DE' => array('German', 'Deutsch'))`, after: `array('de_DE' => array('name' => 'German', 'native' => 'Deutsch'))`.
* `SSViewer::current_custom_theme()` has been replaced with the `SSViewer.theme_enabled` configuration setting.
Please use it to toggle theme behaviour rather than relying on the custom theme being set in the
(now deprecated) `SSViewer::set_theme()` call.
* Scaffolded `DateField`, `TimeField` and `DatetimeField` form field instances automatically include
formatting hints as placeholders and description text below the field itself.
If you change the date/time format of those fields, you need to adjust the hints.
To remove the hints, use `setDescription(null)` and `setAttribute('placeholder', null)`.
* Changed the way FreeStrings in `SSTemplateParser` are recognized, they will now also break on inequality operators (`<`, `>`). If you use inequality operators in free strings in comparisions like
`<% if Some<String == Some>Other>String %>...<% end_if %>`
you have to replace them with explicitly markes strings like
`<% if "Some<String" == "Some>Other>String" %>...<% end_if %>`
This change was necessary in order to support inequality operators in comparisons in templates
* Hard limit displayed pages in the CMS tree to `500`, and the number of direct children to `250`,
to avoid excessive resource usage. Configure through `Hierarchy.node_threshold_total` and `
Hierarchy.node_threshold_leaf`. Set to `0` to show tree unrestricted.

View File

@ -62,7 +62,12 @@ Paste the following content into a new file called `mysite/css/BookmarkedPages.c
.cms-bottom-bar a {color: #444444;}
Load the new CSS file into the CMS, by setting the `LeftAndMain.extra_requirements_css`
[configuration value](/topics/configuration) to 'mysite/css/BookmarkedPages.css'.
[configuration value](/topics/configuration).
:::yml
LeftAndMain:
extra_requirements_css:
mysite/css/BookmarkedPages.css:
## Create a "bookmark" flag on pages ##

View File

@ -213,7 +213,7 @@ This is how you do it:
composer require silverstripe/cms
Composer will scan all of the repositories you list, collect meta-data about the packages within them, and use them in favour of the packages listed on packagist. To switch back to using the mainline version of the package, just remove your the `repositories` section from `composer.json` and run `composer update`.
Composer will scan all of the repositories you list, collect meta-data about the packages within them, and use them in favour of the packages listed on packagist. To switch back to using the mainline version of the package, just remove the `repositories` section from `composer.json` and run `composer update`.
Now add an "upstream" remote to the original repository location so you can rebase or merge your fork as required.
@ -245,7 +245,7 @@ Open `composer.json`, and find the module's `require`. Then put `as (core versi
What this means is that when the `myproj` branch is checked out into a project, this will satisfy any dependencies that 3.0.x-dev would meet. So, if another module has `"silverstripe/framework": ">=3.0.0"` in its dependency list, it won't get a conflict.
Both the version and the alias are specified as Composer versions, not branch names. For the relationship between branch/tag names and Composer vesrions, read [the relevant Composer documentation](http://getcomposer.org/doc/02-libraries.md#specifying-the-version).
Both the version and the alias are specified as Composer versions, not branch names. For the relationship between branch/tag names and Composer versions, read [the relevant Composer documentation](http://getcomposer.org/doc/02-libraries.md#specifying-the-version).
This is not the only way to set things up in Composer. For more information on this topic, read the ["Aliases" chapter of the Composer documentation](http://getcomposer.org/doc/articles/aliases.md).
@ -303,4 +303,4 @@ You don't have to, Composer is designed to work on the constraints you set.
You can declare the ["minimum-stability"](http://getcomposer.org/doc/04-schema.md#minimum-stability)
on your project as suitable, or even whitelist specific modules as tracking
a development branch while keeping others to their stable release.
Read up on [Composer "lock" files](http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file) on how this all fits together.
Read up on [Composer "lock" files](http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file) on how this all fits together.

View File

@ -14,6 +14,11 @@ We provide a GUI for translations through [getlocalization.com](http://getlocali
For all modules listed there, we automatically import new master strings as they get committed to the various codebases, so you're always translating on the latest and greatest version.
Since getlocalization doesn't allow you to download your own work,
we've created a simple downloader for this purpose at [http://translate.silverstripe.org/download.php](http://translate.silverstripe.org/download.php)
([sample download of de.yml](http://translate.silverstripe.org/download.php?project=silverstripe_cms&locale=de)).
Requests count against our own API user on getlocalization.com, so please use the script responsibly.
## FAQ
### How do I translate a module not listed on getlocalization?
@ -123,4 +128,4 @@ you have specific comments on a translation.
* [i18n](/topics/i18n): Developer-level documentation of Silverstripe's i18n capabilities
* [translation-process](../translation-process): Information about managing translations for the core team and/or module maintainers.
* [translatable](https://github.com/silverstripe/silverstripe-translatable): DataObject-interface powering the website-content translations
* ["Translatable ModelAdmin" module](http://silverstripe.org/translatablemodeladmin-module/): An extension which allows translations of DataObjects inside ModelAdmin
* ["Translatable ModelAdmin" module](http://silverstripe.org/translatablemodeladmin-module/): An extension which allows translations of DataObjects inside ModelAdmin

View File

@ -33,12 +33,9 @@ In order to active this extension, you'd add the following to your [config.yml](
- MyMemberExtension
Alternatively, you can add extensions through PHP code as well (in your `config.php` file),
which means they can be used in conditional configuration.
which means they can be used in conditional configuration.
:::php
// Preferred notation: Through the Config API
Config::inst()->update('Member', 'extensions', array('MyMemberExtension'));
// Legacy notation: Through static class access
Member::add_extension('MyMemberExtension');
## Implementation

View File

@ -60,6 +60,26 @@ HTML5 placeholders 'day', 'month' and 'year' are enabled by default.
->setConfig('dmyseparator', '/') // set the separator
->setConfig('dmyplaceholders', 'true'); // enable HTML 5 Placeholders
## Formatting Hints
Its often not immediate apparent which format a field accepts,
and showing the technical format (e.g. `HH:mm:ss`) is of limited
use to the average user. An alternative is to show the current date
in the desired format alongside the field description as an example.
:::php
$dateField = DateField::create('MyDate');
// Show long format as text below the field
$dateField->setDescription(sprintf(
_t('FormField.Example', 'e.g. %s', 'Example format'),
Convert::raw2xml(Zend_Date::now()->toString($dateField->getConfig('dateformat')))
));
// Alternatively, set short format as a placeholder in the field
$dateField->setAttribute('placeholder', $dateField->getConfig('dateformat'));
Note: Fields scaffolded through `[api:DataObject::scaffoldCMSFields()]` automatically
have a description attached to them.
## Calendar Field
The following setting will add a Calendar to a single DateField, using the

View File

@ -69,7 +69,7 @@ to the `LeftAndMain.extra_requirements_javascript` [configuration value](/topics
:::yml
LeftAndMain
extra_requirements_javascript:
- 'mysite/javascript/MyLeftAndMain.Preview.js'
mysite/javascript/MyLeftAndMain.Preview.js:
In order to find out which configuration values are available, the source code
is your best reference at the moment - have a look in `framework/admin/javascript/LeftAndMain.Preview.js`.

View File

@ -74,7 +74,7 @@ Hierarchy operations (defined on `[api:Hierarchy]`:
* `$page->AllHistoricalChildren()`: Return all the children this page had, including pages that were deleted from both stage & live.
* `$page->AllChildrenIncludingDeleted()`: Return all children, including those that have been deleted but are still in live.
## Limiting Hierarchy
## Allowed Children, Default Child and Root-Level
By default, any page type can be the child of any other page type.
However, there are static properties that can be
@ -115,9 +115,20 @@ level.
Note that there is no allowed_parents` control. To set this, you will need to specify the `allowed_children` of all other page types to exclude the page type in question.
## Permission Control
## Tree Limitations
SilverStripe limits the amount of initially rendered nodes in order to avoid
processing delays, usually to a couple of dozen. The value can be configured
through `[api:Hierarchy::$node_threshold_total]`.
If a website has thousands of pages, the tree UI metaphor can become an inefficient way
to manage them. The CMS has an alternative "list view" for this purpose, which allows
sorting and paging through large numbers of pages in a tabular view.
To avoid exceeding performance constraints of both the server and browser,
SilverStripe places hard limits on the amount of rendered pages in
a specific tree leaf, typically a couple of hundred pages.
The value can be configured through `[api:Hierarchy::$node_threshold_leaf]`.
## Tree Display (Description, Icons and Badges)

View File

@ -202,6 +202,13 @@ You can combine two or more conditions with `&&` ("and"). The markup is used if
Lets swap dinners
<% end_if %>
You can use inequalities like `<`, `<=`, `>`, `>=` to compare numbers.
:::ss
<% if $Number>="5" && $Number<="10" %>
Number between 5 and 10
<% end_if %>
## Looping Over Lists
The `<% loop %>...<% end_loop %>` tag is used to **iterate** or loop over a

View File

@ -59,9 +59,8 @@ Redirections](security#redirect_back_to_another_page_after_login) for more infor
| Site URL | | Action |
| -------- | | ------ |
| http://yoursite.com**/dev/build** | | Rebuild the entire database and manifest, see below for additional URL Variables |
| http://yoursite.com**/admin/publishall/** | | Publish all pages on the site |
| http://yoursite.com**/anypage/images/flush** | | Creates new images for the page by deleting the resized ones and going back to the original to create new resized one |
| http://yoursite.com**/admin/publishall/** | | Publish all pages on the site
### /dev/build
| URL Variable | | Values | | Description |

View File

@ -354,7 +354,3 @@ If you are concerned about resource usage on a dedicated server (without restric
These values will just be used for specific scripts (e.g. `[api:Filesystem::sync()]`),
to raise the limits for all executed scripts please use `ini_set('memory_limit', <value>)`
and `ini_set('max_execution_time', <value>)` in your own `_config.php`.
## See Also
[Config Cheat sheet](http://www.ssbits.com/a-config-php-cheatsheet/)

View File

@ -15,10 +15,12 @@ your own routes since the cms module handles these routes.
<?php
class FastFood_Controller extends Controller {
public static $allowed_actions = array('order');
public function order(SS_HTTPRequest $request) {
print_r($arguments);
}
private static $allowed_actions = array('order');
public function order(SS_HTTPRequest $request) {
print_r($request->allParams());
}
}
## Routing
@ -32,7 +34,7 @@ your own routes since the cms module handles these routes.
---
Director:
rules:
'fastfood/$Action/$ID/$Name': 'FastFood_Controller'
'fastfood//$Action/$ID/$Name': 'FastFood_Controller'
Request for `/fastfood/order/24/cheesefries` would result in the following to
@ -69,7 +71,8 @@ way to perform checks against permission codes or custom logic.
:::php
class MyController extends Controller {
public static $allowed_actions = array(
private static $allowed_actions = array(
// someaction can be accessed by anyone, any time
'someaction',
// So can otheraction
@ -107,7 +110,9 @@ e.g. to handle responses conditionally on the passed request data.
:::php
class MyController extends Controller {
public static $allowed_actions = array('myaction');
private static $allowed_actions = array('myaction');
public function myaction($request) {
if(!$request->getVar('apikey')) {
return $this->httpError(403, 'No API key provided');
@ -135,7 +140,9 @@ permission checks.
:::php
class MyController extends Controller {
public static $allowed_actions = array();
private static $allowed_actions = array();
public function init() {
parent::init();
if(!Permission::check('ADMIN')) return $this->httpError(403);
@ -230,10 +237,12 @@ either `301` for permanent redirects, or `302` for temporary redirects (default)
You can also limit access to actions on a controller using the static `$allowed_actions` array. This allows you to always allow an action, or restrict it to a specific permission or to call a method that checks if the action is allowed.
For example, the default `Controller::$allowed_actions` is
private static $allowed_actions = array(
'handleAction',
'handleIndex',
);
which allows the `handleAction` and `handleIndex` methods to be called via a URL.
To allow any action on your controller to be called you can either leave your `$allowed_actions` array empty or not have one at all. This is the default behaviour, however it is not recommended as it allows anything on your controller to be called via a URL, including view-specific methods.
@ -241,6 +250,7 @@ To allow any action on your controller to be called you can either leave your `$
The recommended approach is to explicitly state the actions that can be called via a URL. Any action not in the `$allowed_actions` array, excluding the default `index` method, is then unable to be called.
To always allow an action to be called, you can either add the name of the action to the array or add a value of `true` to the array, using the name of the method as its index. For example
private static $allowed_actions = array(
'MyAwesomeAction',
'MyOtherAction' => true
@ -248,6 +258,7 @@ To always allow an action to be called, you can either add the name of the actio
To require that the current user has a certain permission before being allowed to call an action you add the action to the array as an index with the value being the permission code that user must have. For example
private static $allowed_actions = array(
'MyAwesomeAction',
'MyOtherAction' => true,
@ -256,6 +267,7 @@ To require that the current user has a certain permission before being allowed t
);
If neither of these are enough to decide if an action should be called, you can have the check use a method. The method must be on the controller class and return true if the action is allowed or false if it isn't. To do this add the action to the array as an index with the value being the name of the method to called preceded by '->'. You are able to pass static arguments to the method in much the same way as you can with extensions. Strings are enclosed in quotes, numeric values are written as numbers and true and false are written as true and false. For example
private static $allowed_actions = array(
'MyAwesomeAction',
'MyOtherAction' => true,

View File

@ -103,29 +103,22 @@ This is my `_ss_environment.php` file. I have it placed in `/var`, as each of th
## Available Constants
| Name | Description |
| ---- | ----------- |
| `TEMP_FOLDER` | Absolute file path to store temporary files such as cached templates or the class manifest. Needs to be writeable by the webserver user. Defaults to *sys_get_temp_dir()*, and falls back to *silverstripe-cache* in the webroot. See *getTempFolder()* in *framework/core/Core.php* |
SS_DATABASE_CLASS: The database class to use, MySQLDatabase, MSSQLDatabase, etc. defaults to MySQLDatabase
| `SS_DATABASE_SERVER`| The database server to use, defaulting to localhost|
| Name | Description |
| ---- | ----------- |
| `TEMP_FOLDER` | Absolute file path to store temporary files such as cached templates or the class manifest. Needs to be writeable by the webserver user. Defaults to *sys_get_temp_dir()*, and falls back to *silverstripe-cache* in the webroot. See *getTempFolder()* in *framework/core/Core.php* |
| `SS_DATABASE_CLASS` | The database class to use, MySQLDatabase, MSSQLDatabase, etc. defaults to MySQLDatabase|
| `SS_DATABASE_SERVER`| The database server to use, defaulting to localhost|
| `SS_DATABASE_USERNAME`| The database username (mandatory)|
| `SS_DATABASE_PASSWORD`| The database password (mandatory)|
| `SS_DATABASE_PORT`| The database port|
| `SS_DATABASE_SUFFIX`| A suffix to add to the database name.|
| `SS_DATABASE_PREFIX`| A prefix to add to the database name.|
| `SS_DATABASE_TIMEZONE`| Set the database timezone to something other than the system timezone.
| `SS_DATABASE_CHOOSE_NAME`| Boolean/Int. If set, then the system will choose a default database name for you if
one isn't give in the $database variable. The database name will be "SS_" followed by the name of the folder
into which you have installed SilverStripe. If this is enabled, it means that the phpinstaller will work out of
the box without the installer needing to alter any files. This helps prevent accidental changes to the
environment. If SS_DATABASE_CHOOSE_NAME is an integer greater than one, then an ancestor folder will be used for the
database name. This is handy for a site that's hosted from /sites/examplesite/www or /buildbot/allmodules-2.3/build.
If it's 2, the parent folder will be chosen; if it's 3 the grandparent, and so on.|
| `SS_DATABASE_CHOOSE_NAME`| Boolean/Int. If set, then the system will choose a default database name for you if one isn't give in the $database variable. The database name will be "SS_" followed by the name of the folder into which you have installed SilverStripe. If this is enabled, it means that the phpinstaller will work out of the box without the installer needing to alter any files. This helps prevent accidental changes to the environment. If `SS_DATABASE_CHOOSE_NAME` is an integer greater than one, then an ancestor folder will be used for the database name. This is handy for a site that's hosted from /sites/examplesite/www or /buildbot/allmodules-2.3/build. If it's 2, the parent folder will be chosen; if it's 3 the grandparent, and so on.|
| `SS_ENVIRONMENT_TYPE`| The environment type: dev, test or live.|
| `SS_DEFAULT_ADMIN_USERNAME`| The username of the default admin - this is a non-database user with
administrative privileges.|
| `SS_DEFAULT_ADMIN_USERNAME`| The username of the default admin - this is a non-database user with administrative privileges.|
| `SS_DEFAULT_ADMIN_PASSWORD`| The password of the default admin.|
| `SS_USE_BASIC_AUTH`| Protect the site with basic auth (good for test sites)|
| `SS_SEND_ALL_EMAILS_TO`| If you set this define, all emails will be redirected to this address.|
| `SS_SEND_ALL_EMAILS_FROM`| If you set this define, all emails will be send from this address.|
| `SS_ERROR_LOG` | |
| `SS_ERROR_LOG` | |

View File

@ -25,7 +25,7 @@ when the form is submitted.
new RequiredFields(array('MyRequiredField'))
);
// Optional: Add a CSS class for custom styling
$form->dataFieldByName('MyRequiredField)->addExtraClass('required');
$form->dataFieldByName('MyRequiredField')->addExtraClass('required');
return $form;
}
@ -141,4 +141,4 @@ errors.
## Related
* Model Validation with [api:DataObject->validate()]
* Model Validation with [api:DataObject->validate()]

View File

@ -67,14 +67,35 @@ Formats can be set globally in the i18n class. These settings are currently only
to write your own logic for any frontend output.
:::php
i18n::set_date_format('dd.MM.YYYY');
i18n::set_time_format('HH:mm');
Config::inst()->update('i18n', 'date_format', 'dd.MM.YYYY');
Config::inst()->update('i18n', 'time_format', 'HH:mm');
Most localization routines in SilverStripe use the [Zend_Date API](http://framework.zend.com/manual/en/zend.date.html).
This means all formats are defined in
[ISO date format](http://framework.zend.com/manual/en/zend.date.constants.html#zend.date.constants.selfdefinedformats),
not PHP's built-in [date()](http://nz.php.net/manual/en/function.date.php).
### Language Names
SilverStripe comes with a built-in list of common languages, listed by locale and region.
They can be accessed via the `i18n.common_languages` and `i18n.common_locales` [config setting](/topics/configuratio).
In order to add a value, add the following to your `config.yml`:
:::yml
i18n:
common_languages:
de_CGN:
name: German (Cologne)
native: Kölsch
Similarly, to change an existing existing language label, you can overwrite one of these keys:
i18n:
common_languages:
en_NZ:
native: Niu Zillund
### i18n in URLs
By default, URLs for pages in SilverStripe (the `SiteTree->URLSegment` property)

View File

@ -110,14 +110,11 @@ class File extends DataObject {
* Instructions for the change you need to make are included in a comment in the config file.
*/
private static $allowed_extensions = array(
'','html','htm','xhtml','js','css',
'bmp','png','gif','jpg','jpeg','ico','pcx','tif','tiff',
'au','mid','midi','mpa','mp3','ogg','m4a','ra','wma','wav','cda',
'avi','mpg','mpeg','asf','wmv','m4v','mov','mkv','mp4','swf','flv','ram','rm',
'doc','docx','txt','rtf','xls','xlsx','pages',
'ppt','pptx','pps','csv',
'cab','arj','tar','zip','zipx','sit','sitx','gz','tgz','bz2','ace','arc','pkg','dmg','hqx','jar',
'xml','pdf',
'','ace','arc','arj','asf','au','avi','bmp','bz2','cab','cda','css','csv','dmg','doc','docx',
'flv','gif','gpx','gz','hqx','htm','html','ico','jar','jpeg','jpg','js','kml', 'm4a','m4v',
'mid','midi','mkv','mov','mp3','mp4','mpa','mpeg','mpg','ogg','pages','pcx','pdf','pkg',
'png','pps','ppt','pptx','ra','ram','rm','rtf','sit','sitx','swf','tar','tgz','tif','tiff',
'txt','wav','wma','wmv','xhtml','xls','xlsx','xml','zip','zipx',
);
/**

View File

@ -402,7 +402,8 @@ class FieldList extends ArrayList {
public function push($item, $key = null) {
$this->onBeforeInsert($item);
$item->setContainerFieldList($this);
return parent::push($item, $key = null);
return parent::push($item, $key);
}
/**
@ -410,7 +411,10 @@ class FieldList extends ArrayList {
*/
protected function onBeforeInsert($item) {
$this->flushFieldsCache();
if($item->getName()) $this->rootFieldList()->removeByName($item->getName(), true);
if($item->getName()) {
$this->rootFieldList()->removeByName($item->getName(), true);
}
}
@ -420,7 +424,10 @@ class FieldList extends ArrayList {
* @param Form $form The form to set this FieldList to
*/
public function setForm($form) {
foreach($this as $field) $field->setForm($form);
foreach($this as $field) {
$field->setForm($form);
}
return $this;
}

View File

@ -269,10 +269,50 @@ class TreeDropdownField extends FormField {
. $this->keyField . '\" class=\"class-$child->class"'
. ' . $child->markingClasses() . "\"><a rel=\"$child->ID\">" . $child->' . $this->labelField . ' . "</a>"';
if($isSubTree) {
return substr(trim($obj->getChildrenAsUL('', $eval, null, true, $this->childrenMethod)), 4, -5);
// Limit the amount of nodes shown for performance reasons.
// Skip the check if we're filtering the tree, since its not clear how many children will
// match the filter criteria until they're queried (and matched up with previously marked nodes).
$nodeThresholdLeaf = Config::inst()->get('Hierarchy', 'node_threshold_leaf');
if($nodeThresholdLeaf && !$this->filterCallback && !$this->search) {
$className = $this->sourceObject;
$nodeCountCallback = function($parent, $numChildren) use($className, $nodeThresholdLeaf) {
if($className == 'SiteTree' && $parent->ID && $numChildren > $nodeThresholdLeaf) {
return sprintf(
'<ul><li><span class="item">%s</span></li></ul>',
_t('LeftAndMain.TooManyPages', 'Too many pages')
);
}
};
} else {
return $obj->getChildrenAsUL('class="tree"', $eval, null, true, $this->childrenMethod);
$nodeCountCallback = null;
}
if($isSubTree) {
$html = $obj->getChildrenAsUL(
"",
$eval,
null,
true,
$this->childrenMethod,
'numChildren',
true, // root call
null,
$nodeCountCallback
);
return substr(trim($html), 4, -5);
} else {
$html = $obj->getChildrenAsUL(
'class="tree"',
$eval,
null,
true,
$this->childrenMethod,
'numChildren',
true, // root call
null,
$nodeCountCallback
);
return $html;
}
}

View File

@ -455,6 +455,16 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler {
if(!$this->record->canEdit()) {
return $controller->httpError(403);
}
if (isset($data['ClassName']) && $data['ClassName'] != $this->record->ClassName) {
$newClassName = $data['ClassName'];
// The records originally saved attribute was overwritten by $form->saveInto($record) before.
// This is necessary for newClassInstance() to work as expected, and trigger change detection
// on the ClassName attribute
$this->record->setClassName($this->record->ClassName);
// Replace $record with a new instance
$this->record = $this->record->newClassInstance($newClassName);
}
try {
$form->saveInto($this->record);

View File

@ -92,13 +92,13 @@ class GridFieldFilterHeader implements GridField_HTMLProvider, GridField_DataMan
}
$filterArguments = $state->Columns->toArray();
$dataListClone = null;
$dataListClone = clone($dataList);
foreach($filterArguments as $columnName => $value ) {
if($dataList->canFilterBy($columnName) && $value) {
$dataListClone = $dataList->filter($columnName.':PartialMatch', $value);
$dataListClone = $dataListClone->filter($columnName.':PartialMatch', $value);
}
}
return ($dataListClone) ? $dataListClone : $dataList;
return $dataListClone;
}
public function getHTMLFragments($gridField) {

View File

@ -170,7 +170,7 @@ class i18nTextCollector extends Object {
$fileList = $this->getFilesRecursive("$this->basePath/$module/code");
} else if($module == FRAMEWORK_DIR || substr($module, 0, 7) == 'themes/') {
// framework doesn't have the usual module structure, so we'll scan all subfolders
$fileList = $this->getFilesRecursive("$this->basePath/$module");
$fileList = $this->getFilesRecursive("$this->basePath/$module", null, null, '/\/(tests|dev)$/');
}
foreach($fileList as $filePath) {
// exclude ss-templates, they're scanned separately
@ -183,8 +183,7 @@ class i18nTextCollector extends Object {
// Search for calls in template files if these exists
if(is_dir("$this->basePath/$module/")) {
$dummy = array();
$fileList = $this->getFilesRecursive("$this->basePath/$module/", $dummy, 'ss');
$fileList = $this->getFilesRecursive("$this->basePath/$module/", null, 'ss');
foreach($fileList as $index => $filePath) {
$content = file_get_contents($filePath);
// templates use their filename as a namespace
@ -401,25 +400,30 @@ class i18nTextCollector extends Object {
* @param string $folder base directory to scan (will scan recursively)
* @param array $fileList Array to which potential files will be appended
* @param string $type Optional, "php" or "ss"
* @param string $folderExclude Regular expression matching folder names to exclude
* @return array $fileList An array of files
*/
protected function getFilesRecursive($folder, &$fileList = null, $type = null) {
protected function getFilesRecursive($folder, $fileList = null, $type = null, $folderExclude = null) {
if(!$folderExclude) $folderExclude = '/\/(tests)$/';
if(!$fileList) $fileList = array();
$items = scandir($folder);
$isValidFolder = (
!in_array('_manifest_exclude', $items)
&& !preg_match('/\/tests$/', $folder)
&& !preg_match($folderExclude, $folder)
);
if($items && $isValidFolder) foreach($items as $item) {
if(substr($item,0,1) == '.') continue;
if(substr($item,-4) == '.php' && (!$type || $type == 'php')) {
$fileList[substr($item,0,-4)] = "$folder/$item";
}
else if(substr($item,-3) == '.ss' && (!$type || $type == 'ss')) {
} else if(substr($item,-3) == '.ss' && (!$type || $type == 'ss')) {
$fileList[$item] = "$folder/$item";
} else if(is_dir("$folder/$item")) {
$fileList = array_merge(
$fileList,
$this->getFilesRecursive("$folder/$item", $fileList, $type, $folderExclude)
);
}
else if(is_dir("$folder/$item")) $this->getFilesRecursive("$folder/$item", $fileList, $type);
}
return $fileList;
}

View File

@ -26,11 +26,11 @@
}
});
$('.field.date input.text,.fieldholder-small input.text.date').live('click', function() {
$(document).on("click", ".field.date input.text,.fieldholder-small input.text.date", function() {
$(this).ssDatepicker();
if($(this).data('datepicker')) {
$(this).datepicker('show');
}
});
}(jQuery));
}(jQuery));

View File

@ -488,7 +488,8 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
/* NOP */
},
resetFields: function() {
/* NOP */
// Flush the tree drop down fields, as their content might get changed in other parts of the CMS, ie in Files and images
this.find('.tree-holder').empty();
}
});

View File

@ -29,6 +29,10 @@
* @todo Expand title height to fit all elements
*/
$('.TreeDropdownField').entwine({
// XMLHttpRequest
CurrentXhr: null,
onadd: function() {
this.append(
'<span class="treedropdownfield-title"></span>' +
@ -70,7 +74,7 @@
.removeClass('ui-icon-triangle-1-s')
.addClass('ui-icon-triangle-1-n');
if(tree.is(':empty')) this.loadTree();
if(tree.is(':empty') && !panel.hasClass('loading')) this.loadTree();
this.trigger('panelshow');
},
closePanel: function() {
@ -131,13 +135,21 @@
return this.find(':input:hidden').val();
},
loadTree: function(params, callback) {
var self = this, panel = this.getPanel(), treeHolder = $(panel).find('.tree-holder');
var params = (params) ? $.extend({}, this.getRequestParams(), params) : this.getRequestParams();
var self = this, panel = this.getPanel(), treeHolder = $(panel).find('.tree-holder'),
params = (params) ? $.extend({}, this.getRequestParams(), params) : this.getRequestParams(), xhr;
if(this.getCurrentXhr()) this.getCurrentXhr().abort();
panel.addClass('loading');
treeHolder.load(this.data('urlTree'), params, function(html, status, xhr) {
var firstLoad = true;
if(status == 'success') {
$(this)
xhr = $.ajax({
url: this.data('urlTree'),
data: params,
complete: function(xhr, status) {
panel.removeClass('loading');
},
success: function(html, status, xhr) {
treeHolder.html(html);
var firstLoad = true;
treeHolder
.jstree('destroy')
.bind('loaded.jstree', function(e, data) {
var val = self.getValue(), selectNode = treeHolder.find('*[data-id="' + val + '"]'),
@ -163,12 +175,13 @@
// Avoid auto-closing panel on first load
if(!firstLoad) self.closePanel();
firstLoad=false
firstLoad=false;
});
self.setCurrentXhr(null);
}
panel.removeClass('loading');
});
this.setCurrentXhr(xhr);
},
getTreeConfig: function() {
var self = this;
@ -255,7 +268,7 @@
var title = decodeURIComponent(this.data('title'));
this.find('.treedropdownfield-title').replaceWith(
$('<input type="text" class="treedropdownfield-title search" />')
$('<input type="text" class="treedropdownfield-title search" data-skip-autofocus="true" />')
);
this.setTitle(title ? title : strings.searchFieldTitle);
@ -268,6 +281,9 @@
getTitle: function() {
return this.find('.treedropdownfield-title').val();
},
resetTitle: function() {
this.setTitle(decodeURIComponent(this.data('title')));
},
search: function(str, callback) {
this.openPanel();
this.loadTree({search: str}, callback);
@ -275,7 +291,7 @@
cancelSearch: function() {
this.closePanel();
this.loadTree();
this.setTitle(this.data('title'));
this.resetTitle();
}
});
@ -286,7 +302,7 @@
},
onfocusout: function(e) {
var field = this.getField();
if(!field.getTitle()) field.setTitle(false);
field.resetTitle();
},
onkeydown: function(e) {
var field = this.getField();
@ -311,12 +327,21 @@
},
loadTree: function(params, callback) {
var self = this, panel = this.getPanel(), treeHolder = $(panel).find('.tree-holder');
var params = (params) ? $.extend({}, this.getRequestParams(), params) : this.getRequestParams();
var params = (params) ? $.extend({}, this.getRequestParams(), params) : this.getRequestParams(), xhr;
if(this.getCurrentXhr()) this.getCurrentXhr().abort();
panel.addClass('loading');
treeHolder.load(this.data('urlTree'), params, function(html, status, xhr) {
var firstLoad = true;
if(status == 'success') {
$(this)
xhr = $.ajax({
url: this.data('urlTree'),
data: params,
complete: function(xhr, status) {
panel.removeClass('loading');
},
success: function(html, status, xhr) {
treeHolder.html(html);
var firstLoad = true;
self.setCurrentXhr(null);
treeHolder
.jstree('destroy')
.bind('loaded.jstree', function(e, data) {
$.each(self.getValue(), function(i, val) {
@ -339,9 +364,8 @@
}));
});
}
panel.removeClass('loading');
});
this.setCurrentXhr(xhr);
},
getValue: function() {
var val = this._super();

View File

@ -1,134 +0,0 @@
lc_XX:
BasicAuth:
ENTERINFO: "PLZ ENTR UR USERNAYM N A PASWORD."
ERRORNOTADMIN: "DAT USR IZ NOT AN ADMINISTRATOR."
ERRORNOTREC: "DAT USERNAYM / PASWORD ISNT RECOGNISD SUZ 2 HEAR"
ChangePasswordEmail.ss:
CHANGEPASSWORDTEXT1: "U CHANGD UR PASWORD 4"
CHANGEPASSWORDTEXT2: "U CAN NAO USE TEH FOLLOWIN CREDENSHALS 2 LOG IN:"
HELLO: "OHI! HOWRU2DAI?"
ComplexTableField.ss:
ADDITEM: "ADD"
SORTASC: "SORT ASCENDIN"
SORTDESC: "SORT DESCENDIN"
ComplexTableField_popup.ss:
NEXT: "NEXT (GOGOGO)"
PREVIOUS: "PREVIOUZ"
Date:
DAY: "DAI"
DAYS: "DAIZ"
HOUR: "HOUR"
HOURS: "HOURZ"
MIN: "MIN"
MINS: "MINZ"
MONTH: "MONTH"
MONTHS: "MONTHX"
SEC: "SEC"
SECS: "SECZ"
YEAR: "YEAR"
YEARS: "YEARZ"
DateField:
DropdownField:
CHOOSE: "(pik)"
EmailField:
VALIDATION: "PLZ ENTR AN EMAIL ADDRES."
ForgotPasswordEmail.ss:
HELLO: "OHI! HOWRU2DAI?"
Form:
FIELDISREQUIRED: "%s IS REQUIRED"
VALIDATIONCREDITNUMBER: "PLZ ENSURE U HAS ENTERD TEH %s CREDIT CARD NUMBR RITE CUZ WE NEED UR MONEY RITE NOW."
VALIDATIONFAILED: "VALIDASHUN FAILD1!!1!!!!!!1 WAT NOW?"
VALIDATIONNOTUNIQUE: "TEH VALUE ENTERD R NOT UNIQUE"
VALIDATIONPASSWORDSDONTMATCH: "SRY BOSS, PASWORDZ DOAN MATCH"
VALIDATIONPASSWORDSNOTEMPTY: "PASWORDZ CANT BE EMPTY DOOD"
VALIDATIONSTRONGPASSWORD: "PASWORDZ MUST HAS AT LEAST WAN DIGIT AN WAN ALFANUMERIC CHARACTR."
VALIDCURRENCY: "PLZ ENTR VALID CURRENCY. CUD U?"
HtmlEditorField:
BUTTONINSERTLINK: "INSERT LINK"
BUTTONREMOVELINK: "REMOOV LINK"
CSSCLASS: "ALIGNMENT / STYLE"
CSSCLASSCENTER: "SENTERD, ON ITZ OWN."
CSSCLASSLEFT: "ON TEH LEFT, WIF TEXT WRAPPIN AROUND."
CSSCLASSRIGHT: "ON TEH RITE, WIF TEXT WRAPPIN AROUND."
EMAIL: "EMAIL ADDRESZ"
FILE: "FIEL"
FOLDER: "TEH FOLDER"
IMAGE: "INSERT PIKSHUR"
IMAGEDIMENSIONS: "DIMENSHUNZ"
IMAGEHEIGHTPX: "HEIGHT"
IMAGEWIDTHPX: "WIDTH"
LINK: "INSERT/EDIT LINK 4 HIGHLIGHTD TEXT"
LINKDESCR: "LINK DESCRIPSHUN"
LINKEMAIL: "EMAIL ADDRESZ"
LINKEXTERNAL: "ANODER WEBSIET"
LINKFILE: "DOWNLOAD FIEL"
LINKINTERNAL: "PAEG ON DIS SIET"
LINKOPENNEWWIN: "OPEN LINK IN NEW WINDOW?"
LINKTO: "LINK 2"
PAGE: "PAEG"
URL: "URL N STUFF"
Image_iframe.ss:
TITLE: "PIKSHUR UPLOADIN IFRAME"
Member:
ADDRESS: "ADDRESZ"
BUTTONCHANGEPASSWORD: "CHANGE PASWORD"
BUTTONLOGIN: "LOG IN"
BUTTONLOGINOTHER: "LOG IN AS SOMEONE ELSE"
BUTTONLOSTPASSWORD: "I HAS LOST MAH PASWORD"
CONFIRMNEWPASSWORD: "CUD U CONFIRM NEW PASWORD PLZ"
CONFIRMPASSWORD: "CONFIRM PASWORD"
CONTACTINFO: "SUM CONTACT STUFF"
EMAIL: "EMAIL"
EMAILSIGNUPINTRO1: "TEH LOLCAT SEZ OMG BIGTHX 2 U N U R A NEW MEMBR 4 NOW N UR DETAILZ R LISTD BELOW FOR THAT IF U WANTZ THEM IN SUM TIME"
EMAILSIGNUPINTRO2: "U CAN LOGIN TO TEH WEBSITE USINS TEH CREDENTIALZ LISTED BELOW"
EMAILSIGNUPSUBJECT: "TEH LOLCAT TANX U 4 SIGNINS UP"
ERRORNEWPASSWORD: "UR HAS ENTERD UR NEW PASWORD DIFFERENTLY, PLZ TRY AGAIN, K?"
ERRORPASSWORDNOTMATCH: "UR CURRENT PASWORD DOEZ NOT MATCH, PLZ TRY AGAIN, K?"
ERRORWRONGCRED: "DAT IS NOT SEEMZ 2 BE TEH RITE E-MAIL ADDRES OR PASWORD. PLZ TRY AGAIN, K?"
FIRSTNAME: "FURST NAYM"
GREETING: "WELKUM"
INTERFACELANG: "INTRFACELANGUEEG"
LOGGEDINAS: "URE LOGGD IN AS %s."
MOBILE: "MOBAIL"
NAME: "NAYM"
NEWPASSWORD: "NEW PASWORD"
PASSWORD: "PASWORD"
PHONE: "FONE"
REMEMBERME: "REMEMBR ME NEXT TIME, K?"
SUBJECTPASSWORDCHANGED: "UR PASWORD HAS BEEN CHANGD"
SUBJECTPASSWORDRESET: "YORE PASWORD RESET LINK"
SURNAME: "SHURNAYM"
VALIDATIONMEMBEREXISTS: "THAR ALREADY EXISTZ MEMBR WIF DIS EMAILZ"
WELCOMEBACK: "WELCUM BACK, %s"
YOUROLDPASSWORD: "UR OLD PASWORD"
MemberAuthenticator:
TITLE: "E-MAIL N PASWORD"
NumericField:
VALIDATION: "'%s' IZ NOT NUMBR, ONLY NUMBERS CAN BE ACCEPTD 4 DIS FIELD"
PhoneNumberField:
VALIDATION: "PLZ ENTR VALID FONE NUMBR WE WUNT DISTURB 2 MUCH JUS A BIT"
Security:
ALREADYLOGGEDIN: "U SHALL NOT PASS!! IF U HAS ANOTHR AKOWNT DAT CAN ACCES DAT PAEG, U CAN LOG IN BELOW."
BUTTONSEND: "SEND ME TEH PASWORD RESETZ LINK"
CHANGEPASSWORDBELOW: "U CAN CHANGE UR PASWORD BELOW"
CHANGEPASSWORDHEADER: "CHANGE UR PASWORD"
ENTERNEWPASSWORD: "PLEEZ ENTR NEW PASSWORD. KTHX."
ERRORPASSWORDPERMISSION: "U MUST BE LOGGD IN IN ORDR 2 CHANGE UR PASWORD!"
LOGGEDOUT: "U HAS BEEN LOGGD OUT. IF U WUD LIEK 2 LOG IN AGAIN, ENTR UR CREDENTIALS BELOW."
NOTEPAGESECURED: "TEH PAGE IZ SECURD. ENTR UR CREDENSHALS BELOW AN WE WILL SEND U RITE ALONG."
NOTERESETPASSWORD: "ENTR UR E-MAIL ADDRES AN WE R GONA SEND U LINK WIF WHICH U CAN RESET UR PASWORD"
PASSWORDSENTHEADER: "I R SENT TEH PASWORD RESET LINK TO '%s'"
PASSWORDSENTTEXT: "THXALOT! I R SENT TEH PASWORD RESET LINK TO '%s'"
SimpleImageField:
NOUPLOAD: "DEREZ NO PIKSHUR UPLOADED"
SiteTree:
TABMAIN: "MAIN"
TableField:
ISREQUIRED: "IN %s '%s' IS KINDA REQUIRED"
TableField.ss:
ToggleCompositeField.ss:
HIDE: "HAYD"
SHOW: "SHOW"
ToggleField:
LESS: "lesz"
MORE: "mur"

View File

@ -139,6 +139,8 @@ class DataQuery {
/**
* Ensure that the query is ready to execute.
*
* @return SQLQuery
*/
public function getFinalisedQuery($queriedColumns = null) {
if(!$queriedColumns) $queriedColumns = $this->queriedColumns;
@ -277,17 +279,15 @@ class DataQuery {
if(isset($databaseFields[$parts[0]])) {
$qualCol = "\"$baseClass\".\"{$parts[0]}\"";
// remove original sort
unset($orderby[$k]);
// add new columns sort
$orderby[$qualCol] = $dir;
} else {
$qualCol = "\"$parts[0]\"";
}
// remove original sort
unset($orderby[$k]);
// add new columns sort
$orderby[$qualCol] = $dir;
// To-do: Remove this if block once SQLQuery::$select has been refactored to store getSelect()
// format internally; then this check can be part of selectField()
$selects = $query->getSelect();
@ -419,7 +419,7 @@ class DataQuery {
}
/**
* Set the HAVING clause of this query
* Set the HAVING clause of this query.
*
* @param String $having Escaped SQL statement
*/
@ -458,10 +458,10 @@ class DataQuery {
*
* <code>
* // the entire predicate as a single string
* $query->where("Column = 'Value'");
* $query->where("\"Column\" = 'Value'");
*
* // multiple predicates as an array
* $query->where(array("Column = 'Value'", "Column != 'Value'"));
* $query->where(array("\"Column\" = 'Value'", "\"Column\" != 'Value'"));
* </code>
*
* @param string|array $where Predicate(s) to set, as escaped SQL statements.
@ -476,7 +476,7 @@ class DataQuery {
/**
* Set a WHERE with OR.
*
* @example $dataQuery->whereAny(array("Monkey = 'Chimp'", "Color = 'Brown'"));
* @example $dataQuery->whereAny(array("\"Monkey\" = 'Chimp'", "\"Color\" = 'Brown'"));
* @see where()
*
* @param array $filter Escaped SQL statement.
@ -778,10 +778,10 @@ class DataQuery_SubGroup extends DataQuery {
*
* <code>
* // the entire predicate as a single string
* $query->where("Column = 'Value'");
* $query->where("\"Column\" = 'Value'");
*
* // multiple predicates as an array
* $query->where(array("Column = 'Value'", "Column != 'Value'"));
* $query->where(array("\"Column\" = 'Value'", "\"Column\" != 'Value'"));
* </code>
*
* @param string|array $where Predicate(s) to set, as escaped SQL statements.
@ -796,7 +796,7 @@ class DataQuery_SubGroup extends DataQuery {
/**
* Set a WHERE with OR.
*
* @example $dataQuery->whereAny(array("Monkey = 'Chimp'", "Color = 'Brown'"));
* @example $dataQuery->whereAny(array("\"Monkey\" = 'Chimp'", "\"Color\" = 'Brown'"));
* @see where()
*
* @param array $filter Escaped SQL statement.

View File

@ -750,6 +750,8 @@ abstract class SS_Database {
/**
* Returns the SELECT clauses ready for inserting into a query.
* Caution: Expects correctly quoted and escaped SQL fragments.
*
* @param array $select Select columns
* @param boolean $distinct Distinct select?
* @return string
@ -770,6 +772,8 @@ abstract class SS_Database {
/**
* Return the FROM clause ready for inserting into a query.
* Caution: Expects correctly quoted and escaped SQL fragments.
*
* @return string
*/
public function sqlFromToString($from) {
@ -778,6 +782,8 @@ abstract class SS_Database {
/**
* Returns the WHERE clauses ready for inserting into a query.
* Caution: Expects correctly quoted and escaped SQL fragments.
*
* @return string
*/
public function sqlWhereToString($where, $connective) {
@ -786,6 +792,8 @@ abstract class SS_Database {
/**
* Returns the ORDER BY clauses ready for inserting into a query.
* Caution: Expects correctly quoted and escaped SQL fragments.
*
* @return string
*/
public function sqlOrderByToString($orderby) {
@ -800,6 +808,8 @@ abstract class SS_Database {
/**
* Returns the GROUP BY clauses ready for inserting into a query.
* Caution: Expects correctly quoted and escaped SQL fragments.
*
* @return string
*/
public function sqlGroupByToString($groupby) {
@ -808,6 +818,8 @@ abstract class SS_Database {
/**
* Returns the HAVING clauses ready for inserting into a query.
* Caution: Expects correctly quoted and escaped SQL fragments.
*
* @return string
*/
public function sqlHavingToString($having) {
@ -816,6 +828,8 @@ abstract class SS_Database {
/**
* Return the LIMIT clause ready for inserting into a query.
* Caution: Expects correctly quoted and escaped SQL fragments.
*
* @return string
*/
public function sqlLimitToString($limit) {
@ -847,6 +861,8 @@ abstract class SS_Database {
/**
* Convert a SQLQuery object into a SQL statement
* Caution: Expects correctly quoted and escaped SQL fragments.
*
* @param $query SQLQuery
*/
public function sqlQueryToString(SQLQuery $query) {

View File

@ -15,6 +15,28 @@ class Hierarchy extends DataExtension {
* @var Int
*/
protected $_cache_numChildren;
/**
* @config
* @var integer The lower bounds for the amount of nodes to mark. If set, the logic will expand
* nodes until it reaches at least this number, and then stops. Root nodes will always
* show regardless of this settting. Further nodes can be lazy-loaded via ajax.
* This isn't a hard limit. Example: On a value of 10, with 20 root nodes, each having
* 30 children, the actual node count will be 50 (all root nodes plus first expanded child).
*/
private static $node_threshold_total = 50;
/**
* @config
* @var integer Limit on the maximum children a specific node can display.
* Serves as a hard limit to avoid exceeding available server resources
* in generating the tree, and browser resources in rendering it.
* Nodes with children exceeding this value typically won't display
* any children, although this is configurable through the $nodeCountCallback
* parameter in {@link getChildrenAsUL()}. "Root" nodes will always show
* all children, regardless of this setting.
*/
private static $node_threshold_leaf = 250;
public function augmentSQL(SQLQuery &$query) {
}
@ -74,21 +96,29 @@ class Hierarchy extends DataExtension {
* @param string $childrenMethod The name of the method used to get children from each object
* @param boolean $rootCall Set to true for this first call, and then to false for calls inside the recursion. You
* should not change this.
* @param int $nodeCountThreshold The lower bounds for the amount of nodes to mark. If set, the logic will expand
* nodes until it eaches at least this number, and then stops. Root nodes will always
* show regardless of this settting. Further nodes can be lazy-loaded via ajax.
* This isn't a hard limit. Example: On a value of 10, with 20 root nodes, each having
* 30 children, the actual node count will be 50 (all root nodes plus first expanded child).
* @param int $nodeCountThreshold See {@link self::$node_threshold_total}
* @param callable $nodeCountCallback Called with the node count, which gives the callback an opportunity
* to intercept the query. Useful e.g. to avoid excessive children listings (Arguments: $parent, $numChildren)
*
* @return string
*/
public function getChildrenAsUL($attributes = "", $titleEval = '"<li>" . $child->Title', $extraArg = null,
$limitToMarked = false, $childrenMethod = "AllChildrenIncludingDeleted",
$numChildrenMethod = "numChildren", $rootCall = true, $nodeCountThreshold = 30) {
$numChildrenMethod = "numChildren", $rootCall = true, $nodeCountThreshold = null, $nodeCountCallback = null) {
if(!is_numeric($nodeCountThreshold)) {
$nodeCountThreshold = Config::inst()->get('Hierarchy', 'node_threshold_total');
}
if($limitToMarked && $rootCall) {
$this->markingFinished($numChildrenMethod);
}
if($nodeCountCallback) {
$nodeCountWarning = $nodeCountCallback($this->owner, $this->owner->$numChildrenMethod());
if($nodeCountWarning) return $nodeCountWarning;
}
if($this->owner->hasMethod($childrenMethod)) {
$children = $this->owner->$childrenMethod($extraArg);
@ -110,7 +140,6 @@ class Hierarchy extends DataExtension {
$output .= (is_callable($titleEval)) ? $titleEval($child) : eval("return $titleEval;");
$output .= "\n";
$numChildren = $child->$numChildrenMethod();
if(
// Always traverse into opened nodes (they might be exposed as parents of search results)
@ -119,10 +148,16 @@ class Hierarchy extends DataExtension {
// Otherwise, the remaining nodes are lazy loaded via ajax.
&& $child->isMarked()
) {
$output .= $child->getChildrenAsUL("", $titleEval, $extraArg, $limitToMarked, $childrenMethod,
$numChildrenMethod, false, $nodeCountThreshold);
}
elseif($child->isTreeOpened()) {
// Additionally check if node count requirements are met
$nodeCountWarning = $nodeCountCallback ? $nodeCountCallback($child, $numChildren) : null;
if($nodeCountWarning) {
$output .= $nodeCountWarning;
$child->markClosed();
} else {
$output .= $child->getChildrenAsUL("", $titleEval, $extraArg, $limitToMarked, $childrenMethod,
$numChildrenMethod, false, $nodeCountThreshold);
}
} elseif($child->isTreeOpened()) {
// Since we're not loading children, don't mark it as open either
$child->markClosed();
}

View File

@ -192,30 +192,61 @@ class Image extends File {
}
}
public function SetWidth($width) {
return $this->getWidth() == $width ? $this : $this->getFormattedImage('SetWidth', $width);
}
public function SetHeight($height) {
return $this->getHeight() == $height ? $this : $this->getFormattedImage('SetHeight', $height);
}
public function SetSize($width, $height) {
return (($this->getWidth() == $width) && ($this->getHeight() == $height))
? $this
: $this->getFormattedImage('SetSize', $width, $height);
}
/**
* Resize the image by preserving aspect ratio, keeping the image inside the
* $width and $height
*
* @param integer $width The width to size within
* @param integer $height The height to size within
* @return Image
*/
public function SetRatioSize($width, $height) {
return $this->getFormattedImage('SetRatioSize', $width, $height);
// Check if image is already sized to the correct dimension
$widthRatio = $width / $this->width;
$heightRatio = $height / $this->height;
if( $widthRatio < $heightRatio ) {
// Target is higher aspect ratio than image, so check width
if($this->isWidth($width)) return $this;
} else {
// Target is wider aspect ratio than image, so check height
if($this->isHeight($height)) return $this;
}
// Item must be regenerated
return $this->getFormattedImage('SetRatioSize', $width, $height);
}
/**
* Resize the image by preserving aspect ratio, keeping the image inside the
* $width and $height
*
* @param Image_Backend $backend
* @param integer $width The width to size within
* @param integer $height The height to size within
* @return Image_Backend
*/
public function generateSetRatioSize(Image_Backend $backend, $width, $height) {
return $backend->resizeRatio($width, $height);
}
/**
* Resize this Image by width, keeping aspect ratio. Use in templates with $SetWidth.
*
* @param integer $width The width to set
* @return Image
*/
public function SetWidth($width) {
return $this->isWidth($width)
? $this
: $this->getFormattedImage('SetWidth', $width);
}
/**
* Resize this Image by width, keeping aspect ratio. Use in templates with $SetWidth.
*
* @param Image_Backend $backend
* @param type $width The width to set
* @return Image_Backend
*/
public function generateSetWidth(Image_Backend $backend, $width) {
@ -224,6 +255,21 @@ class Image extends File {
/**
* Resize this Image by height, keeping aspect ratio. Use in templates with $SetHeight.
*
* @param integer $height The height to set
* @return Image
*/
public function SetHeight($height) {
return $this->isHeight($height)
? $this
: $this->getFormattedImage('SetHeight', $height);
}
/**
* Resize this Image by height, keeping aspect ratio. Use in templates with $SetHeight.
*
* @param Image_Backend $backend
* @param integer $height The height to set
* @return Image_Backend
*/
public function generateSetHeight(Image_Backend $backend, $height){
@ -232,6 +278,24 @@ class Image extends File {
/**
* Resize this Image by both width and height, using padded resize. Use in templates with $SetSize.
* @see Image::PaddedImage()
*
* @param integer $width The width to size to
* @param integer $height The height to size to
* @return Image
*/
public function SetSize($width, $height) {
return $this->isSize($width, $height)
? $this
: $this->getFormattedImage('SetSize', $width, $height);
}
/**
* Resize this Image by both width and height, using padded resize. Use in templates with $SetSize.
*
* @param Image_Backend $backend
* @param integer $width The width to size to
* @param integer $height The height to size to
* @return Image_Backend
*/
public function generateSetSize(Image_Backend $backend, $width, $height) {
@ -274,9 +338,62 @@ class Image extends File {
return $backend->croppedResize($this->stat('strip_thumbnail_width'),$this->stat('strip_thumbnail_height'));
}
/**
* Resize this Image by both width and height, using padded resize. Use in templates with $PaddedImage.
* @see Image::SetSize()
*
* @param integer $width The width to size to
* @param integer $height The height to size to
* @return Image
*/
public function PaddedImage($width, $height) {
return $this->isSize($width, $height)
? $this
: $this->getFormattedImage('PaddedImage', $width, $height);
}
/**
* Resize this Image by both width and height, using padded resize. Use in templates with $PaddedImage.
*
* @param Image_Backend $backend
* @param integer $width The width to size to
* @param integer $height The height to size to
* @return Image_Backend
*/
public function generatePaddedImage(Image_Backend $backend, $width, $height) {
return $backend->paddedResize($width, $height);
}
/**
* Determine if this image is of the specified size
*
* @param integer $width Width to check
* @param integer $height Height to check
* @return boolean
*/
public function isSize($width, $height) {
return $this->isWidth($width) && $this->isHeight($height);
}
/**
* Determine if this image is of the specified width
*
* @param integer $width Width to check
* @return boolean
*/
public function isWidth($width) {
return !empty($width) && $this->getWidth() == $width;
}
/**
* Determine if this image is of the specified width
*
* @param integer $height Height to check
* @return boolean
*/
public function isHeight($height) {
return !empty($height) && $this->getHeight() == $height;
}
/**
* Return an image object representing the image in the given format.
@ -323,6 +440,7 @@ class Image extends File {
* Generate an image on the specified format. It will save the image
* at the location specified by cacheFilename(). The image will be generated
* using the specific 'generate' method for the specified format.
*
* @param string $format Name of the format to generate.
* @param string $arg1 Argument to pass to the generate method.
* @param string $arg2 A second argument to pass to the generate method.
@ -352,6 +470,25 @@ class Image extends File {
/**
* Generate a resized copy of this image with the given width & height.
* Use in templates with $ResizedImage.
*
* @param integer $width Width to resize to
* @param integer $height Height to resize to
* @return Image
*/
public function ResizedImage($width, $height) {
return $this->isSize($width, $height)
? $this
: $this->getFormattedImage('ResizedImage', $width, $height);
}
/**
* Generate a resized copy of this image with the given width & height.
* Use in templates with $ResizedImage.
*
* @param Image_Backend $backend
* @param integer $width Width to resize to
* @param integer $height Height to resize to
* @return Image_Backend
*/
public function generateResizedImage(Image_Backend $backend, $width, $height) {
if(!$backend){
@ -361,10 +498,29 @@ class Image extends File {
return $backend->resize($width, $height);
}
}
/**
* Generate a resized copy of this image with the given width & height, cropping to maintain aspect ratio.
* Use in templates with $CroppedImage
*
* @param integer $width Width to crop to
* @param integer $height Height to crop to
* @return Image
*/
public function CroppedImage($width, $height) {
return $this->isSize($width, $height)
? $this
: $this->getFormattedImage('CroppedImage', $width, $height);
}
/**
* Generate a resized copy of this image with the given width & height, cropping to maintain aspect ratio.
* Use in templates with $CroppedImage
*
* @param Image_Backend $backend
* @param integer $width Width to crop to
* @param integer $height Height to crop to
* @return Image_Backend
*/
public function generateCroppedImage(Image_Backend $backend, $width, $height) {
return $backend->croppedResize($width, $height);

View File

@ -180,6 +180,8 @@ class ManyManyList extends RelationList {
$from = $query->getFrom();
unset($from[$this->joinTable]);
$query->setFrom($from);
$query->setDistinct(false);
$query->setOrderBy(null, null); // ensure any default sorting is removed, ORDER BY can break DELETE clauses
// Use a sub-query as SQLite does not support setting delete targets in
// joined queries.

View File

@ -1071,6 +1071,7 @@ class SQLQuery {
$clone->setOrderBy($this->orderby);
$clone->setGroupBy($this->groupby);
if($alias) {
$clone->setSelect(array());
$clone->selectField($column, $alias);
} else {
$clone->setSelect($column);

View File

@ -1077,8 +1077,12 @@ class Versioned extends DataExtension {
* @param $version Either the string 'Live' or a version number
*/
public function doRollbackTo($version) {
$this->owner->extend('onBeforeRollback', $version);
$this->publish($version, "Stage", true);
$this->owner->writeWithoutVersion();
$this->owner->extend('onAfterRollback', $version);
}
/**
@ -1222,4 +1226,32 @@ class Versioned_Version extends ViewableData {
public function Published() {
return !empty( $this->record['WasPublished'] );
}
/**
* Copied from DataObject to allow access via dot notation.
*/
public function relField($fieldName) {
$component = $this;
if(strpos($fieldName, '.') !== false) {
$parts = explode('.', $fieldName);
$fieldName = array_pop($parts);
// Traverse dot syntax
foreach($parts as $relation) {
if($component instanceof SS_List) {
if(method_exists($component,$relation)) $component = $component->$relation();
else $component = $component->relation($relation);
} else {
$component = $component->$relation();
}
}
}
// Unlike has-one's, these "relations" can return false
if($component) {
if ($component->hasMethod($fieldName)) return $component->$fieldName();
return $component->$fieldName;
}
}
}

View File

@ -148,8 +148,7 @@ class Date extends DBField {
*/
public function FormatI18N($formattingString) {
if($this->value) {
$fecfrm = strftime($formattingString, strtotime($this->value));
return utf8_encode($fecfrm);
return strftime($formattingString, strtotime($this->value));
}
}
@ -387,6 +386,15 @@ class Date extends DBField {
}
public function scaffoldFormField($title = null, $params = null) {
return new DateField($this->name, $title);
$field = DateField::create($this->name, $title);
// Show formatting hints for better usability
$field->setDescription(sprintf(
_t('FormField.Example', 'e.g. %s', 'Example format'),
Convert::raw2xml(Zend_Date::now()->toString($field->getConfig('dateformat')))
));
$field->setAttribute('placeholder', $field->getConfig('dateformat'));
return $field;
}
}

View File

@ -87,7 +87,23 @@ class SS_Datetime extends Date implements TemplateGlobalProvider {
}
public function scaffoldFormField($title = null, $params = null) {
return new DatetimeField($this->name, $title);
$field = DatetimeField::create($this->name, $title);
// Show formatting hints for better usability
$dateField = $field->getDateField();
$dateField->setDescription(sprintf(
_t('FormField.Example', 'e.g. %s', 'Example format'),
Convert::raw2xml(Zend_Date::now()->toString($dateField->getConfig('dateformat')))
));
$dateField->setAttribute('placeholder', $dateField->getConfig('dateformat'));
$timeField = $field->getTimeField();
$timeField->setDescription(sprintf(
_t('FormField.Example', 'e.g. %s', 'Example format'),
Convert::raw2xml(Zend_Date::now()->toString($timeField->getConfig('timeformat')))
));
$timeField->setAttribute('placeholder', $timeField->getConfig('timeformat'));
return $field;
}
/**

View File

@ -1,43 +1,67 @@
<?php
/**
* Represents a Decimal field.
*
* @package framework
* @subpackage model
*/
class Decimal extends DBField {
protected $wholeSize, $decimalSize, $defaultValue;
/**
* Create a new Decimal field.
*
* @param string $name
* @param int $wholeSize
* @param int $decimalSize
* @param float $defaultValue
*/
public function __construct($name = null, $wholeSize = 9, $decimalSize = 2, $defaultValue = 0) {
$this->wholeSize = isset($wholeSize) ? $wholeSize : 9;
$this->decimalSize = isset($decimalSize) ? $decimalSize : 2;
$this->defaultValue = $defaultValue;
$this->wholeSize = is_int($wholeSize) ? $wholeSize : 9;
$this->decimalSize = is_int($decimalSize) ? $decimalSize : 2;
$this->defaultValue = number_format((float) $defaultValue, $decimalSize);;
parent::__construct($name);
}
/**
* @return float
*/
public function Nice() {
return number_format($this->value,$this->decimalSize);
return number_format($this->value, $this->decimalSize);
}
/**
* @return int
*/
public function Int() {
return floor( $this->value );
return floor($this->value);
}
public function requireField() {
$parts=Array(
'datatype'=>'decimal',
'precision'=>"$this->wholeSize,$this->decimalSize",
'default'=>(double)$this->defaultValue,
'arrayValue'=>$this->arrayValue);
$parts = array(
'datatype' => 'decimal',
'precision' => "$this->wholeSize,$this->decimalSize",
'default' => $this->defaultValue,
'arrayValue' => $this->arrayValue
);
$values=Array('type'=>'decimal', 'parts'=>$parts);
$values = array(
'type' => 'decimal',
'parts' => $parts
);
DB::requireField($this->tableName, $this->name, $values);
}
/**
* @param DataObject $dataObject
*/
public function saveInto($dataObject) {
$fieldName = $this->name;
if($fieldName) {
$dataObject->$fieldName = (float)preg_replace('/[^0-9.\-\+]/', '', $this->value);
} else {
@ -45,31 +69,42 @@ class Decimal extends DBField {
}
}
/**
* @param string $title
* @param array $params
*
* @return NumericField
*/
public function scaffoldFormField($title = null, $params = null) {
return new NumericField($this->name, $title);
}
/**
* @return float
*/
public function nullValue() {
return "0.00";
}
/**
* Return an encoding of the given value suitable for inclusion in a SQL statement.
* If necessary, this should include quotes.
* Return an encoding of the given value suitable for inclusion in a SQL
* statement. If necessary, this should include quotes.
*
* @param float $value
*
* @return mixed
*/
public function prepValueForDB($value) {
if($value === true) {
return 1;
} if(!$value || !is_numeric($value)) {
if(strpos($value, '[')===false)
if(strpos($value, '[') === false) {
return '0';
else
} else {
return Convert::raw2sql($value);
}
} else {
return Convert::raw2sql($value);
}
}
}

View File

@ -163,7 +163,7 @@ class HTMLText extends Text {
}
// If it's got a content tag
if(preg_match('/<(img|embed|object|iframe)[^>]*>/i', $this->value)) {
if(preg_match('/<(img|embed|object|iframe|meta|source)[^>]*>/i', $this->value)) {
return true;
}

View File

@ -1,22 +1,31 @@
<?php
/**
* An abstract base class for the string field types (i.e. Varchar and Text)
*
* @package framework
* @subpackage model
* @author Pete Bacon Darwin
*
*/
abstract class StringField extends DBField {
/**
* @var boolean
*/
protected $nullifyEmpty = true;
/**
* @var array
*/
private static $casting = array(
"LimitCharacters" => "Text",
'LimitWordCount' => 'Text',
'LimitWordCountXML' => 'HTMLText',
"LowerCase" => "Text",
"UpperCase" => "Text",
);
/**
* Construct a string type field with a set of optional parameters
* Construct a string type field with a set of optional parameters.
*
* @param $name string The name of the field
* @param $options array An array of options e.g. array('nullifyEmpty'=>false). See
* {@link StringField::setOptions()} for information on the available options
@ -27,6 +36,7 @@ abstract class StringField extends DBField {
if(is_array($options)){
$this->setOptions($options);
}
parent::__construct($name);
}
@ -48,15 +58,20 @@ abstract class StringField extends DBField {
}
/**
* Set whether this field stores empty strings rather than converting them to null
* Set whether this field stores empty strings rather than converting
* them to null.
*
* @param $value boolean True if empty strings are to be converted to null
*/
public function setNullifyEmpty($value) {
$this->nullifyEmpty = ($value ? true : false);
}
/**
* Get whether this field stores empty strings rather than converting them to null
* @return bool True if empty strings are to be converted to null
* Get whether this field stores empty strings rather than converting
* them to null
*
* @return boolean True if empty strings are to be converted to null
*/
public function getNullifyEmpty() {
return $this->nullifyEmpty;
@ -93,6 +108,7 @@ abstract class StringField extends DBField {
*/
public function LimitCharacters($limit = 20, $add = '...') {
$value = trim($this->value);
if($this->stat('escape_type') == 'xml') {
$value = strip_tags($value);
$value = html_entity_decode($value, ENT_COMPAT, 'UTF-8');
@ -102,11 +118,55 @@ abstract class StringField extends DBField {
} else {
$value = (mb_strlen($value) > $limit) ? mb_substr($value, 0, $limit) . $add : $value;
}
return $value;
}
/**
* Converts the current value for this Enum DBField to lowercase.
* Limit this field's content by a number of words.
*
* CAUTION: This is not XML safe. Please use
* {@link LimitWordCountXML()} instead.
*
* @param int $numWords Number of words to limit by.
* @param string $add Ellipsis to add to the end of truncated string.
*
* @return string
*/
public function LimitWordCount($numWords = 26, $add = '...') {
$this->value = trim(Convert::xml2raw($this->value));
$ret = explode(' ', $this->value, $numWords + 1);
if(count($ret) <= $numWords - 1) {
$ret = $this->value;
} else {
array_pop($ret);
$ret = implode(' ', $ret) . $add;
}
return $ret;
}
/**
* Limit the number of words of the current field's
* content. This is XML safe, so characters like &
* are converted to &amp;
*
* @param int $numWords Number of words to limit by.
* @param string $add Ellipsis to add to the end of truncated string.
*
* @return string
*/
public function LimitWordCountXML($numWords = 26, $add = '...') {
$ret = $this->LimitWordCount($numWords, $add);
return Convert::raw2xml($ret);
}
/**
* Converts the current value for this StringField to lowercase.
*
* @return string
*/
public function LowerCase() {
@ -114,11 +174,10 @@ abstract class StringField extends DBField {
}
/**
* Converts the current value for this Enum DBField to uppercase.
* Converts the current value for this StringField to uppercase.
* @return string
*/
public function UpperCase() {
return mb_strtoupper($this->value);
}
}

View File

@ -38,41 +38,24 @@ class Text extends StringField {
* @see DBField::requireField()
*/
public function requireField() {
$parts=Array(
'datatype'=>'mediumtext',
'character set'=>'utf8',
'collate'=>'utf8_general_ci',
'arrayValue'=>$this->arrayValue
$parts = array(
'datatype' => 'mediumtext',
'character set' => 'utf8',
'collate' => 'utf8_general_ci',
'arrayValue' => $this->arrayValue
);
$values=Array('type'=>'text', 'parts'=>$parts);
$values= array(
'type' => 'text',
'parts' => $parts
);
DB::requireField($this->tableName, $this->name, $values, $this->default);
}
/**
* Limit this field's content by a number of words.
* CAUTION: This is not XML safe. Please use
* {@link LimitWordCountXML()} instead.
* Return the value of the field stripped of html tags.
*
* @param int $numWords Number of words to limit by
* @param string $add Ellipsis to add to the end of truncated string
* @return string
*/
public function LimitWordCount($numWords = 26, $add = '...') {
$this->value = trim(Convert::xml2raw($this->value));
$ret = explode(' ', $this->value, $numWords + 1);
if(count($ret) <= $numWords - 1) {
$ret = $this->value;
} else {
array_pop($ret);
$ret = implode(' ', $ret) . $add;
}
return $ret;
}
/**
* Return the value of the field stripped of html tags
* @return string
*/
public function NoHTML() {
@ -86,27 +69,16 @@ class Text extends StringField {
public function AbsoluteLinks() {
return HTTP::absoluteURLs($this->value);
}
/**
* Limit the number of words of the current field's
* content. This is XML safe, so characters like &
* are converted to &amp;
*
* @param int $numWords Number of words to limit by
* @param string $add Ellipsis to add to the end of truncated string
* @return string
*/
public function LimitWordCountXML($numWords = 26, $add = '...') {
$ret = $this->LimitWordCount($numWords, $add);
return Convert::raw2xml($ret);
}
/**
* Limit sentences, can be controlled by passing an integer.
*
* @param int $sentCount The amount of sentences you want.
*/
public function LimitSentences($sentCount = 2) {
if(!is_numeric($sentCount)) user_error("Text::LimitSentence() expects one numeric argument", E_USER_NOTICE);
if(!is_numeric($sentCount)) {
user_error("Text::LimitSentence() expects one numeric argument", E_USER_NOTICE);
}
$output = array();
$data = trim(Convert::xml2raw($this->value));
@ -181,7 +153,7 @@ class Text extends StringField {
}
/**
* Performs the same function as the big summary, but doesnt trim new paragraphs off data.
* Performs the same function as the big summary, but doesn't trim new paragraphs off data.
* Caution: Not XML/HTML-safe - does not respect closing tags.
*/
public function BigSummary($maxWords = 50, $plain = 1) {
@ -348,5 +320,3 @@ class Text extends StringField {
return new TextField($this->name, $title);
}
}

View File

@ -71,7 +71,16 @@ class Time extends DBField {
}
public function scaffoldFormField($title = null, $params = null) {
return new TimeField($this->name, $title);
$field = TimeField::create($this->name, $title);
// Show formatting hints for better usability
$field->setDescription(sprintf(
_t('FormField.Example', 'e.g. %s', 'Example format'),
Convert::raw2xml(Zend_Date::now()->toString($field->getConfig('timeformat')))
));
$field->setAttribute('placeholder', $field->getConfig('timeformat'));
return $field;
}
}

View File

@ -12,14 +12,14 @@
width: 20px;
float : left;
}
li div.field {
li > div.selectiongroup_item {
display: none;
font-size: 1em;
}
li input, .right .SelectionGroup li label {
display: block;
}
li.selected div.field {
li.selected > div.selectiongroup_item {
margin-left: 30px;
display: block;
margin-bottom: 1em;

View File

@ -102,12 +102,18 @@ class Group extends DataObject {
$config->getComponentByType('GridFieldDetailForm')
->setValidator(new Member_Validator())
->setItemEditFormCallback(function($form, $component) use($group) {
// If new records are created in a group context,
// set this group by default.
$record = $form->getRecord();
if($record && !$record->ID) {
$groupsField = $form->Fields()->dataFieldByName('DirectGroups');
if($groupsField) $groupsField->setValue($group->ID);
$groupsField = $form->Fields()->dataFieldByName('DirectGroups');
if($groupsField) {
// If new records are created in a group context,
// set this group by default.
if($record && !$record->ID) {
$groupsField->setValue($group->ID);
} elseif($record && $record->ID) {
// TODO Mark disabled once chosen.js supports it
// $groupsField->setDisabledItems(array($group->ID));
$form->Fields()->replaceField('DirectGroups', $groupsField->performReadonlyTransformation());
}
}
});
$memberList = GridField::create('Members',false, $this->Members(), $config)->addExtraClass('members_grid');

View File

@ -91,10 +91,11 @@ class Security extends Controller {
/**
* Random secure token, can be used as a crypto key internally.
* Generate one through 'sake dev/generatesecuretoken'.
*
*
* @config
* @var String
*/
public static $token;
private static $token;
/**
* Get location of word list file

View File

@ -98,4 +98,14 @@ class CmsFormsContext extends BehatContext
$this->getMainContext()->assertElementContains('#' . $inputField->getAttribute('id'), $value);
}
/**
* @Given /^I should see a "([^"]*)" button$/
*/
public function iShouldSeeAButton($text)
{
$page = $this->getSession()->getPage();
$element = $page->find('named', array('link_or_button', "'$text'"));
assertNotNull($element, sprintf('%s button not found', $text));
}
}

View File

@ -242,6 +242,13 @@ class DirectorTest extends SapphireTest {
$this->assertFalse($output);
}
public function testForceSSLAlternateDomain() {
Config::inst()->update('Director', 'alternate_base_url', '/');
$_SERVER['REQUEST_URI'] = Director::baseURL() . 'admin';
$output = Director::forceSSL(array('/^admin/'), 'secure.mysite.com');
$this->assertEquals($output, 'https://secure.mysite.com/admin');
}
/**
* @covers Director::extract_request_headers()
*/
@ -274,6 +281,10 @@ class DirectorTest extends SapphireTest {
$this->assertEquals($headers, Director::extract_request_headers($request));
}
public function testUnmatchedRequestReturns404() {
$this->assertEquals(404, Director::test('no-route')->getStatusCode());
}
}
class DirectorTestRequest_Controller extends Controller implements TestOnly {

View File

@ -19,29 +19,35 @@ class CoreTest extends SapphireTest {
if(file_exists($this->tempPath)) {
$this->assertEquals(getTempFolder(BASE_PATH), $this->tempPath);
} else {
$user = getTempFolderUsername();
// A typical Windows location for where sites are stored on IIS
$this->assertEquals(getTempFolder('C:\\inetpub\\wwwroot\\silverstripe-test-project'),
sys_get_temp_dir() . '/silverstripe-cacheC--inetpub-wwwroot-silverstripe-test-project');
$this->assertEquals(sys_get_temp_dir() . '/silverstripe-cacheC--inetpub-wwwroot-silverstripe-test-project/' . $user,
getTempFolder('C:\\inetpub\\wwwroot\\silverstripe-test-project'));
// A typical Mac OS X location for where sites are stored
$this->assertEquals(getTempFolder('/Users/joebloggs/Sites/silverstripe-test-project'),
sys_get_temp_dir() . '/silverstripe-cache-Users-joebloggs-Sites-silverstripe-test-project');
$this->assertEquals(sys_get_temp_dir() . '/silverstripe-cache-Users-joebloggs-Sites-silverstripe-test-project/' . $user,
getTempFolder('/Users/joebloggs/Sites/silverstripe-test-project'));
// A typical Linux location for where sites are stored
$this->assertEquals(getTempFolder('/var/www/silverstripe-test-project'),
sys_get_temp_dir() . '/silverstripe-cache-var-www-silverstripe-test-project');
$this->assertEquals(sys_get_temp_dir() . '/silverstripe-cache-var-www-silverstripe-test-project/' . $user,
getTempFolder('/var/www/silverstripe-test-project'));
}
}
public function tearDown() {
parent::tearDown();
$user = getTempFolderUsername();
if(file_exists(sys_get_temp_dir() . '/silverstripe-cacheC--inetpub-wwwroot-silverstripe-test-project')) {
rmdir(sys_get_temp_dir() . '/silverstripe-cacheC--inetpub-wwwroot-silverstripe-test-project/' . $user);
rmdir(sys_get_temp_dir() . '/silverstripe-cacheC--inetpub-wwwroot-silverstripe-test-project');
}
if(file_exists(sys_get_temp_dir() . '/silverstripe-cache-Users-joebloggs-Sites-silverstripe-test-project')) {
rmdir(sys_get_temp_dir() . '/silverstripe-cache-Users-joebloggs-Sites-silverstripe-test-project/' . $user);
rmdir(sys_get_temp_dir() . '/silverstripe-cache-Users-joebloggs-Sites-silverstripe-test-project');
}
if(file_exists(sys_get_temp_dir() . '/silverstripe-cache-var-www-silverstripe-test-project')) {
rmdir(sys_get_temp_dir() . '/silverstripe-cache-var-www-silverstripe-test-project/' . $user);
rmdir(sys_get_temp_dir() . '/silverstripe-cache-var-www-silverstripe-test-project');
}
}

View File

@ -265,10 +265,12 @@ class ObjectTest extends SapphireTest {
// ObjectTest_ExtendTest1 is already present in $extensions
ObjectTest_ExtensionRemoveTest::remove_extension('ObjectTest_ExtendTest1');
$this->assertFalse(
ObjectTest_ExtensionRemoveTest::has_extension('ObjectTest_ExtendTest1'),
"Extension added through \$extensions are detected as removed in has_extension()"
);
$objectTest_ExtensionRemoveTest = new ObjectTest_ExtensionRemoveTest();
$this->assertFalse(
$objectTest_ExtensionRemoveTest->hasExtension('ObjectTest_ExtendTest1'),
@ -276,6 +278,27 @@ class ObjectTest extends SapphireTest {
);
}
public function testRemoveExtensionWithParameters() {
ObjectTest_ExtensionRemoveTest::add_extension('ObjectTest_ExtendTest2("MyParam")');
$this->assertTrue(
ObjectTest_ExtensionRemoveTest::has_extension('ObjectTest_ExtendTest2'),
"Extension added through \$add_extension() are added correctly"
);
ObjectTest_ExtensionRemoveTest::remove_extension('ObjectTest_ExtendTest2');
$this->assertFalse(
Object::has_extension('ObjectTest_ExtensionRemoveTest', 'ObjectTest_ExtendTest2'),
"Extension added through \$add_extension() are detected as removed in has_extension()"
);
$objectTest_ExtensionRemoveTest = new ObjectTest_ExtensionRemoveTest();
$this->assertFalse(
$objectTest_ExtensionRemoveTest->hasExtension('ObjectTest_ExtendTest2'),
"Extensions added through \$extensions are detected as removed in instances through hasExtension()"
);
}
public function testParentClass() {
$this->assertEquals(ObjectTest_MyObject::create()->parentClass(), 'Object');
}

View File

@ -254,7 +254,7 @@ class RequirementsTest extends SapphireTest {
$backend->delete_combined_files('RequirementsTest_bc.js');
$html = $backend->includeInHTML(false, self::$html_template);
/* Javascript has correct path */
$this->assertTrue((bool)preg_match('/src=".*\/RequirementsTest_a\.js\?m=\d\d+&amp;test=1&amp;test=2&amp;test=3/', $html),
'javascript has correct path');

View File

@ -242,7 +242,7 @@ class GridFieldDetailFormTest_Person extends DataObject implements TestOnly {
)
);
private static $default_sort = 'FirstName';
private static $default_sort = '"FirstName"';
public function getCMSFields() {
$fields = parent::getCMSFields();
@ -266,7 +266,7 @@ class GridFieldDetailFormTest_PeopleGroup extends DataObject implements TestOnly
'People' => 'GridFieldDetailFormTest_Person'
);
private static $default_sort = 'Name';
private static $default_sort = '"Name"';
public function getCMSFields() {
$fields = parent::getCMSFields();
@ -290,7 +290,7 @@ class GridFieldDetailFormTest_Category extends DataObject implements TestOnly {
'People' => 'GridFieldDetailFormTest_Person'
);
private static $default_sort = 'Name';
private static $default_sort = '"Name"';
public function getCMSFields() {
$fields = parent::getCMSFields();

View File

@ -1161,7 +1161,7 @@ class DataObjectTest_Team extends DataObject implements TestOnly {
)
);
private static $default_sort = "Title";
private static $default_sort = '"Title"';
public function MyTitle() {
return 'Team ' . $this->Title;

View File

@ -60,11 +60,11 @@ class HierarchyTest extends SapphireTest {
$obj3 = Versioned::get_including_deleted("HierarchyTest_Object", "\"Title\" = 'Obj 3'")->First();
// Check that both obj 3 children are returned
$this->assertEquals(array("Obj 3a", "Obj 3b"),
$this->assertEquals(array("Obj 3a", "Obj 3b", "Obj 3c"),
$obj3->AllHistoricalChildren()->column('Title'));
// Check numHistoricalChildren
$this->assertEquals(2, $obj3->numHistoricalChildren());
$this->assertEquals(3, $obj3->numHistoricalChildren());
}
@ -94,7 +94,7 @@ class HierarchyTest extends SapphireTest {
public function testNumChildren() {
$this->assertEquals($this->objFromFixture('HierarchyTest_Object', 'obj1')->numChildren(), 0);
$this->assertEquals($this->objFromFixture('HierarchyTest_Object', 'obj2')->numChildren(), 2);
$this->assertEquals($this->objFromFixture('HierarchyTest_Object', 'obj3')->numChildren(), 2);
$this->assertEquals($this->objFromFixture('HierarchyTest_Object', 'obj3')->numChildren(), 3);
$this->assertEquals($this->objFromFixture('HierarchyTest_Object', 'obj2a')->numChildren(), 2);
$this->assertEquals($this->objFromFixture('HierarchyTest_Object', 'obj2b')->numChildren(), 0);
$this->assertEquals($this->objFromFixture('HierarchyTest_Object', 'obj3a')->numChildren(), 2);
@ -200,29 +200,13 @@ class HierarchyTest extends SapphireTest {
true, // rootCall
$nodeCountThreshold
);
$parser = new CSSContentParser($html);
$node2 = $parser->getByXpath(
'//ul/li[@id="' . $obj2->ID . '"]'
);
$this->assertTrue(
(bool)$node2,
$this->assertTreeContains($html, array($obj2),
'Contains root elements'
);
$node2a = $parser->getByXpath(
'//ul/li[@id="' . $obj2->ID . '"]' .
'/ul/li[@id="' . $obj2a->ID . '"]'
);
$this->assertTrue(
(bool)$node2a,
$this->assertTreeContains($html, array($obj2, $obj2a),
'Contains child elements (in correct nesting)'
);
$node2aa = $parser->getByXpath(
'//ul/li[@id="' . $obj2->ID . '"]' .
'/ul/li[@id="' . $obj2a->ID . '"]' .
'/ul/li[@id="' . $obj2aa->ID . '"]'
);
$this->assertTrue(
(bool)$node2aa,
$this->assertTreeContains($html, array($obj2, $obj2a, $obj2aa),
'Contains grandchild elements (in correct nesting)'
);
}
@ -247,27 +231,13 @@ class HierarchyTest extends SapphireTest {
true,
$nodeCountThreshold
);
$parser = new CSSContentParser($html);
$node1 = $parser->getByXpath(
'//ul/li[@id="' . $obj1->ID . '"]'
);
$this->assertTrue(
(bool)$node1,
$this->assertTreeContains($html, array($obj1),
'Contains root elements'
);
$node2 = $parser->getByXpath(
'//ul/li[@id="' . $obj2->ID . '"]'
);
$this->assertTrue(
(bool)$node2,
$this->assertTreeContains($html, array($obj2),
'Contains root elements'
);
$node2a = $parser->getByXpath(
'//ul/li[@id="' . $obj2->ID . '"]' .
'/ul/li[@id="' . $obj2a->ID . '"]'
);
$this->assertFalse(
(bool)$node2a,
$this->assertTreeNotContains($html, array($obj2, $obj2a),
'Does not contains child elements because they exceed minNodeCount'
);
}
@ -296,20 +266,12 @@ class HierarchyTest extends SapphireTest {
true,
$nodeCountThreshold
);
$parser = new CSSContentParser($html);
$node2 = $parser->getByXpath(
'//ul/li[@id="' . $obj2->ID . '"]'
);
$this->assertTrue(
(bool)$node2,
$this->assertTreeContains($html, array($obj2),
'Contains root elements'
);
$node2aa = $parser->getByXpath(
'//ul/li[@id="' . $obj2->ID . '"]' .
'/ul/li[@id="' . $obj2a->ID . '"]' .
'/ul/li[@id="' . $obj2aa->ID . '"]'
$this->assertTreeContains($html, array($obj2, $obj2a, $obj2aa),
'Does contain marked children nodes regardless of configured threshold'
);
$this->assertTrue((bool)$node2aa);
}
public function testGetChildrenAsULMinNodeCountWithFilters() {
@ -343,21 +305,10 @@ class HierarchyTest extends SapphireTest {
true,
$nodeCountThreshold
);
$parser = new CSSContentParser($html);
$node1 = $parser->getByXpath(
'//ul/li[@id="' . $obj1->ID . '"]'
);
$this->assertFalse(
(bool)$node1,
$this->assertTreeNotContains($html, array($obj1),
'Does not contain root elements which dont match the filter'
);
$node2aa = $parser->getByXpath(
'//ul/li[@id="' . $obj2->ID . '"]' .
'/ul/li[@id="' . $obj2a->ID . '"]' .
'/ul/li[@id="' . $obj2aa->ID . '"]'
);
$this->assertTrue(
(bool)$node2aa,
$this->assertTreeContains($html, array($obj2, $obj2a, $obj2aa),
'Contains non-root elements which match the filter'
);
}
@ -377,8 +328,6 @@ class HierarchyTest extends SapphireTest {
$root->setMarkingFilterFunction(function($record) use($obj2, $obj2a, $obj2aa) {
// Results need to include parent hierarchy, even if we just want to
// match the innermost node.
// var_dump($record->Title);
// var_dump(in_array($record->ID, array($obj2->ID, $obj2a->ID, $obj2aa->ID)));
return in_array($record->ID, array($obj2->ID, $obj2a->ID, $obj2aa->ID));
});
$root->markPartialTree($nodeCountThreshold);
@ -393,25 +342,83 @@ class HierarchyTest extends SapphireTest {
true,
$nodeCountThreshold
);
$parser = new CSSContentParser($html);
$node1 = $parser->getByXpath(
'//ul/li[@id="' . $obj1->ID . '"]'
);
$this->assertFalse(
(bool)$node1,
$this->assertTreeNotContains($html, array($obj1),
'Does not contain root elements which dont match the filter'
);
$node2aa = $parser->getByXpath(
'//ul/li[@id="' . $obj2->ID . '"]' .
'/ul/li[@id="' . $obj2a->ID . '"]' .
'/ul/li[@id="' . $obj2aa->ID . '"]'
);
$this->assertTrue(
(bool)$node2aa,
$this->assertTreeContains($html, array($obj2, $obj2a, $obj2aa),
'Contains non-root elements which match the filter'
);
}
public function testGetChildrenAsULNodeThresholdLeaf() {
$obj1 = $this->objFromFixture('HierarchyTest_Object', 'obj1');
$obj2 = $this->objFromFixture('HierarchyTest_Object', 'obj2');
$obj2a = $this->objFromFixture('HierarchyTest_Object', 'obj2a');
$obj3 = $this->objFromFixture('HierarchyTest_Object', 'obj3');
$obj3a = $this->objFromFixture('HierarchyTest_Object', 'obj3a');
$nodeCountThreshold = 99;
$root = new HierarchyTest_Object();
$root->markPartialTree($nodeCountThreshold);
$nodeCountCallback = function($parent, $numChildren) {
// Set low enough that it the fixture structure should exceed it
if($parent->ID && $numChildren > 2) {
return '<span class="exceeded">Exceeded!</span>';
}
};
$html = $root->getChildrenAsUL(
"",
'"<li id=\"" . $child->ID . "\">" . $child->Title',
null,
true, // limit to marked
"AllChildrenIncludingDeleted",
"numChildren",
true,
$nodeCountThreshold,
$nodeCountCallback
);
$this->assertTreeContains($html, array($obj1),
'Does contain root elements regardless of count'
);
$this->assertTreeContains($html, array($obj3),
'Does contain root elements regardless of count'
);
$this->assertTreeContains($html, array($obj2, $obj2a),
'Contains children which do not exceed threshold'
);
$this->assertTreeNotContains($html, array($obj3, $obj3a),
'Does not contain children which exceed threshold'
);
}
/**
* @param String $html [description]
* @param array $nodes Breadcrumb path as array
* @param String $message
*/
protected function assertTreeContains($html, $nodes, $message = null) {
$parser = new CSSContentParser($html);
$xpath = '/';
foreach($nodes as $node) $xpath .= '/ul/li[@id="' . $node->ID . '"]';
$match = $parser->getByXpath($xpath);
self::assertThat((bool)$match, self::isTrue(), $message);
}
/**
* @param String $html [description]
* @param array $nodes Breadcrumb path as array
* @param String $message
*/
protected function assertTreeNotContains($html, $nodes, $message = null) {
$parser = new CSSContentParser($html);
$xpath = '/';
foreach($nodes as $node) $xpath .= '/ul/li[@id="' . $node->ID . '"]';
$match = $parser->getByXpath($xpath);
self::assertThat((bool)$match, self::isFalse(), $message);
}
}
class HierarchyTest_Object extends DataObject implements TestOnly {

View File

@ -17,6 +17,9 @@ HierarchyTest_Object:
obj3b:
Parent: =>HierarchyTest_Object.obj3
Title: Obj 3b
obj3c:
Parent: =>HierarchyTest_Object.obj3
Title: Obj 3c
obj2aa:
Parent: =>HierarchyTest_Object.obj2a
Title: Obj 2aa

View File

@ -84,6 +84,9 @@ class ImageTest extends SapphireTest {
$this->assertEquals($expected, $actual);
}
/**
* Tests that multiple image manipulations may be performed on a single Image
*/
public function testMultipleGenerateManipulationCalls() {
$image = $this->objFromFixture('Image', 'imageWithoutTitle');
@ -101,6 +104,78 @@ class ImageTest extends SapphireTest {
$this->assertEquals($expected, $actual);
}
/**
* Tests that image manipulations that do not affect the resulting dimensions
* of the output image do not resample the file.
*/
public function testReluctanceToResampling() {
$image = $this->objFromFixture('Image', 'imageWithoutTitle');
$this->assertTrue($image->isSize(300, 300));
// Set width to 50 pixels
$imageSetWidth = $image->SetWidth(300);
$this->assertEquals($imageSetWidth->getWidth(), 300);
$this->assertEquals($image->Filename, $imageSetWidth->Filename);
// Set height to 300 pixels
$imageSetHeight = $image->SetHeight(300);
$this->assertEquals($imageSetHeight->getHeight(), 300);
$this->assertEquals($image->Filename, $imageSetHeight->Filename);
// Crop image to 300 x 300
$imageCropped = $image->CroppedImage(300, 300);
$this->assertTrue($imageCropped->isSize(300, 300));
$this->assertEquals($image->Filename, $imageCropped->Filename);
// Resize (padded) to 300 x 300
$imageSized = $image->SetSize(300, 300);
$this->assertTrue($imageSized->isSize(300, 300));
$this->assertEquals($image->Filename, $imageSized->Filename);
// Padded image 300 x 300 (same as above)
$imagePadded = $image->PaddedImage(300, 300);
$this->assertTrue($imagePadded->isSize(300, 300));
$this->assertEquals($image->Filename, $imagePadded->Filename);
// Resized (stretched) to 300 x 300
$imageStretched = $image->ResizedImage(300, 300);
$this->assertTrue($imageStretched->isSize(300, 300));
$this->assertEquals($image->Filename, $imageStretched->Filename);
// SetRatioSize (various options)
$imageSetRatioSize = $image->SetRatioSize(300, 600);
$this->assertTrue($imageSetRatioSize->isSize(300, 300));
$this->assertEquals($image->Filename, $imageSetRatioSize->Filename);
$imageSetRatioSize = $image->SetRatioSize(600, 300);
$this->assertTrue($imageSetRatioSize->isSize(300, 300));
$this->assertEquals($image->Filename, $imageSetRatioSize->Filename);
$imageSetRatioSize = $image->SetRatioSize(300, 300);
$this->assertTrue($imageSetRatioSize->isSize(300, 300));
$this->assertEquals($image->Filename, $imageSetRatioSize->Filename);
}
public function testImageResize() {
$image = $this->objFromFixture('Image', 'imageWithoutTitle');
$this->assertTrue($image->isSize(300, 300));
// Test normal resize
$resized = $image->SetSize(150, 100);
$this->assertTrue($resized->isSize(150, 100));
// Test cropped resize
$cropped = $image->CroppedImage(100, 200);
$this->assertTrue($cropped->isSize(100, 200));
// Test padded resize
$padded = $image->PaddedImage(200, 100);
$this->assertTrue($padded->isSize(200, 100));
// Test SetRatioSize
$ratio = $image->SetRatioSize(80, 160);
$this->assertTrue($ratio->isSize(80, 80));
}
public function testGeneratedImageDeletion() {
$image = $this->objFromFixture('Image', 'imageWithMetacharacters');
$image_generated = $image->SetWidth(200);

View File

@ -374,7 +374,7 @@ class SQLQueryTest extends SapphireTest {
public function testAggregate() {
$query = new SQLQuery();
$query->setFrom('"SQLQueryTest_DO"');
$query->setGroupBy("Common");
$query->setGroupBy('"Common"');
$queryClone = $query->aggregate('COUNT(*)', 'cnt');
$result = $queryClone->execute();
@ -391,7 +391,7 @@ class SQLQueryTest extends SapphireTest {
$query = new SQLQuery();
$query->setSelect(array('"Name"', '"Meta"'));
$query->setFrom('"SQLQueryTest_DO"');
$query->setOrderBy(array('MAX(Date)'));
$query->setOrderBy(array('MAX("Date")'));
$query->setGroupBy(array('"Name"', '"Meta"'));
$query->setLimit('1', '1');

View File

@ -432,6 +432,22 @@ after')
$this->assertEquals('AD',
$this->render('A<% if Right == Wrong %>B<% else_if RawVal != RawVal %>C<% end_if %>D'));
// test inequalities with simple numbers
$this->assertEquals('ABD', $this->render('A<% if 5 > 3 %>B<% else %>C<% end_if %>D'));
$this->assertEquals('ABD', $this->render('A<% if 5 >= 3 %>B<% else %>C<% end_if %>D'));
$this->assertEquals('ACD', $this->render('A<% if 3 > 5 %>B<% else %>C<% end_if %>D'));
$this->assertEquals('ACD', $this->render('A<% if 3 >= 5 %>B<% else %>C<% end_if %>D'));
$this->assertEquals('ABD', $this->render('A<% if 3 < 5 %>B<% else %>C<% end_if %>D'));
$this->assertEquals('ABD', $this->render('A<% if 3 <= 5 %>B<% else %>C<% end_if %>D'));
$this->assertEquals('ACD', $this->render('A<% if 5 < 3 %>B<% else %>C<% end_if %>D'));
$this->assertEquals('ACD', $this->render('A<% if 5 <= 3 %>B<% else %>C<% end_if %>D'));
$this->assertEquals('ABD', $this->render('A<% if 4 <= 4 %>B<% else %>C<% end_if %>D'));
$this->assertEquals('ABD', $this->render('A<% if 4 >= 4 %>B<% else %>C<% end_if %>D'));
$this->assertEquals('ACD', $this->render('A<% if 4 > 4 %>B<% else %>C<% end_if %>D'));
$this->assertEquals('ACD', $this->render('A<% if 4 < 4 %>B<% else %>C<% end_if %>D'));
// Bare words with ending space
$this->assertEquals('ABC',
$this->render('A<% if "RawVal" == RawVal %>B<% end_if %>C'));

View File

@ -999,11 +999,11 @@ class SSTemplateParser extends Parser {
}
/* FreeString: /[^,)%!=|&]+/ */
/* FreeString: /[^,)%!=><|&]+/ */
protected $match_FreeString_typestack = array('FreeString');
function match_FreeString ($stack = array()) {
$matchrule = "FreeString"; $result = $this->construct($matchrule, $matchrule, null);
if (( $subres = $this->rx( '/[^,)%!=|&]+/' ) ) !== FALSE) {
if (( $subres = $this->rx( '/[^,)%!=><|&]+/' ) ) !== FALSE) {
$result["text"] .= $subres;
return $this->finalise($result);
}
@ -1155,48 +1155,114 @@ class SSTemplateParser extends Parser {
$res['php'] = "'" . str_replace("'", "\\'", trim($sub['text'])) . "'";
}
/* ComparisonOperator: "==" | "!=" | "=" */
/* ComparisonOperator: "!=" | "==" | ">=" | ">" | "<=" | "<" | "=" */
protected $match_ComparisonOperator_typestack = array('ComparisonOperator');
function match_ComparisonOperator ($stack = array()) {
$matchrule = "ComparisonOperator"; $result = $this->construct($matchrule, $matchrule, null);
$_171 = NULL;
$_187 = NULL;
do {
$res_164 = $result;
$pos_164 = $this->pos;
if (( $subres = $this->literal( '==' ) ) !== FALSE) {
if (( $subres = $this->literal( '!=' ) ) !== FALSE) {
$result["text"] .= $subres;
$_171 = TRUE; break;
$_187 = TRUE; break;
}
$result = $res_164;
$this->pos = $pos_164;
$_169 = NULL;
$_185 = NULL;
do {
$res_166 = $result;
$pos_166 = $this->pos;
if (( $subres = $this->literal( '!=' ) ) !== FALSE) {
if (( $subres = $this->literal( '==' ) ) !== FALSE) {
$result["text"] .= $subres;
$_169 = TRUE; break;
$_185 = TRUE; break;
}
$result = $res_166;
$this->pos = $pos_166;
if (substr($this->string,$this->pos,1) == '=') {
$this->pos += 1;
$result["text"] .= '=';
$_169 = TRUE; break;
$_183 = NULL;
do {
$res_168 = $result;
$pos_168 = $this->pos;
if (( $subres = $this->literal( '>=' ) ) !== FALSE) {
$result["text"] .= $subres;
$_183 = TRUE; break;
}
$result = $res_168;
$this->pos = $pos_168;
$_181 = NULL;
do {
$res_170 = $result;
$pos_170 = $this->pos;
if (substr($this->string,$this->pos,1) == '>') {
$this->pos += 1;
$result["text"] .= '>';
$_181 = TRUE; break;
}
$result = $res_170;
$this->pos = $pos_170;
$_179 = NULL;
do {
$res_172 = $result;
$pos_172 = $this->pos;
if (( $subres = $this->literal( '<=' ) ) !== FALSE) {
$result["text"] .= $subres;
$_179 = TRUE; break;
}
$result = $res_172;
$this->pos = $pos_172;
$_177 = NULL;
do {
$res_174 = $result;
$pos_174 = $this->pos;
if (substr($this->string,$this->pos,1) == '<') {
$this->pos += 1;
$result["text"] .= '<';
$_177 = TRUE; break;
}
$result = $res_174;
$this->pos = $pos_174;
if (substr($this->string,$this->pos,1) == '=') {
$this->pos += 1;
$result["text"] .= '=';
$_177 = TRUE; break;
}
$result = $res_174;
$this->pos = $pos_174;
$_177 = FALSE; break;
}
while(0);
if( $_177 === TRUE ) { $_179 = TRUE; break; }
$result = $res_172;
$this->pos = $pos_172;
$_179 = FALSE; break;
}
while(0);
if( $_179 === TRUE ) { $_181 = TRUE; break; }
$result = $res_170;
$this->pos = $pos_170;
$_181 = FALSE; break;
}
while(0);
if( $_181 === TRUE ) { $_183 = TRUE; break; }
$result = $res_168;
$this->pos = $pos_168;
$_183 = FALSE; break;
}
while(0);
if( $_183 === TRUE ) { $_185 = TRUE; break; }
$result = $res_166;
$this->pos = $pos_166;
$_169 = FALSE; break;
$_185 = FALSE; break;
}
while(0);
if( $_169 === TRUE ) { $_171 = TRUE; break; }
if( $_185 === TRUE ) { $_187 = TRUE; break; }
$result = $res_164;
$this->pos = $pos_164;
$_171 = FALSE; break;
$_187 = FALSE; break;
}
while(0);
if( $_171 === TRUE ) { return $this->finalise($result); }
if( $_171 === FALSE) { return FALSE; }
if( $_187 === TRUE ) { return $this->finalise($result); }
if( $_187 === FALSE) { return FALSE; }
}
@ -1204,27 +1270,27 @@ class SSTemplateParser extends Parser {
protected $match_Comparison_typestack = array('Comparison');
function match_Comparison ($stack = array()) {
$matchrule = "Comparison"; $result = $this->construct($matchrule, $matchrule, null);
$_178 = NULL;
$_194 = NULL;
do {
$matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_178 = FALSE; break; }
else { $_194 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'ComparisonOperator'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_178 = FALSE; break; }
else { $_194 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_178 = FALSE; break; }
$_178 = TRUE; break;
else { $_194 = FALSE; break; }
$_194 = TRUE; break;
}
while(0);
if( $_178 === TRUE ) { return $this->finalise($result); }
if( $_178 === FALSE) { return FALSE; }
if( $_194 === TRUE ) { return $this->finalise($result); }
if( $_194 === FALSE) { return FALSE; }
}
@ -1247,11 +1313,11 @@ class SSTemplateParser extends Parser {
protected $match_PresenceCheck_typestack = array('PresenceCheck');
function match_PresenceCheck ($stack = array()) {
$matchrule = "PresenceCheck"; $result = $this->construct($matchrule, $matchrule, null);
$_185 = NULL;
$_201 = NULL;
do {
$res_183 = $result;
$pos_183 = $this->pos;
$_182 = NULL;
$res_199 = $result;
$pos_199 = $this->pos;
$_198 = NULL;
do {
$stack[] = $result; $result = $this->construct( $matchrule, "Not" );
if (( $subres = $this->literal( 'not' ) ) !== FALSE) {
@ -1261,27 +1327,27 @@ class SSTemplateParser extends Parser {
}
else {
$result = array_pop($stack);
$_182 = FALSE; break;
$_198 = FALSE; break;
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$_182 = TRUE; break;
$_198 = TRUE; break;
}
while(0);
if( $_182 === FALSE) {
$result = $res_183;
$this->pos = $pos_183;
unset( $res_183 );
unset( $pos_183 );
if( $_198 === FALSE) {
$result = $res_199;
$this->pos = $pos_199;
unset( $res_199 );
unset( $pos_199 );
}
$matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_185 = FALSE; break; }
$_185 = TRUE; break;
else { $_201 = FALSE; break; }
$_201 = TRUE; break;
}
while(0);
if( $_185 === TRUE ) { return $this->finalise($result); }
if( $_185 === FALSE) { return FALSE; }
if( $_201 === TRUE ) { return $this->finalise($result); }
if( $_201 === FALSE) { return FALSE; }
}
@ -1306,31 +1372,31 @@ class SSTemplateParser extends Parser {
protected $match_IfArgumentPortion_typestack = array('IfArgumentPortion');
function match_IfArgumentPortion ($stack = array()) {
$matchrule = "IfArgumentPortion"; $result = $this->construct($matchrule, $matchrule, null);
$_190 = NULL;
$_206 = NULL;
do {
$res_187 = $result;
$pos_187 = $this->pos;
$res_203 = $result;
$pos_203 = $this->pos;
$matcher = 'match_'.'Comparison'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_190 = TRUE; break;
$_206 = TRUE; break;
}
$result = $res_187;
$this->pos = $pos_187;
$result = $res_203;
$this->pos = $pos_203;
$matcher = 'match_'.'PresenceCheck'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_190 = TRUE; break;
$_206 = TRUE; break;
}
$result = $res_187;
$this->pos = $pos_187;
$_190 = FALSE; break;
$result = $res_203;
$this->pos = $pos_203;
$_206 = FALSE; break;
}
while(0);
if( $_190 === TRUE ) { return $this->finalise($result); }
if( $_190 === FALSE) { return FALSE; }
if( $_206 === TRUE ) { return $this->finalise($result); }
if( $_206 === FALSE) { return FALSE; }
}
@ -1343,27 +1409,27 @@ class SSTemplateParser extends Parser {
protected $match_BooleanOperator_typestack = array('BooleanOperator');
function match_BooleanOperator ($stack = array()) {
$matchrule = "BooleanOperator"; $result = $this->construct($matchrule, $matchrule, null);
$_195 = NULL;
$_211 = NULL;
do {
$res_192 = $result;
$pos_192 = $this->pos;
$res_208 = $result;
$pos_208 = $this->pos;
if (( $subres = $this->literal( '||' ) ) !== FALSE) {
$result["text"] .= $subres;
$_195 = TRUE; break;
$_211 = TRUE; break;
}
$result = $res_192;
$this->pos = $pos_192;
$result = $res_208;
$this->pos = $pos_208;
if (( $subres = $this->literal( '&&' ) ) !== FALSE) {
$result["text"] .= $subres;
$_195 = TRUE; break;
$_211 = TRUE; break;
}
$result = $res_192;
$this->pos = $pos_192;
$_195 = FALSE; break;
$result = $res_208;
$this->pos = $pos_208;
$_211 = FALSE; break;
}
while(0);
if( $_195 === TRUE ) { return $this->finalise($result); }
if( $_195 === FALSE) { return FALSE; }
if( $_211 === TRUE ) { return $this->finalise($result); }
if( $_211 === FALSE) { return FALSE; }
}
@ -1371,18 +1437,18 @@ class SSTemplateParser extends Parser {
protected $match_IfArgument_typestack = array('IfArgument');
function match_IfArgument ($stack = array()) {
$matchrule = "IfArgument"; $result = $this->construct($matchrule, $matchrule, null);
$_204 = NULL;
$_220 = NULL;
do {
$matcher = 'match_'.'IfArgumentPortion'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "IfArgumentPortion" );
}
else { $_204 = FALSE; break; }
else { $_220 = FALSE; break; }
while (true) {
$res_203 = $result;
$pos_203 = $this->pos;
$_202 = NULL;
$res_219 = $result;
$pos_219 = $this->pos;
$_218 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'BooleanOperator'; $key = $matcher; $pos = $this->pos;
@ -1390,30 +1456,30 @@ class SSTemplateParser extends Parser {
if ($subres !== FALSE) {
$this->store( $result, $subres, "BooleanOperator" );
}
else { $_202 = FALSE; break; }
else { $_218 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'IfArgumentPortion'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "IfArgumentPortion" );
}
else { $_202 = FALSE; break; }
$_202 = TRUE; break;
else { $_218 = FALSE; break; }
$_218 = TRUE; break;
}
while(0);
if( $_202 === FALSE) {
$result = $res_203;
$this->pos = $pos_203;
unset( $res_203 );
unset( $pos_203 );
if( $_218 === FALSE) {
$result = $res_219;
$this->pos = $pos_219;
unset( $res_219 );
unset( $pos_219 );
break;
}
}
$_204 = TRUE; break;
$_220 = TRUE; break;
}
while(0);
if( $_204 === TRUE ) { return $this->finalise($result); }
if( $_204 === FALSE) { return FALSE; }
if( $_220 === TRUE ) { return $this->finalise($result); }
if( $_220 === FALSE) { return FALSE; }
}
@ -1430,42 +1496,42 @@ class SSTemplateParser extends Parser {
protected $match_IfPart_typestack = array('IfPart');
function match_IfPart ($stack = array()) {
$matchrule = "IfPart"; $result = $this->construct($matchrule, $matchrule, null);
$_214 = NULL;
$_230 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_214 = FALSE; break; }
else { $_230 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'if' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_214 = FALSE; break; }
else { $_230 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_214 = FALSE; break; }
else { $_230 = FALSE; break; }
$matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "IfArgument" );
}
else { $_214 = FALSE; break; }
else { $_230 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_214 = FALSE; break; }
$res_213 = $result;
$pos_213 = $this->pos;
else { $_230 = FALSE; break; }
$res_229 = $result;
$pos_229 = $this->pos;
$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Template" );
}
else {
$result = $res_213;
$this->pos = $pos_213;
unset( $res_213 );
unset( $pos_213 );
$result = $res_229;
$this->pos = $pos_229;
unset( $res_229 );
unset( $pos_229 );
}
$_214 = TRUE; break;
$_230 = TRUE; break;
}
while(0);
if( $_214 === TRUE ) { return $this->finalise($result); }
if( $_214 === FALSE) { return FALSE; }
if( $_230 === TRUE ) { return $this->finalise($result); }
if( $_230 === FALSE) { return FALSE; }
}
@ -1473,35 +1539,35 @@ class SSTemplateParser extends Parser {
protected $match_ElseIfPart_typestack = array('ElseIfPart');
function match_ElseIfPart ($stack = array()) {
$matchrule = "ElseIfPart"; $result = $this->construct($matchrule, $matchrule, null);
$_224 = NULL;
$_240 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_224 = FALSE; break; }
else { $_240 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'else_if' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_224 = FALSE; break; }
else { $_240 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_224 = FALSE; break; }
else { $_240 = FALSE; break; }
$matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "IfArgument" );
}
else { $_224 = FALSE; break; }
else { $_240 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_224 = FALSE; break; }
else { $_240 = FALSE; break; }
$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Template" );
}
else { $_224 = FALSE; break; }
$_224 = TRUE; break;
else { $_240 = FALSE; break; }
$_240 = TRUE; break;
}
while(0);
if( $_224 === TRUE ) { return $this->finalise($result); }
if( $_224 === FALSE) { return FALSE; }
if( $_240 === TRUE ) { return $this->finalise($result); }
if( $_240 === FALSE) { return FALSE; }
}
@ -1509,27 +1575,27 @@ class SSTemplateParser extends Parser {
protected $match_ElsePart_typestack = array('ElsePart');
function match_ElsePart ($stack = array()) {
$matchrule = "ElsePart"; $result = $this->construct($matchrule, $matchrule, null);
$_232 = NULL;
$_248 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_232 = FALSE; break; }
else { $_248 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'else' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_232 = FALSE; break; }
else { $_248 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_232 = FALSE; break; }
else { $_248 = FALSE; break; }
$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Template" );
}
else { $_232 = FALSE; break; }
$_232 = TRUE; break;
else { $_248 = FALSE; break; }
$_248 = TRUE; break;
}
while(0);
if( $_232 === TRUE ) { return $this->finalise($result); }
if( $_232 === FALSE) { return FALSE; }
if( $_248 === TRUE ) { return $this->finalise($result); }
if( $_248 === FALSE) { return FALSE; }
}
@ -1537,50 +1603,50 @@ class SSTemplateParser extends Parser {
protected $match_If_typestack = array('If');
function match_If ($stack = array()) {
$matchrule = "If"; $result = $this->construct($matchrule, $matchrule, null);
$_242 = NULL;
$_258 = NULL;
do {
$matcher = 'match_'.'IfPart'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_242 = FALSE; break; }
else { $_258 = FALSE; break; }
while (true) {
$res_235 = $result;
$pos_235 = $this->pos;
$res_251 = $result;
$pos_251 = $this->pos;
$matcher = 'match_'.'ElseIfPart'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else {
$result = $res_235;
$this->pos = $pos_235;
unset( $res_235 );
unset( $pos_235 );
$result = $res_251;
$this->pos = $pos_251;
unset( $res_251 );
unset( $pos_251 );
break;
}
}
$res_236 = $result;
$pos_236 = $this->pos;
$res_252 = $result;
$pos_252 = $this->pos;
$matcher = 'match_'.'ElsePart'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else {
$result = $res_236;
$this->pos = $pos_236;
unset( $res_236 );
unset( $pos_236 );
$result = $res_252;
$this->pos = $pos_252;
unset( $res_252 );
unset( $pos_252 );
}
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_242 = FALSE; break; }
else { $_258 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'end_if' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_242 = FALSE; break; }
else { $_258 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_242 = FALSE; break; }
$_242 = TRUE; break;
else { $_258 = FALSE; break; }
$_258 = TRUE; break;
}
while(0);
if( $_242 === TRUE ) { return $this->finalise($result); }
if( $_242 === FALSE) { return FALSE; }
if( $_258 === TRUE ) { return $this->finalise($result); }
if( $_258 === FALSE) { return FALSE; }
}
@ -1610,61 +1676,61 @@ class SSTemplateParser extends Parser {
protected $match_Require_typestack = array('Require');
function match_Require ($stack = array()) {
$matchrule = "Require"; $result = $this->construct($matchrule, $matchrule, null);
$_258 = NULL;
$_274 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_258 = FALSE; break; }
else { $_274 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'require' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_258 = FALSE; break; }
else { $_274 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_258 = FALSE; break; }
else { $_274 = FALSE; break; }
$stack[] = $result; $result = $this->construct( $matchrule, "Call" );
$_254 = NULL;
$_270 = NULL;
do {
$matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Method" );
}
else { $_254 = FALSE; break; }
else { $_270 = FALSE; break; }
if (substr($this->string,$this->pos,1) == '(') {
$this->pos += 1;
$result["text"] .= '(';
}
else { $_254 = FALSE; break; }
else { $_270 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'CallArguments'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "CallArguments" );
}
else { $_254 = FALSE; break; }
else { $_270 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ')') {
$this->pos += 1;
$result["text"] .= ')';
}
else { $_254 = FALSE; break; }
$_254 = TRUE; break;
else { $_270 = FALSE; break; }
$_270 = TRUE; break;
}
while(0);
if( $_254 === TRUE ) {
if( $_270 === TRUE ) {
$subres = $result; $result = array_pop($stack);
$this->store( $result, $subres, 'Call' );
}
if( $_254 === FALSE) {
if( $_270 === FALSE) {
$result = array_pop($stack);
$_258 = FALSE; break;
$_274 = FALSE; break;
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_258 = FALSE; break; }
$_258 = TRUE; break;
else { $_274 = FALSE; break; }
$_274 = TRUE; break;
}
while(0);
if( $_258 === TRUE ) { return $this->finalise($result); }
if( $_258 === FALSE) { return FALSE; }
if( $_274 === TRUE ) { return $this->finalise($result); }
if( $_274 === FALSE) { return FALSE; }
}
@ -1684,97 +1750,97 @@ class SSTemplateParser extends Parser {
protected $match_CacheBlockArgument_typestack = array('CacheBlockArgument');
function match_CacheBlockArgument ($stack = array()) {
$matchrule = "CacheBlockArgument"; $result = $this->construct($matchrule, $matchrule, null);
$_278 = NULL;
$_294 = NULL;
do {
$res_266 = $result;
$pos_266 = $this->pos;
$_265 = NULL;
$res_282 = $result;
$pos_282 = $this->pos;
$_281 = NULL;
do {
$_263 = NULL;
$_279 = NULL;
do {
$res_260 = $result;
$pos_260 = $this->pos;
$res_276 = $result;
$pos_276 = $this->pos;
if (( $subres = $this->literal( 'if ' ) ) !== FALSE) {
$result["text"] .= $subres;
$_263 = TRUE; break;
$_279 = TRUE; break;
}
$result = $res_260;
$this->pos = $pos_260;
$result = $res_276;
$this->pos = $pos_276;
if (( $subres = $this->literal( 'unless ' ) ) !== FALSE) {
$result["text"] .= $subres;
$_263 = TRUE; break;
$_279 = TRUE; break;
}
$result = $res_260;
$this->pos = $pos_260;
$_263 = FALSE; break;
$result = $res_276;
$this->pos = $pos_276;
$_279 = FALSE; break;
}
while(0);
if( $_263 === FALSE) { $_265 = FALSE; break; }
$_265 = TRUE; break;
if( $_279 === FALSE) { $_281 = FALSE; break; }
$_281 = TRUE; break;
}
while(0);
if( $_265 === TRUE ) {
$result = $res_266;
$this->pos = $pos_266;
$_278 = FALSE; break;
if( $_281 === TRUE ) {
$result = $res_282;
$this->pos = $pos_282;
$_294 = FALSE; break;
}
if( $_265 === FALSE) {
$result = $res_266;
$this->pos = $pos_266;
if( $_281 === FALSE) {
$result = $res_282;
$this->pos = $pos_282;
}
$_276 = NULL;
$_292 = NULL;
do {
$_274 = NULL;
$_290 = NULL;
do {
$res_267 = $result;
$pos_267 = $this->pos;
$res_283 = $result;
$pos_283 = $this->pos;
$matcher = 'match_'.'DollarMarkedLookup'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "DollarMarkedLookup" );
$_274 = TRUE; break;
$_290 = TRUE; break;
}
$result = $res_267;
$this->pos = $pos_267;
$_272 = NULL;
$result = $res_283;
$this->pos = $pos_283;
$_288 = NULL;
do {
$res_269 = $result;
$pos_269 = $this->pos;
$res_285 = $result;
$pos_285 = $this->pos;
$matcher = 'match_'.'QuotedString'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "QuotedString" );
$_272 = TRUE; break;
$_288 = TRUE; break;
}
$result = $res_269;
$this->pos = $pos_269;
$result = $res_285;
$this->pos = $pos_285;
$matcher = 'match_'.'Lookup'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Lookup" );
$_272 = TRUE; break;
$_288 = TRUE; break;
}
$result = $res_269;
$this->pos = $pos_269;
$_272 = FALSE; break;
$result = $res_285;
$this->pos = $pos_285;
$_288 = FALSE; break;
}
while(0);
if( $_272 === TRUE ) { $_274 = TRUE; break; }
$result = $res_267;
$this->pos = $pos_267;
$_274 = FALSE; break;
if( $_288 === TRUE ) { $_290 = TRUE; break; }
$result = $res_283;
$this->pos = $pos_283;
$_290 = FALSE; break;
}
while(0);
if( $_274 === FALSE) { $_276 = FALSE; break; }
$_276 = TRUE; break;
if( $_290 === FALSE) { $_292 = FALSE; break; }
$_292 = TRUE; break;
}
while(0);
if( $_276 === FALSE) { $_278 = FALSE; break; }
$_278 = TRUE; break;
if( $_292 === FALSE) { $_294 = FALSE; break; }
$_294 = TRUE; break;
}
while(0);
if( $_278 === TRUE ) { return $this->finalise($result); }
if( $_278 === FALSE) { return FALSE; }
if( $_294 === TRUE ) { return $this->finalise($result); }
if( $_294 === FALSE) { return FALSE; }
}
@ -1795,44 +1861,44 @@ class SSTemplateParser extends Parser {
protected $match_CacheBlockArguments_typestack = array('CacheBlockArguments');
function match_CacheBlockArguments ($stack = array()) {
$matchrule = "CacheBlockArguments"; $result = $this->construct($matchrule, $matchrule, null);
$_287 = NULL;
$_303 = NULL;
do {
$matcher = 'match_'.'CacheBlockArgument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_287 = FALSE; break; }
else { $_303 = FALSE; break; }
while (true) {
$res_286 = $result;
$pos_286 = $this->pos;
$_285 = NULL;
$res_302 = $result;
$pos_302 = $this->pos;
$_301 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ',') {
$this->pos += 1;
$result["text"] .= ',';
}
else { $_285 = FALSE; break; }
else { $_301 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'CacheBlockArgument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_285 = FALSE; break; }
$_285 = TRUE; break;
else { $_301 = FALSE; break; }
$_301 = TRUE; break;
}
while(0);
if( $_285 === FALSE) {
$result = $res_286;
$this->pos = $pos_286;
unset( $res_286 );
unset( $pos_286 );
if( $_301 === FALSE) {
$result = $res_302;
$this->pos = $pos_302;
unset( $res_302 );
unset( $pos_302 );
break;
}
}
$_287 = TRUE; break;
$_303 = TRUE; break;
}
while(0);
if( $_287 === TRUE ) { return $this->finalise($result); }
if( $_287 === FALSE) { return FALSE; }
if( $_303 === TRUE ) { return $this->finalise($result); }
if( $_303 === FALSE) { return FALSE; }
}
@ -1851,204 +1917,204 @@ class SSTemplateParser extends Parser {
$matchrule = "CacheBlockTemplate"; $result = $this->construct($matchrule, $matchrule, array('TemplateMatcher' => 'CacheRestrictedTemplate'));
$count = 0;
while (true) {
$res_331 = $result;
$pos_331 = $this->pos;
$_330 = NULL;
$res_347 = $result;
$pos_347 = $this->pos;
$_346 = NULL;
do {
$_328 = NULL;
$_344 = NULL;
do {
$res_289 = $result;
$pos_289 = $this->pos;
$res_305 = $result;
$pos_305 = $this->pos;
$matcher = 'match_'.'Comment'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_328 = TRUE; break;
$_344 = TRUE; break;
}
$result = $res_289;
$this->pos = $pos_289;
$_326 = NULL;
$result = $res_305;
$this->pos = $pos_305;
$_342 = NULL;
do {
$res_291 = $result;
$pos_291 = $this->pos;
$res_307 = $result;
$pos_307 = $this->pos;
$matcher = 'match_'.'Translate'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_326 = TRUE; break;
$_342 = TRUE; break;
}
$result = $res_291;
$this->pos = $pos_291;
$_324 = NULL;
$result = $res_307;
$this->pos = $pos_307;
$_340 = NULL;
do {
$res_293 = $result;
$pos_293 = $this->pos;
$res_309 = $result;
$pos_309 = $this->pos;
$matcher = 'match_'.'If'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_324 = TRUE; break;
$_340 = TRUE; break;
}
$result = $res_293;
$this->pos = $pos_293;
$_322 = NULL;
$result = $res_309;
$this->pos = $pos_309;
$_338 = NULL;
do {
$res_295 = $result;
$pos_295 = $this->pos;
$res_311 = $result;
$pos_311 = $this->pos;
$matcher = 'match_'.'Require'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_322 = TRUE; break;
$_338 = TRUE; break;
}
$result = $res_295;
$this->pos = $pos_295;
$_320 = NULL;
$result = $res_311;
$this->pos = $pos_311;
$_336 = NULL;
do {
$res_297 = $result;
$pos_297 = $this->pos;
$res_313 = $result;
$pos_313 = $this->pos;
$matcher = 'match_'.'OldI18NTag'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_320 = TRUE; break;
$_336 = TRUE; break;
}
$result = $res_297;
$this->pos = $pos_297;
$_318 = NULL;
$result = $res_313;
$this->pos = $pos_313;
$_334 = NULL;
do {
$res_299 = $result;
$pos_299 = $this->pos;
$res_315 = $result;
$pos_315 = $this->pos;
$matcher = 'match_'.'Include'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_318 = TRUE; break;
$_334 = TRUE; break;
}
$result = $res_299;
$this->pos = $pos_299;
$_316 = NULL;
$result = $res_315;
$this->pos = $pos_315;
$_332 = NULL;
do {
$res_301 = $result;
$pos_301 = $this->pos;
$res_317 = $result;
$pos_317 = $this->pos;
$matcher = 'match_'.'ClosedBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_316 = TRUE; break;
$_332 = TRUE; break;
}
$result = $res_301;
$this->pos = $pos_301;
$_314 = NULL;
$result = $res_317;
$this->pos = $pos_317;
$_330 = NULL;
do {
$res_303 = $result;
$pos_303 = $this->pos;
$res_319 = $result;
$pos_319 = $this->pos;
$matcher = 'match_'.'OpenBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_314 = TRUE; break;
$_330 = TRUE; break;
}
$result = $res_303;
$this->pos = $pos_303;
$_312 = NULL;
$result = $res_319;
$this->pos = $pos_319;
$_328 = NULL;
do {
$res_305 = $result;
$pos_305 = $this->pos;
$res_321 = $result;
$pos_321 = $this->pos;
$matcher = 'match_'.'MalformedBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_312 = TRUE; break;
$_328 = TRUE; break;
}
$result = $res_305;
$this->pos = $pos_305;
$_310 = NULL;
$result = $res_321;
$this->pos = $pos_321;
$_326 = NULL;
do {
$res_307 = $result;
$pos_307 = $this->pos;
$res_323 = $result;
$pos_323 = $this->pos;
$matcher = 'match_'.'Injection'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_310 = TRUE; break;
$_326 = TRUE; break;
}
$result = $res_307;
$this->pos = $pos_307;
$result = $res_323;
$this->pos = $pos_323;
$matcher = 'match_'.'Text'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_310 = TRUE; break;
$_326 = TRUE; break;
}
$result = $res_307;
$this->pos = $pos_307;
$_310 = FALSE; break;
$result = $res_323;
$this->pos = $pos_323;
$_326 = FALSE; break;
}
while(0);
if( $_310 === TRUE ) { $_312 = TRUE; break; }
$result = $res_305;
$this->pos = $pos_305;
$_312 = FALSE; break;
if( $_326 === TRUE ) { $_328 = TRUE; break; }
$result = $res_321;
$this->pos = $pos_321;
$_328 = FALSE; break;
}
while(0);
if( $_312 === TRUE ) { $_314 = TRUE; break; }
$result = $res_303;
$this->pos = $pos_303;
$_314 = FALSE; break;
if( $_328 === TRUE ) { $_330 = TRUE; break; }
$result = $res_319;
$this->pos = $pos_319;
$_330 = FALSE; break;
}
while(0);
if( $_314 === TRUE ) { $_316 = TRUE; break; }
$result = $res_301;
$this->pos = $pos_301;
$_316 = FALSE; break;
if( $_330 === TRUE ) { $_332 = TRUE; break; }
$result = $res_317;
$this->pos = $pos_317;
$_332 = FALSE; break;
}
while(0);
if( $_316 === TRUE ) { $_318 = TRUE; break; }
$result = $res_299;
$this->pos = $pos_299;
$_318 = FALSE; break;
if( $_332 === TRUE ) { $_334 = TRUE; break; }
$result = $res_315;
$this->pos = $pos_315;
$_334 = FALSE; break;
}
while(0);
if( $_318 === TRUE ) { $_320 = TRUE; break; }
$result = $res_297;
$this->pos = $pos_297;
$_320 = FALSE; break;
if( $_334 === TRUE ) { $_336 = TRUE; break; }
$result = $res_313;
$this->pos = $pos_313;
$_336 = FALSE; break;
}
while(0);
if( $_320 === TRUE ) { $_322 = TRUE; break; }
$result = $res_295;
$this->pos = $pos_295;
$_322 = FALSE; break;
if( $_336 === TRUE ) { $_338 = TRUE; break; }
$result = $res_311;
$this->pos = $pos_311;
$_338 = FALSE; break;
}
while(0);
if( $_322 === TRUE ) { $_324 = TRUE; break; }
$result = $res_293;
$this->pos = $pos_293;
$_324 = FALSE; break;
if( $_338 === TRUE ) { $_340 = TRUE; break; }
$result = $res_309;
$this->pos = $pos_309;
$_340 = FALSE; break;
}
while(0);
if( $_324 === TRUE ) { $_326 = TRUE; break; }
$result = $res_291;
$this->pos = $pos_291;
$_326 = FALSE; break;
if( $_340 === TRUE ) { $_342 = TRUE; break; }
$result = $res_307;
$this->pos = $pos_307;
$_342 = FALSE; break;
}
while(0);
if( $_326 === TRUE ) { $_328 = TRUE; break; }
$result = $res_289;
$this->pos = $pos_289;
$_328 = FALSE; break;
if( $_342 === TRUE ) { $_344 = TRUE; break; }
$result = $res_305;
$this->pos = $pos_305;
$_344 = FALSE; break;
}
while(0);
if( $_328 === FALSE) { $_330 = FALSE; break; }
$_330 = TRUE; break;
if( $_344 === FALSE) { $_346 = FALSE; break; }
$_346 = TRUE; break;
}
while(0);
if( $_330 === FALSE) {
$result = $res_331;
$this->pos = $pos_331;
unset( $res_331 );
unset( $pos_331 );
if( $_346 === FALSE) {
$result = $res_347;
$this->pos = $pos_347;
unset( $res_347 );
unset( $pos_347 );
break;
}
$count += 1;
@ -2067,63 +2133,63 @@ class SSTemplateParser extends Parser {
protected $match_UncachedBlock_typestack = array('UncachedBlock');
function match_UncachedBlock ($stack = array()) {
$matchrule = "UncachedBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_368 = NULL;
$_384 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_368 = FALSE; break; }
else { $_384 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_368 = FALSE; break; }
else { $_384 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_336 = $result;
$pos_336 = $this->pos;
$res_352 = $result;
$pos_352 = $this->pos;
$matcher = 'match_'.'CacheBlockArguments'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else {
$result = $res_336;
$this->pos = $pos_336;
unset( $res_336 );
unset( $pos_336 );
$result = $res_352;
$this->pos = $pos_352;
unset( $res_352 );
unset( $pos_352 );
}
$res_348 = $result;
$pos_348 = $this->pos;
$_347 = NULL;
$res_364 = $result;
$pos_364 = $this->pos;
$_363 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$stack[] = $result; $result = $this->construct( $matchrule, "Conditional" );
$_343 = NULL;
$_359 = NULL;
do {
$_341 = NULL;
$_357 = NULL;
do {
$res_338 = $result;
$pos_338 = $this->pos;
$res_354 = $result;
$pos_354 = $this->pos;
if (( $subres = $this->literal( 'if' ) ) !== FALSE) {
$result["text"] .= $subres;
$_341 = TRUE; break;
$_357 = TRUE; break;
}
$result = $res_338;
$this->pos = $pos_338;
$result = $res_354;
$this->pos = $pos_354;
if (( $subres = $this->literal( 'unless' ) ) !== FALSE) {
$result["text"] .= $subres;
$_341 = TRUE; break;
$_357 = TRUE; break;
}
$result = $res_338;
$this->pos = $pos_338;
$_341 = FALSE; break;
$result = $res_354;
$this->pos = $pos_354;
$_357 = FALSE; break;
}
while(0);
if( $_341 === FALSE) { $_343 = FALSE; break; }
$_343 = TRUE; break;
if( $_357 === FALSE) { $_359 = FALSE; break; }
$_359 = TRUE; break;
}
while(0);
if( $_343 === TRUE ) {
if( $_359 === TRUE ) {
$subres = $result; $result = array_pop($stack);
$this->store( $result, $subres, 'Conditional' );
}
if( $_343 === FALSE) {
if( $_359 === FALSE) {
$result = array_pop($stack);
$_347 = FALSE; break;
$_363 = FALSE; break;
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
@ -2131,87 +2197,87 @@ class SSTemplateParser extends Parser {
if ($subres !== FALSE) {
$this->store( $result, $subres, "Condition" );
}
else { $_347 = FALSE; break; }
$_347 = TRUE; break;
else { $_363 = FALSE; break; }
$_363 = TRUE; break;
}
while(0);
if( $_347 === FALSE) {
$result = $res_348;
$this->pos = $pos_348;
unset( $res_348 );
unset( $pos_348 );
if( $_363 === FALSE) {
$result = $res_364;
$this->pos = $pos_364;
unset( $res_364 );
unset( $pos_364 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_368 = FALSE; break; }
$res_351 = $result;
$pos_351 = $this->pos;
else { $_384 = FALSE; break; }
$res_367 = $result;
$pos_367 = $this->pos;
$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Template" );
}
else {
$result = $res_351;
$this->pos = $pos_351;
unset( $res_351 );
unset( $pos_351 );
$result = $res_367;
$this->pos = $pos_367;
unset( $res_367 );
unset( $pos_367 );
}
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_368 = FALSE; break; }
else { $_384 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_368 = FALSE; break; }
$_364 = NULL;
else { $_384 = FALSE; break; }
$_380 = NULL;
do {
$_362 = NULL;
$_378 = NULL;
do {
$res_355 = $result;
$pos_355 = $this->pos;
$res_371 = $result;
$pos_371 = $this->pos;
if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_362 = TRUE; break;
$_378 = TRUE; break;
}
$result = $res_355;
$this->pos = $pos_355;
$_360 = NULL;
$result = $res_371;
$this->pos = $pos_371;
$_376 = NULL;
do {
$res_357 = $result;
$pos_357 = $this->pos;
$res_373 = $result;
$pos_373 = $this->pos;
if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_360 = TRUE; break;
$_376 = TRUE; break;
}
$result = $res_357;
$this->pos = $pos_357;
$result = $res_373;
$this->pos = $pos_373;
if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
$result["text"] .= $subres;
$_360 = TRUE; break;
$_376 = TRUE; break;
}
$result = $res_357;
$this->pos = $pos_357;
$_360 = FALSE; break;
$result = $res_373;
$this->pos = $pos_373;
$_376 = FALSE; break;
}
while(0);
if( $_360 === TRUE ) { $_362 = TRUE; break; }
$result = $res_355;
$this->pos = $pos_355;
$_362 = FALSE; break;
if( $_376 === TRUE ) { $_378 = TRUE; break; }
$result = $res_371;
$this->pos = $pos_371;
$_378 = FALSE; break;
}
while(0);
if( $_362 === FALSE) { $_364 = FALSE; break; }
$_364 = TRUE; break;
if( $_378 === FALSE) { $_380 = FALSE; break; }
$_380 = TRUE; break;
}
while(0);
if( $_364 === FALSE) { $_368 = FALSE; break; }
if( $_380 === FALSE) { $_384 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_368 = FALSE; break; }
$_368 = TRUE; break;
else { $_384 = FALSE; break; }
$_384 = TRUE; break;
}
while(0);
if( $_368 === TRUE ) { return $this->finalise($result); }
if( $_368 === FALSE) { return FALSE; }
if( $_384 === TRUE ) { return $this->finalise($result); }
if( $_384 === FALSE) { return FALSE; }
}
@ -2227,240 +2293,240 @@ class SSTemplateParser extends Parser {
$matchrule = "CacheRestrictedTemplate"; $result = $this->construct($matchrule, $matchrule, null);
$count = 0;
while (true) {
$res_420 = $result;
$pos_420 = $this->pos;
$_419 = NULL;
$res_436 = $result;
$pos_436 = $this->pos;
$_435 = NULL;
do {
$_417 = NULL;
$_433 = NULL;
do {
$res_370 = $result;
$pos_370 = $this->pos;
$res_386 = $result;
$pos_386 = $this->pos;
$matcher = 'match_'.'Comment'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_417 = TRUE; break;
$_433 = TRUE; break;
}
$result = $res_370;
$this->pos = $pos_370;
$_415 = NULL;
$result = $res_386;
$this->pos = $pos_386;
$_431 = NULL;
do {
$res_372 = $result;
$pos_372 = $this->pos;
$res_388 = $result;
$pos_388 = $this->pos;
$matcher = 'match_'.'Translate'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_415 = TRUE; break;
$_431 = TRUE; break;
}
$result = $res_372;
$this->pos = $pos_372;
$_413 = NULL;
$result = $res_388;
$this->pos = $pos_388;
$_429 = NULL;
do {
$res_374 = $result;
$pos_374 = $this->pos;
$res_390 = $result;
$pos_390 = $this->pos;
$matcher = 'match_'.'If'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_413 = TRUE; break;
$_429 = TRUE; break;
}
$result = $res_374;
$this->pos = $pos_374;
$_411 = NULL;
$result = $res_390;
$this->pos = $pos_390;
$_427 = NULL;
do {
$res_376 = $result;
$pos_376 = $this->pos;
$res_392 = $result;
$pos_392 = $this->pos;
$matcher = 'match_'.'Require'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_411 = TRUE; break;
$_427 = TRUE; break;
}
$result = $res_376;
$this->pos = $pos_376;
$_409 = NULL;
$result = $res_392;
$this->pos = $pos_392;
$_425 = NULL;
do {
$res_378 = $result;
$pos_378 = $this->pos;
$res_394 = $result;
$pos_394 = $this->pos;
$matcher = 'match_'.'CacheBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_409 = TRUE; break;
$_425 = TRUE; break;
}
$result = $res_378;
$this->pos = $pos_378;
$_407 = NULL;
$result = $res_394;
$this->pos = $pos_394;
$_423 = NULL;
do {
$res_380 = $result;
$pos_380 = $this->pos;
$res_396 = $result;
$pos_396 = $this->pos;
$matcher = 'match_'.'UncachedBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_407 = TRUE; break;
$_423 = TRUE; break;
}
$result = $res_380;
$this->pos = $pos_380;
$_405 = NULL;
$result = $res_396;
$this->pos = $pos_396;
$_421 = NULL;
do {
$res_382 = $result;
$pos_382 = $this->pos;
$res_398 = $result;
$pos_398 = $this->pos;
$matcher = 'match_'.'OldI18NTag'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_405 = TRUE; break;
$_421 = TRUE; break;
}
$result = $res_382;
$this->pos = $pos_382;
$_403 = NULL;
$result = $res_398;
$this->pos = $pos_398;
$_419 = NULL;
do {
$res_384 = $result;
$pos_384 = $this->pos;
$res_400 = $result;
$pos_400 = $this->pos;
$matcher = 'match_'.'Include'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_403 = TRUE; break;
$_419 = TRUE; break;
}
$result = $res_384;
$this->pos = $pos_384;
$_401 = NULL;
$result = $res_400;
$this->pos = $pos_400;
$_417 = NULL;
do {
$res_386 = $result;
$pos_386 = $this->pos;
$res_402 = $result;
$pos_402 = $this->pos;
$matcher = 'match_'.'ClosedBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_401 = TRUE; break;
$_417 = TRUE; break;
}
$result = $res_386;
$this->pos = $pos_386;
$_399 = NULL;
$result = $res_402;
$this->pos = $pos_402;
$_415 = NULL;
do {
$res_388 = $result;
$pos_388 = $this->pos;
$res_404 = $result;
$pos_404 = $this->pos;
$matcher = 'match_'.'OpenBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_399 = TRUE; break;
$_415 = TRUE; break;
}
$result = $res_388;
$this->pos = $pos_388;
$_397 = NULL;
$result = $res_404;
$this->pos = $pos_404;
$_413 = NULL;
do {
$res_390 = $result;
$pos_390 = $this->pos;
$res_406 = $result;
$pos_406 = $this->pos;
$matcher = 'match_'.'MalformedBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_397 = TRUE; break;
$_413 = TRUE; break;
}
$result = $res_390;
$this->pos = $pos_390;
$_395 = NULL;
$result = $res_406;
$this->pos = $pos_406;
$_411 = NULL;
do {
$res_392 = $result;
$pos_392 = $this->pos;
$res_408 = $result;
$pos_408 = $this->pos;
$matcher = 'match_'.'Injection'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_395 = TRUE; break;
$_411 = TRUE; break;
}
$result = $res_392;
$this->pos = $pos_392;
$result = $res_408;
$this->pos = $pos_408;
$matcher = 'match_'.'Text'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_395 = TRUE; break;
$_411 = TRUE; break;
}
$result = $res_392;
$this->pos = $pos_392;
$_395 = FALSE; break;
$result = $res_408;
$this->pos = $pos_408;
$_411 = FALSE; break;
}
while(0);
if( $_395 === TRUE ) { $_397 = TRUE; break; }
$result = $res_390;
$this->pos = $pos_390;
$_397 = FALSE; break;
if( $_411 === TRUE ) { $_413 = TRUE; break; }
$result = $res_406;
$this->pos = $pos_406;
$_413 = FALSE; break;
}
while(0);
if( $_397 === TRUE ) { $_399 = TRUE; break; }
$result = $res_388;
$this->pos = $pos_388;
$_399 = FALSE; break;
if( $_413 === TRUE ) { $_415 = TRUE; break; }
$result = $res_404;
$this->pos = $pos_404;
$_415 = FALSE; break;
}
while(0);
if( $_399 === TRUE ) { $_401 = TRUE; break; }
$result = $res_386;
$this->pos = $pos_386;
$_401 = FALSE; break;
if( $_415 === TRUE ) { $_417 = TRUE; break; }
$result = $res_402;
$this->pos = $pos_402;
$_417 = FALSE; break;
}
while(0);
if( $_401 === TRUE ) { $_403 = TRUE; break; }
$result = $res_384;
$this->pos = $pos_384;
$_403 = FALSE; break;
if( $_417 === TRUE ) { $_419 = TRUE; break; }
$result = $res_400;
$this->pos = $pos_400;
$_419 = FALSE; break;
}
while(0);
if( $_403 === TRUE ) { $_405 = TRUE; break; }
$result = $res_382;
$this->pos = $pos_382;
$_405 = FALSE; break;
if( $_419 === TRUE ) { $_421 = TRUE; break; }
$result = $res_398;
$this->pos = $pos_398;
$_421 = FALSE; break;
}
while(0);
if( $_405 === TRUE ) { $_407 = TRUE; break; }
$result = $res_380;
$this->pos = $pos_380;
$_407 = FALSE; break;
if( $_421 === TRUE ) { $_423 = TRUE; break; }
$result = $res_396;
$this->pos = $pos_396;
$_423 = FALSE; break;
}
while(0);
if( $_407 === TRUE ) { $_409 = TRUE; break; }
$result = $res_378;
$this->pos = $pos_378;
$_409 = FALSE; break;
if( $_423 === TRUE ) { $_425 = TRUE; break; }
$result = $res_394;
$this->pos = $pos_394;
$_425 = FALSE; break;
}
while(0);
if( $_409 === TRUE ) { $_411 = TRUE; break; }
$result = $res_376;
$this->pos = $pos_376;
$_411 = FALSE; break;
if( $_425 === TRUE ) { $_427 = TRUE; break; }
$result = $res_392;
$this->pos = $pos_392;
$_427 = FALSE; break;
}
while(0);
if( $_411 === TRUE ) { $_413 = TRUE; break; }
$result = $res_374;
$this->pos = $pos_374;
$_413 = FALSE; break;
if( $_427 === TRUE ) { $_429 = TRUE; break; }
$result = $res_390;
$this->pos = $pos_390;
$_429 = FALSE; break;
}
while(0);
if( $_413 === TRUE ) { $_415 = TRUE; break; }
$result = $res_372;
$this->pos = $pos_372;
$_415 = FALSE; break;
if( $_429 === TRUE ) { $_431 = TRUE; break; }
$result = $res_388;
$this->pos = $pos_388;
$_431 = FALSE; break;
}
while(0);
if( $_415 === TRUE ) { $_417 = TRUE; break; }
$result = $res_370;
$this->pos = $pos_370;
$_417 = FALSE; break;
if( $_431 === TRUE ) { $_433 = TRUE; break; }
$result = $res_386;
$this->pos = $pos_386;
$_433 = FALSE; break;
}
while(0);
if( $_417 === FALSE) { $_419 = FALSE; break; }
$_419 = TRUE; break;
if( $_433 === FALSE) { $_435 = FALSE; break; }
$_435 = TRUE; break;
}
while(0);
if( $_419 === FALSE) {
$result = $res_420;
$this->pos = $pos_420;
unset( $res_420 );
unset( $pos_420 );
if( $_435 === FALSE) {
$result = $res_436;
$this->pos = $pos_436;
unset( $res_436 );
unset( $pos_436 );
break;
}
$count += 1;
@ -2489,101 +2555,101 @@ class SSTemplateParser extends Parser {
protected $match_CacheBlock_typestack = array('CacheBlock');
function match_CacheBlock ($stack = array()) {
$matchrule = "CacheBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_475 = NULL;
$_491 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_475 = FALSE; break; }
else { $_491 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$stack[] = $result; $result = $this->construct( $matchrule, "CacheTag" );
$_428 = NULL;
$_444 = NULL;
do {
$_426 = NULL;
$_442 = NULL;
do {
$res_423 = $result;
$pos_423 = $this->pos;
$res_439 = $result;
$pos_439 = $this->pos;
if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_426 = TRUE; break;
$_442 = TRUE; break;
}
$result = $res_423;
$this->pos = $pos_423;
$result = $res_439;
$this->pos = $pos_439;
if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
$result["text"] .= $subres;
$_426 = TRUE; break;
$_442 = TRUE; break;
}
$result = $res_423;
$this->pos = $pos_423;
$_426 = FALSE; break;
$result = $res_439;
$this->pos = $pos_439;
$_442 = FALSE; break;
}
while(0);
if( $_426 === FALSE) { $_428 = FALSE; break; }
$_428 = TRUE; break;
if( $_442 === FALSE) { $_444 = FALSE; break; }
$_444 = TRUE; break;
}
while(0);
if( $_428 === TRUE ) {
if( $_444 === TRUE ) {
$subres = $result; $result = array_pop($stack);
$this->store( $result, $subres, 'CacheTag' );
}
if( $_428 === FALSE) {
if( $_444 === FALSE) {
$result = array_pop($stack);
$_475 = FALSE; break;
$_491 = FALSE; break;
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_433 = $result;
$pos_433 = $this->pos;
$_432 = NULL;
$res_449 = $result;
$pos_449 = $this->pos;
$_448 = NULL;
do {
$matcher = 'match_'.'CacheBlockArguments'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_432 = FALSE; break; }
$_432 = TRUE; break;
else { $_448 = FALSE; break; }
$_448 = TRUE; break;
}
while(0);
if( $_432 === FALSE) {
$result = $res_433;
$this->pos = $pos_433;
unset( $res_433 );
unset( $pos_433 );
if( $_448 === FALSE) {
$result = $res_449;
$this->pos = $pos_449;
unset( $res_449 );
unset( $pos_449 );
}
$res_445 = $result;
$pos_445 = $this->pos;
$_444 = NULL;
$res_461 = $result;
$pos_461 = $this->pos;
$_460 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$stack[] = $result; $result = $this->construct( $matchrule, "Conditional" );
$_440 = NULL;
$_456 = NULL;
do {
$_438 = NULL;
$_454 = NULL;
do {
$res_435 = $result;
$pos_435 = $this->pos;
$res_451 = $result;
$pos_451 = $this->pos;
if (( $subres = $this->literal( 'if' ) ) !== FALSE) {
$result["text"] .= $subres;
$_438 = TRUE; break;
$_454 = TRUE; break;
}
$result = $res_435;
$this->pos = $pos_435;
$result = $res_451;
$this->pos = $pos_451;
if (( $subres = $this->literal( 'unless' ) ) !== FALSE) {
$result["text"] .= $subres;
$_438 = TRUE; break;
$_454 = TRUE; break;
}
$result = $res_435;
$this->pos = $pos_435;
$_438 = FALSE; break;
$result = $res_451;
$this->pos = $pos_451;
$_454 = FALSE; break;
}
while(0);
if( $_438 === FALSE) { $_440 = FALSE; break; }
$_440 = TRUE; break;
if( $_454 === FALSE) { $_456 = FALSE; break; }
$_456 = TRUE; break;
}
while(0);
if( $_440 === TRUE ) {
if( $_456 === TRUE ) {
$subres = $result; $result = array_pop($stack);
$this->store( $result, $subres, 'Conditional' );
}
if( $_440 === FALSE) {
if( $_456 === FALSE) {
$result = array_pop($stack);
$_444 = FALSE; break;
$_460 = FALSE; break;
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'IfArgument'; $key = $matcher; $pos = $this->pos;
@ -2591,132 +2657,132 @@ class SSTemplateParser extends Parser {
if ($subres !== FALSE) {
$this->store( $result, $subres, "Condition" );
}
else { $_444 = FALSE; break; }
$_444 = TRUE; break;
else { $_460 = FALSE; break; }
$_460 = TRUE; break;
}
while(0);
if( $_444 === FALSE) {
$result = $res_445;
$this->pos = $pos_445;
unset( $res_445 );
unset( $pos_445 );
if( $_460 === FALSE) {
$result = $res_461;
$this->pos = $pos_461;
unset( $res_461 );
unset( $pos_461 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_475 = FALSE; break; }
else { $_491 = FALSE; break; }
while (true) {
$res_458 = $result;
$pos_458 = $this->pos;
$_457 = NULL;
$res_474 = $result;
$pos_474 = $this->pos;
$_473 = NULL;
do {
$_455 = NULL;
$_471 = NULL;
do {
$res_448 = $result;
$pos_448 = $this->pos;
$res_464 = $result;
$pos_464 = $this->pos;
$matcher = 'match_'.'CacheBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_455 = TRUE; break;
$_471 = TRUE; break;
}
$result = $res_448;
$this->pos = $pos_448;
$_453 = NULL;
$result = $res_464;
$this->pos = $pos_464;
$_469 = NULL;
do {
$res_450 = $result;
$pos_450 = $this->pos;
$res_466 = $result;
$pos_466 = $this->pos;
$matcher = 'match_'.'UncachedBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_453 = TRUE; break;
$_469 = TRUE; break;
}
$result = $res_450;
$this->pos = $pos_450;
$result = $res_466;
$this->pos = $pos_466;
$matcher = 'match_'.'CacheBlockTemplate'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_453 = TRUE; break;
$_469 = TRUE; break;
}
$result = $res_450;
$this->pos = $pos_450;
$_453 = FALSE; break;
$result = $res_466;
$this->pos = $pos_466;
$_469 = FALSE; break;
}
while(0);
if( $_453 === TRUE ) { $_455 = TRUE; break; }
$result = $res_448;
$this->pos = $pos_448;
$_455 = FALSE; break;
if( $_469 === TRUE ) { $_471 = TRUE; break; }
$result = $res_464;
$this->pos = $pos_464;
$_471 = FALSE; break;
}
while(0);
if( $_455 === FALSE) { $_457 = FALSE; break; }
$_457 = TRUE; break;
if( $_471 === FALSE) { $_473 = FALSE; break; }
$_473 = TRUE; break;
}
while(0);
if( $_457 === FALSE) {
$result = $res_458;
$this->pos = $pos_458;
unset( $res_458 );
unset( $pos_458 );
if( $_473 === FALSE) {
$result = $res_474;
$this->pos = $pos_474;
unset( $res_474 );
unset( $pos_474 );
break;
}
}
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_475 = FALSE; break; }
else { $_491 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_475 = FALSE; break; }
$_471 = NULL;
else { $_491 = FALSE; break; }
$_487 = NULL;
do {
$_469 = NULL;
$_485 = NULL;
do {
$res_462 = $result;
$pos_462 = $this->pos;
$res_478 = $result;
$pos_478 = $this->pos;
if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_469 = TRUE; break;
$_485 = TRUE; break;
}
$result = $res_462;
$this->pos = $pos_462;
$_467 = NULL;
$result = $res_478;
$this->pos = $pos_478;
$_483 = NULL;
do {
$res_464 = $result;
$pos_464 = $this->pos;
$res_480 = $result;
$pos_480 = $this->pos;
if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_467 = TRUE; break;
$_483 = TRUE; break;
}
$result = $res_464;
$this->pos = $pos_464;
$result = $res_480;
$this->pos = $pos_480;
if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
$result["text"] .= $subres;
$_467 = TRUE; break;
$_483 = TRUE; break;
}
$result = $res_464;
$this->pos = $pos_464;
$_467 = FALSE; break;
$result = $res_480;
$this->pos = $pos_480;
$_483 = FALSE; break;
}
while(0);
if( $_467 === TRUE ) { $_469 = TRUE; break; }
$result = $res_462;
$this->pos = $pos_462;
$_469 = FALSE; break;
if( $_483 === TRUE ) { $_485 = TRUE; break; }
$result = $res_478;
$this->pos = $pos_478;
$_485 = FALSE; break;
}
while(0);
if( $_469 === FALSE) { $_471 = FALSE; break; }
$_471 = TRUE; break;
if( $_485 === FALSE) { $_487 = FALSE; break; }
$_487 = TRUE; break;
}
while(0);
if( $_471 === FALSE) { $_475 = FALSE; break; }
if( $_487 === FALSE) { $_491 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_475 = FALSE; break; }
$_475 = TRUE; break;
else { $_491 = FALSE; break; }
$_491 = TRUE; break;
}
while(0);
if( $_475 === TRUE ) { return $this->finalise($result); }
if( $_475 === FALSE) { return FALSE; }
if( $_491 === TRUE ) { return $this->finalise($result); }
if( $_491 === FALSE) { return FALSE; }
}
@ -2762,93 +2828,93 @@ class SSTemplateParser extends Parser {
protected $match_OldTPart_typestack = array('OldTPart');
function match_OldTPart ($stack = array()) {
$matchrule = "OldTPart"; $result = $this->construct($matchrule, $matchrule, null);
$_494 = NULL;
$_510 = NULL;
do {
if (( $subres = $this->literal( '_t' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_494 = FALSE; break; }
else { $_510 = FALSE; break; }
$matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_494 = FALSE; break; }
else { $_510 = FALSE; break; }
if (substr($this->string,$this->pos,1) == '(') {
$this->pos += 1;
$result["text"] .= '(';
}
else { $_494 = FALSE; break; }
else { $_510 = FALSE; break; }
$matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_494 = FALSE; break; }
else { $_510 = FALSE; break; }
$matcher = 'match_'.'QuotedString'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_494 = FALSE; break; }
$res_487 = $result;
$pos_487 = $this->pos;
$_486 = NULL;
else { $_510 = FALSE; break; }
$res_503 = $result;
$pos_503 = $this->pos;
$_502 = NULL;
do {
$matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_486 = FALSE; break; }
else { $_502 = FALSE; break; }
if (substr($this->string,$this->pos,1) == ',') {
$this->pos += 1;
$result["text"] .= ',';
}
else { $_486 = FALSE; break; }
else { $_502 = FALSE; break; }
$matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_486 = FALSE; break; }
else { $_502 = FALSE; break; }
$matcher = 'match_'.'CallArguments'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_486 = FALSE; break; }
$_486 = TRUE; break;
else { $_502 = FALSE; break; }
$_502 = TRUE; break;
}
while(0);
if( $_486 === FALSE) {
$result = $res_487;
$this->pos = $pos_487;
unset( $res_487 );
unset( $pos_487 );
if( $_502 === FALSE) {
$result = $res_503;
$this->pos = $pos_503;
unset( $res_503 );
unset( $pos_503 );
}
$matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_494 = FALSE; break; }
else { $_510 = FALSE; break; }
if (substr($this->string,$this->pos,1) == ')') {
$this->pos += 1;
$result["text"] .= ')';
}
else { $_494 = FALSE; break; }
else { $_510 = FALSE; break; }
$matcher = 'match_'.'N'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_494 = FALSE; break; }
$res_493 = $result;
$pos_493 = $this->pos;
$_492 = NULL;
else { $_510 = FALSE; break; }
$res_509 = $result;
$pos_509 = $this->pos;
$_508 = NULL;
do {
if (substr($this->string,$this->pos,1) == ';') {
$this->pos += 1;
$result["text"] .= ';';
}
else { $_492 = FALSE; break; }
$_492 = TRUE; break;
else { $_508 = FALSE; break; }
$_508 = TRUE; break;
}
while(0);
if( $_492 === FALSE) {
$result = $res_493;
$this->pos = $pos_493;
unset( $res_493 );
unset( $pos_493 );
if( $_508 === FALSE) {
$result = $res_509;
$this->pos = $pos_509;
unset( $res_509 );
unset( $pos_509 );
}
$_494 = TRUE; break;
$_510 = TRUE; break;
}
while(0);
if( $_494 === TRUE ) { return $this->finalise($result); }
if( $_494 === FALSE) { return FALSE; }
if( $_510 === TRUE ) { return $this->finalise($result); }
if( $_510 === FALSE) { return FALSE; }
}
@ -2891,23 +2957,23 @@ class SSTemplateParser extends Parser {
protected $match_OldTTag_typestack = array('OldTTag');
function match_OldTTag ($stack = array()) {
$matchrule = "OldTTag"; $result = $this->construct($matchrule, $matchrule, null);
$_502 = NULL;
$_518 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_502 = FALSE; break; }
else { $_518 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'OldTPart'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_502 = FALSE; break; }
else { $_518 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_502 = FALSE; break; }
$_502 = TRUE; break;
else { $_518 = FALSE; break; }
$_518 = TRUE; break;
}
while(0);
if( $_502 === TRUE ) { return $this->finalise($result); }
if( $_502 === FALSE) { return FALSE; }
if( $_518 === TRUE ) { return $this->finalise($result); }
if( $_518 === FALSE) { return FALSE; }
}
@ -2920,49 +2986,49 @@ class SSTemplateParser extends Parser {
protected $match_OldSprintfTag_typestack = array('OldSprintfTag');
function match_OldSprintfTag ($stack = array()) {
$matchrule = "OldSprintfTag"; $result = $this->construct($matchrule, $matchrule, null);
$_519 = NULL;
$_535 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_519 = FALSE; break; }
else { $_535 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'sprintf' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_519 = FALSE; break; }
else { $_535 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == '(') {
$this->pos += 1;
$result["text"] .= '(';
}
else { $_519 = FALSE; break; }
else { $_535 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'OldTPart'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_519 = FALSE; break; }
else { $_535 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ',') {
$this->pos += 1;
$result["text"] .= ',';
}
else { $_519 = FALSE; break; }
else { $_535 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'CallArguments'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_519 = FALSE; break; }
else { $_535 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ')') {
$this->pos += 1;
$result["text"] .= ')';
}
else { $_519 = FALSE; break; }
else { $_535 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_519 = FALSE; break; }
$_519 = TRUE; break;
else { $_535 = FALSE; break; }
$_535 = TRUE; break;
}
while(0);
if( $_519 === TRUE ) { return $this->finalise($result); }
if( $_519 === FALSE) { return FALSE; }
if( $_535 === TRUE ) { return $this->finalise($result); }
if( $_535 === FALSE) { return FALSE; }
}
@ -2983,31 +3049,31 @@ class SSTemplateParser extends Parser {
protected $match_OldI18NTag_typestack = array('OldI18NTag');
function match_OldI18NTag ($stack = array()) {
$matchrule = "OldI18NTag"; $result = $this->construct($matchrule, $matchrule, null);
$_524 = NULL;
$_540 = NULL;
do {
$res_521 = $result;
$pos_521 = $this->pos;
$res_537 = $result;
$pos_537 = $this->pos;
$matcher = 'match_'.'OldSprintfTag'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_524 = TRUE; break;
$_540 = TRUE; break;
}
$result = $res_521;
$this->pos = $pos_521;
$result = $res_537;
$this->pos = $pos_537;
$matcher = 'match_'.'OldTTag'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_524 = TRUE; break;
$_540 = TRUE; break;
}
$result = $res_521;
$this->pos = $pos_521;
$_524 = FALSE; break;
$result = $res_537;
$this->pos = $pos_537;
$_540 = FALSE; break;
}
while(0);
if( $_524 === TRUE ) { return $this->finalise($result); }
if( $_524 === FALSE) { return FALSE; }
if( $_540 === TRUE ) { return $this->finalise($result); }
if( $_540 === FALSE) { return FALSE; }
}
@ -3020,30 +3086,30 @@ class SSTemplateParser extends Parser {
protected $match_NamedArgument_typestack = array('NamedArgument');
function match_NamedArgument ($stack = array()) {
$matchrule = "NamedArgument"; $result = $this->construct($matchrule, $matchrule, null);
$_529 = NULL;
$_545 = NULL;
do {
$matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Name" );
}
else { $_529 = FALSE; break; }
else { $_545 = FALSE; break; }
if (substr($this->string,$this->pos,1) == '=') {
$this->pos += 1;
$result["text"] .= '=';
}
else { $_529 = FALSE; break; }
else { $_545 = FALSE; break; }
$matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Value" );
}
else { $_529 = FALSE; break; }
$_529 = TRUE; break;
else { $_545 = FALSE; break; }
$_545 = TRUE; break;
}
while(0);
if( $_529 === TRUE ) { return $this->finalise($result); }
if( $_529 === FALSE) { return FALSE; }
if( $_545 === TRUE ) { return $this->finalise($result); }
if( $_545 === FALSE) { return FALSE; }
}
@ -3072,75 +3138,75 @@ class SSTemplateParser extends Parser {
protected $match_Include_typestack = array('Include');
function match_Include ($stack = array()) {
$matchrule = "Include"; $result = $this->construct($matchrule, $matchrule, null);
$_548 = NULL;
$_564 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_548 = FALSE; break; }
else { $_564 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'include' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_548 = FALSE; break; }
else { $_564 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Template" );
}
else { $_548 = FALSE; break; }
else { $_564 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_545 = $result;
$pos_545 = $this->pos;
$_544 = NULL;
$res_561 = $result;
$pos_561 = $this->pos;
$_560 = NULL;
do {
$matcher = 'match_'.'NamedArgument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) { $this->store( $result, $subres ); }
else { $_544 = FALSE; break; }
else { $_560 = FALSE; break; }
while (true) {
$res_543 = $result;
$pos_543 = $this->pos;
$_542 = NULL;
$res_559 = $result;
$pos_559 = $this->pos;
$_558 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ',') {
$this->pos += 1;
$result["text"] .= ',';
}
else { $_542 = FALSE; break; }
else { $_558 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'NamedArgument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
}
else { $_542 = FALSE; break; }
$_542 = TRUE; break;
else { $_558 = FALSE; break; }
$_558 = TRUE; break;
}
while(0);
if( $_542 === FALSE) {
$result = $res_543;
$this->pos = $pos_543;
unset( $res_543 );
unset( $pos_543 );
if( $_558 === FALSE) {
$result = $res_559;
$this->pos = $pos_559;
unset( $res_559 );
unset( $pos_559 );
break;
}
}
$_544 = TRUE; break;
$_560 = TRUE; break;
}
while(0);
if( $_544 === FALSE) {
$result = $res_545;
$this->pos = $pos_545;
unset( $res_545 );
unset( $pos_545 );
if( $_560 === FALSE) {
$result = $res_561;
$this->pos = $pos_561;
unset( $res_561 );
unset( $pos_561 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_548 = FALSE; break; }
$_548 = TRUE; break;
else { $_564 = FALSE; break; }
$_564 = TRUE; break;
}
while(0);
if( $_548 === TRUE ) { return $this->finalise($result); }
if( $_548 === FALSE) { return FALSE; }
if( $_564 === TRUE ) { return $this->finalise($result); }
if( $_564 === FALSE) { return FALSE; }
}
@ -3176,48 +3242,48 @@ class SSTemplateParser extends Parser {
protected $match_BlockArguments_typestack = array('BlockArguments');
function match_BlockArguments ($stack = array()) {
$matchrule = "BlockArguments"; $result = $this->construct($matchrule, $matchrule, null);
$_557 = NULL;
$_573 = NULL;
do {
$matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Argument" );
}
else { $_557 = FALSE; break; }
else { $_573 = FALSE; break; }
while (true) {
$res_556 = $result;
$pos_556 = $this->pos;
$_555 = NULL;
$res_572 = $result;
$pos_572 = $this->pos;
$_571 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (substr($this->string,$this->pos,1) == ',') {
$this->pos += 1;
$result["text"] .= ',';
}
else { $_555 = FALSE; break; }
else { $_571 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$matcher = 'match_'.'Argument'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Argument" );
}
else { $_555 = FALSE; break; }
$_555 = TRUE; break;
else { $_571 = FALSE; break; }
$_571 = TRUE; break;
}
while(0);
if( $_555 === FALSE) {
$result = $res_556;
$this->pos = $pos_556;
unset( $res_556 );
unset( $pos_556 );
if( $_571 === FALSE) {
$result = $res_572;
$this->pos = $pos_572;
unset( $res_572 );
unset( $pos_572 );
break;
}
}
$_557 = TRUE; break;
$_573 = TRUE; break;
}
while(0);
if( $_557 === TRUE ) { return $this->finalise($result); }
if( $_557 === FALSE) { return FALSE; }
if( $_573 === TRUE ) { return $this->finalise($result); }
if( $_573 === FALSE) { return FALSE; }
}
@ -3225,153 +3291,153 @@ class SSTemplateParser extends Parser {
protected $match_NotBlockTag_typestack = array('NotBlockTag');
function match_NotBlockTag ($stack = array()) {
$matchrule = "NotBlockTag"; $result = $this->construct($matchrule, $matchrule, null);
$_595 = NULL;
$_611 = NULL;
do {
$res_559 = $result;
$pos_559 = $this->pos;
$res_575 = $result;
$pos_575 = $this->pos;
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) {
$result["text"] .= $subres;
$_595 = TRUE; break;
$_611 = TRUE; break;
}
$result = $res_559;
$this->pos = $pos_559;
$_593 = NULL;
$result = $res_575;
$this->pos = $pos_575;
$_609 = NULL;
do {
$_590 = NULL;
$_606 = NULL;
do {
$_588 = NULL;
$_604 = NULL;
do {
$res_561 = $result;
$pos_561 = $this->pos;
$res_577 = $result;
$pos_577 = $this->pos;
if (( $subres = $this->literal( 'if' ) ) !== FALSE) {
$result["text"] .= $subres;
$_588 = TRUE; break;
$_604 = TRUE; break;
}
$result = $res_561;
$this->pos = $pos_561;
$_586 = NULL;
$result = $res_577;
$this->pos = $pos_577;
$_602 = NULL;
do {
$res_563 = $result;
$pos_563 = $this->pos;
$res_579 = $result;
$pos_579 = $this->pos;
if (( $subres = $this->literal( 'else_if' ) ) !== FALSE) {
$result["text"] .= $subres;
$_586 = TRUE; break;
$_602 = TRUE; break;
}
$result = $res_563;
$this->pos = $pos_563;
$_584 = NULL;
$result = $res_579;
$this->pos = $pos_579;
$_600 = NULL;
do {
$res_565 = $result;
$pos_565 = $this->pos;
$res_581 = $result;
$pos_581 = $this->pos;
if (( $subres = $this->literal( 'else' ) ) !== FALSE) {
$result["text"] .= $subres;
$_584 = TRUE; break;
$_600 = TRUE; break;
}
$result = $res_565;
$this->pos = $pos_565;
$_582 = NULL;
$result = $res_581;
$this->pos = $pos_581;
$_598 = NULL;
do {
$res_567 = $result;
$pos_567 = $this->pos;
$res_583 = $result;
$pos_583 = $this->pos;
if (( $subres = $this->literal( 'require' ) ) !== FALSE) {
$result["text"] .= $subres;
$_582 = TRUE; break;
$_598 = TRUE; break;
}
$result = $res_567;
$this->pos = $pos_567;
$_580 = NULL;
$result = $res_583;
$this->pos = $pos_583;
$_596 = NULL;
do {
$res_569 = $result;
$pos_569 = $this->pos;
$res_585 = $result;
$pos_585 = $this->pos;
if (( $subres = $this->literal( 'cached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_580 = TRUE; break;
$_596 = TRUE; break;
}
$result = $res_569;
$this->pos = $pos_569;
$_578 = NULL;
$result = $res_585;
$this->pos = $pos_585;
$_594 = NULL;
do {
$res_571 = $result;
$pos_571 = $this->pos;
$res_587 = $result;
$pos_587 = $this->pos;
if (( $subres = $this->literal( 'uncached' ) ) !== FALSE) {
$result["text"] .= $subres;
$_578 = TRUE; break;
$_594 = TRUE; break;
}
$result = $res_571;
$this->pos = $pos_571;
$_576 = NULL;
$result = $res_587;
$this->pos = $pos_587;
$_592 = NULL;
do {
$res_573 = $result;
$pos_573 = $this->pos;
$res_589 = $result;
$pos_589 = $this->pos;
if (( $subres = $this->literal( 'cacheblock' ) ) !== FALSE) {
$result["text"] .= $subres;
$_576 = TRUE; break;
$_592 = TRUE; break;
}
$result = $res_573;
$this->pos = $pos_573;
$result = $res_589;
$this->pos = $pos_589;
if (( $subres = $this->literal( 'include' ) ) !== FALSE) {
$result["text"] .= $subres;
$_576 = TRUE; break;
$_592 = TRUE; break;
}
$result = $res_573;
$this->pos = $pos_573;
$_576 = FALSE; break;
$result = $res_589;
$this->pos = $pos_589;
$_592 = FALSE; break;
}
while(0);
if( $_576 === TRUE ) { $_578 = TRUE; break; }
$result = $res_571;
$this->pos = $pos_571;
$_578 = FALSE; break;
if( $_592 === TRUE ) { $_594 = TRUE; break; }
$result = $res_587;
$this->pos = $pos_587;
$_594 = FALSE; break;
}
while(0);
if( $_578 === TRUE ) { $_580 = TRUE; break; }
$result = $res_569;
$this->pos = $pos_569;
$_580 = FALSE; break;
if( $_594 === TRUE ) { $_596 = TRUE; break; }
$result = $res_585;
$this->pos = $pos_585;
$_596 = FALSE; break;
}
while(0);
if( $_580 === TRUE ) { $_582 = TRUE; break; }
$result = $res_567;
$this->pos = $pos_567;
$_582 = FALSE; break;
if( $_596 === TRUE ) { $_598 = TRUE; break; }
$result = $res_583;
$this->pos = $pos_583;
$_598 = FALSE; break;
}
while(0);
if( $_582 === TRUE ) { $_584 = TRUE; break; }
$result = $res_565;
$this->pos = $pos_565;
$_584 = FALSE; break;
if( $_598 === TRUE ) { $_600 = TRUE; break; }
$result = $res_581;
$this->pos = $pos_581;
$_600 = FALSE; break;
}
while(0);
if( $_584 === TRUE ) { $_586 = TRUE; break; }
$result = $res_563;
$this->pos = $pos_563;
$_586 = FALSE; break;
if( $_600 === TRUE ) { $_602 = TRUE; break; }
$result = $res_579;
$this->pos = $pos_579;
$_602 = FALSE; break;
}
while(0);
if( $_586 === TRUE ) { $_588 = TRUE; break; }
$result = $res_561;
$this->pos = $pos_561;
$_588 = FALSE; break;
if( $_602 === TRUE ) { $_604 = TRUE; break; }
$result = $res_577;
$this->pos = $pos_577;
$_604 = FALSE; break;
}
while(0);
if( $_588 === FALSE) { $_590 = FALSE; break; }
$_590 = TRUE; break;
if( $_604 === FALSE) { $_606 = FALSE; break; }
$_606 = TRUE; break;
}
while(0);
if( $_590 === FALSE) { $_593 = FALSE; break; }
if( $_606 === FALSE) { $_609 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_593 = FALSE; break; }
$_593 = TRUE; break;
else { $_609 = FALSE; break; }
$_609 = TRUE; break;
}
while(0);
if( $_593 === TRUE ) { $_595 = TRUE; break; }
$result = $res_559;
$this->pos = $pos_559;
$_595 = FALSE; break;
if( $_609 === TRUE ) { $_611 = TRUE; break; }
$result = $res_575;
$this->pos = $pos_575;
$_611 = FALSE; break;
}
while(0);
if( $_595 === TRUE ) { return $this->finalise($result); }
if( $_595 === FALSE) { return FALSE; }
if( $_611 === TRUE ) { return $this->finalise($result); }
if( $_611 === FALSE) { return FALSE; }
}
@ -3380,53 +3446,53 @@ class SSTemplateParser extends Parser {
protected $match_ClosedBlock_typestack = array('ClosedBlock');
function match_ClosedBlock ($stack = array()) {
$matchrule = "ClosedBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_615 = NULL;
$_631 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_615 = FALSE; break; }
else { $_631 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_599 = $result;
$pos_599 = $this->pos;
$res_615 = $result;
$pos_615 = $this->pos;
$matcher = 'match_'.'NotBlockTag'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$result = $res_599;
$this->pos = $pos_599;
$_615 = FALSE; break;
$result = $res_615;
$this->pos = $pos_615;
$_631 = FALSE; break;
}
else {
$result = $res_599;
$this->pos = $pos_599;
$result = $res_615;
$this->pos = $pos_615;
}
$matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "BlockName" );
}
else { $_615 = FALSE; break; }
$res_605 = $result;
$pos_605 = $this->pos;
$_604 = NULL;
else { $_631 = FALSE; break; }
$res_621 = $result;
$pos_621 = $this->pos;
$_620 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_604 = FALSE; break; }
else { $_620 = FALSE; break; }
$matcher = 'match_'.'BlockArguments'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "BlockArguments" );
}
else { $_604 = FALSE; break; }
else { $_620 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_604 = FALSE; break; }
$_604 = TRUE; break;
else { $_620 = FALSE; break; }
$_620 = TRUE; break;
}
while(0);
if( $_604 === FALSE) {
$result = $res_605;
$this->pos = $pos_605;
unset( $res_605 );
unset( $pos_605 );
if( $_620 === FALSE) {
$result = $res_621;
$this->pos = $pos_621;
unset( $res_621 );
unset( $pos_621 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$stack[] = $result; $result = $this->construct( $matchrule, "Zap" );
@ -3437,36 +3503,36 @@ class SSTemplateParser extends Parser {
}
else {
$result = array_pop($stack);
$_615 = FALSE; break;
$_631 = FALSE; break;
}
$res_608 = $result;
$pos_608 = $this->pos;
$res_624 = $result;
$pos_624 = $this->pos;
$matcher = 'match_'.$this->expression($result, $stack, 'TemplateMatcher'); $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Template" );
}
else {
$result = $res_608;
$this->pos = $pos_608;
unset( $res_608 );
unset( $pos_608 );
$result = $res_624;
$this->pos = $pos_624;
unset( $res_624 );
unset( $pos_624 );
}
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_615 = FALSE; break; }
else { $_631 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_615 = FALSE; break; }
else { $_631 = FALSE; break; }
if (( $subres = $this->literal( ''.$this->expression($result, $stack, 'BlockName').'' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_615 = FALSE; break; }
else { $_631 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_615 = FALSE; break; }
$_615 = TRUE; break;
else { $_631 = FALSE; break; }
$_631 = TRUE; break;
}
while(0);
if( $_615 === TRUE ) { return $this->finalise($result); }
if( $_615 === FALSE) { return FALSE; }
if( $_631 === TRUE ) { return $this->finalise($result); }
if( $_631 === FALSE) { return FALSE; }
}
@ -3573,62 +3639,62 @@ class SSTemplateParser extends Parser {
protected $match_OpenBlock_typestack = array('OpenBlock');
function match_OpenBlock ($stack = array()) {
$matchrule = "OpenBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_628 = NULL;
$_644 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_628 = FALSE; break; }
else { $_644 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_619 = $result;
$pos_619 = $this->pos;
$res_635 = $result;
$pos_635 = $this->pos;
$matcher = 'match_'.'NotBlockTag'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$result = $res_619;
$this->pos = $pos_619;
$_628 = FALSE; break;
$result = $res_635;
$this->pos = $pos_635;
$_644 = FALSE; break;
}
else {
$result = $res_619;
$this->pos = $pos_619;
$result = $res_635;
$this->pos = $pos_635;
}
$matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "BlockName" );
}
else { $_628 = FALSE; break; }
$res_625 = $result;
$pos_625 = $this->pos;
$_624 = NULL;
else { $_644 = FALSE; break; }
$res_641 = $result;
$pos_641 = $this->pos;
$_640 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_624 = FALSE; break; }
else { $_640 = FALSE; break; }
$matcher = 'match_'.'BlockArguments'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "BlockArguments" );
}
else { $_624 = FALSE; break; }
else { $_640 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_624 = FALSE; break; }
$_624 = TRUE; break;
else { $_640 = FALSE; break; }
$_640 = TRUE; break;
}
while(0);
if( $_624 === FALSE) {
$result = $res_625;
$this->pos = $pos_625;
unset( $res_625 );
unset( $pos_625 );
if( $_640 === FALSE) {
$result = $res_641;
$this->pos = $pos_641;
unset( $res_641 );
unset( $pos_641 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_628 = FALSE; break; }
$_628 = TRUE; break;
else { $_644 = FALSE; break; }
$_644 = TRUE; break;
}
while(0);
if( $_628 === TRUE ) { return $this->finalise($result); }
if( $_628 === FALSE) { return FALSE; }
if( $_644 === TRUE ) { return $this->finalise($result); }
if( $_644 === FALSE) { return FALSE; }
}
@ -3697,27 +3763,27 @@ class SSTemplateParser extends Parser {
protected $match_MismatchedEndBlock_typestack = array('MismatchedEndBlock');
function match_MismatchedEndBlock ($stack = array()) {
$matchrule = "MismatchedEndBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_636 = NULL;
$_652 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_636 = FALSE; break; }
else { $_652 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_636 = FALSE; break; }
else { $_652 = FALSE; break; }
$matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Word" );
}
else { $_636 = FALSE; break; }
else { $_652 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_636 = FALSE; break; }
$_636 = TRUE; break;
else { $_652 = FALSE; break; }
$_652 = TRUE; break;
}
while(0);
if( $_636 === TRUE ) { return $this->finalise($result); }
if( $_636 === FALSE) { return FALSE; }
if( $_652 === TRUE ) { return $this->finalise($result); }
if( $_652 === FALSE) { return FALSE; }
}
@ -3732,78 +3798,78 @@ class SSTemplateParser extends Parser {
protected $match_MalformedOpenTag_typestack = array('MalformedOpenTag');
function match_MalformedOpenTag ($stack = array()) {
$matchrule = "MalformedOpenTag"; $result = $this->construct($matchrule, $matchrule, null);
$_651 = NULL;
$_667 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_651 = FALSE; break; }
else { $_667 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$res_640 = $result;
$pos_640 = $this->pos;
$res_656 = $result;
$pos_656 = $this->pos;
$matcher = 'match_'.'NotBlockTag'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$result = $res_640;
$this->pos = $pos_640;
$_651 = FALSE; break;
$result = $res_656;
$this->pos = $pos_656;
$_667 = FALSE; break;
}
else {
$result = $res_640;
$this->pos = $pos_640;
$result = $res_656;
$this->pos = $pos_656;
}
$matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Tag" );
}
else { $_651 = FALSE; break; }
$res_650 = $result;
$pos_650 = $this->pos;
$_649 = NULL;
else { $_667 = FALSE; break; }
$res_666 = $result;
$pos_666 = $this->pos;
$_665 = NULL;
do {
$res_646 = $result;
$pos_646 = $this->pos;
$_645 = NULL;
$res_662 = $result;
$pos_662 = $this->pos;
$_661 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_645 = FALSE; break; }
else { $_661 = FALSE; break; }
$matcher = 'match_'.'BlockArguments'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "BlockArguments" );
}
else { $_645 = FALSE; break; }
else { $_661 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_645 = FALSE; break; }
$_645 = TRUE; break;
else { $_661 = FALSE; break; }
$_661 = TRUE; break;
}
while(0);
if( $_645 === FALSE) {
$result = $res_646;
$this->pos = $pos_646;
unset( $res_646 );
unset( $pos_646 );
if( $_661 === FALSE) {
$result = $res_662;
$this->pos = $pos_662;
unset( $res_662 );
unset( $pos_662 );
}
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_649 = FALSE; break; }
$_649 = TRUE; break;
else { $_665 = FALSE; break; }
$_665 = TRUE; break;
}
while(0);
if( $_649 === TRUE ) {
$result = $res_650;
$this->pos = $pos_650;
$_651 = FALSE; break;
if( $_665 === TRUE ) {
$result = $res_666;
$this->pos = $pos_666;
$_667 = FALSE; break;
}
if( $_649 === FALSE) {
$result = $res_650;
$this->pos = $pos_650;
if( $_665 === FALSE) {
$result = $res_666;
$this->pos = $pos_666;
}
$_651 = TRUE; break;
$_667 = TRUE; break;
}
while(0);
if( $_651 === TRUE ) { return $this->finalise($result); }
if( $_651 === FALSE) { return FALSE; }
if( $_667 === TRUE ) { return $this->finalise($result); }
if( $_667 === FALSE) { return FALSE; }
}
@ -3818,57 +3884,57 @@ class SSTemplateParser extends Parser {
protected $match_MalformedCloseTag_typestack = array('MalformedCloseTag');
function match_MalformedCloseTag ($stack = array()) {
$matchrule = "MalformedCloseTag"; $result = $this->construct($matchrule, $matchrule, null);
$_663 = NULL;
$_679 = NULL;
do {
if (( $subres = $this->literal( '<%' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_663 = FALSE; break; }
else { $_679 = FALSE; break; }
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
$stack[] = $result; $result = $this->construct( $matchrule, "Tag" );
$_657 = NULL;
$_673 = NULL;
do {
if (( $subres = $this->literal( 'end_' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_657 = FALSE; break; }
else { $_673 = FALSE; break; }
$matcher = 'match_'.'Word'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres, "Word" );
}
else { $_657 = FALSE; break; }
$_657 = TRUE; break;
else { $_673 = FALSE; break; }
$_673 = TRUE; break;
}
while(0);
if( $_657 === TRUE ) {
if( $_673 === TRUE ) {
$subres = $result; $result = array_pop($stack);
$this->store( $result, $subres, 'Tag' );
}
if( $_657 === FALSE) {
if( $_673 === FALSE) {
$result = array_pop($stack);
$_663 = FALSE; break;
$_679 = FALSE; break;
}
$res_662 = $result;
$pos_662 = $this->pos;
$_661 = NULL;
$res_678 = $result;
$pos_678 = $this->pos;
$_677 = NULL;
do {
if (( $subres = $this->whitespace( ) ) !== FALSE) { $result["text"] .= $subres; }
if (( $subres = $this->literal( '%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_661 = FALSE; break; }
$_661 = TRUE; break;
else { $_677 = FALSE; break; }
$_677 = TRUE; break;
}
while(0);
if( $_661 === TRUE ) {
$result = $res_662;
$this->pos = $pos_662;
$_663 = FALSE; break;
if( $_677 === TRUE ) {
$result = $res_678;
$this->pos = $pos_678;
$_679 = FALSE; break;
}
if( $_661 === FALSE) {
$result = $res_662;
$this->pos = $pos_662;
if( $_677 === FALSE) {
$result = $res_678;
$this->pos = $pos_678;
}
$_663 = TRUE; break;
$_679 = TRUE; break;
}
while(0);
if( $_663 === TRUE ) { return $this->finalise($result); }
if( $_663 === FALSE) { return FALSE; }
if( $_679 === TRUE ) { return $this->finalise($result); }
if( $_679 === FALSE) { return FALSE; }
}
@ -3883,85 +3949,85 @@ class SSTemplateParser extends Parser {
protected $match_MalformedBlock_typestack = array('MalformedBlock');
function match_MalformedBlock ($stack = array()) {
$matchrule = "MalformedBlock"; $result = $this->construct($matchrule, $matchrule, null);
$_668 = NULL;
$_684 = NULL;
do {
$res_665 = $result;
$pos_665 = $this->pos;
$res_681 = $result;
$pos_681 = $this->pos;
$matcher = 'match_'.'MalformedOpenTag'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_668 = TRUE; break;
$_684 = TRUE; break;
}
$result = $res_665;
$this->pos = $pos_665;
$result = $res_681;
$this->pos = $pos_681;
$matcher = 'match_'.'MalformedCloseTag'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_668 = TRUE; break;
$_684 = TRUE; break;
}
$result = $res_665;
$this->pos = $pos_665;
$_668 = FALSE; break;
$result = $res_681;
$this->pos = $pos_681;
$_684 = FALSE; break;
}
while(0);
if( $_668 === TRUE ) { return $this->finalise($result); }
if( $_668 === FALSE) { return FALSE; }
if( $_684 === TRUE ) { return $this->finalise($result); }
if( $_684 === FALSE) { return FALSE; }
}
/* Comment: "<%--" (!"--%>" /./)+ "--%>" */
/* Comment: "<%--" (!"--%>" /(?s)./)+ "--%>" */
protected $match_Comment_typestack = array('Comment');
function match_Comment ($stack = array()) {
$matchrule = "Comment"; $result = $this->construct($matchrule, $matchrule, null);
$_676 = NULL;
$_692 = NULL;
do {
if (( $subres = $this->literal( '<%--' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_676 = FALSE; break; }
else { $_692 = FALSE; break; }
$count = 0;
while (true) {
$res_674 = $result;
$pos_674 = $this->pos;
$_673 = NULL;
$res_690 = $result;
$pos_690 = $this->pos;
$_689 = NULL;
do {
$res_671 = $result;
$pos_671 = $this->pos;
$res_687 = $result;
$pos_687 = $this->pos;
if (( $subres = $this->literal( '--%>' ) ) !== FALSE) {
$result["text"] .= $subres;
$result = $res_671;
$this->pos = $pos_671;
$_673 = FALSE; break;
$result = $res_687;
$this->pos = $pos_687;
$_689 = FALSE; break;
}
else {
$result = $res_671;
$this->pos = $pos_671;
$result = $res_687;
$this->pos = $pos_687;
}
if (( $subres = $this->rx( '/(?s)./' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_673 = FALSE; break; }
$_673 = TRUE; break;
else { $_689 = FALSE; break; }
$_689 = TRUE; break;
}
while(0);
if( $_673 === FALSE) {
$result = $res_674;
$this->pos = $pos_674;
unset( $res_674 );
unset( $pos_674 );
if( $_689 === FALSE) {
$result = $res_690;
$this->pos = $pos_690;
unset( $res_690 );
unset( $pos_690 );
break;
}
$count += 1;
}
if ($count > 0) { }
else { $_676 = FALSE; break; }
else { $_692 = FALSE; break; }
if (( $subres = $this->literal( '--%>' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_676 = FALSE; break; }
$_676 = TRUE; break;
else { $_692 = FALSE; break; }
$_692 = TRUE; break;
}
while(0);
if( $_676 === TRUE ) { return $this->finalise($result); }
if( $_676 === FALSE) { return FALSE; }
if( $_692 === TRUE ) { return $this->finalise($result); }
if( $_692 === FALSE) { return FALSE; }
}
@ -3977,258 +4043,258 @@ class SSTemplateParser extends Parser {
$matchrule = "TopTemplate"; $result = $this->construct($matchrule, $matchrule, array('TemplateMatcher' => 'Template'));
$count = 0;
while (true) {
$res_732 = $result;
$pos_732 = $this->pos;
$_731 = NULL;
$res_748 = $result;
$pos_748 = $this->pos;
$_747 = NULL;
do {
$_729 = NULL;
$_745 = NULL;
do {
$res_678 = $result;
$pos_678 = $this->pos;
$res_694 = $result;
$pos_694 = $this->pos;
$matcher = 'match_'.'Comment'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_729 = TRUE; break;
$_745 = TRUE; break;
}
$result = $res_678;
$this->pos = $pos_678;
$_727 = NULL;
$result = $res_694;
$this->pos = $pos_694;
$_743 = NULL;
do {
$res_680 = $result;
$pos_680 = $this->pos;
$res_696 = $result;
$pos_696 = $this->pos;
$matcher = 'match_'.'Translate'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_727 = TRUE; break;
$_743 = TRUE; break;
}
$result = $res_680;
$this->pos = $pos_680;
$_725 = NULL;
$result = $res_696;
$this->pos = $pos_696;
$_741 = NULL;
do {
$res_682 = $result;
$pos_682 = $this->pos;
$res_698 = $result;
$pos_698 = $this->pos;
$matcher = 'match_'.'If'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_725 = TRUE; break;
$_741 = TRUE; break;
}
$result = $res_682;
$this->pos = $pos_682;
$_723 = NULL;
$result = $res_698;
$this->pos = $pos_698;
$_739 = NULL;
do {
$res_684 = $result;
$pos_684 = $this->pos;
$res_700 = $result;
$pos_700 = $this->pos;
$matcher = 'match_'.'Require'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_723 = TRUE; break;
$_739 = TRUE; break;
}
$result = $res_684;
$this->pos = $pos_684;
$_721 = NULL;
$result = $res_700;
$this->pos = $pos_700;
$_737 = NULL;
do {
$res_686 = $result;
$pos_686 = $this->pos;
$res_702 = $result;
$pos_702 = $this->pos;
$matcher = 'match_'.'CacheBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_721 = TRUE; break;
$_737 = TRUE; break;
}
$result = $res_686;
$this->pos = $pos_686;
$_719 = NULL;
$result = $res_702;
$this->pos = $pos_702;
$_735 = NULL;
do {
$res_688 = $result;
$pos_688 = $this->pos;
$res_704 = $result;
$pos_704 = $this->pos;
$matcher = 'match_'.'UncachedBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_719 = TRUE; break;
$_735 = TRUE; break;
}
$result = $res_688;
$this->pos = $pos_688;
$_717 = NULL;
$result = $res_704;
$this->pos = $pos_704;
$_733 = NULL;
do {
$res_690 = $result;
$pos_690 = $this->pos;
$res_706 = $result;
$pos_706 = $this->pos;
$matcher = 'match_'.'OldI18NTag'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_717 = TRUE; break;
$_733 = TRUE; break;
}
$result = $res_690;
$this->pos = $pos_690;
$_715 = NULL;
$result = $res_706;
$this->pos = $pos_706;
$_731 = NULL;
do {
$res_692 = $result;
$pos_692 = $this->pos;
$res_708 = $result;
$pos_708 = $this->pos;
$matcher = 'match_'.'Include'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_715 = TRUE; break;
$_731 = TRUE; break;
}
$result = $res_692;
$this->pos = $pos_692;
$_713 = NULL;
$result = $res_708;
$this->pos = $pos_708;
$_729 = NULL;
do {
$res_694 = $result;
$pos_694 = $this->pos;
$res_710 = $result;
$pos_710 = $this->pos;
$matcher = 'match_'.'ClosedBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_713 = TRUE; break;
$_729 = TRUE; break;
}
$result = $res_694;
$this->pos = $pos_694;
$_711 = NULL;
$result = $res_710;
$this->pos = $pos_710;
$_727 = NULL;
do {
$res_696 = $result;
$pos_696 = $this->pos;
$res_712 = $result;
$pos_712 = $this->pos;
$matcher = 'match_'.'OpenBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_711 = TRUE; break;
$_727 = TRUE; break;
}
$result = $res_696;
$this->pos = $pos_696;
$_709 = NULL;
$result = $res_712;
$this->pos = $pos_712;
$_725 = NULL;
do {
$res_698 = $result;
$pos_698 = $this->pos;
$res_714 = $result;
$pos_714 = $this->pos;
$matcher = 'match_'.'MalformedBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_709 = TRUE; break;
$_725 = TRUE; break;
}
$result = $res_698;
$this->pos = $pos_698;
$_707 = NULL;
$result = $res_714;
$this->pos = $pos_714;
$_723 = NULL;
do {
$res_700 = $result;
$pos_700 = $this->pos;
$res_716 = $result;
$pos_716 = $this->pos;
$matcher = 'match_'.'MismatchedEndBlock'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_707 = TRUE; break;
$_723 = TRUE; break;
}
$result = $res_700;
$this->pos = $pos_700;
$_705 = NULL;
$result = $res_716;
$this->pos = $pos_716;
$_721 = NULL;
do {
$res_702 = $result;
$pos_702 = $this->pos;
$res_718 = $result;
$pos_718 = $this->pos;
$matcher = 'match_'.'Injection'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_705 = TRUE; break;
$_721 = TRUE; break;
}
$result = $res_702;
$this->pos = $pos_702;
$result = $res_718;
$this->pos = $pos_718;
$matcher = 'match_'.'Text'; $key = $matcher; $pos = $this->pos;
$subres = ( $this->packhas( $key, $pos ) ? $this->packread( $key, $pos ) : $this->packwrite( $key, $pos, $this->$matcher(array_merge($stack, array($result))) ) );
if ($subres !== FALSE) {
$this->store( $result, $subres );
$_705 = TRUE; break;
$_721 = TRUE; break;
}
$result = $res_702;
$this->pos = $pos_702;
$_705 = FALSE; break;
$result = $res_718;
$this->pos = $pos_718;
$_721 = FALSE; break;
}
while(0);
if( $_705 === TRUE ) { $_707 = TRUE; break; }
$result = $res_700;
$this->pos = $pos_700;
$_707 = FALSE; break;
if( $_721 === TRUE ) { $_723 = TRUE; break; }
$result = $res_716;
$this->pos = $pos_716;
$_723 = FALSE; break;
}
while(0);
if( $_707 === TRUE ) { $_709 = TRUE; break; }
$result = $res_698;
$this->pos = $pos_698;
$_709 = FALSE; break;
if( $_723 === TRUE ) { $_725 = TRUE; break; }
$result = $res_714;
$this->pos = $pos_714;
$_725 = FALSE; break;
}
while(0);
if( $_709 === TRUE ) { $_711 = TRUE; break; }
$result = $res_696;
$this->pos = $pos_696;
$_711 = FALSE; break;
if( $_725 === TRUE ) { $_727 = TRUE; break; }
$result = $res_712;
$this->pos = $pos_712;
$_727 = FALSE; break;
}
while(0);
if( $_711 === TRUE ) { $_713 = TRUE; break; }
$result = $res_694;
$this->pos = $pos_694;
$_713 = FALSE; break;
if( $_727 === TRUE ) { $_729 = TRUE; break; }
$result = $res_710;
$this->pos = $pos_710;
$_729 = FALSE; break;
}
while(0);
if( $_713 === TRUE ) { $_715 = TRUE; break; }
$result = $res_692;
$this->pos = $pos_692;
$_715 = FALSE; break;
if( $_729 === TRUE ) { $_731 = TRUE; break; }
$result = $res_708;
$this->pos = $pos_708;
$_731 = FALSE; break;
}
while(0);
if( $_715 === TRUE ) { $_717 = TRUE; break; }
$result = $res_690;
$this->pos = $pos_690;
$_717 = FALSE; break;
if( $_731 === TRUE ) { $_733 = TRUE; break; }
$result = $res_706;
$this->pos = $pos_706;
$_733 = FALSE; break;
}
while(0);
if( $_717 === TRUE ) { $_719 = TRUE; break; }
$result = $res_688;
$this->pos = $pos_688;
$_719 = FALSE; break;
if( $_733 === TRUE ) { $_735 = TRUE; break; }
$result = $res_704;
$this->pos = $pos_704;
$_735 = FALSE; break;
}
while(0);
if( $_719 === TRUE ) { $_721 = TRUE; break; }
$result = $res_686;
$this->pos = $pos_686;
$_721 = FALSE; break;
if( $_735 === TRUE ) { $_737 = TRUE; break; }
$result = $res_702;
$this->pos = $pos_702;
$_737 = FALSE; break;
}
while(0);
if( $_721 === TRUE ) { $_723 = TRUE; break; }
$result = $res_684;
$this->pos = $pos_684;
$_723 = FALSE; break;
if( $_737 === TRUE ) { $_739 = TRUE; break; }
$result = $res_700;
$this->pos = $pos_700;
$_739 = FALSE; break;
}
while(0);
if( $_723 === TRUE ) { $_725 = TRUE; break; }
$result = $res_682;
$this->pos = $pos_682;
$_725 = FALSE; break;
if( $_739 === TRUE ) { $_741 = TRUE; break; }
$result = $res_698;
$this->pos = $pos_698;
$_741 = FALSE; break;
}
while(0);
if( $_725 === TRUE ) { $_727 = TRUE; break; }
$result = $res_680;
$this->pos = $pos_680;
$_727 = FALSE; break;
if( $_741 === TRUE ) { $_743 = TRUE; break; }
$result = $res_696;
$this->pos = $pos_696;
$_743 = FALSE; break;
}
while(0);
if( $_727 === TRUE ) { $_729 = TRUE; break; }
$result = $res_678;
$this->pos = $pos_678;
$_729 = FALSE; break;
if( $_743 === TRUE ) { $_745 = TRUE; break; }
$result = $res_694;
$this->pos = $pos_694;
$_745 = FALSE; break;
}
while(0);
if( $_729 === FALSE) { $_731 = FALSE; break; }
$_731 = TRUE; break;
if( $_745 === FALSE) { $_747 = FALSE; break; }
$_747 = TRUE; break;
}
while(0);
if( $_731 === FALSE) {
$result = $res_732;
$this->pos = $pos_732;
unset( $res_732 );
unset( $pos_732 );
if( $_747 === FALSE) {
$result = $res_748;
$this->pos = $pos_748;
unset( $res_748 );
unset( $pos_748 );
break;
}
$count += 1;
@ -4260,189 +4326,189 @@ class SSTemplateParser extends Parser {
$matchrule = "Text"; $result = $this->construct($matchrule, $matchrule, null);
$count = 0;
while (true) {
$res_771 = $result;
$pos_771 = $this->pos;
$_770 = NULL;
$res_787 = $result;
$pos_787 = $this->pos;
$_786 = NULL;
do {
$_768 = NULL;
$_784 = NULL;
do {
$res_733 = $result;
$pos_733 = $this->pos;
$res_749 = $result;
$pos_749 = $this->pos;
if (( $subres = $this->rx( '/ [^<${\\\\]+ /' ) ) !== FALSE) {
$result["text"] .= $subres;
$_768 = TRUE; break;
$_784 = TRUE; break;
}
$result = $res_733;
$this->pos = $pos_733;
$_766 = NULL;
$result = $res_749;
$this->pos = $pos_749;
$_782 = NULL;
do {
$res_735 = $result;
$pos_735 = $this->pos;
$res_751 = $result;
$pos_751 = $this->pos;
if (( $subres = $this->rx( '/ (\\\\.) /' ) ) !== FALSE) {
$result["text"] .= $subres;
$_766 = TRUE; break;
$_782 = TRUE; break;
}
$result = $res_735;
$this->pos = $pos_735;
$_764 = NULL;
$result = $res_751;
$this->pos = $pos_751;
$_780 = NULL;
do {
$res_737 = $result;
$pos_737 = $this->pos;
$_740 = NULL;
$res_753 = $result;
$pos_753 = $this->pos;
$_756 = NULL;
do {
if (substr($this->string,$this->pos,1) == '<') {
$this->pos += 1;
$result["text"] .= '<';
}
else { $_740 = FALSE; break; }
$res_739 = $result;
$pos_739 = $this->pos;
else { $_756 = FALSE; break; }
$res_755 = $result;
$pos_755 = $this->pos;
if (substr($this->string,$this->pos,1) == '%') {
$this->pos += 1;
$result["text"] .= '%';
$result = $res_739;
$this->pos = $pos_739;
$_740 = FALSE; break;
$result = $res_755;
$this->pos = $pos_755;
$_756 = FALSE; break;
}
else {
$result = $res_739;
$this->pos = $pos_739;
$result = $res_755;
$this->pos = $pos_755;
}
$_740 = TRUE; break;
$_756 = TRUE; break;
}
while(0);
if( $_740 === TRUE ) { $_764 = TRUE; break; }
$result = $res_737;
$this->pos = $pos_737;
$_762 = NULL;
if( $_756 === TRUE ) { $_780 = TRUE; break; }
$result = $res_753;
$this->pos = $pos_753;
$_778 = NULL;
do {
$res_742 = $result;
$pos_742 = $this->pos;
$_747 = NULL;
$res_758 = $result;
$pos_758 = $this->pos;
$_763 = NULL;
do {
if (substr($this->string,$this->pos,1) == '$') {
$this->pos += 1;
$result["text"] .= '$';
}
else { $_747 = FALSE; break; }
$res_746 = $result;
$pos_746 = $this->pos;
$_745 = NULL;
else { $_763 = FALSE; break; }
$res_762 = $result;
$pos_762 = $this->pos;
$_761 = NULL;
do {
if (( $subres = $this->rx( '/[A-Za-z_]/' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_745 = FALSE; break; }
$_745 = TRUE; break;
else { $_761 = FALSE; break; }
$_761 = TRUE; break;
}
while(0);
if( $_745 === TRUE ) {
$result = $res_746;
$this->pos = $pos_746;
$_747 = FALSE; break;
if( $_761 === TRUE ) {
$result = $res_762;
$this->pos = $pos_762;
$_763 = FALSE; break;
}
if( $_745 === FALSE) {
$result = $res_746;
$this->pos = $pos_746;
if( $_761 === FALSE) {
$result = $res_762;
$this->pos = $pos_762;
}
$_747 = TRUE; break;
$_763 = TRUE; break;
}
while(0);
if( $_747 === TRUE ) { $_762 = TRUE; break; }
$result = $res_742;
$this->pos = $pos_742;
$_760 = NULL;
if( $_763 === TRUE ) { $_778 = TRUE; break; }
$result = $res_758;
$this->pos = $pos_758;
$_776 = NULL;
do {
$res_749 = $result;
$pos_749 = $this->pos;
$_752 = NULL;
$res_765 = $result;
$pos_765 = $this->pos;
$_768 = NULL;
do {
if (substr($this->string,$this->pos,1) == '{') {
$this->pos += 1;
$result["text"] .= '{';
}
else { $_752 = FALSE; break; }
$res_751 = $result;
$pos_751 = $this->pos;
else { $_768 = FALSE; break; }
$res_767 = $result;
$pos_767 = $this->pos;
if (substr($this->string,$this->pos,1) == '$') {
$this->pos += 1;
$result["text"] .= '$';
$result = $res_751;
$this->pos = $pos_751;
$_752 = FALSE; break;
$result = $res_767;
$this->pos = $pos_767;
$_768 = FALSE; break;
}
else {
$result = $res_751;
$this->pos = $pos_751;
$result = $res_767;
$this->pos = $pos_767;
}
$_752 = TRUE; break;
$_768 = TRUE; break;
}
while(0);
if( $_752 === TRUE ) { $_760 = TRUE; break; }
$result = $res_749;
$this->pos = $pos_749;
$_758 = NULL;
if( $_768 === TRUE ) { $_776 = TRUE; break; }
$result = $res_765;
$this->pos = $pos_765;
$_774 = NULL;
do {
if (( $subres = $this->literal( '{$' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_758 = FALSE; break; }
$res_757 = $result;
$pos_757 = $this->pos;
$_756 = NULL;
else { $_774 = FALSE; break; }
$res_773 = $result;
$pos_773 = $this->pos;
$_772 = NULL;
do {
if (( $subres = $this->rx( '/[A-Za-z_]/' ) ) !== FALSE) { $result["text"] .= $subres; }
else { $_756 = FALSE; break; }
$_756 = TRUE; break;
else { $_772 = FALSE; break; }
$_772 = TRUE; break;
}
while(0);
if( $_756 === TRUE ) {
$result = $res_757;
$this->pos = $pos_757;
$_758 = FALSE; break;
if( $_772 === TRUE ) {
$result = $res_773;
$this->pos = $pos_773;
$_774 = FALSE; break;
}
if( $_756 === FALSE) {
$result = $res_757;
$this->pos = $pos_757;
if( $_772 === FALSE) {
$result = $res_773;
$this->pos = $pos_773;
}
$_758 = TRUE; break;
$_774 = TRUE; break;
}
while(0);
if( $_758 === TRUE ) { $_760 = TRUE; break; }
$result = $res_749;
$this->pos = $pos_749;
$_760 = FALSE; break;
if( $_774 === TRUE ) { $_776 = TRUE; break; }
$result = $res_765;
$this->pos = $pos_765;
$_776 = FALSE; break;
}
while(0);
if( $_760 === TRUE ) { $_762 = TRUE; break; }
$result = $res_742;
$this->pos = $pos_742;
$_762 = FALSE; break;
if( $_776 === TRUE ) { $_778 = TRUE; break; }
$result = $res_758;
$this->pos = $pos_758;
$_778 = FALSE; break;
}
while(0);
if( $_762 === TRUE ) { $_764 = TRUE; break; }
$result = $res_737;
$this->pos = $pos_737;
$_764 = FALSE; break;
if( $_778 === TRUE ) { $_780 = TRUE; break; }
$result = $res_753;
$this->pos = $pos_753;
$_780 = FALSE; break;
}
while(0);
if( $_764 === TRUE ) { $_766 = TRUE; break; }
$result = $res_735;
$this->pos = $pos_735;
$_766 = FALSE; break;
if( $_780 === TRUE ) { $_782 = TRUE; break; }
$result = $res_751;
$this->pos = $pos_751;
$_782 = FALSE; break;
}
while(0);
if( $_766 === TRUE ) { $_768 = TRUE; break; }
$result = $res_733;
$this->pos = $pos_733;
$_768 = FALSE; break;
if( $_782 === TRUE ) { $_784 = TRUE; break; }
$result = $res_749;
$this->pos = $pos_749;
$_784 = FALSE; break;
}
while(0);
if( $_768 === FALSE) { $_770 = FALSE; break; }
$_770 = TRUE; break;
if( $_784 === FALSE) { $_786 = FALSE; break; }
$_786 = TRUE; break;
}
while(0);
if( $_770 === FALSE) {
$result = $res_771;
$this->pos = $pos_771;
unset( $res_771 );
unset( $pos_771 );
if( $_786 === FALSE) {
$result = $res_787;
$this->pos = $pos_787;
unset( $res_787 );
unset( $pos_787 );
break;
}
$count += 1;

View File

@ -281,7 +281,7 @@ class SSTemplateParser extends Parser {
# character which, in some context, would indicate the end of a free string, regardless of if we're actually in
# that context or not
FreeString: /[^,)%!=|&]+/
FreeString: /[^,)%!=><|&]+/
# An argument - either a marked value, or a bare value, prefering lookup matching on the bare value over
# freestring matching as long as that would give a successful parse
@ -338,7 +338,7 @@ class SSTemplateParser extends Parser {
# if and else_if blocks allow basic comparisons between arguments
ComparisonOperator: "==" | "!=" | "="
ComparisonOperator: "!=" | "==" | ">=" | ">" | "<=" | "<" | "="
Comparison: Argument < ComparisonOperator > Argument
*/
@ -804,7 +804,7 @@ class SSTemplateParser extends Parser {
* @deprecated
*/
function ClosedBlock_Handle_Control(&$res) {
Deprecation::notice('3.1', 'Use <% with %> or <% loop %> instead.');
Deprecation::notice('3.1', '<% control %> is deprecated. Use <% with %> or <% loop %> instead.');
return $this->ClosedBlock_Handle_Loop($res);
}
@ -1002,7 +1002,7 @@ class SSTemplateParser extends Parser {
// non-dynamically calculated
$text = preg_replace(
'/href\s*\=\s*\"\#/',
'href="\' . (SSViewer::$options[\'rewriteHashlinks\'] ? strip_tags( $_SERVER[\'REQUEST_URI\'] ) : "") .
'href="\' . (Config::inst()->get(\'SSViewer\', \'rewrite_hash_links\') ? strip_tags( $_SERVER[\'REQUEST_URI\'] ) : "") .
\'#',
$text
);

View File

@ -572,15 +572,20 @@ class SSViewer {
/**
* @config
* @var string
* @var string The used "theme", which usually consists of templates, images and stylesheets.
* Only used when {@link $theme_enabled} is set to TRUE.
*/
private static $current_theme = null;
private static $theme = null;
/**
* @config
* @var string
* @var boolean Use the theme. Set to FALSE in order to disable themes,
* which can be useful for scenarios where theme overrides are temporarily undesired,
* such as an administrative interface separate from the website theme.
* It retains the theme settings to be re-enabled, for example when a website content
* needs to be rendered from within this administrative interface.
*/
private static $current_custom_theme = null;
private static $theme_enabled = true;
/**
* @var boolean
@ -603,9 +608,6 @@ class SSViewer {
public static function set_theme($theme) {
Deprecation::notice('3.2', 'Use the "SSViewer.theme" config setting instead');
Config::inst()->update('SSViewer', 'theme', $theme);
//Static publishing needs to have a theme set, otherwise it defaults to the content controller theme
if(!is_null($theme))
Config::inst()->update('SSViewer', 'custom_theme', $theme);
}
/**
@ -655,8 +657,8 @@ class SSViewer {
* @return string
*/
public static function current_custom_theme(){
Deprecation::notice('3.2', 'Use the "SSViewer.theme" config setting instead');
return Config::inst()->get('SSViewer', 'custom_theme');
Deprecation::notice('3.2', 'Use the "SSViewer.theme" and "SSViewer.theme_enabled" config settings instead');
return Config::inst()->get('SSViewer', 'theme_enabled') ? Config::inst()->get('SSViewer', 'theme') : null;
}
/**
@ -683,8 +685,13 @@ class SSViewer {
if(!is_array($templateList) && substr((string) $templateList,-3) == '.ss') {
$this->chosenTemplates['main'] = $templateList;
} else {
if(Config::inst()->get('SSViewer', 'theme_enabled')) {
$theme = Config::inst()->get('SSViewer', 'theme');
} else {
$theme = null;
}
$this->chosenTemplates = SS_TemplateLoader::instance()->findTemplates(
$templateList, Config::inst()->get('SSViewer', 'theme')
$templateList, $theme
);
}
@ -792,7 +799,12 @@ class SSViewer {
*/
public static function getTemplateFileByType($identifier, $type) {
$loader = SS_TemplateLoader::instance();
$found = $loader->findTemplates("$type/$identifier", Config::inst()->get('SSViewer', 'theme'));
if(Config::inst()->get('SSViewer', 'theme_enabled')) {
$theme = Config::inst()->get('SSViewer', 'theme');
} else {
$theme = null;
}
$found = $loader->findTemplates("$type/$identifier", $theme);
if ($found) {
return $found['main'];

View File

@ -522,7 +522,10 @@ class ViewableData extends Object implements IteratorAggregate {
* @return string
*/
public function ThemeDir($subtheme = false) {
if($theme = Config::inst()->get('SSViewer', 'theme')) {
if(
Config::inst()->get('SSViewer', 'theme_enabled')
&& $theme = Config::inst()->get('SSViewer', 'theme')
) {
return THEMES_DIR . "/$theme" . ($subtheme ? "_$subtheme" : null);
}