From 86e76aef335f0c026f1ffb66bf807b2aa0f6a566 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 1 Nov 2022 12:10:43 +0800 Subject: [PATCH] * Add comment of zin and program. --- module/program/ui/browse.html.php | 5 ++- zin/wg/actionbar/v1.php | 49 ++++++++++++++++++--- zin/wg/button/v1.php | 71 +++++++++++++++++++++++++++++++ zin/wg/tab/v1.php | 56 ++++++++++++++++++++++++ zin/wg/toolbar/v1.php | 48 ++++++++++++++++++--- 5 files changed, 214 insertions(+), 15 deletions(-) diff --git a/module/program/ui/browse.html.php b/module/program/ui/browse.html.php index 6e40494d5a..ffb7e48ec3 100644 --- a/module/program/ui/browse.html.php +++ b/module/program/ui/browse.html.php @@ -1,6 +1,7 @@ lang->program->featureBar['browse'] as $key => $label) { @@ -12,8 +13,10 @@ if(common::hasPriv('project', 'batchEdit') and $programType != 'bygrid' and $has { $toolbar->append(html::checkbox('editProject', array('1' => $lang->project->edit), '', $this->cookie->editProject ? 'checked=checked' : '')); } + $toolbar->append(' ' . $lang->user->search . ''); +/* Set actionbar. */ $actionbar = actionbar(); if(common::hasPriv('project', 'create')) { diff --git a/zin/wg/actionbar/v1.php b/zin/wg/actionbar/v1.php index 3cfd2f1302..092092c052 100644 --- a/zin/wg/actionbar/v1.php +++ b/zin/wg/actionbar/v1.php @@ -1,29 +1,64 @@ + * @package actionbar + * @version $Id + * @link https://www.zentao.net + */ class actionbar extends wg { - private $children = array(); + /** + * Action list. + * + * @var array + * @access private + */ + private $actions = array(); - public function __construct($text = '') + /** + * Construct function. + * + * @access public + * @return void + */ + public function __construct() { parent::__construct(); } + /** + * Set action data. + * + * @param object $item + * @access public + * @return void + */ public function append($item) { - $this->children[] = $item; + $this->actions[] = $item; } + /** + * Get actionbar html. + * + * @access public + * @return string + */ public function toString() { $html = '
'; - foreach($this->children as $child) + foreach($this->actions as $action) { - if(is_string($child)) + if(is_string($action)) { - $html .= $child; + $html .= $action; continue; } - $html .= $child->toString(); + + $html .= $action->toString(); } return $html . '
'; } diff --git a/zin/wg/button/v1.php b/zin/wg/button/v1.php index 596bf0017f..26925d9f50 100644 --- a/zin/wg/button/v1.php +++ b/zin/wg/button/v1.php @@ -1,35 +1,106 @@ + * @package button + * @version $Id + * @link https://www.zentao.net + */ class button extends wg { + /** + * Button url. + * + * @var string + * @access public + */ public $link = ''; + + /** + * Jump mode. + * + * @var string + * @access public + */ public $target = ''; + + /** + * Miscellaneous. + * + * @var string + * @access public + */ public $misc = ''; + + /** + * Whether to wrap. + * + * @var bool + * @access public + */ public $newline = true; + /** + * Construct function, init tab data. + * + * @param string $text + * @access public + * @return void + */ public function __construct($text) { parent::__construct(); $this->text = $text; } + /** + * Set Button url. + * + * @param string $link + * @access public + * @return object + */ public function link($link) { $this->link = $link; return $this; } + /** + * Set button jump mode. + * + * @param string $target + * @access public + * @return object + */ public function target($target = '') { $this->target = $target; return $this; } + /** + * Set attribute. + * + * @param string $misc + * @access public + * @return object + */ public function misc($misc) { $this->misc = $misc; return $this; } + /** + * Set button newline. + * + * @param bool $newline + * @access public + * @return object + */ public function newline($newline = true) { $this->newline = $newline; diff --git a/zin/wg/tab/v1.php b/zin/wg/tab/v1.php index a42396b943..d9968b77e9 100644 --- a/zin/wg/tab/v1.php +++ b/zin/wg/tab/v1.php @@ -1,28 +1,84 @@ + * @package tab + * @version $Id + * @link https://www.zentao.net + */ class tab extends wg { + /** + * Tab content. + * + * @var string + * @access private + */ private $text; + /** + * Active status. + * + * @var bool + * @access private + */ private $isActive; + /** + * Tab url. + * + * @var string + * @access private + */ + private $link; + + /** + * Construct function, init tab data. + * + * @param string $text + * @access public + * @return void + */ public function __construct($text) { parent::__construct(); $this->text = $text; } + /** + * Set active status. + * + * @param bool $isActive + * @access public + * @return object + */ public function active($isActive) { $this->isActive = $isActive; return $this; } + /** + * Set tab url. + * + * @param string $link + * @access public + * @return object + */ public function link($link) { $this->link = $link; return $this; } + /** + * Get tab html. + * + * @access public + * @return string + */ public function toString() { $active = $this->isActive ? 'btn-active-text' : ''; diff --git a/zin/wg/toolbar/v1.php b/zin/wg/toolbar/v1.php index 99d023eba7..1b06955958 100644 --- a/zin/wg/toolbar/v1.php +++ b/zin/wg/toolbar/v1.php @@ -1,29 +1,63 @@ + * @package toolbar + * @version $Id + * @link https://www.zentao.net + */ class toolbar extends wg { - private $children = array(); + /** + * Tool list. + * + * @var array + * @access private + */ + private $tools = array(); - public function __construct($text = '') + /** + * Construct function. + * + * @access public + * @return void + */ + public function __construct() { parent::__construct(); } + /** + * Set tools data. + * + * @param object $item + * @access public + * @return void + */ public function append($item) { - $this->children[] = $item; + $this->tools[] = $item; } + /** + * Get toolbar html. + * + * @access public + * @return string + */ public function toString() { $html = '
'; - foreach($this->children as $child) + foreach($this->tools as $tool) { - if(is_string($child)) + if(is_string($tool)) { - $html .= $child; + $html .= $tool; continue; } - $html .= $child->toString(); + $html .= $tool->toString(); } return $html . '
'; }