MIOLO20
Carregando...
Procurando...
Nenhuma entrada encontrada
mactionpanel.class
Ir para a documentação deste ficheiro.
1<?php
2
3class MActionPanel extends MPanel
4{
5 var $iconType = 'large';
8
9 function __construct($name = '', $caption = '', $controls = NULL, $close = '', $icon = '', $iconType='large')
10 {
11 parent::__construct($name, $caption, $controls, $close, $icon);
12 $this->setIconType($iconType);
13 }
14
15 public function setIconType($type = 'large')
16 {
17 $this->iconType = $type;
18 if ( $this->iconType == 'large' )
19 {
20 $this->setControlSize('70px','65px');
21 }
22 else
23 {
24 $this->setControlSize('135px','25px');
25 }
26 }
27
28 public function setControlSize($width, $height)
29 {
30 $this->controlWidth = $width;
31 $this->controlHeight = $height;
32 }
33
34
35 private function _getControl($label, $image, $module = 'main', $action = '', $item = NULL, $args = NULL)
36 {
37 $actionURL = $this->manager->getActionURL($module, $action, $item, $args);
38
39 $control = new MImageLinkLabel('', $label, $actionURL, $image);
40 $control->addAttribute('title', $label);
41
42 if( $this->iconType != 'large')
43 {
44 $control->setImageType('icon');
45 }
46
47 if($this->controlWidth)
48 {
49 $control->width = $this->controlWidth;
50 }
51
52 if($this->controlHeight)
53 {
54 $control->height = $this->controlHeight;
55 }
56
57 return $control;
58 }
59
60
61 public function addAction($label, $image, $module = 'main', $action = '', $item = NULL, $args = NULL)
62 {
63 $control = $this->_getControl($label, $image, $module, $action, $item, $args);
64 $this->addControl($control);
65 }
66
67
68 public function InsertAction($pos, $label, $image, $module = 'main', $action = '', $item = NULL, $args = NULL)
69 {
70 $control = $this->_getControl($label, $image, $module, $action, $item, $args);
71 $this->insertControl($pos, $control);
72 }
73
74
75 public function addUserAction($transaction, $access, $label, $image, $module = 'main', $action = '', $item = '', $args = NULL)
76 {
77 if ( $this->manager->perms->checkAccess($transaction, $access) )
78 {
79 $this->addAction($label, $image, $module, $action, $item, $args);
80 }
81 }
82
83
84 public function insertUserAction($pos, $transaction, $access, $label, $image, $module = 'main', $action = '', $item = '', $args = NULL)
85 {
86 if ( $this->manager->checkAccess($transaction, $access) )
87 {
88 $this->insertAction($pos, $label, $image, $module, $action, $item, $args);
89 }
90 }
91
92 public function addGroupAction($transaction, $access, $label, $image, $module = 'main', $action = '', $item = '', $args = NULL)
93 {
94 if ( $this->manager->perms->checkAccess($transaction, $access, false, true) )
95 {
96 $this->addAction($label, $image, $module, $action, $item, $args);
97 }
98 }
99
100
101 public function insertGroupAction($pos, $transaction, $access, $label, $image, $module = 'main', $action = '', $item = '', $args = NULL)
102 {
103 if ( $this->manager->checkAccess($transaction, $access, false, true) )
104 {
105 $this->insertAction($pos, $label, $image, $module, $action, $item, $args);
106 }
107 }
108
109
110
111 public function addBreak()
112 {
113 $this->addControl( new Spacer(), '0', 'clear' );
114 }
115}
116
117?>
addUserAction($transaction, $access, $label, $image, $module='main', $action='', $item='', $args=NULL)
addAction($label, $image, $module='main', $action='', $item=NULL, $args=NULL)
setControlSize($width, $height)
__construct($name='', $caption='', $controls=NULL, $close='', $icon='', $iconType='large')
insertGroupAction($pos, $transaction, $access, $label, $image, $module='main', $action='', $item='', $args=NULL)
insertUserAction($pos, $transaction, $access, $label, $image, $module='main', $action='', $item='', $args=NULL)
addGroupAction($transaction, $access, $label, $image, $module='main', $action='', $item='', $args=NULL)
setIconType($type='large')
InsertAction($pos, $label, $image, $module='main', $action='', $item=NULL, $args=NULL)
insertControl($pos, $control=null, $width='', $float='left')
addControl($control, $width='', $float='left')
$action
Definição base.php:4