DrupalBin
Submit Code
About
Recent Posts
css path
1 hour 43 min
ago
Fix for Code
5 hours 43 min
ago
Fix for Code
5 hours 49 min
ago
Fix for Code
5 hours 57 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
php
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
Fix for display and pane cloning
View
Download
Fix
This fix will not be saved to the database until you submit.
Summary:
Tags:
Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Source code:
*
function panels_clone_display($did, $new = TRUE, $save = FALSE) { // since objects are always passed by reference in php5, need to do this to ensure the original object, // if $did is an object, is untouched by the cloning operation if (!is_object($did)) { $old_display = panels_load_display($did); } else { $old_display = $did; } $display->content = panels_clone_panes($display->content, $new); $display = drupal_clone($old_display); return $display; } function panels_clone_panes($panes, $new) { $counter = 0; foreach ($panes as $pid => $pane) { $panes[$pid] = panels_clone_pane($pane, $new ? 'new-' . ++$counter : $pid); } return $panes; } function panels_clone_pane($old_pane, $pid = NULL) { $pane = drupal_clone($old_pane); if (!is_null($pid)) { $pane->pid = $pid; } return $pane; }
Syntax highlighting mode:
ActionScript
ColdFusion
Diff
Drupal
Drupal 5
Drupal 6
HTML
Javascript
MySQL
PHP
Python
robots.txt
SQL
Text
Select the syntax highlighting mode to use.