-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathportlet.module
More file actions
759 lines (661 loc) · 21 KB
/
Copy pathportlet.module
File metadata and controls
759 lines (661 loc) · 21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
<?php
/**
* Implementation of hook_help().
*/
function portlet_help($path, $arg) {
}
/**
* Return form to setup portlets on main page
*/
function portlet_setup($form_state, $cookieid) {
$form = array();
$form['categories'] = array(
'#tree' => TRUE
);
$portlets = portlet_get_tree(0, $cookieid);
foreach ($portlets as $portlet) {
// Add not empty categories as fieldset
if ($portlet->type == 'root' AND ! empty($portlet->children)) {
$form['categories']['category-'.$portlet->pid] = array(
'#type' => 'fieldset',
'#title' => $portlet->title,
'#weight' => $portlet->weight,
'#attributes' => array('class' => 'portlet-category-frame')
);
// Other portlets with parent as checkboxes
} elseif ($portlet->parent != 0) {
// Portlets out of the categories should not be considered
$attributes = !is_null($portlet->column) ? array('checked' => 'checked') : array();
$attributes['class'] = 'portlet-checkbox '.$class;
$form['categories']['category-'.$portlet->parent]['#parent'] = TRUE;
$form['categories']['category-'.$portlet->parent]['panel-'.$portlet->pid] = array(
'#id' => 'portlet-'.$portlet->pid.'-checkbox',
'#type' => 'checkbox',
'#return_value' => $portlet->pid,
'#title' => $portlet->title,
'#weight' => $portlet->weight,
'#attributes' => $attributes
);
}
}
$form['submit'] = array('#type' => 'submit', '#value' => t('Save'));
return $form;
}
function portlet_setup_submit($form, &$form_state) {
global $user;
$portlets = portlet_get_all('c._column, c._order');
$oid = ($user->uid) ? $user->uid : $_COOKIE['cid'];
if ($user->uid) {
$insert = 'INSERT INTO {portlet_users} (oid, _column, pid, _order) VALUES (%d, "center", %d, 9999)';
$delete = 'DELETE FROM {portlet_users} WHERE oid=%d AND pid=%d;';
} else {
$insert = 'INSERT INTO {portlet_guests} (oid, _column, pid, _order) VALUES ("%s", "center", %d, 9999)';
$delete = 'DELETE FROM {portlet_guests} WHERE oid="%s" AND pid=%d;';
}
foreach ($form_state['values']['categories'] as $portlet) {
foreach ($portlet as $name => $checked) {
list($foo, $pid) = explode('-', $name);
// If not in column but checked - insert
if (is_null($portlets[$pid]->column) and $checked) {
db_query($insert, $oid, $pid, $pid, $oid);
}
// If in column but unchecked - delete
elseif (! is_null($portlets[$pid]->column) and ! $checked) {
db_query($delete, $oid, $pid);
}
}
}
}
/**
* Implementation of hook_perm
*/
function portlet_perm() {
return array('administer portlet');
}
/**
* Return standard panels theme
*/
function theme_portlet($pid, $title, $content, $state, $countable, $type, $count) {
$content_classes = ($state == 'minimized') ? 'portlet-invisible' : 'portlet-visible';
$output = '<div id="portlet-'.$pid.'" class="portlet-panel portlet-panel-js portlet-panel-titled portlet-panel-'.check_plain($type).'">';
$output .= '<div id="portlet-'.$pid.'-bar" class="portlet-panel-header portlet-handler-js">';
$output .= '<div class="portlet-panel-title"><a href="'.url('taxonomy/term/'.$pid).'">'.htmlspecialchars($title, ENT_QUOTES, 'UTF-8').'</a></div>';
// @think - how make available + or - depending on count of available elements
$output .= '<div class="portlet-panel-icons">';
if ($countable) {
$output .= '<a class="portlet-countup portlet-option-element-js" href="'.url('portlet/update/'.$type.'/'.$pid.'/'.(int)($count + 1)).'"> '.theme('image', drupal_get_path('module', 'portlet') . '/images/button_plus.png') .' </a>';
$output .= '<a class="portlet-countdown portlet-option-element-js" href="'.url('portlet/update/'.$type.'/'.$pid.'/'.(int)($count - 1)).'"> '.theme('image', drupal_get_path('module', 'portlet') . '/images/button_minus.png') .' </a>';
}
// @fixit: switch to constants (numerical values)
list($action, $icon) = ($state == 'minimized') ? array('maximize', 'M') : array('minimize', 'm');
$output .= ' ';
$output .= '<a class="portlet-resize portlet-option-element-js" href="'.url('portlet/'.$action.'/'.$pid).'">'. theme('image', drupal_get_path('module', 'portlet') . '/images/button_minimize.png') .'</a>';
$output .= ' ';
$output .= '<a class="portlet-close portlet-option-element-js" href="'.url('portlet/remove/'.$pid).'">'. theme('image', drupal_get_path('module', 'portlet') . '/images/button_close.png') .'</a>';
$output .= '</div>';
$output .= '</div>';
// @simplify for all portlets without edge
$output .= '<div id="portlet-'.$pid.'-content" class="portlet-panel-content portlet-panel-content-edge '.$content_classes.'"><div class="portlet-panel-content-right"><div class="portlet-panel-content-inner">'. $content .'</div></div></div>';
$output .= '<div class="portlet-panel-bottom"><div class="portlet-panel-bottom-left"> </div><div class="portlet-panel-bottom-fill"> </div></div>';
$output .= '</div>';
return $output;
}
function theme_portlet_empty($pid, $title, $content, $state, $countable, $type, $count) {
$output = '<div id="portlet-'.$pid.'" class="portlet-panel portlet-panel-js">';
$output .= '<div id="portlet-'.$pid.'-content" class="portlet-panel-content portlet-handler-js">'.$content.'</div>';
$output .= '</div>';
return $output;
}
/**
* Forbidd access if user not identificate
*/
function portlet_check_access() {
global $user;
if (! isset($_COOKIE['cid']) AND ! $user->uid) {
drupal_access_denied();
}
}
/**
* Load portlet container
*/
function portlet_container_load($title) {
$container = new stdClass();
$container->title = $title;
return $container;
}
/**
* Save configuration of panels to database.
*/
function portlet_save_ajax() {
global $user;
portlet_check_access();
$columns = array(
'left' => array(),
'center' => array(),
'right' => array()
);
portlet_clear();
if ($user->uid) {
$query = 'INSERT INTO {portlet_users} (oid, _column, pid, _order) VALUES (%d, "%s", %d, %d)';
} else {
$query = 'INSERT INTO {portlet_guests} (oid, _column, pid, _order) VALUES ("%s", "%s", %d, %d)';
}
// Set owner panel id on is logged user or guest
$oid = ($user->uid) ? $user->uid : $_COOKIE['cid'];
$saved = TRUE;
foreach ($_POST as $column => $content) {
if ($content) {
$portlets = explode(',', $content);
$sequence_number = count($portlets);
foreach ($portlets as $portlet) {
list($foo, $pid) = explode('-', $portlet);
$saved &= db_query($query, $oid, $column, $pid, $sequence_number);
$sequence_number--;
}
}
}
if (! $saved) {
drupal_access_denied();
}
}
/**
* Reset panels configurations
*/
function portlet_clear() {
global $user;
if ($user->uid) {
db_query('DELETE FROM {portlet_users} WHERE oid="%d"', (int)$user->uid);
} else {
db_query('DELETE FROM {portlet_guests} WHERE oid="%s"', $_COOKIE['cid']);
}
}
/**
* Site to reset panels configuration
*/
function portlet_reset() {
portlet_clear();
portlet_load_default_configuration();
drupal_set_message('Ustawienia paneli zostaly zresetowane do wartolci domyslnych');
drupal_goto('portlet');
}
/**
* Load portlet of the given ID
*/
function portlet_load($pid) {
return db_fetch_object(db_query('SELECT pid, title, parent, type, arg, countable FROM {portlet_config} WHERE pid = %d', $pid));
}
/**
* Return default configuration of panels
*/
function portlet_load_default_configuration($cookieid = NULL) {
global $user;
$cookieid = ($_COOKIE['cid']) ? $_COOKIE['cid'] : $cookieid;
$args = array();
$default = variable_get('portlet_default', array());
foreach ($default as $column => $_portlets) {
$columns[$column] = array();
$i = 0;
foreach ($_portlets as $pid) {
if ($user->uid) {
db_query('INSERT INTO {portlet_users} (oid, pid, _column, count, state, _order) VALUES (%d, %d, "%s", 5, "maximized", %d)',
$user->uid, $pid, $column, $i);
} else {
db_query('INSERT INTO {portlet_guests} (oid, pid, _column, count, state, _order) VALUES ("%s", %d, "%s", 5, "maximized", %d)', $cookieid, $pid, $column, $i);
}
$i++;
}
}
// Only after inserting data to database
// we can get all portlets
// issue is caused that LEFT JOIN doesn't return all data when portley_guest
// don't contain user identificator
$columns = array();
$portlets = portlet_get_all(NULL, $cookieid);
foreach ($default as $column => $_portlets) {
foreach ($_portlets as $pid) {
$columns[$column] = array_merge((array)$columns[$column], array($portlets[$pid]));
}
}
return $columns;
}
/**
* Return all portlets in database
*
* @param string - list of fileds
* for which portlets should be ordered
* @return array of portlets
*/
function portlet_get_all($order = NULL, $cookieid = NULL) {
static $portlets;
global $user;
$cookieid = ($_COOKIE['cid']) ? $_COOKIE['cid'] : $cookieid;
if ($order) {
$order = 'ORDER BY '.$order.' DESC';
}
if (empty($portlets[$order])) {
$portlets[$order] = array();
if ($user->uid) {
$result = db_query('SELECT
p.pid, p.title, p.parent, p.type, p.arg, p.countable, c.state, c._column as `column`, c.count
FROM
{portlet_config} AS p
LEFT JOIN
{portlet_users} AS c
ON
p.pid = c.pid
AND c.oid=%d
'.$order,
$user->uid);
} else {
$result = db_query('SELECT
p.pid, p.title, p.parent, p.type, p.arg, p.countable, c.state, c._column as `column`, c.count
FROM
{portlet_config} AS p
LEFT JOIN
{portlet_guests} AS c
ON
p.pid = c.pid
AND c.oid="%s"
'.$order,
$cookieid);
/*echo 'SELECT
p.pid, p.title, p.parent, p.type, p.arg, p.countable, c.state, c._column as `column`, c.count
FROM
{portlet_config} AS p
LEFT JOIN
{portlet_guests} AS c
ON
p.pid = c.pid
WHERE
(c.oid="'.$cookieid.'" OR c.pid IS NULL)
'.$order;*/
}
while ($portlet = db_fetch_object($result)) {
$portlets[$order][$portlet->pid] = $portlet;
}
}
return $portlets[$order];
}
/**
* Return portlets tree puting portlets in their categories
*
* @param int parent of portlets to return
* @return array been portlets tree
*/
function portlet_get_tree($parent = 0, $cookieid = NULL) {
static $children, $parents;
global $user;
// @fixit hmac instead two table
$cookieid = ($_COOKIE['cid']) ? $_COOKIE['cid'] : $cookieid;
$portlets = portlet_get_all('p.weight, p.title', $cookieid);
if (! isset($children)) {
$children = array();
foreach ($portlets as $portlet) {
$children[$portlet->parent][] = $portlet->pid;
$parents[$portlet->pid][] = $portlet->parent;
}
}
$tree = array();
if (! empty($children[$parent])) {
foreach ($children[$parent] as $child) {
$portlet = drupal_clone($portlets[$child]);
$portlet->children = $children[$child];
$tree[] = $portlet;
if (! empty($children[$child])) {
$tree = array_merge($tree, portlet_get_tree($child, $cookieid));
}
}
}
return $tree;
}
/**
* Get portlets and choose
*
* @return array Portlets in user defined order
*/
function portlet_get_columns($cookieid = NULL) {
$columns = array();
$portlets = portlet_get_all('c._column, c._order', $cookieid);
foreach ($portlets as $portlet) {
if ($portlet->column) {
$columns[$portlet->column][] = $portlet;
}
}
return $columns;
}
/**
* Set cookie of fluid panels
*/
function portlet_set_cookie() {
$cookieid = (isset($_COOKIE['cid']) && $_COOKIE['cid']) ? $_COOKIE['cid'] : uniqid('mx', TRUE);
setcookie('cid',$cookieid, time() + 3600 * 24 * 7 * 4 * 6 * 50, '/'); // 23 years expire date
db_query('UPDATE {portlet_guests} SET period=NOW() WHERE oid="%s";', $_COOKIE['cid']);
return $cookieid;
}
/**
* Return main site - view of the panels.
* $new_cookieid is passed to default_config
* to fill database with new proper value
* when cookie is fresh
*/
function portlet() {
global $user;
$new_cookieid = NULL;
if (! $user->uid) { $new_cookieid = portlet_set_cookie(); }
drupal_add_css(drupal_get_path('module', 'portlet') . '/portlet.css');
jquery_ui_add('ui.sortable');
drupal_add_js(drupal_get_path('module', 'portlet') .'/portlet.js');
$columns = portlet_get_columns($new_cookieid);
if (empty($columns) AND ! $user->uid) { $columns = portlet_load_default_configuration($new_cookieid); }
return theme('portlet_page', $columns, $new_cookieid);
}
/**
* Set new count for database panel
*/
function portlet_set_count($pid, $count) {
global $user;
if ($user->uid) {
$result = db_query('UPDATE {portlet_users} SET count=%d WHERE oid=%d AND pid=%d', $count, $user->uid, $pid);
} else {
$result = db_query('UPDATE {portlet_guests} SET count=%d WHERE oid=%d AND pid=%d', $count, $_COOKIE['cid'], $pid);
}
return $result;
}
/**
* Update count filed panel
*/
function portlet_update_page($type, $pid, $count) {
portlet_check_access();
// $type is unused variable add
// only for compatibility with portlet_update_ajax
// $type isn't necessery because link
// is generated by portlet_theme where type is known.
$result = portlet_set_count($pid, $count);
if (! $result) {
drupal_access_denied();
}
drupal_goto('portlet');
}
/**
* Return json elements to update in panel
*/
function portlet_update_ajax($type, $pid, $count) {
portlet_check_access();
$result = portlet_set_count($pid, $count);
if (! $result) {
drupal_access_denied();
}
$elements_quantity = call_user_func_array('portlet_'.$type.'_count', array($pid));
$up = $count + 1;
$down = $count - 1;
// Maximum allowed elements is number of elements in database
if ($up > $elements_quantity) {
$up = $elements_quantity;
}
// Minimum allowed elements is one
if ($down < 1) {
$down = 1;
}
$portlet = portlet_load($pid);
$to_update = array(
'content' => call_user_func_array('portlet_'.$type.'_content', array($portlet->arg, $count)),
'countdown' => url('portlet/update/'.$type.'/'.$pid.'/'.(int)($down)),
'countup' => url('portlet/update/'.$type.'/'.$pid.'/'.(int)($up))
);
echo json_encode($to_update);
exit;
}
/**
* Miminimize panel in DB
*/
function portlet_minimize_db($pid) {
global $user;
if ($user->uid) {
$result = db_query('UPDATE {portlet_users} SET state="minimized" WHERE oid=%d AND pid=%d', $user->uid, $pid);
} else {
$result = db_query('UPDATE {portlet_guests} SET state="minimized" WHERE oid=%d AND pid=%d', $_COOKIE['cid'], $pid);
}
return $result;
}
/**
* Handle minimization
*/
function portlet_minimize($pid) {
portlet_check_access();
$result = portlet_minimize_db($pid);
if (! $result) {
drupal_access_denied();
}
drupal_goto('portlet');
}
function portlet_minimize_ajax($pid) {
portlet_check_access();
$result = portlet_minimize_db($pid);
if (! $result) {
drupal_access_denied();
}
$to_update = array(
'url' => url('portlet/maximize/'.$pid)
);
echo json_encode($to_update);
exit;
}
/**
* Maximize panel in DB
*/
function portlet_maximize_db($pid) {
global $user;
if ($user->uid) {
$result = db_query('UPDATE {portlet_users} SET state="maximized" WHERE oid=%d AND pid=%d', $user->uid, $pid);
} else {
$result = db_query('UPDATE {portlet_guests} SET state="maximized" WHERE oid=%d AND pid=%d', $_COOKIE['cid'], $pid);
}
return $result;
}
/**
* Handle minimization
*/
function portlet_maximize($pid) {
portlet_check_access();
$result = portlet_maximize_db($pid);
if (! $result) {
drupal_access_denied();
}
drupal_goto('portlet');
}
function portlet_maximize_ajax($pid) {
portlet_check_access();
$result = portlet_maximize_db($pid);
if (! $result) {
drupal_access_denied();
}
$to_update = array(
'url' => url('portlet/minimize/'.$pid)
);
echo json_encode($to_update);
exit;
}
/**
* Remove portlet from database
*/
function portlet_remove($pid) {
global $user;
if ($user->uid) {
$result = db_query('DELETE FROM {portlet_users} WHERE oid=%d AND pid=%d', $user->uid, $pid);
} else {
$result = db_query('DELETE FROM {portlet_guests} WHERE oid="%s" AND pid=%d', $_COOKIE['cid'], $pid);
}
return $result;
}
/**
* Return parent of panels
*/
function portlet_get_parent($pid) {
return db_result(db_query('SELECT parent FROM {portlet_config} WHERE pid=%d;', $pid));
}
/**
* Delete panel from column
*/
function portlet_delete($pid) {
portlet_check_access();
$result = portlet_remove($pid);
if (! $result) {
drupal_access_denied();
}
drupal_goto('portlet');
}
/**
* Delete panel from column
*/
function portlet_delete_ajax($pid) {
portlet_check_access();
$result = portlet_remove($pid);
if (! $result) {
drupal_access_denied();
}
$category = portlet_get_parent($pid);
$to_update = array(
'category' => $category
);
echo json_encode($to_update);
exit;
}
/**
* Implemetation of hook_menu().
*/
function portlet_menu() {
$items['portlet'] = array(
'title' => '', // No title on mainpage - only portlets
'page callback' => 'portlet',
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
$items['admin/build/portlet'] = array(
'title' => 'Portlets',
'description' => t('Setup set of available portlets and choose default configuration.'),
'page callback' => 'drupal_get_form',
'page arguments' => array('portlet_admin_form'),
'access arguments' => array('administer portlet'),
'file' => 'portlet.admin.inc',
);
$items['admin/build/portlet/order'] = array(
'title' => 'Order',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['admin/build/portlet/default'] = array(
'title' => 'Default',
'page callback' => 'portlet_default',
'page arguments' => array(),
'access arguments' => array('administer portlet'),
'type' => MENU_LOCAL_TASK,
'file' => 'portlet.admin.inc'
);
$items['portlet/container/edit/%portlet_container'] = array(
'page callback' => 'drupal_get_form',
'page arguments' => array('portlet_container', 3),
'access arguments' => array('administer portlet'),
'file' => 'portlet.admin.inc',
'type' => MENU_CALLBACK
);
$items['admin/build/portlet/container/update'] = array(
'page callback' => 'portlet_update_in_default',
'page arguments' => array(),
'access arguments' => array('administer portlet'),
'file' => 'portlet.admin.inc',
'type' => MENU_CALLBACK
);
$items['admin/build/portlet/edit/%portlet'] = array(
'page callback' => 'drupal_get_form',
'page arguments' => array('portlet_edit_form', 4),
'access arguments' => array('administer portlet'),
'file' => 'portlet.admin.inc',
'type' => MENU_CALLBACK
);
$items['portlet/save/ajax'] = array(
'page callback' => 'portlet_save_ajax',
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
$items['portlet/reset'] = array(
'page callback' => 'portlet_reset',
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
$items['portlet/update/%/%/%'] = array(
'page callback' => 'portlet_update_page',
'page arguments' => array(2,3,4),
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
$items['portlet/update/%/%/%/ajax'] = array(
'page callback' => 'portlet_update_ajax',
'page arguments' => array(2,3,4),
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
$items['portlet/remove/%'] = array(
'page callback' => 'portlet_delete',
'page arguments' => array(2),
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
$items['portlet/remove/%/ajax'] = array(
'page callback' => 'portlet_delete_ajax',
'page arguments' => array(2),
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
$items['portlet/maximize/%'] = array(
'page callback' => 'portlet_maximize',
'page arguments' => array(2),
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
$items['portlet/maximize/%/ajax'] = array(
'page callback' => 'portlet_maximize_ajax',
'page arguments' => array(2),
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
$items['portlet/minimize/%'] = array(
'page callback' => 'portlet_minimize',
'page arguments' => array(2),
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
$items['portlet/minimize/%/ajax'] = array(
'page callback' => 'portlet_minimize_ajax',
'page arguments' => array(2),
'access callback' => TRUE,
'type' => MENU_CALLBACK
);
return $items;
}
/**
* Implementation of hook_theme().
*/
function portlet_theme() {
$items['portlet_empty'] = array(
'arguments' => array()
);
$items['portlet_page'] = array(
'arguments' => array('columns' => NULL, 'cookieid' => NULL),
'template' => 'portlet'
);
$items['portlet_admin'] = array(
'template' => 'admin'
);
$items['portlet'] = array(
'arguments' => array()
);
$items['portlet_admin_form'] = array(
'arguments' => array($form => NULL)
);
$items['portlet_default'] = array(
'arguments' => array('default' => NULL, 'portlets' => NULL),
'template' => 'default'
);
return $items;
}
?>