* Adjust button class for zui3.

This commit is contained in:
tianshujie
2022-11-02 10:32:04 +08:00
parent eb32dd075e
commit 2bd3ae9c67
2 changed files with 15 additions and 15 deletions
+2 -2
View File
@@ -20,13 +20,13 @@ $toolbar->append('<a class="querybox-toggle" id="bysearchTab"><i class="icon ico
$actionbar = actionbar();
if(common::hasPriv('project', 'create'))
{
$button = button('<i class="icon icon-plus"></i> ' . $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('<i class="icon icon-plus"></i> ' . $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'), "<i class='icon icon-plus'></i> " . $this->lang->program->create, '', "class='btn btn-primary create-program-btn'");
$button = button("<i class='icon icon-plus'></i> " . $this->lang->program->create)->link($this->createLink('program', 'create'))->addClass('btn primary');
$actionbar->append($button);
}
+13 -13
View File
@@ -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);
}
}