non security modules update
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
|
||||
div.panels-ipe-handlebar-wrapper ul {
|
||||
float: right;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.panels-ipe-handlebar-wrapper li {
|
||||
margin: 0 0 0 .5em;
|
||||
float: right;
|
||||
}
|
||||
|
||||
div.panels-ipe-draghandle span.panels-ipe-draghandle-icon {
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.panels-ipe-placeholder {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.panels-ipe-newblock {
|
||||
left: 30px;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
div.panels-ipe-handlebar-wrapper li a span,
|
||||
div.panels-ipe-newblock a span {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div.panels-ipe-newblock a.style {
|
||||
margin-left: .5em;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.panels-ipe-editing .panels-ipe-region {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/** ============================================================================
|
||||
* Controller form markup
|
||||
*/
|
||||
|
||||
.ipe-throbber {
|
||||
right: 49%;
|
||||
right: auto;
|
||||
}
|
||||
|
||||
div.panels-ipe-control .form-submit {
|
||||
padding: 0 34px 2px 0.8em;
|
||||
}
|
||||
|
||||
#panels-ipe-save,
|
||||
#panels-ipe-cancel {
|
||||
background-position: 86% 0;
|
||||
}
|
||||
|
||||
div.panels-ipe-pseudobutton-container a.panels-ipe-startedit {
|
||||
padding-right: 34px;
|
||||
padding-left: 10px;
|
||||
background-position: 93% 9px;
|
||||
}
|
||||
|
||||
div.panels-ipe-pseudobutton-container a.panels-ipe-change-layout {
|
||||
padding-right: 34px;
|
||||
padding-left: 10px;
|
||||
background-position: 93% 9px;
|
||||
}
|
@@ -27,6 +27,7 @@ div.panels-ipe-handlebar-wrapper {
|
||||
.panels-ipe-editing div.panels-ipe-portlet-wrapper {
|
||||
margin-top: 1em;
|
||||
border: 1px solid #CCC;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Hide empty panes when not editing them. */
|
||||
@@ -163,6 +164,10 @@ div.panels-ipe-newblock {
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
div.panels-ipe-newblock li {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
div.panels-ipe-handlebar-wrapper li a,
|
||||
div.panels-ipe-dragtitle span,
|
||||
div.panels-ipe-newblock a,
|
||||
@@ -236,7 +241,9 @@ div.panels-ipe-handlebar-wrapper li.delete a span {
|
||||
div.panels-ipe-handlebar-wrapper li a:hover,
|
||||
div.panels-ipe-dragtitle span:hover,
|
||||
div.panels-ipe-newblock a:hover,
|
||||
span.panels-ipe-draghandle-icon:hover {
|
||||
span.panels-ipe-draghandle-icon:hover,
|
||||
div.panels-ipe-handlebar-wrapper li a:focus,
|
||||
div.panels-ipe-newblock a:focus {
|
||||
background: #E6E6E6;
|
||||
background-image: linear-gradient(bottom, #C5C5C5 0%, #FAFAFA 100%);
|
||||
background-image: -o-linear-gradient(bottom, #C5C5C5 0%, #FAFAFA 100%);
|
||||
@@ -375,9 +382,10 @@ div.panels-ipe-control .form-submit {
|
||||
padding: 0 0.8em 2px 34px;
|
||||
}
|
||||
|
||||
input#panels-ipe-save, input#panels-ipe-cancel,
|
||||
input#panels-ipe-save:hover, input#panels-ipe-cancel:hover,
|
||||
input#panels-ipe-save:active, input#panels-ipe-cancel:active {
|
||||
div.panels-ipe-control input.panels-ipe-save, div.panels-ipe-control input.panels-ipe-cancel,
|
||||
div.panels-ipe-control input.panels-ipe-save:hover, div.panels-ipe-control input.panels-ipe-cancel:hover,
|
||||
div.panels-ipe-control input.panels-ipe-save:focus, div.panels-ipe-control input.panels-ipe-cancel:focus,
|
||||
div.panels-ipe-control input.panels-ipe-save:active, div.panels-ipe-control input.panels-ipe-cancel:active {
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
@@ -389,7 +397,7 @@ div.panels-ipe-pseudobutton-container a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
input#panels-ipe-save {
|
||||
div.panels-ipe-control .panels-ipe-save {
|
||||
background-image: url(../images/icon-save.png);
|
||||
background-image: url(../images/icon-save.png), linear-gradient(bottom, #383838 0%, #666666 100%);
|
||||
background-image: url(../images/icon-save.png), -o-linear-gradient(bottom, #383838 0%, #666666 100%);
|
||||
@@ -406,7 +414,7 @@ input#panels-ipe-save {
|
||||
);
|
||||
}
|
||||
|
||||
input#panels-ipe-cancel {
|
||||
div.panels-ipe-control .panels-ipe-cancel {
|
||||
background-image: url(../images/icon-close.png);
|
||||
background-image: url(../images/icon-close.png), linear-gradient(bottom, #383838 0%, #666666 100%);
|
||||
background-image: url(../images/icon-close.png), -o-linear-gradient(bottom, #383838 0%, #666666 100%);
|
||||
@@ -424,7 +432,9 @@ input#panels-ipe-cancel {
|
||||
}
|
||||
|
||||
div.panels-ipe-pseudobutton-container:hover,
|
||||
div.panels-ipe-control .form-submit:hover {
|
||||
div.panels-ipe-control .form-submit:hover,
|
||||
div.panels-ipe-pseudobutton-container:focus,
|
||||
div.panels-ipe-control .form-submit:focus {
|
||||
background: #999999;
|
||||
background-image: linear-gradient(bottom, #3D3D3D 0%, #999999 100%);
|
||||
background-image: -o-linear-gradient(bottom, #3D3D3D 0%, #999999 100%);
|
||||
@@ -442,11 +452,13 @@ div.panels-ipe-control .form-submit:hover {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
div.panels-ipe-pseudobutton-container a:hover {
|
||||
div.panels-ipe-pseudobutton-container a:hover,
|
||||
div.panels-ipe-pseudobutton-container a:focus {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
input#panels-ipe-cancel:hover {
|
||||
div.panels-ipe-control .panels-ipe-cancel:hover,
|
||||
div.panels-ipe-control .panels-ipe-cancel:focus {
|
||||
background-image: url(../images/icon-close.png), linear-gradient(bottom, #3D3D3D 0%, #999999 100%);
|
||||
background-image: url(../images/icon-close.png), -o-linear-gradient(bottom, #3D3D3D 0%, #999999 100%);
|
||||
background-image: url(../images/icon-close.png), -moz-linear-gradient(bottom, #3D3D3D 0%, #999999 100%);
|
||||
@@ -462,7 +474,8 @@ input#panels-ipe-cancel:hover {
|
||||
);
|
||||
}
|
||||
|
||||
input#panels-ipe-save:hover {
|
||||
div.panels-ipe-control .panels-ipe-save:hover,
|
||||
div.panels-ipe-control .panels-ipe-save:focus {
|
||||
background-image: url(../images/icon-save.png), linear-gradient(bottom, #3D3D3D 0%, #999999 100%);
|
||||
background-image: url(../images/icon-save.png), -o-linear-gradient(bottom, #3D3D3D 0%, #999999 100%);
|
||||
background-image: url(../images/icon-save.png), -moz-linear-gradient(bottom, #3D3D3D 0%, #999999 100%);
|
||||
@@ -502,7 +515,7 @@ div.panels-ipe-pseudobutton-container a:active {
|
||||
color: #CCC;
|
||||
}
|
||||
|
||||
input#panels-ipe-cancel:active {
|
||||
div.panels-ipe-control .panels-ipe-cancel:active {
|
||||
background-image: url(../images/icon-close.png), linear-gradient(bottom, #616161 0%, #333333 100%);
|
||||
background-image: url(../images/icon-close.png), -o-linear-gradient(bottom, #616161 0%, #333333 100%);
|
||||
background-image: url(../images/icon-close.png), -moz-linear-gradient(bottom, #616161 0%, #333333 100%);
|
||||
@@ -518,7 +531,7 @@ input#panels-ipe-cancel:active {
|
||||
);
|
||||
}
|
||||
|
||||
input#panels-ipe-save:active {
|
||||
div.panels-ipe-control .panels-ipe-save:active {
|
||||
background-image: url(../images/icon-save.png), linear-gradient(bottom, #616161 0%, #333333 100%);
|
||||
background-image: url(../images/icon-save.png), -o-linear-gradient(bottom, #616161 0%, #333333 100%);
|
||||
background-image: url(../images/icon-save.png), -moz-linear-gradient(bottom, #616161 0%, #333333 100%);
|
||||
@@ -534,6 +547,12 @@ input#panels-ipe-save:active {
|
||||
);
|
||||
}
|
||||
|
||||
div.panels-ipe-control .panels-ipe-save, div.panels-ipe-control .panels-ipe-cancel,
|
||||
div.panels-ipe-control .panels-ipe-save:hover, div.panels-ipe-control .panels-ipe-cancel:hover,
|
||||
div.panels-ipe-control .panels-ipe-save:active, div.panels-ipe-control .panels-ipe-cancel:active {
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
div.panels-ipe-pseudobutton-container a.panels-ipe-startedit {
|
||||
padding-left: 34px;
|
||||
background: url(../images/icon-configure.png) no-repeat 10px 9px;
|
||||
@@ -552,3 +571,7 @@ div.panels-ipe-button-container {
|
||||
form#panels-ipe-edit-control-form {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.panels-ipe-dragbar-admin-title{
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
@@ -15,9 +15,11 @@ Drupal.PanelsIPE = {
|
||||
$('a.pane-delete:not(.pane-delete-processed)', context)
|
||||
.addClass('pane-delete-processed')
|
||||
.click(function() {
|
||||
if (confirm('Remove this pane?')) {
|
||||
if (confirm(Drupal.t('Remove this pane?'))) {
|
||||
$(this).parents('div.panels-ipe-portlet-wrapper').fadeOut('medium', function() {
|
||||
var $sortable = $(this).closest('.ui-sortable');
|
||||
$(this).empty().remove();
|
||||
$sortable.trigger('sortremove');
|
||||
});
|
||||
$(this).parents('div.panels-ipe-display-container').addClass('changed');
|
||||
}
|
||||
@@ -34,6 +36,10 @@ Drupal.behaviors.PanelsIPE = {
|
||||
$('div#panels-ipe-display-' + key + ':not(.panels-ipe-processed)')
|
||||
.addClass('panels-ipe-processed')
|
||||
.each(function() {
|
||||
// If we're replacing an old IPE, clean it up a little.
|
||||
if (Drupal.PanelsIPE.editors[key]) {
|
||||
Drupal.PanelsIPE.editors[key].editing = false;
|
||||
}
|
||||
Drupal.PanelsIPE.editors[key] = new DrupalPanelsIPE(key);
|
||||
Drupal.PanelsIPE.editors[key].showContainer();
|
||||
});
|
||||
@@ -92,6 +98,22 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// If a user navigates away from a locked IPE, cancel the lock in the background.
|
||||
$(window).bind('beforeunload', function() {
|
||||
if (!ipe.editing) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ipe.topParent && ipe.topParent.hasClass('changed')) {
|
||||
ipe.changed = true;
|
||||
}
|
||||
|
||||
if (ipe.changed) {
|
||||
return Drupal.t('This will discard all unsaved changes. Are you sure?');
|
||||
}
|
||||
});
|
||||
|
||||
// If a user navigates away from a locked IPE, cancel the lock in the background.
|
||||
$(window).bind('unload', function() {
|
||||
ipe.cancelLock(true);
|
||||
@@ -170,6 +192,7 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
};
|
||||
|
||||
this.initEditing = function(formdata) {
|
||||
ipe.editing = true;
|
||||
ipe.topParent = $('div#panels-ipe-display-' + cache_key);
|
||||
ipe.backup = this.topParent.clone();
|
||||
|
||||
@@ -192,7 +215,7 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
|
||||
$('.panels-ipe-form-container', ipe.control).append(formdata);
|
||||
|
||||
$('input:submit:not(.ajax-processed)', ipe.control).addClass('ajax-processed').each(function() {
|
||||
$('input:submit:not(.ajax-processed), button:not(.ajax-processed)', ipe.control).addClass('ajax-processed').each(function() {
|
||||
var element_settings = {};
|
||||
|
||||
element_settings.url = $(this.form).attr('action');
|
||||
@@ -212,17 +235,6 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
ipe.showForm();
|
||||
ipe.topParent.addClass('panels-ipe-editing');
|
||||
|
||||
//Reposition the "Add new pane" button
|
||||
$('.panels-ipe-newblock').each(function() {
|
||||
var link_width_half = parseInt($(this).children('a').outerWidth() / 2);
|
||||
|
||||
$(this).css('margin-left', '-' + link_width_half + 'px');
|
||||
|
||||
$(this).css('margin-top', '-' + parseInt($(this).children('a').outerHeight() / 2) + 'px');
|
||||
|
||||
$(this).parents('.panels-ipe-placeholder').find('h3').css('width', parseInt(($(this).parents('.panels-ipe-placeholder').width() / 2) - link_width_half) + 'px');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
this.hideContainer = function() {
|
||||
@@ -246,18 +258,18 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
};
|
||||
|
||||
this.endEditing = function() {
|
||||
ipe.editing = false;
|
||||
ipe.lockPath = null;
|
||||
$('.panels-ipe-form-container', ipe.control).empty();
|
||||
$('.panels-ipe-form-container').empty();
|
||||
// Re-show all the IPE non-editing meta-elements
|
||||
$('div.panels-ipe-off').show('fast');
|
||||
|
||||
ipe.showButtons();
|
||||
// Re-hide all the IPE meta-elements
|
||||
$('div.panels-ipe-on').hide();
|
||||
if (ipe.topParent) {
|
||||
ipe.topParent.removeClass('panels-ipe-editing');
|
||||
$('div.panels-ipe-sort-container', ipe.topParent).sortable("destroy");
|
||||
}
|
||||
|
||||
$('.panels-ipe-editing').removeClass('panels-ipe-editing');
|
||||
$('div.panels-ipe-sort-container.ui-sortable', ipe.topParent).sortable("destroy");
|
||||
};
|
||||
|
||||
this.saveEditing = function() {
|
||||
@@ -273,7 +285,7 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
val += id;
|
||||
}
|
||||
});
|
||||
$('input[name="panel[pane][' + region + ']"]', ipe.control).val(val);
|
||||
$('[name="panel[pane][' + region + ']"]', ipe.control).val(val);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -310,7 +322,7 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
|
||||
this.createSortContainers = function() {
|
||||
$('div.panels-ipe-region', this.topParent).each(function() {
|
||||
$('div.panels-ipe-portlet-marker', this).parent()
|
||||
$(this).children('div.panels-ipe-portlet-marker').parent()
|
||||
.wrapInner('<div class="panels-ipe-sort-container" />');
|
||||
|
||||
// Move our gadgets outside of the sort container so that sortables
|
||||
@@ -318,9 +330,6 @@ function DrupalPanelsIPE(cache_key, cfg) {
|
||||
$('div.panels-ipe-portlet-static', this).each(function() {
|
||||
$(this).prependTo($(this).parent().parent());
|
||||
});
|
||||
|
||||
// Also remove the last panel separator.
|
||||
$('div.panel-separator', this).filter(':last').remove();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -334,6 +343,8 @@ $(function() {
|
||||
Drupal.PanelsIPE.editors[data.key].initEditing(data.data);
|
||||
Drupal.PanelsIPE.editors[data.key].lockPath = data.lockPath;
|
||||
}
|
||||
Drupal.attachBehaviors();
|
||||
|
||||
};
|
||||
|
||||
Drupal.ajax.prototype.commands.IPEsetLockState = function(ajax, data, status) {
|
||||
@@ -342,6 +353,12 @@ $(function() {
|
||||
}
|
||||
};
|
||||
|
||||
Drupal.ajax.prototype.commands.addNewPane = function(ajax, data, status) {
|
||||
if (Drupal.PanelsIPE.editors[data.key]) {
|
||||
Drupal.PanelsIPE.editors[data.key].changed = true;
|
||||
}
|
||||
};
|
||||
|
||||
Drupal.ajax.prototype.commands.cancelIPE = function(ajax, data, status) {
|
||||
if (Drupal.PanelsIPE.editors[data.key]) {
|
||||
Drupal.PanelsIPE.editors[data.key].cancelIPE();
|
||||
@@ -366,12 +383,45 @@ $(function() {
|
||||
}
|
||||
};
|
||||
|
||||
Drupal.ajax.prototype.commands.insertNewPane = function(ajax, data, status) {
|
||||
IPEContainerSelector = '#panels-ipe-regionid-' + data.regionId + ' div.panels-ipe-sort-container';
|
||||
firstPaneSelector = IPEContainerSelector + ' div.panels-ipe-portlet-wrapper:first';
|
||||
// Insert the new pane before the first existing pane in the region, if
|
||||
// any.
|
||||
if ($(firstPaneSelector).length) {
|
||||
insertData = {
|
||||
'method': 'before',
|
||||
'selector': firstPaneSelector,
|
||||
'data': data.renderedPane,
|
||||
'settings': null
|
||||
}
|
||||
Drupal.ajax.prototype.commands.insert(ajax, insertData, status);
|
||||
}
|
||||
// Else, insert it as a first child of the container. Doing so might fall
|
||||
// outside of the wrapping markup for the style, but it's the best we can
|
||||
// do.
|
||||
else {
|
||||
insertData = {
|
||||
'method': 'prepend',
|
||||
'selector': IPEContainerSelector,
|
||||
'data': data.renderedPane,
|
||||
'settings': null
|
||||
}
|
||||
Drupal.ajax.prototype.commands.insert(ajax, insertData, status);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Override the eventResponse on ajax.js so we can add a little extra
|
||||
* behavior.
|
||||
*/
|
||||
Drupal.ajax.prototype.ipeReplacedEventResponse = Drupal.ajax.prototype.eventResponse;
|
||||
Drupal.ajax.prototype.eventResponse = function (element, event) {
|
||||
if (element.ipeCancelThis) {
|
||||
element.ipeCancelThis = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($(this.element).attr('id') == 'panels-ipe-cancel') {
|
||||
if (!Drupal.PanelsIPE.editors[this.element_settings.ipe_cache_key].cancelEditing()) {
|
||||
return false;
|
||||
@@ -404,7 +454,7 @@ $(function() {
|
||||
|
||||
Drupal.ajax.prototype.ipeReplacedBeforeSerialize = Drupal.ajax.prototype.beforeSerialize;
|
||||
Drupal.ajax.prototype.beforeSerialize = function (element_settings, options) {
|
||||
if ($(this.element).attr('id') == 'panels-ipe-save') {
|
||||
if ($(this.element).hasClass('panels-ipe-save')) {
|
||||
Drupal.PanelsIPE.editors[this.element_settings.ipe_cache_key].saveEditing();
|
||||
};
|
||||
return this.ipeReplacedBeforeSerialize(element_settings, options);
|
||||
|
@@ -1,14 +1,15 @@
|
||||
name = Panels In-Place Editor
|
||||
description = Provide a UI for managing some Panels directly on the frontend, instead of having to use the backend.
|
||||
package = "Panels"
|
||||
version = PANELS_VERSION
|
||||
dependencies[] = panels
|
||||
core = 7.x
|
||||
configure = admin/structure/panels
|
||||
files[] = panels_ipe.module
|
||||
|
||||
; Information added by drupal.org packaging script on 2012-08-18
|
||||
version = "7.x-3.3"
|
||||
; Information added by Drupal.org packaging script on 2015-01-28
|
||||
version = "7.x-3.5"
|
||||
core = "7.x"
|
||||
project = "panels"
|
||||
datestamp = "1345319572"
|
||||
datestamp = "1422472985"
|
||||
|
||||
|
@@ -73,18 +73,17 @@ function theme_panels_ipe_placeholder_pane($vars) {
|
||||
return $output;
|
||||
}
|
||||
|
||||
function theme_panels_ipe_pane_wrapper($vars) {
|
||||
$output = $vars['output'];
|
||||
function template_preprocess_panels_ipe_pane_wrapper(&$vars) {
|
||||
$pane = $vars['pane'];
|
||||
$display = $vars['display'];
|
||||
$renderer = $vars['renderer'];
|
||||
|
||||
$content_type = ctools_get_content_type($pane->type);
|
||||
$subtype = ctools_content_get_subtype($content_type, $pane->subtype);
|
||||
$links = array();
|
||||
$vars['links'] = array();
|
||||
|
||||
if (ctools_content_editable($content_type, $subtype, $pane->configuration)) {
|
||||
$links['edit'] = array(
|
||||
$vars['links']['edit'] = array(
|
||||
'title' => isset($content_type['edit text']) ? '<span>' . $content_type['edit text'] . '</span>' : '<span>' . t('Settings') . '</span>',
|
||||
'href' => $renderer->get_url('edit-pane', $pane->pid),
|
||||
'html' => TRUE,
|
||||
@@ -98,7 +97,7 @@ function theme_panels_ipe_pane_wrapper($vars) {
|
||||
|
||||
// Add option to configure style in IPE
|
||||
if (user_access('administer panels styles')) {
|
||||
$links['style'] = array(
|
||||
$vars['links']['style'] = array(
|
||||
'title' => '<span>' . t('Style') . '</span>',
|
||||
'href' => $renderer->get_url('style-type', 'pane', $pane->pid),
|
||||
'html' => TRUE,
|
||||
@@ -111,7 +110,7 @@ function theme_panels_ipe_pane_wrapper($vars) {
|
||||
|
||||
// Deleting is managed entirely in the js; this is just an attachment point
|
||||
// for it
|
||||
$links['delete'] = array(
|
||||
$vars['links']['delete'] = array(
|
||||
'title' => '<span>' . t('Delete') . '</span>',
|
||||
'href' => '#',
|
||||
'html' => TRUE,
|
||||
@@ -122,19 +121,38 @@ function theme_panels_ipe_pane_wrapper($vars) {
|
||||
),
|
||||
);
|
||||
|
||||
$context = array(
|
||||
'pane' => $pane,
|
||||
'display' => $display,
|
||||
'renderer' => $renderer
|
||||
);
|
||||
drupal_alter('panels_ipe_pane_links', $vars['links'], $context);
|
||||
|
||||
}
|
||||
|
||||
function theme_panels_ipe_pane_wrapper($vars) {
|
||||
$output = $vars['output'];
|
||||
$pane = $vars['pane'];
|
||||
$display = $vars['display'];
|
||||
|
||||
$attributes = array(
|
||||
'class' => 'panels-ipe-linkbar',
|
||||
);
|
||||
|
||||
$links = theme('links', array('links' => $links, 'attributes' => $attributes));
|
||||
$type = ctools_get_content_type($pane->type);
|
||||
$title ='<span class = "panels-ipe-dragbar-admin-title">' . ctools_content_admin_title($type, $pane->subtype, $pane->configuration, $display->context) . '</span>';
|
||||
|
||||
$links = theme('links', array('links' => $vars['links'], 'attributes' => $attributes));
|
||||
|
||||
if (!empty($pane->locks['type']) && $pane->locks['type'] == 'immovable') {
|
||||
$links = '<div class="panels-ipe-dragbar panels-ipe-nodraghandle clearfix">' . $links . '</div>';
|
||||
$links = '<div class="panels-ipe-dragbar panels-ipe-nodraghandle clearfix">' . $links .$title .'</div>';
|
||||
}
|
||||
else {
|
||||
$links = '<div class="panels-ipe-dragbar panels-ipe-draghandle clearfix">' . $links . '<span class="panels-ipe-draghandle-icon"><span class="panels-ipe-draghandle-icon-inner"></span></span></div>';
|
||||
$links = '<div class="panels-ipe-dragbar panels-ipe-draghandle clearfix">' . $links . $title . '<span class="panels-ipe-draghandle-icon"><span class="panels-ipe-draghandle-icon-inner"></span></span></div>';
|
||||
}
|
||||
|
||||
$handlebar = '<div class="panels-ipe-handlebar-wrapper panels-ipe-on">' . $links . '</div>';
|
||||
|
||||
return $handlebar . $output;
|
||||
}
|
||||
|
||||
@@ -142,33 +160,53 @@ function theme_panels_ipe_region_wrapper($vars) {
|
||||
return $vars['controls'] . $vars['output'];
|
||||
}
|
||||
|
||||
function theme_panels_ipe_add_pane_button($vars) {
|
||||
function template_preprocess_panels_ipe_add_pane_button(&$vars) {
|
||||
$region_id = $vars['region_id'];
|
||||
$display = $vars['display'];
|
||||
$renderer = $vars['renderer'];
|
||||
$link = '';
|
||||
$vars['links'] = '';
|
||||
|
||||
// Add option to configure style in IPE
|
||||
if (user_access('administer panels styles')) {
|
||||
$link .= ' ' . l('<span>' . t('Region style') . '</span>', $renderer->get_url('style-type', 'region', $region_id), array(
|
||||
$vars['links']['style'] = array(
|
||||
'title' => '<span>' . t('Region style') . '</span>',
|
||||
'href' => $renderer->get_url('style-type', 'region', $region_id),
|
||||
'html' => TRUE,
|
||||
'attributes' => array(
|
||||
'class' => array('ctools-use-modal', 'style', 'panels-ipe-hide-bar'),
|
||||
'class' => array('ctools-use-modal', 'panels-ipe-hide-bar', 'style'),
|
||||
'title' => t('Region style'),
|
||||
),
|
||||
'html' => TRUE,
|
||||
));
|
||||
);
|
||||
}
|
||||
|
||||
// Add option to add items in the IPE
|
||||
$link .= ' ' . l('<span>' . t('Add new pane') . '</span>', $renderer->get_url('select-content', $region_id), array(
|
||||
'attributes' => array(
|
||||
'class' => array('ctools-use-modal', 'add', 'panels-ipe-hide-bar'),
|
||||
'title' => t('Add new pane'),
|
||||
),
|
||||
'html' => TRUE,
|
||||
));
|
||||
$vars['links']['add-pane'] = array(
|
||||
'title' => '<span>' . t('Add new pane') . '</span>',
|
||||
'href' => $renderer->get_url('select-content', $region_id),
|
||||
'attributes' => array(
|
||||
'class' => array('ctools-use-modal', 'add', 'panels-ipe-hide-bar'),
|
||||
'title' => t('Add new pane'),
|
||||
),
|
||||
'html' => TRUE,
|
||||
);
|
||||
|
||||
return '<div class="panels-ipe-newblock panels-ipe-on">' . $link . '</div>';
|
||||
$context = array(
|
||||
'region_id' => $region_id,
|
||||
'display' => $display,
|
||||
'renderer' => $renderer,
|
||||
);
|
||||
drupal_alter('panels_ipe_region_links', $vars['links'], $context);
|
||||
|
||||
}
|
||||
|
||||
function theme_panels_ipe_add_pane_button($vars) {
|
||||
$attributes = array(
|
||||
'class' => array('panels-ipe-linkbar', 'inline'),
|
||||
);
|
||||
|
||||
$links = theme('links', array('links' => $vars['links'], 'attributes' => $attributes));
|
||||
|
||||
return '<div class="panels-ipe-newblock panels-ipe-on">' . $links . '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -29,6 +29,7 @@ class panels_renderer_ipe extends panels_renderer_editor {
|
||||
'#type' => 'link',
|
||||
'#title' => t('Customize this page'),
|
||||
'#href' => $this->get_url('save_form'),
|
||||
'#options' => array('query' => drupal_get_destination()),
|
||||
'#id' => 'panels-ipe-customize-page',
|
||||
'#attributes' => array(
|
||||
'class' => array('panels-ipe-startedit', 'panels-ipe-pseudobutton'),
|
||||
@@ -49,6 +50,7 @@ class panels_renderer_ipe extends panels_renderer_editor {
|
||||
'#type' => 'link',
|
||||
'#title' => t('Change layout'),
|
||||
'#href' => $this->get_url('change_layout'),
|
||||
'#options' => array('query' => drupal_get_destination()),
|
||||
'#attributes' => array(
|
||||
'class' => array('panels-ipe-change-layout', 'panels-ipe-pseudobutton', 'ctools-modal-layout'),
|
||||
),
|
||||
@@ -134,15 +136,28 @@ class panels_renderer_ipe extends panels_renderer_editor {
|
||||
return "<div id=\"panels-ipe-paneid-{$pane->pid}\" class=\"panels-ipe-portlet-wrapper panels-ipe-portlet-marker\">" . $output . "</div>";
|
||||
}
|
||||
|
||||
function prepare_panes($panes) {
|
||||
// Set to admin mode just for this to ensure all panes are represented.
|
||||
$this->admin = TRUE;
|
||||
$panes = parent::prepare_panes($panes);
|
||||
$this->admin = FALSE;
|
||||
}
|
||||
|
||||
function render_pane_content(&$pane) {
|
||||
$content = parent::render_pane_content($pane);
|
||||
if (!empty($pane->shown) && panels_pane_access($pane, $this->display)) {
|
||||
$content = parent::render_pane_content($pane);
|
||||
}
|
||||
// Ensure that empty panes have some content.
|
||||
if (empty($content) || empty($content->content)) {
|
||||
if (empty($content)) {
|
||||
$content = new stdClass();
|
||||
}
|
||||
|
||||
// Get the administrative title.
|
||||
$content_type = ctools_get_content_type($pane->type);
|
||||
$title = ctools_content_admin_title($content_type, $pane->subtype, $pane->configuration, $this->display->context);
|
||||
|
||||
$content->content = t('Placeholder for empty "@title"', array('@title' => $title));
|
||||
$content->content = t('Placeholder for empty or inaccessible "@title"', array('@title' => html_entity_decode($title, ENT_QUOTES)));
|
||||
// Add these to prevent notices.
|
||||
$content->type = 'panels_ipe';
|
||||
$content->subtype = 'panels_ipe';
|
||||
@@ -227,6 +242,7 @@ class panels_renderer_ipe extends panels_renderer_editor {
|
||||
$_POST['ajax_html_ids'] = array();
|
||||
|
||||
$form_state = array(
|
||||
'renderer' => $this,
|
||||
'display' => &$this->display,
|
||||
'content_types' => $this->cache->content_types,
|
||||
'rerender' => FALSE,
|
||||
@@ -244,7 +260,7 @@ class panels_renderer_ipe extends panels_renderer_editor {
|
||||
'command' => 'initIPE',
|
||||
'key' => $this->clean_key,
|
||||
'data' => drupal_render($output),
|
||||
'lockPath' => $this->get_url('unlock_ipe'),
|
||||
'lockPath' => url($this->get_url('unlock_ipe')),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -315,7 +331,7 @@ class panels_renderer_ipe extends panels_renderer_editor {
|
||||
$this->commands[] = array(
|
||||
'command' => 'IPEsetLockState',
|
||||
'key' => $this->clean_key,
|
||||
'lockPath' => $this->get_url('unlock_ipe'),
|
||||
'lockPath' => url($this->get_url('unlock_ipe')),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -344,7 +360,7 @@ class panels_renderer_ipe extends panels_renderer_editor {
|
||||
if (!empty($form_state['clicked_button']['#save-display'])) {
|
||||
// Saved. Save the cache.
|
||||
panels_edit_cache_save($this->cache);
|
||||
$this->display->skip_cache;
|
||||
$this->display->skip_cache = TRUE;
|
||||
|
||||
// Since the layout changed, we have to update these things in the
|
||||
// renderer in order to get the right settings.
|
||||
@@ -391,8 +407,16 @@ class panels_renderer_ipe extends panels_renderer_editor {
|
||||
$pane = $this->display->content[$pid];
|
||||
}
|
||||
|
||||
$this->commands[] = ajax_command_prepend("#panels-ipe-regionid-{$pane->panel} div.panels-ipe-sort-container", $this->render_pane($pane));
|
||||
$this->commands[] = array(
|
||||
'command' => 'insertNewPane',
|
||||
'regionId' => $pane->panel,
|
||||
'renderedPane' => $this->render_pane($pane),
|
||||
);
|
||||
$this->commands[] = ajax_command_changed("#panels-ipe-display-{$this->clean_key}");
|
||||
$this->commands[] = array(
|
||||
'command' => 'addNewPane',
|
||||
'key' => $this->clean_key,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,12 +454,14 @@ function panels_ipe_edit_control_form($form, &$form_state) {
|
||||
'#type' => 'submit',
|
||||
'#value' => t('Save'),
|
||||
'#id' => 'panels-ipe-save',
|
||||
'#attributes' => array('class' => array('panels-ipe-save')),
|
||||
'#submit' => array('panels_edit_display_form_submit'),
|
||||
'#save-display' => TRUE,
|
||||
);
|
||||
$form['buttons']['cancel'] = array(
|
||||
'#type' => 'submit',
|
||||
'#id' => 'panels-ipe-cancel',
|
||||
'#attributes' => array('class' => array('panels-ipe-cancel')),
|
||||
'#value' => t('Cancel'),
|
||||
);
|
||||
return $form;
|
||||
|
Reference in New Issue
Block a user