ActionPopupItem Class Reference

display action in a JavaScript popup More...

Inheritance diagram for ActionPopupItem:

Inheritance graph
[legend]
Collaboration diagram for ActionPopupItem:

Collaboration graph
[legend]

Public Member Functions

 ActionItem ($desc, $action, $classCss, $paramString, $module=null, $submod=null, $tab=null, $mod=false)
 Constructor.
 ActionPopupItem ($desc, $action, $classCss, $paramString, $module=null, $submod=null, $tab=null, $width=300, $mod=false)
 buildUrlChunk ($arr)
 Build an URL chunk using a array of option => value.
 display ($param, $extraParams=array())
 display a link for the action
 displayWithNoRight ($param, $extraParams=array())
 display function if you don't have the right for this action
 displayWithRight ($param, $extraParams=array())
 display function if you have correct right on this action
 encapsulate ($obj, $extraParams=array())
 transform $obj param in link for this action
 setWidth ($width)
 Set the JavaScript popup width.
 strHelp ()
 display help (not use for the moment)

Data Fields

 $action
 $classCss
 $desc
 $mod
 $paramString

Detailed Description

display action in a JavaScript popup

See also:
ActionItem

showPopup (js)

Definition at line 246 of file PageGenerator.php.


Member Function Documentation

ActionItem::ActionItem ( desc,
action,
classCss,
paramString,
module = null,
submod = null,
tab = null,
mod = false 
) [inherited]

Constructor.

Parameters:
$desc description
$action string include in the url
$classCss class for CSS like "supprimer" or other class define in the CSS global.css
$paramString add "&$param=" at the very end of the url

Definition at line 140 of file PageGenerator.php.

References ActionItem::$action, ActionItem::$classCss, ActionItem::$desc, ActionItem::$mod, $module, ActionItem::$paramString, and $submod.

Referenced by ActionPopupItem().

00140                                                                                                                             {
00141         $this->desc=$desc;
00142         $this->action=$action;
00143         $this->classCss=$classCss;
00144         $this->paramString=$paramString;
00145         if ($module == null) $this->module = $_GET["module"];
00146         else $this->module = $module;
00147         if ($submod == null) $this->submod = $_GET["submod"];
00148         else $this->submod = $submod;
00149         $this->tab = $tab;
00150         $this->mod = $mod;
00151         $this->path = $this->module . "/" . $this->submod . "/" . $this->action;
00152         if ($this->tab != null) {
00153             $this->path .= "/" . $this->tab;
00154         }
00155     }

ActionPopupItem::ActionPopupItem ( desc,
action,
classCss,
paramString,
module = null,
submod = null,
tab = null,
width = 300,
mod = false 
)

Definition at line 248 of file PageGenerator.php.

References ActionItem::$action, ActionItem::$classCss, ActionItem::$desc, ActionItem::$mod, $module, ActionItem::$paramString, $submod, ActionItem::ActionItem(), and setWidth().

00248                                                                                                                                                {
00249         $this->ActionItem($desc, $action, $classCss, $paramString, $module, $submod, $tab, $mod);
00250         $this->setWidth($width);
00251     }

Here is the call graph for this function:

ActionItem::buildUrlChunk ( arr  )  [inherited]

Build an URL chunk using a array of option => value.

Definition at line 219 of file PageGenerator.php.

References $arr, and $value.

Referenced by displayWithRight(), ActionItem::displayWithRight(), encapsulate(), and ActionItem::encapsulate().

00219                                  {
00220         $urlChunk = "";
00221         foreach($arr as $option => $value) {
00222             $urlChunk .= "&" . $option . "=" . urlencode($value);
00223         }
00224         return $urlChunk;
00225     }

ActionItem::display ( param,
extraParams = array() 
) [inherited]

display a link for the action

Parameters:
add &$this->param=$param at the very end of the url display "displayWithRight" if you have correct right

Definition at line 162 of file PageGenerator.php.

References $param, ActionItem::displayWithNoRight(), ActionItem::displayWithRight(), and hasCorrectAcl().

00162                                                      {
00163         if (hasCorrectAcl($this->module,$this->submod,$this->action)) {
00164             $this->displayWithRight($param, $extraParams);
00165         } else {
00166             $this->displayWithNoRight($param, $extraParams);
00167         }
00168     }

Here is the call graph for this function:

ActionItem::displayWithNoRight ( param,
extraParams = array() 
) [inherited]

display function if you don't have the right for this action

Definition at line 188 of file PageGenerator.php.

Referenced by ActionItem::display().

00188                                                                 {
00189         echo "<li class=\"".$this->classCss."\" style=\"opacity: 0.30;\">";
00190         echo "<a title=\"".$this->desc."\" href=\"#\" onclick='return false;'>&nbsp;</a>";
00191         echo "</li>";
00192     }

ActionPopupItem::displayWithRight ( param,
extraParams = array() 
)

display function if you have correct right on this action

Reimplemented from ActionItem.

Definition at line 261 of file PageGenerator.php.

References $param, and ActionItem::buildUrlChunk().

00261                                                               {
00262         /* Add special param for actionPopupItem */
00263         $extraParams['mod'] = $this->mod;
00264         if (is_array($extraParams) & !empty($extraParams)) {
00265             $urlChunk = $this->buildUrlChunk($extraParams);
00266         } else {
00267             $urlChunk = "&amp;" . $this->paramString."=" . rawurlencode($param);
00268         }
00269         echo "<li class=\"".$this->classCss."\">";
00270         echo "<a title=\"".$this->desc."\" href=\"main.php?module=".$this->module."&amp;submod=".$this->submod."&amp;action=" . $this->action . $urlChunk . "\"";
00271         echo " onclick=\"PopupWindow(event,'main.php?module=".$this->module."&amp;submod=".$this->submod."&amp;action=" .$this->action . $urlChunk . "', " . $this->width . "); return false;\">&nbsp;</a>";
00272         echo "</li>";
00273     }

Here is the call graph for this function:

ActionPopupItem::encapsulate ( obj,
extraParams = array() 
)

transform $obj param in link for this action

Reimplemented from ActionItem.

Definition at line 275 of file PageGenerator.php.

References ActionItem::buildUrlChunk().

00275                                                        {
00276         if (is_array($extraParams) & !empty($extraParams)) {
00277             $urlChunk = $this->buildUrlChunk($extraParams);
00278         } else {
00279             $urlChunk = "&amp;" . $this->paramString."=" . rawurlencode($obj);
00280         }
00281         $str= "<a title=\"".$this->desc."\" href=\"main.php?module=".$this->module."&amp;submod=".$this->submod."&amp;action=".$this->action . $urlChunk . "\" ";
00282         $str.= "  onclick=\"showPopup(event,'main.php?module=".$this->module."&amp;submod=".$this->submod."&amp;action=".$this->action . $urlChunk . "', " . $this->width . "); return false;\">";
00283         $str.= "$obj";
00284         $str.=" </a>";
00285         return $str;
00286     }

Here is the call graph for this function:

ActionPopupItem::setWidth ( width  ) 

Set the JavaScript popup width.

The default width value is 300px.

Definition at line 257 of file PageGenerator.php.

Referenced by ActionPopupItem().

00257                               {
00258         $this->width = $width;
00259     }

ActionItem::strHelp (  )  [inherited]

display help (not use for the moment)

Definition at line 231 of file PageGenerator.php.

00231                        {
00232         $str = "";
00233         $str.= "<li class=\"".$this->classCss."\">";
00234         $str.= "<a title=\"".$this->desc."\" href=\"#\">";
00235         $str.= " </a>".$this->desc."</li>";
00236         return $str;
00237     }


Field Documentation

ActionItem::$action [inherited]

Definition at line 127 of file PageGenerator.php.

Referenced by ActionItem::ActionItem(), and ActionPopupItem().

ActionItem::$classCss [inherited]

Definition at line 128 of file PageGenerator.php.

Referenced by ActionItem::ActionItem(), and ActionPopupItem().

ActionItem::$desc [inherited]

Definition at line 126 of file PageGenerator.php.

Referenced by ActionItem::ActionItem(), and ActionPopupItem().

ActionItem::$mod [inherited]

Definition at line 130 of file PageGenerator.php.

Referenced by ActionItem::ActionItem(), and ActionPopupItem().

ActionItem::$paramString [inherited]

Definition at line 129 of file PageGenerator.php.

Referenced by ActionItem::ActionItem(), and ActionPopupItem().


The documentation for this class was generated from the following file:

Generated on Tue May 4 11:48:03 2010 for MMC web interface by  doxygen 1.5.8