* @package design * @link https://www.zentao.net */ namespace zin; jsVar('+type', strtolower($type)); jsVar('projectID', $projectID); jsVar('productID', $productID); /* zin: Define the set::module('design') feature bar on main menu. */ featureBar ( li(searchToggle(set::module('design'))) ); /* zin: Define the toolbar on main menu. */ $canCreate = hasPriv('design', 'create'); $canBatchCreate = hasPriv('design', 'batchCreate'); $createItem = array('text' => $lang->design->create, 'url' => helper::createLink('design', 'create', "projectID={$projectID}&productID={$productID}&type={$type}")); $batchCreateItem = array('text' => $lang->design->batchCreate, 'url' => helper::createLink('design', 'batchCreate', "projectID={$projectID}&productID={$productID}&type={$type}")); toolbar ( $canCreate && $canBatchCreate ? btnGroup ( btn(setClass('btn primary'), set::icon('plus'), set::url($createItem['url']), $lang->design->create), dropdown ( btn(setClass('btn primary dropdown-toggle'), setStyle(array('padding' => '6px', 'border-radius' => '0 2px 2px 0'))), set::items(array_filter(array($createItem, $batchCreateItem))), set::placement('bottom-end') ) ) : null, $canCreate && !$canBatchCreate ? item(set($createItem + array('class' => 'btn primary', 'icon' => 'plus'))) : null, $canBatchCreate && !$canCreate ? item(set($batchCreateItem + array('class' => 'btn primary', 'icon' => 'plus'))) : null ); jsVar('confirmDelete', $lang->design->confirmDelete); $tableData = initTableData($designs, $config->design->dtable->fieldList, $this->design); dtable ( set::userMap($users), set::cols($config->design->dtable->fieldList), set::data($tableData), set::footPager( usePager() ) ); /* ====== Render page ====== */ render();