diff --git a/module/program/ui/browse.html.php b/module/program/ui/browse.html.php index 5dfa80b0fc..542fe2bb71 100644 --- a/module/program/ui/browse.html.php +++ b/module/program/ui/browse.html.php @@ -20,13 +20,13 @@ $toolbar->append(' ' . $this->lang->project->create)->link($this->createLink('project', 'createGuide', "programID=0&from=PGM"))->misc('class="btn btn-secondary" data-toggle="modal" data-target="#guideDialog"'); + $button = button(' ' . $this->lang->project->create)->link($this->createLink('project', 'createGuide', "programID=0&from=PGM"))->addClass('btn secondary')->misc('data-toggle="modal" data-target="#guideDialog"'); $actionbar->append($button); } if(common::hasPriv('program', 'create')) { - $button = html::a($this->createLink('program', 'create'), " " . $this->lang->program->create, '', "class='btn btn-primary create-program-btn'"); + $button = button(" " . $this->lang->program->create)->link($this->createLink('program', 'create'))->addClass('btn primary'); $actionbar->append($button); } diff --git a/zin/wg/button/v1.php b/zin/wg/button/v1.php index 2657b76e55..5f096ecdb4 100644 --- a/zin/wg/button/v1.php +++ b/zin/wg/button/v1.php @@ -26,6 +26,14 @@ class button extends wg */ public $target = ''; + /** + * Class. + * + * @var string + * @access public + */ + public $class = ''; + /** * Miscellaneous. * @@ -34,14 +42,6 @@ class button extends wg */ public $misc = ''; - /** - * Whether to wrap. - * - * @var bool - * @access public - */ - public $newline = true; - /** * Construct function, init button data. * @@ -95,15 +95,15 @@ class button extends wg } /** - * Set button newline. + * Set class. * - * @param bool $newline + * @param string $class * @access public * @return object */ - public function newline($newline = true) + public function addClass($class) { - $this->newline = $newline; + $this->class = $class; return $this; } @@ -115,6 +115,6 @@ class button extends wg */ public function toString() { - return html::a($this->link, $this->text, $this->target, $this->misc . $this->toHx(), $this->newline); + return html::linkButton($this->text, $this->link, $this->target, $this->misc, $this->class); } }