DrupalBin
Submit Code
About
Recent Posts
How do i make this work in D6 (I have to clear the cache everytime to see the tabs)
2 hours 23 min
ago
Code
3 hours 19 min
ago
Code
7 hours 17 min
ago
oopsie in modules/taxonomy/taxonomy.test
9 hours 16 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); if ($save) { panels_save_display($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.