/** * Add single page action * * You can use set of two params where first param is title and second one * is URL (the default set) and you can use array of actions as first * parram mapped like $title => $url * * @access public * @param string $title * @param string $url * @return PageAction */ function add_page_action() { $args = func_get_args(); if (!is_array($args) || !count($args)) { return; } // Array of data as first param mapped like $title => $url if (is_array(array_var($args, 0))) { foreach (array_var($args, 0) as $title => $url) { if (!empty($title) && !empty($url)) { PageActions::instance()->addAction(new PageAction($title, $url)); } // if } // foreach // Two string params, title and URL } else { $title = array_var($args, 0); $url = array_var($args, 1); if (!empty($title) && !empty($url)) { PageActions::instance()->addAction(new PageAction($title, $url)); } // if } // if }
/** * Add single page action * * You can use set of two params where first param is title and second one * is URL (the default set) and you can use array of actions as first * parram mapped like $title => $url * * @access public * @param string $title * @param string $url * @return PageAction */ function add_page_action() { $args = func_get_args(); if (!is_array($args) || !count($args)) { return; } // Array of data as first param mapped like $title => $url if (is_array(array_var($args, 0))) { foreach (array_var($args, 0) as $title => $url) { if (!empty($title) && !empty($url)) { PageActions::instance()->addAction(new PageAction($title, $url, array_var($args, 1))); } // if } // foreach // Four string params, title, URL and name } else { $title = array_var($args, 0); $url = array_var($args, 1); $name = array_var($args, 2); $target = array_var($args, 3); $attributes = array_var($args, 4); $isCommon = array_var($args, 5); if (!empty($title) && !empty($url)) { PageActions::instance()->addAction(new PageAction($title, $url, $name, $target, $attributes, $isCommon)); } // if } // if }
<tr> <td class="coViewHeader coViewSmallHeader" colspan=2 rowspan=2><div class="coViewPropertiesHeader"><?php echo lang("actions"); ?> </div></td> <td class="coViewTopRight"></td> </tr> <tr><td class="coViewRight" rowspan=2></td></tr> <tr> <td class="coViewBody" colspan=2> <?php if (count(PageActions::instance()->getActions()) > 0) { ?> <div id="actionsDialog1"> <?php $pactions = PageActions::instance()->getActions(); $shown = 0; foreach ($pactions as $action) { if ($action->isCommon) { //if it is a common action sets the style display:block if ($action->getTarget() != '') { ?> <a id="<?php $atrib = $action->getAttributes(); echo array_var($atrib, 'id'); ?> " style="display:block" class="coViewAction <?php echo $action->getName(); ?> " href="<?php echo $action->getURL();