Révision 2545992a
Ajouté par Assos Assos il y a environ 8 ans
drupal7/sites/all/modules/panelizer/CHANGELOG.txt | ||
---|---|---|
1 |
Panelizer 7.x-3.4, 2016-08-19 |
|
2 |
----------------------------- |
|
3 |
#2785821 by DamienMcKenna: Resolve issues with tests running on drupalci. |
|
4 |
#2785793 by attiks: Fix errors in panelizer_update_7115(). |
|
5 |
#2785883 by DamienMcKenna, pbuyle, attiks, FeyP, smaz: Fixes for |
|
6 |
panelizer_update_7303() to avoid infinite loops. |
|
7 |
#2193221 by michel.g: 'Undefined index' errors because the 'help' variable is |
|
8 |
not always present. |
|
9 |
#2785945 by dsnopek, DamienMcKenna, mpotter, czigor: Fixed access-denied problem |
|
10 |
caused by needing to add the new Panels Storage API attributes to exported |
|
11 |
defaults. |
|
12 |
#2786471 by mpotter, dsnopek: Fixed multilingual issue with the Search API |
|
13 |
integration. |
|
14 |
By DamienMcKenna: Require Panels 7.x-3.6. |
|
15 |
|
|
16 |
|
|
1 | 17 |
Panelizer 7.x-3.3, 2016-08-17 |
2 | 18 |
----------------------------- |
3 | 19 |
#2762351 by DamienMcKenna: Skip update 7300 if there are no records to process. |
drupal7/sites/all/modules/panelizer/README.txt | ||
---|---|---|
32 | 32 |
Requirements |
33 | 33 |
-------------------------------------------------------------------------------- |
34 | 34 |
CTools v7.x-1.9 or newer. |
35 |
Panels v7.x-3.5 or newer.
|
|
35 |
Panels v7.x-3.6 or newer.
|
|
36 | 36 |
|
37 | 37 |
|
38 | 38 |
Configuration & Usage |
drupal7/sites/all/modules/panelizer/panelizer.info | ||
---|---|---|
1 | 1 |
name = Panelizer |
2 | 2 |
description = Allow any node type to have custom panel displays, similar to the panel node type. |
3 | 3 |
package = "Panels" |
4 |
dependencies[] = panels (>= 3.5)
|
|
5 |
dependencies[] = ctools (>= 1.9)
|
|
4 |
dependencies[] = panels (>= 3.6)
|
|
5 |
dependencies[] = ctools |
|
6 | 6 |
dependencies[] = page_manager |
7 | 7 |
core = 7.x |
8 | 8 |
configure = admin/structure/panelizer |
... | ... | |
34 | 34 |
; Tests: Standard node translations. |
35 | 35 |
files[] = tests/panelizer.node_content_translation.test |
36 | 36 |
|
37 |
; Tests: Exportables. |
|
38 |
files[] = tests/panelizer.exportables.test |
|
39 |
|
|
37 | 40 |
; Tests: Panels IPE. |
38 | 41 |
files[] = tests/panelizer.with_panels_ipe.test |
39 | 42 |
|
... | ... | |
53 | 56 |
test_dependencies[] = workbench_moderation (>= 3.x) |
54 | 57 |
files[] = tests/panelizer.with_workbench_moderation.test |
55 | 58 |
|
56 |
; Information added by Drupal.org packaging script on 2016-08-17
|
|
57 |
version = "7.x-3.3"
|
|
59 |
; Information added by Drupal.org packaging script on 2016-08-19
|
|
60 |
version = "7.x-3.4"
|
|
58 | 61 |
core = "7.x" |
59 | 62 |
project = "panelizer" |
60 |
datestamp = "1471449520"
|
|
63 |
datestamp = "1471635552"
|
|
61 | 64 |
|
drupal7/sites/all/modules/panelizer/panelizer.install | ||
---|---|---|
750 | 750 |
// corrupting data during hook_panels_display_save. |
751 | 751 |
$display->did = db_insert('panels_display') |
752 | 752 |
->fields(array( |
753 |
'did' => NULL, |
|
754 | 753 |
'layout' => $display->layout, |
755 | 754 |
'layout_settings' => serialize($display->layout_settings), |
756 | 755 |
'panel_settings' => serialize($display->panel_settings), |
... | ... | |
803 | 802 |
// hook_panels_pane_insert. |
804 | 803 |
$new_pane->pid = db_insert('panels_pane') |
805 | 804 |
->fields(array( |
806 |
'pid' => NULL, |
|
807 | 805 |
'did' => $new_pane->did, |
808 | 806 |
'panel' => $new_pane->panel, |
809 | 807 |
'type' => $new_pane->type, |
... | ... | |
1248 | 1246 |
} |
1249 | 1247 |
} |
1250 | 1248 |
|
1251 |
// Set a limit of how many rows to process per batch. 1000 rows is probably |
|
1252 |
// good. |
|
1253 |
$limit = 1000; |
|
1249 |
// Set a limit of how many rows to process per batch. |
|
1250 |
$limit = 100; |
|
1254 | 1251 |
|
1255 | 1252 |
// Run the query |
1256 | 1253 |
$result = db_query_range("SELECT pd.did, p.name |
1257 | 1254 |
FROM {panels_display} pd |
1258 | 1255 |
JOIN {panelizer_defaults} p ON p.did = pd.did |
1259 |
WHERE pd.storage_type = '' AND pd.did > :current_did", 0, $limit, array(':current_did' => $sandbox['current_did'])); |
|
1260 |
|
|
1261 |
foreach ($result as $row) { |
|
1262 |
db_update('panels_display') |
|
1263 |
->fields(array( |
|
1264 |
'storage_type' => 'panelizer_default', |
|
1265 |
'storage_id' => $row->name, |
|
1266 |
)) |
|
1267 |
->condition('did', $row->did) |
|
1268 |
->execute(); |
|
1256 |
WHERE pd.storage_type = '' AND pd.did > :current_did |
|
1257 |
ORDER BY pd.did ASC", 0, $limit, array( |
|
1258 |
':current_did' => $sandbox['current_did'], |
|
1259 |
)); |
|
1260 |
|
|
1261 |
// No results means that it's finished. |
|
1262 |
if (empty($result)) { |
|
1263 |
$sandbox['progress'] = $sandbox['max']; |
|
1264 |
} |
|
1265 |
else { |
|
1266 |
foreach ($result as $row) { |
|
1267 |
db_update('panels_display') |
|
1268 |
->fields(array( |
|
1269 |
'storage_type' => 'panelizer_default', |
|
1270 |
'storage_id' => $row->name, |
|
1271 |
)) |
|
1272 |
->condition('did', $row->did) |
|
1273 |
->execute(); |
|
1269 | 1274 |
|
1270 |
// Update our progress information. |
|
1271 |
$sandbox['progress']++; |
|
1272 |
$sandbox['current_did'] = $row->did; |
|
1275 |
// Update our progress information. |
|
1276 |
$sandbox['progress']++; |
|
1277 |
$sandbox['current_did'] = $row->did; |
|
1278 |
} |
|
1273 | 1279 |
} |
1274 | 1280 |
|
1275 | 1281 |
// Set the "finished" status, to tell batch engine whether this function |
... | ... | |
1282 | 1288 |
} |
1283 | 1289 |
|
1284 | 1290 |
/** |
1285 |
* Set the storage type and ID on existing {panelizer_entity} records. |
|
1291 |
* Set the storage type and ID on existing {panelizer_entity} records. This may |
|
1292 |
* take some time to complete. |
|
1286 | 1293 |
*/ |
1287 | 1294 |
function panelizer_update_7303(&$sandbox) { |
1288 | 1295 |
if (!isset($sandbox['progress'])) { |
... | ... | |
1299 | 1306 |
} |
1300 | 1307 |
|
1301 | 1308 |
// Set a limit of how many rows to process per batch. |
1302 |
$limit = 1000;
|
|
1309 |
$limit = 100; |
|
1303 | 1310 |
|
1304 | 1311 |
// Look for records to be updated. |
1305 | 1312 |
$result = db_query_range("SELECT pd.did, p.entity_type, p.entity_id, p.view_mode |
1306 | 1313 |
FROM {panels_display} pd |
1307 | 1314 |
JOIN {panelizer_entity} p ON p.did = pd.did |
1308 |
WHERE pd.storage_type = '' AND pd.did > :current_did", 0, $limit, array(':current_did' => $sandbox['current_did'])); |
|
1309 |
|
|
1310 |
foreach ($result as $row) { |
|
1311 |
db_update('panels_display') |
|
1312 |
->fields(array( |
|
1313 |
'storage_type' => 'panelizer_entity', |
|
1314 |
'storage_id' => implode(':', array($row->entity_type, $row->entity_id, $row->view_mode)), |
|
1315 |
)) |
|
1316 |
->condition('did', $row->did) |
|
1317 |
->execute(); |
|
1315 |
WHERE pd.storage_type = '' AND pd.did > :current_did |
|
1316 |
ORDER BY pd.did ASC", 0, $limit, array( |
|
1317 |
':current_did' => $sandbox['current_did'], |
|
1318 |
)); |
|
1319 |
|
|
1320 |
// No results means that it's finished. |
|
1321 |
if (empty($result)) { |
|
1322 |
$sandbox['progress'] = $sandbox['max']; |
|
1323 |
} |
|
1324 |
else { |
|
1325 |
foreach ($result as $row) { |
|
1326 |
db_update('panels_display') |
|
1327 |
->fields(array( |
|
1328 |
'storage_type' => 'panelizer_entity', |
|
1329 |
'storage_id' => implode(':', array($row->entity_type, $row->entity_id, $row->view_mode)), |
|
1330 |
)) |
|
1331 |
->condition('did', $row->did) |
|
1332 |
->execute(); |
|
1318 | 1333 |
|
1319 |
// Update our progress information. |
|
1320 |
$sandbox['progress']++; |
|
1321 |
$sandbox['current_did'] = $row->did; |
|
1334 |
// Update our progress information. |
|
1335 |
$sandbox['progress']++; |
|
1336 |
$sandbox['current_did'] = $row->did; |
|
1337 |
} |
|
1322 | 1338 |
} |
1323 | 1339 |
|
1324 | 1340 |
// Set the "finished" status, to tell batch engine whether this function |
drupal7/sites/all/modules/panelizer/panelizer.module | ||
---|---|---|
518 | 518 |
$handler->hook_panelizer_defaults($items); |
519 | 519 |
} |
520 | 520 |
|
521 |
// If a default Panels display has no storage type, set it. |
|
522 |
foreach ($items as &$panelizer) { |
|
523 |
$display =& $panelizer->display; |
|
524 |
if (empty($display->storage_type)) { |
|
525 |
$display->storage_type = 'panelizer_default'; |
|
526 |
$display->storage_id = $panelizer->name; |
|
527 |
} |
|
528 |
} |
|
529 |
|
|
521 | 530 |
// Allow features_overrides to alter the config. |
522 | 531 |
drupal_alter('panelizer_defaults_override', $items); |
523 | 532 |
} |
drupal7/sites/all/modules/panelizer/plugins/entity/PanelizerEntityDefault.class.php | ||
---|---|---|
3290 | 3290 |
'view modes' => array(), |
3291 | 3291 |
); |
3292 | 3292 |
if (!empty($values[0]['status'])) { |
3293 |
$settings['help'] = $values[0]['help']; |
|
3293 |
// This field is optional so should not always be applied. |
|
3294 |
if (isset($values[0]['help']) && !empty($values[0]['help'])) { |
|
3295 |
$settings['help'] = $values[0]['help']; |
|
3296 |
} |
|
3294 | 3297 |
|
3295 | 3298 |
foreach ($values as $view_mode => $config) { |
3296 | 3299 |
if (!empty($view_mode) && !empty($config)) { |
3297 | 3300 |
// Fix the configuration. |
3298 |
// Make sure each setting is disabled if the view mode is |
|
3299 |
// disabled. |
|
3301 |
// Make sure each setting is disabled if the view mode is disabled. |
|
3300 | 3302 |
if (empty($config['status'])) { |
3301 | 3303 |
foreach ($config as $key => $val) { |
3302 | 3304 |
$config[$key] = 0; |
drupal7/sites/all/modules/panelizer/plugins/search_api/PanelizerSearchApiAlterCallback.class.php | ||
---|---|---|
44 | 44 |
global $language_content; |
45 | 45 |
$original_language_content = $language_content; |
46 | 46 |
$languages = language_list(); |
47 |
$language_content = $languages[$item->search_api_language]; |
|
47 |
if (isset($languages[$item->search_api_language])) { |
|
48 |
$language_content = $languages[$item->search_api_language]; |
|
49 |
} |
|
50 |
else { |
|
51 |
$language_content = language_default(); |
|
52 |
} |
|
48 | 53 |
} |
49 | 54 |
|
50 | 55 |
try { |
drupal7/sites/all/modules/panelizer/tests/panelizer.exportables.test | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
/** |
|
4 |
* @file |
|
5 |
* Test the exportables functionality for Panelizer. |
|
6 |
*/ |
|
7 |
|
|
8 |
class PanelizerExportablesTest extends PanelizerTestHelper { |
|
9 |
|
|
10 |
/** |
|
11 |
* {@inheritdoc} |
|
12 |
*/ |
|
13 |
public static function getInfo() { |
|
14 |
return array( |
|
15 |
'name' => 'Panelizer exportables', |
|
16 |
'description' => 'Test how exported configurations work.', |
|
17 |
'group' => 'Panelizer', |
|
18 |
); |
|
19 |
} |
|
20 |
|
|
21 |
/** |
|
22 |
* {@inheritdoc} |
|
23 |
*/ |
|
24 |
function setUp(array $modules = array()) { |
|
25 |
// Need this extra module for the default it exports. |
|
26 |
$modules[] = 'panelizer_test_exportables'; |
|
27 |
|
|
28 |
parent::setUp($modules); |
|
29 |
|
|
30 |
// Enable Panelizer for the 'page' content type. |
|
31 |
$this->togglePanelizer(); |
|
32 |
// Enable the Panels view mode too. |
|
33 |
$this->simpleEnablePage('node_view'); |
|
34 |
|
|
35 |
// Reset the static variable used to identify permissions, otherwise the |
|
36 |
// permissions check in drupalCreateUser will fail because of the new perms |
|
37 |
// added for the newly Panelizered entity display. |
|
38 |
$this->checkPermissions(array(), TRUE); |
|
39 |
} |
|
40 |
|
|
41 |
/** |
|
42 |
* Verify that the exported configuration can be edited. |
|
43 |
*/ |
|
44 |
function testExportablesAreConfigurable() { |
|
45 |
$perms = array( |
|
46 |
// Standard node permissions. |
|
47 |
'administer content types', |
|
48 |
'access administration pages', |
|
49 |
|
|
50 |
// Panelizer. |
|
51 |
'administer panelizer', |
|
52 |
|
|
53 |
// Permission to manage the 'content', i.e. the display. |
|
54 |
'administer panelizer node page content', |
|
55 |
); |
|
56 |
$web_user = $this->drupalCreateUser($perms); |
|
57 |
$this->drupalLogin($web_user); |
|
58 |
|
|
59 |
// Load the Panelizer admin page for the 'page' content type. |
|
60 |
$this->drupalGet('admin/structure/types/manage/page/panelizer/page_manager'); |
|
61 |
$this->assertResponse(200); |
|
62 |
|
|
63 |
// The two defaults that were exported. |
|
64 |
$defaults = array( |
|
65 |
'node:page:with_storage' => 'Test (with Storage API)', |
|
66 |
'node:page:without_storage' => 'Test (without Storage API)', |
|
67 |
); |
|
68 |
|
|
69 |
// Confirm the two exported displays are listed. |
|
70 |
foreach ($defaults as $default => $label) { |
|
71 |
$this->assertText($default); |
|
72 |
} |
|
73 |
|
|
74 |
// Try loading the exported displays' configuration pages. |
|
75 |
foreach ($defaults as $default => $label) { |
|
76 |
// $default = urlencode($default); |
|
77 |
$this->drupalGet('admin/structure/types/manage/page/panelizer/page_manager/' . $default . '/settings'); |
|
78 |
$this->assertResponse(200); |
|
79 |
$this->assertFieldByName('title', $label); |
|
80 |
$this->assertFieldByName('css_class', str_replace(':', '-', $default)); |
|
81 |
$this->drupalGet('admin/structure/types/manage/page/panelizer/page_manager/' . $default . '/context'); |
|
82 |
$this->assertResponse(200); |
|
83 |
$this->assertText(t('Built in context')); |
|
84 |
$this->drupalGet('admin/structure/types/manage/page/panelizer/page_manager/' . $default . '/access'); |
|
85 |
$this->assertResponse(200); |
|
86 |
$this->assertText(t('No criteria selected, this test will pass.')); |
|
87 |
$this->drupalGet('admin/structure/types/manage/page/panelizer/page_manager/' . $default . '/layout'); |
|
88 |
$this->assertResponse(200); |
|
89 |
$this->assertFieldByName('categories'); |
|
90 |
$this->drupalGet('admin/structure/types/manage/page/panelizer/page_manager/' . $default . '/content'); |
|
91 |
$this->assertResponse(200); |
|
92 |
} |
|
93 |
} |
|
94 |
|
|
95 |
/** |
|
96 |
* Verify that the exported configuration can be edited when applied to an |
|
97 |
* individual entity. |
|
98 |
*/ |
|
99 |
function testExportablesChangeablePreEntity() { |
|
100 |
$perms = array( |
|
101 |
// Standard node permissions. |
|
102 |
'create page content', |
|
103 |
'edit own page content', |
|
104 |
|
|
105 |
// Allow access to the 'panelizer' tab. |
|
106 |
'administer panelizer node page overview', |
|
107 |
// Permission to manage the 'content', i.e. the display. |
|
108 |
'administer panelizer node page content', |
|
109 |
// Allow choosing the display that is used. |
|
110 |
'administer panelizer node page choice', |
|
111 |
); |
|
112 |
$web_user = $this->drupalCreateUser($perms); |
|
113 |
$this->drupalLogin($web_user); |
|
114 |
|
|
115 |
// Create a node. |
|
116 |
$edit = array( |
|
117 |
'panelizer[page_manager][name]' => 'node:page:without_storage', |
|
118 |
); |
|
119 |
$node = $this->createNode($edit); |
|
120 |
$this->assertNotEqual($node->nid, 0); |
|
121 |
|
|
122 |
// Load the Panelizer main page. |
|
123 |
$this->drupalGet('node/' . $node->nid . '/panelizer'); |
|
124 |
$this->assertResponse(200); |
|
125 |
|
|
126 |
// Confirm there's a link to the 'content' page, and load it. |
|
127 |
$path = 'node/' . $node->nid . '/panelizer/page_manager/content'; |
|
128 |
$this->assertLinkByHref(url($path)); |
|
129 |
$this->drupalGet($path); |
|
130 |
$this->assertResponse(200); |
|
131 |
|
|
132 |
// Confirm the 'Add content' link is on the page. |
|
133 |
$this->assertLink(t('Add content')); |
|
134 |
$ajax_path = 'panels/ajax/editor/select-content/panelizer:node:' . $node->nid . ':page_manager:' . $node->vid . '/center'; |
|
135 |
// Need to pass the path through url() to get the correct syntax for the |
|
136 |
// actual link. |
|
137 |
$this->assertLinkByHref(url($ajax_path)); |
|
138 |
|
|
139 |
// Load the AJAX path to see what it contains. |
|
140 |
$json = $this->drupalGetAJAX($ajax_path); |
|
141 |
$this->assertResponse(200); |
|
142 |
|
|
143 |
// Examine the JSON response from the AJAX API. |
|
144 |
$this->verbose('<pre>' . print_r($json, TRUE) . '</pre>'); |
|
145 |
// $this->assertEqual(count($json), 2); |
|
146 |
$this->assertTrue(isset($json[0]['command'])); |
|
147 |
$this->assertEqual($json[0]['command'], 'settings'); |
|
148 |
$this->assertTrue(isset($json[0]['settings'])); |
|
149 |
$this->assertTrue(isset($json[0]['merge'])); |
|
150 |
$this->assertEqual($json[0]['merge'], 'TRUE'); |
|
151 |
$this->assertTrue(isset($json[1]['command'])); |
|
152 |
|
|
153 |
// This is what should happen. |
|
154 |
$this->assertEqual($json[1]['command'], 'modal_display'); |
|
155 |
$this->assertTrue(isset($json[1]['title'])); |
|
156 |
if (isset($json[1]['title'])) { |
|
157 |
$this->assertEqual($json[1]['title'], t('Add content to Center')); |
|
158 |
} |
|
159 |
$this->assertTrue(isset($json[1]['output'])); |
|
160 |
|
|
161 |
// This is what should not happen. |
|
162 |
$this->assertNotEqual($json[1]['command'], 'alert'); |
|
163 |
$this->assertFalse(isset($json[1]['text'])); |
|
164 |
if (isset($json[1]['text'])) { |
|
165 |
$this->assertNotEqual($json[1]['text'], t('You are not authorized to access this page.'), 'Access Denied error in the AJAX response.'); |
|
166 |
} |
|
167 |
} |
|
168 |
|
|
169 |
} |
drupal7/sites/all/modules/panelizer/tests/panelizer.with_panels_ipe.test | ||
---|---|---|
38 | 38 |
/** |
39 | 39 |
* Test whether the IPE 'content' permissions work correctly. |
40 | 40 |
*/ |
41 |
// function testIpeContentAccess() { |
|
42 |
// $perms = array( |
|
43 |
// // Standard node permissions. |
|
44 |
// 'create page content', |
|
45 |
// 'administer content types', |
|
46 |
// 'administer nodes', |
|
47 |
// 'bypass node access', |
|
48 |
// |
|
49 |
// 'access administration pages', |
|
50 |
// |
|
51 |
// // Panels IPE. |
|
52 |
// 'use panels in place editing', |
|
53 |
// |
|
54 |
// // Panelizer. |
|
55 |
// 'administer panelizer', |
|
56 |
// |
|
57 |
// // Permission to manage the 'content', i.e. the display. |
|
58 |
// 'administer panelizer node page content', |
|
59 |
// ); |
|
60 |
// $web_user = $this->drupalCreateUser($perms); |
|
61 |
// $this->drupalLogin($web_user); |
|
62 |
// |
|
63 |
// // Just 'cause. |
|
64 |
// drupal_flush_all_caches(); |
|
65 |
// // Create a test node. |
|
66 |
// $node = $this->createNode(); |
|
67 |
// |
|
68 |
// // Enable IPE for this node. |
|
69 |
// $this->drupalGet('node/' . $node->nid . '/panelizer/page_manager/settings'); |
|
70 |
// $this->assertResponse(200); |
|
71 |
// $this->assertFieldByName('pipeline'); |
|
72 |
// $edit = array( |
|
73 |
// 'pipeline' => 'ipe', |
|
74 |
// ); |
|
75 |
// $this->drupalPost(NULL, $edit, t('Save')); |
|
76 |
// $this->assertText(t('The settings have been updated.')); |
|
77 |
// |
|
78 |
// // Load the node view page. |
|
79 |
// $this->drupalGet('node/' . $node->nid); |
|
80 |
// $this->assertResponse(200); |
|
81 |
// |
|
82 |
// // Confirm the IPE link is on the form. |
|
83 |
// $this->assertLink(t('Customize this page')); |
|
84 |
// $path = 'panels/ajax/ipe/save_form/panelizer%3Anode%3A' . $node->nid . '%3Apage_manager%3A' . $node->vid; |
|
85 |
// $query_string = array('destination' => 'node/' . $node->nid); |
|
86 |
// $this->assertLinkByHref(base_path() . $path . '?destination=' . $query_string['destination']); |
|
87 |
// |
|
88 |
// // Load the API path when logged in. This should give an AJAX response with |
|
89 |
// // two commands - the first should be "settings" and the second one should |
|
90 |
// // be "initIPE". |
|
91 |
// $json = $this->drupalGetAJAX(urldecode($path), array('query' => $query_string)); |
|
92 |
// $this->assertResponse(200); |
|
93 |
// $this->verbose('<pre>' . print_r($json, TRUE) . '</pre>'); |
|
94 |
// // @todo What permission does this need to get a proper response? |
|
95 |
// $this->assertEqual(count($json), 2); |
|
96 |
// $this->assertTrue(isset($json[0]['command'])); |
|
97 |
// $this->assertEqual($json[0]['command'], 'settings'); |
|
98 |
// $this->assertTrue(isset($json[0]['settings'])); |
|
99 |
// $this->assertTrue(isset($json[0]['merge'])); |
|
100 |
// $this->assertEqual($json[0]['merge'], 'TRUE'); |
|
101 |
// $this->assertTrue(isset($json[1]['command'])); |
|
102 |
// $this->assertEqual($json[1]['command'], 'initIPE'); |
|
103 |
// $this->assertTrue(isset($json[1]['key'])); |
|
104 |
// $this->assertEqual($json[1]['key'], 'panelizer-node-' . $node->nid . '-page-manager-' . $node->vid); |
|
105 |
// $this->assertTrue(isset($json[1]['data'])); |
|
106 |
// $this->assertTrue(isset($json[1]['lockPath'])); |
|
107 |
// |
|
108 |
// // Log out. |
|
109 |
// $this->drupalLogout(); |
|
110 |
// |
|
111 |
// // Load the API path when logged out. This should give a 404-by-AJAX |
|
112 |
// // response. |
|
113 |
// $json = $this->drupalGetAJAX(urldecode($path), array('query' => $query_string)); |
|
114 |
// $this->assertResponse(200); |
|
115 |
// $this->verbose('<pre>' . print_r($json, TRUE) . '</pre>'); |
|
116 |
// $this->assertEqual(count($json), 2); |
|
117 |
// $this->assertTrue(isset($json[1]['command'])); |
|
118 |
// $this->assertEqual($json[1]['command'], 'alert'); |
|
119 |
// $this->assertTrue(isset($json[1]['text'])); |
|
120 |
// $this->assertEqual($json[1]['text'], t('You are not authorized to access this page.')); |
|
121 |
// $this->assertFalse(isset($json[1]['key'])); |
|
122 |
// $this->assertFalse(isset($json[1]['data'])); |
|
123 |
// $this->assertFalse(isset($json[1]['lockPath'])); |
|
124 |
// } |
|
125 |
// |
|
126 |
// /** |
|
127 |
// * Test whether the IPE 'layout' permissions work correctly. |
|
128 |
// */ |
|
129 |
// function testIpeLayoutAccess() { |
|
130 |
// $perms = array( |
|
131 |
// // Standard node permissions. |
|
132 |
// 'create page content', |
|
133 |
// 'administer content types', |
|
134 |
// 'administer nodes', |
|
135 |
// 'bypass node access', |
|
136 |
// |
|
137 |
// // Panels IPE. |
|
138 |
// 'use panels in place editing', |
|
139 |
// // Adds the "Change layout" functionality to IPE. |
|
140 |
// 'change layouts in place editing', |
|
141 |
// |
|
142 |
// // Panelizer. |
|
143 |
// 'administer panelizer', |
|
144 |
// |
|
145 |
// // Permission to modify the layout. |
|
146 |
// 'administer panelizer node page layout', |
|
147 |
// ); |
|
148 |
// $web_user = $this->drupalCreateUser($perms); |
|
149 |
// $this->drupalLogin($web_user); |
|
150 |
// |
|
151 |
// // Just 'cause. |
|
152 |
// drupal_flush_all_caches(); |
|
153 |
// |
|
154 |
// // Create a test node. |
|
155 |
// $node = $this->createNode(); |
|
156 |
// |
|
157 |
// // Enable IPE for this node. |
|
158 |
// $this->drupalGet('node/' . $node->nid . '/panelizer/page_manager/settings'); |
|
159 |
// $this->assertResponse(200); |
|
160 |
// $this->assertFieldByName('pipeline'); |
|
161 |
// $edit = array( |
|
162 |
// 'pipeline' => 'ipe', |
|
163 |
// ); |
|
164 |
// $this->drupalPost(NULL, $edit, t('Save')); |
|
165 |
// $this->assertText(t('The settings have been updated.')); |
|
166 |
// |
|
167 |
// // Load the node view page. |
|
168 |
// $this->drupalGet('node/' . $node->nid); |
|
169 |
// $this->assertResponse(200); |
|
170 |
// |
|
171 |
// // Confirm the IPE link is on the form. |
|
172 |
// $this->assertLink(t('Change layout')); |
|
173 |
// $path = 'panels/ajax/ipe/change_layout/panelizer%3Anode%3A' . $node->nid . '%3Apage_manager%3A' . $node->vid; |
|
174 |
// $query_string = array('destination' => 'node/' . $node->nid); |
|
175 |
// $this->assertLinkByHref(base_path() . $path . '?destination=' . $query_string['destination']); |
|
176 |
// |
|
177 |
// // Load the API path when logged in. This should give an AJAX response with |
|
178 |
// // three commands - the first should be "settings", the second one should be |
|
179 |
// // "modal_display" and the third "IPEsetLockState". |
|
180 |
// $json = $this->drupalGetAJAX(urldecode($path), array('query' => $query_string)); |
|
181 |
// $this->assertResponse(200); |
|
182 |
// $this->verbose('<pre>' . print_r($json, TRUE) . '</pre>'); |
|
183 |
// // @todo What permission does this need to get a proper response? |
|
184 |
// $this->assertEqual(count($json), 3); |
|
185 |
// $this->assertTrue(isset($json[0]['command'])); |
|
186 |
// $this->assertEqual($json[0]['command'], 'settings'); |
|
187 |
// $this->assertTrue(isset($json[0]['settings'])); |
|
188 |
// $this->assertTrue(isset($json[0]['merge'])); |
|
189 |
// $this->assertEqual($json[0]['merge'], 'TRUE'); |
|
190 |
// $this->assertTrue(isset($json[1]['command'])); |
|
191 |
// $this->assertEqual($json[1]['command'], 'modal_display'); |
|
192 |
// $this->assertTrue(isset($json[1]['title'])); |
|
193 |
// $this->assertEqual($json[1]['title'], t('Change layout')); |
|
194 |
// $this->assertTrue(isset($json[2]['command'])); |
|
195 |
// $this->assertEqual($json[2]['command'], 'IPEsetLockState'); |
|
196 |
// $this->assertTrue(isset($json[2]['key'])); |
|
197 |
// $this->assertEqual($json[2]['key'], 'panelizer-node-' . $node->nid . '-page-manager-' . $node->vid); |
|
198 |
// $this->assertTrue(isset($json[2]['lockPath'])); |
|
199 |
// |
|
200 |
// // Log out. |
|
201 |
// $this->drupalLogout(); |
|
202 |
// |
|
203 |
// // Load the API path when logged out. This should give a 404-by-AJAX |
|
204 |
// // response. |
|
205 |
// $json = $this->drupalGetAJAX(urldecode($path), array('query' => $query_string)); |
|
206 |
// $this->assertResponse(200); |
|
207 |
// $this->verbose('<pre>' . print_r($json, TRUE) . '</pre>'); |
|
208 |
// $this->assertEqual(count($json), 2); |
|
209 |
// $this->assertTrue(isset($json[1]['command'])); |
|
210 |
// $this->assertEqual($json[1]['command'], 'alert'); |
|
211 |
// $this->assertTrue(isset($json[1]['text'])); |
|
212 |
// $this->assertEqual($json[1]['text'], t('You are not authorized to access this page.')); |
|
213 |
// $this->assertFalse(isset($json[1]['key'])); |
|
214 |
// $this->assertFalse(isset($json[1]['data'])); |
|
215 |
// $this->assertFalse(isset($json[1]['lockPath'])); |
|
216 |
// } |
|
41 |
function testIpeContentAccess() { |
|
42 |
$perms = array( |
|
43 |
// Standard node permissions. |
|
44 |
'create page content', |
|
45 |
'administer content types', |
|
46 |
'administer nodes', |
|
47 |
'bypass node access', |
|
48 |
|
|
49 |
'access administration pages', |
|
50 |
|
|
51 |
// Panels IPE. |
|
52 |
'use panels in place editing', |
|
53 |
|
|
54 |
// Panelizer. |
|
55 |
'administer panelizer', |
|
56 |
|
|
57 |
// Permission to manage the 'content', i.e. the display. |
|
58 |
'administer panelizer node page content', |
|
59 |
); |
|
60 |
$web_user = $this->drupalCreateUser($perms); |
|
61 |
$this->drupalLogin($web_user); |
|
62 |
|
|
63 |
// Just 'cause. |
|
64 |
drupal_flush_all_caches(); |
|
65 |
// Create a test node. |
|
66 |
$node = $this->createNode(); |
|
67 |
|
|
68 |
// Enable IPE for this node. |
|
69 |
$this->drupalGet('node/' . $node->nid . '/panelizer/page_manager/settings'); |
|
70 |
$this->assertResponse(200); |
|
71 |
$this->assertFieldByName('pipeline'); |
|
72 |
$edit = array( |
|
73 |
'pipeline' => 'ipe', |
|
74 |
); |
|
75 |
$this->drupalPost(NULL, $edit, t('Save')); |
|
76 |
$this->assertText(t('The settings have been updated.')); |
|
77 |
|
|
78 |
// Load the node view page. |
|
79 |
$this->drupalGet('node/' . $node->nid); |
|
80 |
$this->assertResponse(200); |
|
81 |
|
|
82 |
// Confirm the IPE link is on the form. |
|
83 |
$this->assertLink(t('Customize this page')); |
|
84 |
$path = 'panels/ajax/ipe/save_form/panelizer:node:' . $node->nid . ':page_manager:' . $node->vid; |
|
85 |
$query_string = array('destination' => 'node/' . $node->nid); |
|
86 |
$full_path = url($path, array('query' => array('destination' => $query_string['destination']))); |
|
87 |
$this->assertLinkByHref($full_path); |
|
88 |
// Confirm the link via xpath. |
|
89 |
$xpath = $this->xpath("//a[@id='panels-ipe-customize-page']"); |
|
90 |
$this->assertEqual(count($xpath), 1, 'Found the "Customize this page" link.'); |
|
91 |
$this->assertEqual($xpath[0]['href'], $full_path);//, 'The "Customize this Page" link is what was expected.'); |
|
92 |
|
|
93 |
// Load the API path when logged in. This should give an AJAX response with |
|
94 |
// two commands - the first should be "settings" and the second one should |
|
95 |
// be "initIPE". |
|
96 |
$json = $this->drupalGetAJAX($path, array('query' => $query_string)); |
|
97 |
$this->assertResponse(200); |
|
98 |
$this->verbose('<pre>' . print_r($json, TRUE) . '</pre>'); |
|
99 |
// @todo What permission does this need to get a proper response? |
|
100 |
$this->assertEqual(count($json), 2); |
|
101 |
$this->assertTrue(isset($json[0]['command'])); |
|
102 |
$this->assertEqual($json[0]['command'], 'settings'); |
|
103 |
$this->assertTrue(isset($json[0]['settings'])); |
|
104 |
$this->assertTrue(isset($json[0]['merge'])); |
|
105 |
$this->assertEqual($json[0]['merge'], 'TRUE'); |
|
106 |
$this->assertTrue(isset($json[1]['command'])); |
|
107 |
$this->assertEqual($json[1]['command'], 'initIPE'); |
|
108 |
$this->assertTrue(isset($json[1]['key'])); |
|
109 |
$this->assertEqual($json[1]['key'], 'panelizer-node-' . $node->nid . '-page-manager-' . $node->vid); |
|
110 |
$this->assertTrue(isset($json[1]['data'])); |
|
111 |
$this->assertTrue(isset($json[1]['lockPath'])); |
|
112 |
|
|
113 |
// Log out. |
|
114 |
$this->drupalLogout(); |
|
115 |
|
|
116 |
// Load the API path when logged out. This should give a 404-by-AJAX |
|
117 |
// response. |
|
118 |
$json = $this->drupalGetAJAX($path, array('query' => $query_string)); |
|
119 |
$this->assertResponse(200); |
|
120 |
$this->verbose('<pre>' . print_r($json, TRUE) . '</pre>'); |
|
121 |
$this->assertEqual(count($json), 2); |
|
122 |
$this->assertTrue(isset($json[1]['command'])); |
|
123 |
$this->assertEqual($json[1]['command'], 'alert'); |
|
124 |
$this->assertTrue(isset($json[1]['text'])); |
|
125 |
$this->assertEqual($json[1]['text'], t('You are not authorized to access this page.')); |
|
126 |
$this->assertFalse(isset($json[1]['key'])); |
|
127 |
$this->assertFalse(isset($json[1]['data'])); |
|
128 |
$this->assertFalse(isset($json[1]['lockPath'])); |
|
129 |
} |
|
130 |
|
|
131 |
/** |
|
132 |
* Test whether the IPE 'layout' permissions work correctly. |
|
133 |
*/ |
|
134 |
function testIpeLayoutAccess() { |
|
135 |
$perms = array( |
|
136 |
// Standard node permissions. |
|
137 |
'create page content', |
|
138 |
'administer content types', |
|
139 |
'administer nodes', |
|
140 |
'bypass node access', |
|
141 |
|
|
142 |
// Panels IPE. |
|
143 |
'use panels in place editing', |
|
144 |
// Adds the "Change layout" functionality to IPE. |
|
145 |
'change layouts in place editing', |
|
146 |
|
|
147 |
// Panelizer. |
|
148 |
'administer panelizer', |
|
149 |
|
|
150 |
// Permission to modify the layout. |
|
151 |
'administer panelizer node page layout', |
|
152 |
); |
|
153 |
$web_user = $this->drupalCreateUser($perms); |
|
154 |
$this->drupalLogin($web_user); |
|
155 |
|
|
156 |
// Just 'cause. |
|
157 |
drupal_flush_all_caches(); |
|
158 |
|
|
159 |
// Create a test node. |
|
160 |
$node = $this->createNode(); |
|
161 |
|
|
162 |
// Enable IPE for this node. |
|
163 |
$this->drupalGet('node/' . $node->nid . '/panelizer/page_manager/settings'); |
|
164 |
$this->assertResponse(200); |
|
165 |
$this->assertFieldByName('pipeline'); |
|
166 |
$edit = array( |
|
167 |
'pipeline' => 'ipe', |
|
168 |
); |
|
169 |
$this->drupalPost(NULL, $edit, t('Save')); |
|
170 |
$this->assertText(t('The settings have been updated.')); |
|
171 |
|
|
172 |
// Load the node view page. |
|
173 |
$this->drupalGet('node/' . $node->nid); |
|
174 |
$this->assertResponse(200); |
|
175 |
|
|
176 |
// Confirm the IPE link is on the form. |
|
177 |
$this->assertLink(t('Change layout')); |
|
178 |
$path = 'panels/ajax/ipe/change_layout/panelizer:node:' . $node->nid . ':page_manager:' . $node->vid; |
|
179 |
$query_string = array('destination' => 'node/' . $node->nid); |
|
180 |
$full_path = url($path, array('query' => array('destination' => $query_string['destination']))); |
|
181 |
$this->assertLinkByHref($full_path); |
|
182 |
// Confirm the link via xpath. |
|
183 |
$xpath = $this->xpath("//a[@id='ajax-link']"); |
|
184 |
$this->assertEqual(count($xpath), 1, 'Found the "Change layout" link.'); |
|
185 |
$this->assertEqual($xpath[0]['href'], $full_path);//, 'The "Change layout" link is what was expected.'); |
|
186 |
|
|
187 |
// Load the API path when logged in. This should give an AJAX response with |
|
188 |
// three commands - the first should be "settings", the second one should be |
|
189 |
// "modal_display" and the third "IPEsetLockState". |
|
190 |
$json = $this->drupalGetAJAX($path, array('query' => $query_string)); |
|
191 |
$this->assertResponse(200); |
|
192 |
$this->verbose('<pre>' . print_r($json, TRUE) . '</pre>'); |
|
193 |
// @todo What permission does this need to get a proper response? |
|
194 |
$this->assertEqual(count($json), 3); |
|
195 |
$this->assertTrue(isset($json[0]['command'])); |
|
196 |
$this->assertEqual($json[0]['command'], 'settings'); |
|
197 |
$this->assertTrue(isset($json[0]['settings'])); |
|
198 |
$this->assertTrue(isset($json[0]['merge'])); |
|
199 |
$this->assertEqual($json[0]['merge'], 'TRUE'); |
|
200 |
$this->assertTrue(isset($json[1]['command'])); |
|
201 |
$this->assertEqual($json[1]['command'], 'modal_display'); |
|
202 |
$this->assertTrue(isset($json[1]['title'])); |
|
203 |
$this->assertEqual($json[1]['title'], t('Change layout')); |
|
204 |
$this->assertTrue(isset($json[2]['command'])); |
|
205 |
$this->assertEqual($json[2]['command'], 'IPEsetLockState'); |
|
206 |
$this->assertTrue(isset($json[2]['key'])); |
|
207 |
$this->assertEqual($json[2]['key'], 'panelizer-node-' . $node->nid . '-page-manager-' . $node->vid); |
|
208 |
$this->assertTrue(isset($json[2]['lockPath'])); |
|
209 |
|
|
210 |
// Log out. |
|
211 |
$this->drupalLogout(); |
|
212 |
|
|
213 |
// Load the API path when logged out. This should give a 404-by-AJAX |
|
214 |
// response. |
|
215 |
$json = $this->drupalGetAJAX($path, array('query' => $query_string)); |
|
216 |
$this->assertResponse(200); |
|
217 |
$this->verbose('<pre>' . print_r($json, TRUE) . '</pre>'); |
|
218 |
$this->assertEqual(count($json), 2); |
|
219 |
$this->assertTrue(isset($json[1]['command'])); |
|
220 |
$this->assertEqual($json[1]['command'], 'alert'); |
|
221 |
$this->assertTrue(isset($json[1]['text'])); |
|
222 |
$this->assertEqual($json[1]['text'], t('You are not authorized to access this page.')); |
|
223 |
$this->assertFalse(isset($json[1]['key'])); |
|
224 |
$this->assertFalse(isset($json[1]['data'])); |
|
225 |
$this->assertFalse(isset($json[1]['lockPath'])); |
|
226 |
} |
|
217 | 227 |
|
218 | 228 |
/** |
219 | 229 |
* Test whether the IPE 'content' permissions work correctly w entity perms. |
... | ... | |
259 | 269 |
|
260 | 270 |
// Confirm the IPE link is on the form. |
261 | 271 |
$this->assertLink(t('Customize this page')); |
262 |
$path = 'panels/ajax/ipe/save_form/panelizer%3Anode%3A' . $node->nid . '%3Apage_manager%3A' . $node->vid;
|
|
272 |
$path = 'panels/ajax/ipe/save_form/panelizer:node:' . $node->nid . ':page_manager:' . $node->vid;
|
|
263 | 273 |
$query_string = array('destination' => 'node/' . $node->nid); |
264 |
$this->assertLinkByHref(base_path() . $path . '?destination=' . $query_string['destination']); |
|
274 |
$full_path = url($path, array('query' => array('destination' => $query_string['destination']))); |
|
275 |
$this->assertLinkByHref($full_path); |
|
276 |
// Confirm the link via xpath. |
|
277 |
$xpath = $this->xpath("//a[@id='panels-ipe-customize-page']"); |
|
278 |
$this->assertEqual(count($xpath), 1, 'Found the "Customize this page" link.'); |
|
279 |
$this->assertEqual($xpath[0]['href'], $full_path);//, 'The "Customize this Page" link is what was expected.'); |
|
265 | 280 |
|
266 | 281 |
// Log out. |
267 | 282 |
$this->drupalLogout(); |
... | ... | |
292 | 307 |
|
293 | 308 |
// Confirm the IPE link is not on the form. |
294 | 309 |
$this->assertNoLink(t('Customize this page')); |
295 |
$path = 'panels/ajax/ipe/save_form/panelizer%3Anode%3A' . $node->nid . '%3Apage_manager%3A' . $node->vid;
|
|
310 |
$path = 'panels/ajax/ipe/save_form/panelizer:node:' . $node->nid . ':page_manager:' . $node->vid;
|
|
296 | 311 |
$query_string = array('destination' => 'node/' . $node->nid); |
297 |
$this->assertNoLinkByHref(base_path() . $path . '?destination=' . $query_string['destination']); |
|
312 |
$full_path = url($path, array('query' => array('destination' => $query_string['destination']))); |
|
313 |
$this->assertNoLinkByHref($full_path); |
|
298 | 314 |
|
299 | 315 |
// Confirm the IPE link is not on the form. |
300 | 316 |
$this->assertNoLink(t('Change layout')); |
301 |
$path = 'panels/ajax/ipe/change_layout/panelizer%3Anode%3A' . $node->nid . '%3Apage_manager%3A' . $node->vid;
|
|
317 |
$path = 'panels/ajax/ipe/change_layout/panelizer:node:' . $node->nid . ':Apage_manager:' . $node->vid;
|
|
302 | 318 |
$query_string = array('destination' => 'node/' . $node->nid); |
303 |
$this->assertNoLinkByHref(base_path() . $path . '?destination=' . $query_string['destination']); |
|
319 |
$full_path = url($path, array('query' => array('destination' => $query_string['destination']))); |
|
320 |
$this->assertNoLinkByHref($full_path); |
|
304 | 321 |
} |
305 | 322 |
|
306 | 323 |
} |
drupal7/sites/all/modules/panelizer/tests/panelizer_test_exportables.info | ||
---|---|---|
1 |
name = Panelizer Test Exportables |
|
2 |
description = "Helper module for testing Panelizer's exportables." |
|
3 |
core = 7.x |
|
4 |
|
|
5 |
; Don't show this on the modules admin page. |
|
6 |
hidden = TRUE |
|
7 |
|
|
8 |
dependencies[] = panelizer |
|
9 |
|
|
10 |
; Information added by Drupal.org packaging script on 2016-08-19 |
|
11 |
version = "7.x-3.4" |
|
12 |
core = "7.x" |
|
13 |
project = "panelizer" |
|
14 |
datestamp = "1471635552" |
|
15 |
|
drupal7/sites/all/modules/panelizer/tests/panelizer_test_exportables.module | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
/** |
|
4 |
* @file |
|
5 |
* |
|
6 |
*/ |
|
7 |
|
|
8 |
/** |
|
9 |
* Implements hook_ctools_plugin_api(). |
|
10 |
*/ |
|
11 |
function panelizer_test_exportables_ctools_plugin_api($module = NULL, $api = NULL) { |
|
12 |
if ($module == "panelizer" && $api == "panelizer") { |
|
13 |
return array("version" => "1"); |
|
14 |
} |
|
15 |
} |
|
16 |
|
|
17 |
/** |
|
18 |
* Implements hook_panelizer_defaults(). |
|
19 |
*/ |
|
20 |
function panelizer_test_exportables_panelizer_defaults() { |
|
21 |
$export = array(); |
|
22 |
|
|
23 |
$panelizer = new stdClass(); |
|
24 |
$panelizer->disabled = FALSE; /* Edit this to true to make a default panelizer disabled initially */ |
|
25 |
$panelizer->api_version = 1; |
|
26 |
$panelizer->title = 'Test (with Storage API)'; |
|
27 |
$panelizer->panelizer_type = 'node'; |
|
28 |
$panelizer->panelizer_key = 'page'; |
|
29 |
$panelizer->access = array(); |
|
30 |
$panelizer->view_mode = 'page_manager'; |
|
31 |
$panelizer->name = 'node:page:with_storage'; |
|
32 |
$panelizer->css_id = ''; |
|
33 |
$panelizer->css_class = 'node-page-with_storage'; |
|
34 |
$panelizer->css = ''; |
|
35 |
$panelizer->no_blocks = FALSE; |
|
36 |
$panelizer->title_element = 'H2'; |
|
37 |
$panelizer->link_to_entity = TRUE; |
|
38 |
$panelizer->extra = array(); |
|
39 |
$panelizer->pipeline = 'standard'; |
|
40 |
$panelizer->contexts = array(); |
|
41 |
$panelizer->relationships = array(); |
|
42 |
$display = new panels_display(); |
|
43 |
$display->layout = 'flexible'; |
|
44 |
$display->layout_settings = array(); |
|
45 |
$display->panel_settings = array( |
|
46 |
'style_settings' => array( |
|
47 |
'default' => NULL, |
|
48 |
'center' => NULL, |
|
49 |
), |
|
50 |
); |
|
51 |
$display->cache = array(); |
|
52 |
$display->storage_type = 'panelizer_default'; |
|
53 |
$display->storage_id = 'node:page:with_storage'; |
|
54 |
$display->title = '%node:title'; |
|
55 |
$display->uuid = '4c374a0f-7b0b-476a-a0b4-86c8507c9a1d'; |
|
56 |
$display->content = array(); |
|
57 |
$display->panels = array(); |
|
58 |
$pane = new stdClass(); |
|
59 |
$pane->pid = 'new-e469448b-1f59-4eed-9551-00aede8e914d'; |
|
60 |
$pane->panel = 'center'; |
|
61 |
$pane->type = 'entity_field'; |
|
62 |
$pane->subtype = 'node:body'; |
|
63 |
$pane->shown = TRUE; |
|
64 |
$pane->access = array(); |
|
65 |
$pane->configuration = array( |
|
66 |
'label' => 'hidden', |
|
67 |
'formatter' => 'text_default', |
|
68 |
'delta_limit' => 0, |
|
69 |
'delta_offset' => '0', |
|
70 |
'delta_reversed' => FALSE, |
|
71 |
'formatter_settings' => array(), |
|
72 |
'context' => 'panelizer', |
|
73 |
); |
|
74 |
$pane->cache = array(); |
|
75 |
$pane->style = array( |
|
76 |
'settings' => NULL, |
|
77 |
); |
|
78 |
$pane->css = array(); |
|
79 |
$pane->extras = array(); |
|
80 |
$pane->position = 0; |
|
81 |
$pane->locks = array(); |
|
82 |
$pane->uuid = 'e469448b-1f59-4eed-9551-00aede8e914d'; |
|
83 |
$display->content['new-e469448b-1f59-4eed-9551-00aede8e914d'] = $pane; |
|
84 |
$display->panels['center'][] = 'new-e469448b-1f59-4eed-9551-00aede8e914d'; |
|
85 |
$pane = new stdClass(); |
|
86 |
$pane->pid = 'new-59b236d1-4b04-4009-9845-a9a41141658d'; |
|
87 |
$pane->panel = 'center'; |
|
88 |
$pane->type = 'node_links'; |
|
89 |
$pane->subtype = 'node_links'; |
|
90 |
$pane->shown = TRUE; |
|
91 |
$pane->access = array(); |
|
92 |
$pane->configuration = array( |
|
93 |
'override_title' => FALSE, |
|
94 |
'override_title_text' => '', |
|
95 |
'build_mode' => 'page_manager', |
|
96 |
'identifier' => '', |
|
97 |
'link' => TRUE, |
|
98 |
'context' => 'panelizer', |
|
99 |
); |
|
100 |
$pane->cache = array(); |
|
101 |
$pane->style = array( |
|
102 |
'settings' => NULL, |
|
103 |
); |
|
104 |
$pane->css = array( |
|
105 |
'css_class' => 'link-wrapper', |
|
106 |
); |
|
107 |
$pane->extras = array(); |
|
108 |
$pane->position = 3; |
|
109 |
$pane->locks = array(); |
|
110 |
$pane->uuid = '59b236d1-4b04-4009-9845-a9a41141658d'; |
|
111 |
$display->content['new-59b236d1-4b04-4009-9845-a9a41141658d'] = $pane; |
|
112 |
$display->panels['center'][] = 'new-59b236d1-4b04-4009-9845-a9a41141658d'; |
|
113 |
$display->hide_title = PANELS_TITLE_FIXED; |
|
114 |
$display->title_pane = 'new-e469448b-1f59-4eed-9551-00aede8e914d'; |
|
115 |
$panelizer->display = $display; |
|
116 |
$export[$panelizer->name] = $panelizer; |
|
117 |
|
|
118 |
$panelizer = new stdClass(); |
|
119 |
$panelizer->disabled = FALSE; /* Edit this to true to make a default panelizer disabled initially */ |
|
120 |
$panelizer->api_version = 1; |
|
121 |
$panelizer->title = 'Test (without Storage API)'; |
|
122 |
$panelizer->panelizer_type = 'node'; |
|
123 |
$panelizer->panelizer_key = 'page'; |
|
124 |
$panelizer->access = array(); |
|
125 |
$panelizer->view_mode = 'page_manager'; |
|
126 |
$panelizer->name = 'node:page:without_storage'; |
|
127 |
$panelizer->css_id = ''; |
|
128 |
$panelizer->css_class = 'node-page-without_storage'; |
|
129 |
$panelizer->css = ''; |
|
130 |
$panelizer->no_blocks = FALSE; |
|
131 |
$panelizer->title_element = 'H2'; |
|
132 |
$panelizer->link_to_entity = TRUE; |
|
133 |
$panelizer->extra = array(); |
|
134 |
$panelizer->pipeline = 'standard'; |
|
135 |
$panelizer->contexts = array(); |
|
136 |
$panelizer->relationships = array(); |
|
137 |
$display = new panels_display(); |
|
138 |
$display->layout = 'flexible'; |
|
139 |
$display->layout_settings = array(); |
|
140 |
$display->panel_settings = array( |
|
141 |
'style_settings' => array( |
|
142 |
'default' => NULL, |
|
143 |
'center' => NULL, |
|
144 |
), |
|
145 |
); |
|
146 |
$display->cache = array(); |
|
147 |
$display->title = '%node:title'; |
|
148 |
$display->uuid = '4c374a0f-7b0b-476a-a0b4-86c8507c9a1c'; |
|
149 |
$display->content = array(); |
|
150 |
$display->panels = array(); |
|
151 |
$pane = new stdClass(); |
|
152 |
$pane->pid = 'new-e469448b-1f59-4eed-9551-00aede8e914f'; |
|
153 |
$pane->panel = 'center'; |
|
154 |
$pane->type = 'entity_field'; |
|
155 |
$pane->subtype = 'node:body'; |
|
156 |
$pane->shown = TRUE; |
|
157 |
$pane->access = array(); |
|
158 |
$pane->configuration = array( |
|
159 |
'label' => 'hidden', |
|
160 |
'formatter' => 'text_default', |
|
161 |
'delta_limit' => 0, |
|
162 |
'delta_offset' => '0', |
|
163 |
'delta_reversed' => FALSE, |
|
164 |
'formatter_settings' => array(), |
|
165 |
'context' => 'panelizer', |
|
166 |
); |
|
167 |
$pane->cache = array(); |
|
168 |
$pane->style = array( |
|
169 |
'settings' => NULL, |
|
170 |
); |
|
171 |
$pane->css = array(); |
|
172 |
$pane->extras = array(); |
|
173 |
$pane->position = 0; |
|
174 |
$pane->locks = array(); |
|
175 |
$pane->uuid = 'e469448b-1f59-4eed-9551-00aede8e914f'; |
|
176 |
$display->content['new-e469448b-1f59-4eed-9551-00aede8e914f'] = $pane; |
|
177 |
$display->panels['center'][] = 'new-e469448b-1f59-4eed-9551-00aede8e914f'; |
|
178 |
$pane = new stdClass(); |
|
179 |
$pane->pid = 'new-59b236d1-4b04-4009-9845-a9a411416580'; |
|
180 |
$pane->panel = 'center'; |
|
181 |
$pane->type = 'node_links'; |
|
182 |
$pane->subtype = 'node_links'; |
|
183 |
$pane->shown = TRUE; |
|
184 |
$pane->access = array(); |
|
185 |
$pane->configuration = array( |
|
186 |
'override_title' => FALSE, |
|
187 |
'override_title_text' => '', |
|
188 |
'build_mode' => 'page_manager', |
|
189 |
'identifier' => '', |
|
190 |
'link' => TRUE, |
|
191 |
'context' => 'panelizer', |
|
192 |
); |
|
193 |
$pane->cache = array(); |
|
194 |
$pane->style = array( |
|
195 |
'settings' => NULL, |
|
196 |
); |
|
197 |
$pane->css = array( |
|
198 |
'css_class' => 'link-wrapper', |
|
199 |
); |
|
200 |
$pane->extras = array(); |
|
201 |
$pane->position = 3; |
|
202 |
$pane->locks = array(); |
|
203 |
$pane->uuid = '59b236d1-4b04-4009-9845-a9a411416580'; |
|
204 |
$display->content['new-59b236d1-4b04-4009-9845-a9a411416580'] = $pane; |
|
205 |
$display->panels['center'][] = 'new-59b236d1-4b04-4009-9845-a9a411416580'; |
|
206 |
$display->hide_title = PANELS_TITLE_FIXED; |
|
207 |
$display->title_pane = 'new-e469448b-1f59-4eed-9551-00aede8e914f'; |
|
208 |
$panelizer->display = $display; |
|
209 |
$export[$panelizer->name] = $panelizer; |
|
210 |
|
|
211 |
return $export; |
|
212 |
} |
drupal7/sites/all/modules/panels/i18n_panels/i18n_panels.info | ||
---|---|---|
7 | 7 |
package = Multilingual - Internationalization |
8 | 8 |
core = 7.x |
9 | 9 |
|
10 |
; Information added by Drupal.org packaging script on 2016-08-17
|
|
11 |
version = "7.x-3.6"
|
|
10 |
; Information added by Drupal.org packaging script on 2016-08-20
|
|
11 |
version = "7.x-3.7"
|
|
12 | 12 |
core = "7.x" |
13 | 13 |
project = "panels" |
14 |
datestamp = "1471447743"
|
|
14 |
datestamp = "1471704242"
|
|
15 | 15 |
|
drupal7/sites/all/modules/panels/panels.info | ||
---|---|---|
10 | 10 |
files[] = includes/plugins.inc |
11 | 11 |
files[] = plugins/views/panels_views_plugin_row_fields.inc |
12 | 12 |
|
13 |
; Information added by Drupal.org packaging script on 2016-08-17
|
|
14 |
version = "7.x-3.6"
|
|
13 |
; Information added by Drupal.org packaging script on 2016-08-20
|
|
14 |
version = "7.x-3.7"
|
|
15 | 15 |
core = "7.x" |
16 | 16 |
project = "panels" |
17 |
datestamp = "1471447743"
|
|
17 |
datestamp = "1471704242"
|
|
18 | 18 |
|
drupal7/sites/all/modules/panels/panels.install | ||
---|---|---|
435 | 435 |
|
436 | 436 |
/** |
437 | 437 |
* Adding universally unique identifiers to panels. |
438 |
* |
|
439 |
* Note: This update hook is not written well. It calls apis which uses the |
|
440 |
* most updated drupal database, causing missing columns or tables errors. To |
|
441 |
* mitigate the issue, we've added updates from 7303 and 7305. Future updates |
|
442 |
* should go below the 7305 update. |
|
443 |
* |
|
444 |
* See https://www.drupal.org/node/2787123 for more info. |
|
438 | 445 |
*/ |
439 | 446 |
function panels_update_7302() { |
440 | 447 |
if (!module_load_include('inc', 'ctools', 'includes/uuid')) { |
441 | 448 |
throw new DrupalUpdateException(t('Ctools UUID support not detected. You must update to a more recent version of the ctools module.')); |
442 | 449 |
} |
450 |
// Run the 7303 update first to avoid caching issues. |
|
451 |
// This *probably* should be placed right above update 7305, however it was |
|
452 |
// tested here and re-testing this update is difficult, so it stays here. |
|
453 |
panels_update_7303(); |
|
454 |
|
|
443 | 455 |
// Load the schema. |
444 | 456 |
$schema = panels_schema_5(); |
445 | 457 |
$msg = array(); |
... | ... | |
491 | 503 |
|
492 | 504 |
$dids = array_unique(array_merge($display_dids, $pane_dids)); |
493 | 505 |
|
506 |
// Before using panels_save_display(), we have to make sure any new fields |
|
507 |
// are added from future updates. |
|
508 |
panels_update_7305(); |
|
509 |
|
|
494 | 510 |
// If the Panels module is disabled we don't have access to |
495 | 511 |
// panels_load_displays(). |
496 | 512 |
if (!function_exists('panels_load_displays')) { |
... | ... | |
551 | 567 |
|
552 | 568 |
foreach ($new_fields as $table => $fields) { |
553 | 569 |
foreach ($fields as $field_name) { |
554 |
db_add_field($table, $field_name, $schema[$table]['fields'][$field_name]); |
|
570 |
// Due to a previous failure, the column may already exist: |
|
571 |
if (!db_field_exists($table, $field_name)) { |
|
572 |
db_add_field($table, $field_name, $schema[$table]['fields'][$field_name]); |
|
573 |
} |
|
555 | 574 |
} |
556 | 575 |
} |
557 | 576 |
} |
drupal7/sites/all/modules/panels/panels.module | ||
---|---|---|
334 | 334 |
); |
335 | 335 |
} |
336 | 336 |
|
337 |
/** |
|
338 |
* Implementation of hook_flush_caches(). |
|
339 |
* |
|
340 |
* We implement this so that we can be sure our legacy rendering state setting |
|
341 |
* in $conf is updated whenever caches are cleared. |
|
342 |
*/ |
|
343 |
//function panels_flush_caches() { |
|
344 |
// $legacy = panels_get_legacy_state(); |
|
345 |
// $legacy->determineStatus(); |
|
346 |
//} |
|
347 |
|
|
348 | 337 |
/** |
349 | 338 |
* Implements hook_flush_caches(). |
350 | 339 |
*/ |
... | ... | |
664 | 653 |
|
665 | 654 |
/** |
666 | 655 |
* Forms the basis of a panel display |
667 |
* |
|
668 | 656 |
*/ |
669 | 657 |
class panels_display { |
670 | 658 |
var $args = array(); |
... | ... | |
1813 | 1801 |
} |
1814 | 1802 |
} |
1815 | 1803 |
|
1804 |
/** |
|
1805 |
* Implements hook_default_page_manager_handlers_alter(). |
|
1806 |
* |
|
1807 |
* If a default Panels display has no storage type, set it. |
|
1808 |
*/ |
|
1809 |
function panels_default_page_manager_handlers_alter(&$handlers) { |
|
1810 |
foreach ($handlers as &$handler) { |
|
1811 |
if ($handler->handler == 'panel_context') { |
|
1812 |
$display =& $handler->conf['display']; |
|
1813 |
if (empty($display->storage_type)) { |
|
1814 |
$display->storage_type = 'page_manager'; |
|
1815 |
$display->storage_id = $handler->name; |
|
1816 |
} |
|
1817 |
} |
|
1818 |
} |
|
1819 |
} |
|
1820 |
|
|
1821 |
/** |
|
1822 |
* Implements hook_default_page_manager_pages_alter(). |
|
1823 |
*/ |
|
1824 |
function panels_default_page_manager_pages_alter(&$pages) { |
|
1825 |
foreach ($pages as &$page) { |
|
1826 |
panels_default_page_manager_handlers_alter($page->default_handlers); |
|
1827 |
} |
|
1828 |
} |
|
1829 |
|
|
1816 | 1830 |
// -------------------------------------------------------------------------- |
1817 | 1831 |
// General utility functions |
1818 | 1832 |
|
drupal7/sites/all/modules/panels/panels_ipe/js/panels_ipe.js | ||
---|---|---|
26 | 26 |
|
27 | 27 |
Drupal.behaviors.PanelsIPE = { |
28 | 28 |
attach: function(context) { |
29 |
// Remove any old editors. |
|
30 |
for (var i in Drupal.PanelsIPE.editors) { |
|
31 |
if (Drupal.settings.PanelsIPECacheKeys.indexOf(i) === -1) { |
|
32 |
// Clean-up a little bit and remove it. |
|
33 |
Drupal.PanelsIPE.editors[i].editing = false; |
|
34 |
Drupal.PanelsIPE.editors[i].changed = false; |
|
35 |
delete Drupal.PanelsIPE.editors[i]; |
|
36 |
} |
|
37 |
} |
|
38 |
|
|
39 |
// Initialize new editors. |
|
29 | 40 |
for (var i in Drupal.settings.PanelsIPECacheKeys) { |
30 | 41 |
var key = Drupal.settings.PanelsIPECacheKeys[i]; |
31 | 42 |
$('div#panels-ipe-display-' + key + ':not(.panels-ipe-processed)') |
... | ... | |
208 | 219 |
|
209 | 220 |
$('div.panels-ipe-sort-container', ipe.topParent).bind('sortstop', this.enableRegions); |
210 | 221 |
|
222 |
// Refresh the control jQuery object. |
|
223 |
ipe.control = $(ipe.control.selector); |
|
211 | 224 |
$('.panels-ipe-form-container', ipe.control).append(formdata); |
212 | 225 |
|
213 | 226 |
$('input:submit:not(.ajax-processed), button:not(.ajax-processed)', ipe.control).addClass('ajax-processed').each(function() { |
... | ... | |
259 | 272 |
// Re-show all the IPE non-editing meta-elements |
260 | 273 |
$('div.panels-ipe-off').show('fast'); |
261 | 274 |
|
275 |
// Refresh the container and control jQuery objects. |
|
276 |
ipe.container = $(ipe.container.selector); |
|
277 |
ipe.control = $(ipe.control.selector); |
|
278 |
|
|
262 | 279 |
ipe.showButtons(); |
263 | 280 |
// Re-hide all the IPE meta-elements |
264 | 281 |
$('div.panels-ipe-on').hide(); |
drupal7/sites/all/modules/panels/panels_ipe/panels_ipe.api.php | ||
---|---|---|
15 | 15 |
* Returns TRUE to allow access, FALSE to deny, or NULL if the module |
16 | 16 |
* implementing this hook doesn't care about access for the given display. |
17 | 17 |
*/ |
18 |
function hook_panels_ipe_access($panels_display) {
|
|
18 |
function hook_panels_ipe_access(panels_display $display) {
|
|
19 | 19 |
// We only care about displays with the 'panelizer' context. |
20 | 20 |
if (!isset($display->context['panelizer'])) { |
21 | 21 |
return NULL; |
drupal7/sites/all/modules/panels/panels_ipe/panels_ipe.info | ||
---|---|---|
7 | 7 |
configure = admin/structure/panels |
8 | 8 |
files[] = panels_ipe.module |
9 | 9 |
|
10 |
; Information added by Drupal.org packaging script on 2016-08-17
|
|
11 |
version = "7.x-3.6"
|
|
10 |
; Information added by Drupal.org packaging script on 2016-08-20
|
|
11 |
version = "7.x-3.7"
|
|
12 | 12 |
core = "7.x" |
13 | 13 |
project = "panels" |
14 |
datestamp = "1471447743"
|
|
14 |
datestamp = "1471704242"
|
|
15 | 15 |
|
drupal7/sites/all/modules/panels/panels_ipe/plugins/display_renderers/panels_renderer_ipe.class.php | ||
---|---|---|
345 | 345 |
// rendered. |
346 | 346 |
$this->meta_location = 'inline'; |
347 | 347 |
$this->commands[] = ajax_command_replace("#panels-ipe-display-{$this->clean_key}", panels_render_display($this->display, $this)); |
348 |
$buttons = &drupal_static('panels_ipe_toolbar_buttons', array()); |
|
349 |
$output = theme('panels_ipe_toolbar', array('buttons' => $buttons)); |
|
350 |
$this->commands[] = ajax_command_replace('#panels-ipe-control-container', $output); |
|
348 | 351 |
} |
349 | 352 |
else { |
350 | 353 |
// Cancelled. Clear the cache. |
drupal7/sites/all/modules/panels/panels_mini/panels_mini.info | ||
---|---|---|
5 | 5 |
dependencies[] = panels |
6 | 6 |
core = 7.x |
7 | 7 |
files[] = plugins/export_ui/panels_mini_ui.class.php |
8 |
; Information added by Drupal.org packaging script on 2016-08-17
|
|
9 |
version = "7.x-3.6"
|
|
8 |
; Information added by Drupal.org packaging script on 2016-08-20
|
|
9 |
version = "7.x-3.7"
|
|
10 | 10 |
core = "7.x" |
11 | 11 |
project = "panels" |
12 |
datestamp = "1471447743"
|
|
12 |
datestamp = "1471704242"
|
|
13 | 13 |
|
drupal7/sites/all/modules/panels/panels_mini/panels_mini.module | ||
---|---|---|
313 | 313 |
foreach ($panel_names as $name) { |
314 | 314 |
$cids[] = 'panels_mini_load:' . $name->name; |
315 | 315 |
} |
316 |
if (empty($cids)) { |
|
317 |
return array_filter($cache); |
|
318 |
} |
|
319 | 316 |
$output = cache_get_multiple($cids, 'cache_panels'); |
320 | 317 |
foreach ($output as $mini) { |
321 | 318 |
if (!empty($mini->data)) { |
... | ... | |
430 | 427 |
} |
431 | 428 |
} |
432 | 429 |
|
430 |
/** |
|
431 |
* Implements hook_default_panels_mini_alter(). |
|
432 |
* |
|
433 |
* If a default Panels display has no storage type, set it. |
|
434 |
*/ |
|
435 |
function panels_default_panels_mini_alter(&$mini_panels) { |
|
436 |
foreach ($mini_panels as &$mini_panel) { |
|
437 |
$display =& $mini_panel->display; |
|
438 |
if (empty($display->storage_type)) { |
|
439 |
$display->storage_type = 'panels_mini'; |
|
440 |
$display->storage_id = $mini_panel->name; |
|
441 |
} |
|
442 |
} |
|
443 |
} |
|
444 |
|
|
433 | 445 |
/** |
434 | 446 |
* Get the display cache for the panels_mini plugin. |
435 | 447 |
*/ |
drupal7/sites/all/modules/panels/panels_node/panels_node.info | ||
---|---|---|
7 | 7 |
core = 7.x |
8 | 8 |
files[] = panels_node.module |
9 | 9 |
|
10 |
; Information added by Drupal.org packaging script on 2016-08-17
|
|
11 |
version = "7.x-3.6"
|
|
10 |
; Information added by Drupal.org packaging script on 2016-08-20
|
|
11 |
version = "7.x-3.7"
|
|
12 | 12 |
core = "7.x" |
13 | 13 |
project = "panels" |
14 |
datestamp = "1471447743"
|
|
14 |
datestamp = "1471704242"
|
|
15 | 15 |
|
drupal7/sites/all/modules/panels/panels_node/panels_node.install | ||
---|---|---|
120 | 120 |
} |
121 | 121 |
} |
122 | 122 |
|
123 |
/* |
|
123 |
/**
|
|
124 | 124 |
* Set the storage type and id on existing panels nodes. |
125 | 125 |
*/ |
126 | 126 |
function panels_node_update_7302() { |
drupal7/sites/all/modules/panels/panels_node/panels_node.module | ||
---|---|---|
72 | 72 |
|
73 | 73 |
$items['node/add/panel/choose-layout'] = array( |
74 | 74 |
'title' => 'Choose layout', |
75 |
'access arguments' => array('create panel-nodes'),
|
|
75 |
'access callback' => 'panels_add_panel_access_callback',
|
|
76 | 76 |
'page callback' => 'panels_node_add', |
77 | 77 |
'type' => MENU_CALLBACK, |
78 | 78 |
); |
... | ... | |
91 | 91 |
return node_access('update', $node); |
92 | 92 |
} |
93 | 93 |
|
94 |
/** |
|
95 |
* Access callback to determine if user has access to add panel nodes. |
|
96 |
*/ |
|
97 |
function panels_add_panel_access_callback() { |
|
98 |
return user_access('create panel content') || user_access('administer panel-nodes'); |
|
99 |
} |
|
100 |
|
|
94 | 101 |
/** |
95 | 102 |
* Override of node add page to force layout selection prior |
96 | 103 |
* to actually editing a node. |
drupal7/sites/all/modules/panels/plugins/display_renderers/panels_renderer_editor.class.php | ||
---|---|---|
545 | 545 |
return 'update'; |
546 | 546 |
} |
547 | 547 |
|
548 |
return parent::get_panels_storage_op($method); |
|
548 |
return parent::get_panels_storage_op_for_ajax($method);
|
|
549 | 549 |
} |
550 | 550 |
|
551 | 551 |
/** |
drupal7/sites/all/modules/panels/plugins/display_renderers/panels_renderer_standard.class.php | ||
---|---|---|
621 | 621 |
// Pass long the css_id that is usually available. |
622 | 622 |
if (!empty($pane->css['css_id'])) { |
623 | 623 |
$id = ctools_context_keyword_substitute($pane->css['css_id'], array(), $this->display->context); |
624 |
$content->css_id = drupal_html_id($id);
|
|
624 |
$content->css_id = check_plain($id);
|
|
625 | 625 |
} |
626 | 626 |
|
627 | 627 |
// Pass long the css_class that is usually available. |
628 | 628 |
if (!empty($pane->css['css_class'])) { |
629 | 629 |
$class = ctools_context_keyword_substitute($pane->css['css_class'], array(), $this->display->context, array('css safe' => TRUE)); |
630 |
$content->css_class = check_plain(drupal_strtolower($class));
|
|
630 |
$content->css_class = check_plain($class);
|
|
631 | 631 |
} |
632 | 632 |
} |
633 | 633 |
|
drupal7/sites/all/modules/panels/plugins/page_wizards/landing_page.inc | ||
---|---|---|
66 | 66 |
); |
67 | 67 |
$cache->display = panels_new_display(); |
68 | 68 |
$cache->display->layout = 'flexible'; |
69 |
$cache->display->storage_type = 'page_manager'; |
|
70 |
$cache->display->storage_id = 'new'; |
|
69 | 71 |
} |
70 | 72 |
|
71 | 73 |
/** |
... | ... | |
257 | 259 |
// Create the the panel context variant configured with our display |
258 | 260 |
$plugin = page_manager_get_task_handler('panel_context'); |
259 | 261 |
|
262 |
// Set the storage id. |
|
263 |
$cache->display->storage_id = $cache->name; |
|
264 |
|
|
260 | 265 |
// Create a new handler. |
261 | 266 |
$handler = page_manager_new_task_handler($plugin); |
262 | 267 |
$handler->conf['title'] = t('Landing page'); |
Formats disponibles : Unified diff
Weekly update of contrib modules