diff --git a/module/program/ui/browse.html.php b/module/program/ui/browse.html.php index b255b96162..dd1bfcedfe 100644 --- a/module/program/ui/browse.html.php +++ b/module/program/ui/browse.html.php @@ -8,9 +8,26 @@ foreach($this->lang->program->featureBar['browse'] as $key => $label) $toolbar->append($tab); } +if(common::hasPriv('project', 'batchEdit') and $programType != 'bygrid' and $hasProject === true) +{ + $toolbar->append(html::checkbox('editProject', array('1' => $lang->project->edit), '', $this->cookie->editProject ? 'checked=checked' : '')); +} +$toolbar->append(' ' . $lang->user->search . ''); + +$actionbar = actionbar(); +if(common::hasPriv('project', 'create')) +{ + $button = button(' ' . $this->lang->project->create)->link($this->createLink('project', 'createGuide', "programID=0&from=PGM"))->misc('class="btn btn-secondary" data-toggle="modal" data-target="#guideDialog"'); + $actionbar->append($button); +} +if(isset($lang->pageActions)) +{ + $actionbar->append($lang->pageActions); +} + $menu = block('h'); $menu->toolbar = $toolbar; -//$menu->actionbar = '
actionbar
'; +$menu->actionbar = $actionbar; $page = page('list'); $page->top->menu = $menu; diff --git a/zin/wg.func.php b/zin/wg.func.php index dc56a04aba..3e32663218 100644 --- a/zin/wg.func.php +++ b/zin/wg.func.php @@ -10,3 +10,4 @@ function button($text = '', $v = 0) {return wgFactory('button', $text);} function select($text = '', $v = 0) {return wgFactory('select', $text);} function tab($text = '', $v = 0) {return wgFactory('tab', $text);} function toolbar($text = '', $v = 0) {return wgFactory('toolbar', $text);} +function actionbar($text = '', $v = 0) {return wgFactory('actionbar', $text);} diff --git a/zin/wg/actionbar/v1.php b/zin/wg/actionbar/v1.php new file mode 100644 index 0000000000..886d7e0c16 --- /dev/null +++ b/zin/wg/actionbar/v1.php @@ -0,0 +1,29 @@ +children[] = $item; + } + + public function toString() + { + $html = '
'; + foreach($this->children as $child) + { + if(is_string($child)) + { + $html .= $child; + continue; + } + $html .= $child->toString(); + } + return $html . '
'; + } +} diff --git a/zin/wg/button/v1.php b/zin/wg/button/v1.php index fcc12c3840..c967280eb4 100644 --- a/zin/wg/button/v1.php +++ b/zin/wg/button/v1.php @@ -1,12 +1,42 @@ text = $text; } - public function label() + public function link($link) { - $this-> + $this->link = $link; + return $this; + } + + public function target($target = '') + { + $this->target = $target; + return $this; + } + + public function misc($misc) + { + $this->misc = $misc; + return $this; + } + + public function newline($newline = true) + { + $this->newline = $newline; + return $this; + } + + public function toString() + { + return html::a($this->link, $this->text, $this->target, $this->misc, $this->newline); } } diff --git a/zin/wg/toolbar/v1.php b/zin/wg/toolbar/v1.php index c30a6bd1f5..68a449e7b4 100644 --- a/zin/wg/toolbar/v1.php +++ b/zin/wg/toolbar/v1.php @@ -17,6 +17,11 @@ class toolbar $html = '
'; foreach($this->children as $child) { + if(is_string($child)) + { + $html .= $child; + continue; + } $html .= $child->toString(); } return $html . '
';