本文整理汇总了PHP中commonModel::hasPriv方法的典型用法代码示例。如果您正苦于以下问题:PHP commonModel::hasPriv方法的具体用法?PHP commonModel::hasPriv怎么用?PHP commonModel::hasPriv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类commonModel
的用法示例。
在下文中一共展示了commonModel::hasPriv方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createModuleMenu
public function createModuleMenu($method)
{
if (!isset($this->lang->my->{$method}->menu)) {
return false;
}
$string = "<nav id='menu'><ul class='nav'>\n";
/* Get menus of current module and current method. */
$moduleMenus = $this->lang->my->{$method}->menu;
$currentMethod = $this->app->getMethodName();
/* Cycling to print every menus of current module. */
foreach ($moduleMenus as $methodName => $methodMenu) {
/* Split the methodMenu to label, module, method, vars. */
list($label, $module, $method, $vars) = explode('|', $methodMenu);
$class = '';
if ($method == $currentMethod) {
$class = "class='active'";
}
$hasPriv = commonModel::hasPriv($module, $method);
if ($module == 'my' and $method == 'order') {
$hasPriv = commonModel::hasPriv('order', 'browse');
}
if ($module == 'my' and $method == 'contract') {
$hasPriv = commonModel::hasPriv('contract', 'browse');
}
if ($hasPriv) {
$string .= "<li {$class}>" . html::a(helper::createLink($module, $method, $vars), $label) . "</li>\n";
}
}
$string .= "</ul></nav>\n";
return $string;
}
示例2: getAvailableBlocks
/**
* Get block list.
*
* @access public
* @return string
*/
public function getAvailableBlocks()
{
foreach ($this->lang->block->availableBlocks as $key => $block) {
if (!commonModel::hasPriv($key, 'browse')) {
unset($this->lang->block->availableBlocks->{$key});
}
}
return json_encode($this->lang->block->availableBlocks);
}
示例3: getAvailableBlocks
/**
* Get block list.
*
* @access public
* @return string
*/
public function getAvailableBlocks()
{
foreach ($this->lang->block->availableBlocks as $key => $block) {
$module = $key == 'thread' ? 'forum' : $key;
$method = $key == 'thread' ? 'board' : 'index';
if (!commonModel::hasPriv($module, $method)) {
unset($this->lang->block->availableBlocks->{$key});
}
}
return json_encode($this->lang->block->availableBlocks);
}
示例4: getAvailableBlocks
/**
* Get block list.
*
* @access public
* @return string
*/
public function getAvailableBlocks()
{
foreach ($this->lang->block->availableBlocks as $key => $block) {
$method = $key == 'project' ? 'index' : 'browse';
if ($key == 'attend') {
$method = 'personal';
}
if (!commonModel::hasPriv($key, $method)) {
unset($this->lang->block->availableBlocks->{$key});
}
}
return json_encode($this->lang->block->availableBlocks);
}
示例5:
echo $lang->user->ip;
?>
</th>
<th><?php
echo $lang->user->status;
?>
</th>
<th><?php
echo $lang->actions;
?>
</th>
</tr>
</thead>
<tbody>
<?php
$forbidPriv = commonModel::hasPriv('user', 'forbid');
?>
<?php
foreach ($users as $user) {
?>
<tr class='text-center'>
<td>
<input type='checkbox' name='account[]' value='<?php
echo $user->account;
?>
'/>
<?php
echo $user->id;
?>
</td>
<td><?php
示例6: contract
/**
* contract list.
*
* @param string $type
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function contract($type = 'unfinished', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->loadModel('common', 'sys');
if (!commonModel::hasPriv('order', 'browse')) {
$this->common->deny('my', 'order');
}
$this->loadModel('contract', 'crm');
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$contracts = $this->contract->getList(0, $type, $owner = 'my', $orderBy, $pager);
/* Set preAndNext condition. */
$this->session->set('contractQueryCondition', $this->dao->get());
/* Save session for return link. */
$this->session->set('contractList', "javascript:\$.openEntry(\"dashboard\")");
$this->view->title = $this->lang->contract->browse;
$this->view->contracts = $contracts;
$this->view->customers = $this->loadModel('customer', 'crm')->getPairs('client');
$this->view->pager = $pager;
$this->view->type = $type;
$this->view->orderBy = $orderBy;
$this->view->currencySign = $this->loadModel('common', 'sys')->getCurrencySign();
$this->view->currencyList = $this->common->getCurrencyList();
$this->display();
}
示例7:
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yidong Wang <yidong@cnezsoft.com>
* @package purchase
* @version $Id$
* @link http://www.ranzhico.com
*/
include '../../common/view/header.html.php';
js::set('mode', $mode);
?>
<li id='bysearchTab'><?php
echo html::a('#', "<i class='icon-search icon'></i>" . $lang->search->common);
?>
</li>
<div id='menuActions'>
<?php
if (commonModel::hasPriv('purchase', 'export')) {
?>
<div class='btn-group'>
<button data-toggle='dropdown' class='btn btn-primary dropdown-toggle' type='button'><?php
$lang->exportIcon . $lang->export;
?>
<span class='caret'></span></button>
<ul id='exportActionMenu' class='dropdown-menu'>
<li><?php
commonModel::printLink('purchase', 'export', "mode=all&orderBy={$orderBy}", $lang->exportAll, "class='iframe' data-width='700'");
?>
</li>
<li><?php
commonModel::printLink('purchase', 'export', "mode=thisPage&orderBy={$orderBy}", $lang->exportThisPage, "class='iframe' data-width='700'");
?>
</li>
示例8: inlink
include '../../common/view/header.admin.html.php';
js::set('setCounts', $lang->site->setCounts);
js::set('score', commonModel::isAvailable('score'));
?>
<div class='panel'>
<div class='panel-heading'><strong><i class='icon-envelope'></i> <?php
echo $lang->mail->common;
?>
<i class='icon-arrow-right'></i> <?php
echo $lang->mail->save;
?>
</strong></div>
<div class='panel-body'>
<div class='alert alert-success'>
<i class='icon-ok-sign'></i>
<div class='content'><?php
echo $lang->mail->successSaved;
?>
</div>
</div>
<div><?php
if ($this->post->turnon and commonModel::hasPriv('mail', 'test')) {
echo html::linkButton($lang->mail->test, inlink('test'));
}
?>
</div>
</div>
</div>
<?php
include '../../common/view/footer.admin.html.php';
示例9: select
/**
* Create the select code of projects.
*
* @param array $projects
* @param int $projectID
* @param string $currentModule
* @param string $currentMethod
* @param string $extra
* @access public
* @return string
*/
public function select($projects, $projectID, $currentModule, $currentMethod, $extra = '')
{
if (!$projectID) {
return;
}
setCookie("lastProject", $projectID, $this->config->cookieLife, $this->config->webRoot);
$currentProject = $this->getById($projectID);
$methodName = $this->app->getMethodName();
$moduleName = $this->app->getModuleName();
$menu = "<nav id='menu'><ul class='nav'>";
$menu .= "<li><a id='currentItem' href=\"javascript:showDropMenu('project', '{$projectID}', '{$currentModule}', '{$currentMethod}', '{$extra}')\"><i class='icon-folder-open-alt'></i> <strong>{$currentProject->name}</strong> <span class='icon-caret-down'></span></a><div id='dropMenu'></div></li>";
$viewIcons = array('browse' => 'list-ul', 'kanban' => 'columns', 'outline' => 'list-alt');
$this->lang->task->browse = $this->lang->task->list;
if ($methodName == 'browse' or $methodName == 'importtask') {
$menu .= '<li class="divider angle"></li>';
if (isset($currentProject->members[$this->app->user->account])) {
$menu .= commonModel::printLink('task', 'browse', "projectID={$projectID}&mode=assignedTo", $this->lang->task->assignedToMe, '', false, '', 'li');
}
$menu .= commonModel::printLink('task', 'browse', "projectID={$projectID}&mode=all", $this->lang->task->all, '', false, '', 'li');
$menu .= commonModel::printLink('task', 'browse', "projectID={$projectID}&mode=createdBy", $this->lang->task->createdByMe, '', false, '', 'li');
$menu .= commonModel::printLink('task', 'browse', "projectID={$projectID}&mode=finishedBy", $this->lang->task->finishedByMe, '', false, '', 'li');
$menu .= commonModel::printLink('task', 'browse', "projectID={$projectID}&mode=untilToday", $this->lang->task->untilToday, '', false, '', 'li');
$menu .= commonModel::printLink('task', 'browse', "projectID={$projectID}&mode=expired", $this->lang->task->expired, '', false, '', 'li');
} else {
if ($methodName == 'kanban' || $methodName == 'outline') {
$menu .= '<li class="divider angle"></li>';
foreach ($this->lang->task->groups as $key => $value) {
if (empty($key)) {
continue;
}
$menu .= "<li data-group='{$key}'>" . commonModel::printLink('task', $methodName, "projectID={$projectID}&groupBy={$key}", $value, '', false) . "</li>";
}
} else {
if ($methodName == 'view') {
$menu .= '<li class="divider angle"></li>';
$menu .= '<li class="title">' . $this->lang->{$moduleName}->view . '</li>';
} else {
if ($methodName == 'batchcreate') {
$menu .= '<li class="divider angle"></li>';
$menu .= '<li class="title">' . $this->lang->{$moduleName}->batchCreate . '</li>';
} else {
if ($methodName == 'create') {
$menu .= '<li class="divider angle"></li>';
$menu .= '<li class="title">' . $this->lang->{$moduleName}->create . '</li>';
}
}
}
}
}
$menu .= "</ul>";
$menu .= "<div class='pull-right'>" . commonModel::printLink('task', 'create', "projectID={$projectID}", '<i class="icon-sitemap"></i> ' . $this->lang->task->create, 'class="btn btn-primary"', false) . "</div>";
$menu .= "<div class='pull-right'>" . commonModel::printLink('task', 'batchCreate', "projectID={$projectID}", '<i class="icon-plus"></i> ' . $this->lang->task->batchCreate, 'class="btn btn-primary"', false) . "</div>";
$menu .= "<div class='pull-right'>" . commonModel::printLink('project', 'importTask', "projectID={$projectID}", $this->lang->importIcon . $this->lang->project->import, 'class="btn btn-primary"', false) . "</div>";
if (commonModel::hasPriv('task', 'export')) {
$menu .= "<div class='btn-group pull-right'>";
$menu .= "<button data-toggle='dropdown' class='btn btn-primary dropdown-toggle' type='button'>" . $this->lang->exportIcon . $this->lang->export . " <span class='caret'></span></button>";
$menu .= "<ul id='exportActionMenu' class='dropdown-menu w-100px'>";
$menu .= "<li>" . commonModel::printLink('task', 'export', "mode=all&projectID={$projectID}&orderBy={$extra}", $this->lang->exportAll, "class='iframe' data-width='700'", false) . "</li>";
$menu .= "<li>" . commonModel::printLink('task', 'export', "mode=thisPage&projectID={$projectID}&orderBy={$extra}", $this->lang->exportThisPage, "class='iframe' data-width='700'", false) . "</li>";
$menu .= "</ul>";
$menu .= "</div>";
}
if ($methodName == 'browse' || $methodName == 'kanban' || $methodName == 'outline') {
$taskListType = $methodName;
$viewName = $this->lang->task->{$methodName};
$menu .= "<ul class='nav pull-right'>";
$menu .= "<li id='viewBar' class='dropdown'><a href='javascript:;' id='groupButton' data-toggle='dropdown' class='dropdown-toggle'><i class='icon-" . $viewIcons[$methodName] . "'></i> {$viewName} <i class='icon-caret-down'></i></a><ul class='dropdown-menu'>";
$menu .= "<li" . ($methodName == 'browse' ? " class='active'" : '') . ">" . commonModel::printLink('task', 'browse', "projectID={$projectID}", "<i class='icon-list-ul icon'></i> " . $this->lang->task->list, '', false) . "</li>";
$menu .= "<li" . ($methodName == 'kanban' ? " class='active'" : '') . ">" . commonModel::printLink('task', 'kanban', "projectID={$projectID}", "<i class='icon-columns icon'></i> " . $this->lang->task->kanban, '', false) . "</li>";
$menu .= "<li" . ($methodName == 'outline' ? " class='active'" : '') . ">" . commonModel::printLink('task', 'outline', "projectID={$projectID}", "<i class='icon-list-alt icon'></i> " . $this->lang->task->outline, '', false) . "</li>";
$menu .= '</ul></li>';
if ($methodName == 'outline') {
$menu .= '<li><a href="javascript:;" id="toggleAll"><i class="icon-plus"></i></a></li>';
}
$menu .= "</ul>";
}
$menu .= '</nav>';
return $menu;
}
示例10: getAdminCatalog
/**
* Get book catalog for admin.
*
* @param int $nodeID
* @param array $serials the serial number list for all nodes.
* @access public
* @return void
*/
public function getAdminCatalog($nodeID, $serials)
{
$catalog = '';
$node = $this->getNodeByID($nodeID);
if (!$node) {
return $catalog;
}
$children = $this->getChildren($nodeID);
if ($node->type != 'book') {
$serial = $serials[$nodeID];
}
$anchor = "name='node{$node->id}' id='node{$node->id}'";
$titleLink = $node->type == 'book' ? $node->title : html::a(helper::createLink('book', 'admin', "bookID={$node->id}"), $node->title);
$editLink = commonModel::hasPriv('book', 'edit') ? html::a(helper::createLink('book', 'edit', "nodeID={$node->id}"), $this->lang->edit, $anchor) : '';
$delLink = empty($children) ? commonModel::hasPriv('book', 'edit') ? html::a(helper::createLink('book', 'delete', "bookID={$node->id}"), $this->lang->delete, "class='deleter'") : '' : '';
$filesLink = commonModel::hasPriv('file', 'browse') ? html::a(helper::createLink('file', 'browse', "objectType=book&objectID={$node->id}&isImage=0"), $this->lang->book->files, "data-toggle='modal' data-width='1000'") : '';
$catalogLink = commonModel::hasPriv('book', 'catalog') ? html::a(helper::createLink('book', 'catalog', "nodeID={$node->id}"), $this->lang->book->catalog) : '';
$moveLink = commonModel::hasPriv('book', 'sort') ? html::a('javascript:;', "<i class='icon-move'></i>", "class='sort sort-handle'") : '';
$childrenHtml = '';
if ($children) {
$childrenHtml .= '<dl>';
foreach ($children as $child) {
$childrenHtml .= $this->getAdminCatalog($child->id, $serials);
}
$childrenHtml .= '</dl>';
}
if ($node->type == 'book') {
$catalog .= "<dt class='book' data-id='" . $node->id . "'><strong>" . $titleLink . '</strong><span class="actions">' . $editLink . $catalogLink . $delLink . '</span></dt>' . $childrenHtml;
}
if ($node->type == 'chapter') {
$catalog .= "<dd class='catalog chapter' data-id='" . $node->id . "'><strong><span class='order'>" . $serial . '</span> ' . $titleLink . '</strong><span class="actions">' . $editLink . $catalogLink . $delLink . $moveLink . '</span>' . $childrenHtml . '</dd>';
}
if ($node->type == 'article') {
$catalog .= "<dd class='catalog article' data-id='" . $node->id . "'><strong><span class='order'>" . $serial . '</span> ' . $node->title . '</strong><span class="actions">' . $editLink . $filesLink . $delLink . $moveLink . '</span>' . $childrenHtml . '</dd>';
}
return $catalog;
}
示例11: count
* @package ui
* @version $Id$
* @link http://www.chanzhi.org
*/
include '../../common/view/header.admin.html.php';
?>
<div class='panel panel-templates'>
<div class='cards cards-templates' data-template='<?php
echo $this->config->template->{$this->device}->name;
?>
' data-theme='<?php
echo $this->config->template->{$this->device}->theme;
?>
'>
<?php
$customThemePriv = commonModel::hasPriv('ui', 'customTheme');
?>
<?php
foreach ($templates as $code => $template) {
?>
<?php
$desc = $template['desc'];
$count = count($template['themes']);
$isCurrent = $this->config->template->{$this->device}->name == $code;
$themeName = $isCurrent ? $this->config->template->{$this->device}->theme : 'default';
$templateRoot = $webRoot . 'template/' . $code . '/';
?>
<div class='col-card'>
<div class="card-template card<?php
if ($isCurrent) {
echo ' current';
示例12: foreach
commonModel::printOrderLink('createdDate', $orderBy, $vars, $lang->doc->createdDate);
?>
</th>
<th class='w-90px {sorter:false}'><?php
echo $lang->actions;
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($docs as $key => $doc) {
?>
<?php
$viewLink = $this->createLink('doc', 'view', "docID={$doc->id}");
$canView = commonModel::hasPriv('doc', 'view');
?>
<tr class='text-center'>
<td><?php
if ($canView) {
echo html::a($viewLink, sprintf('%03d', $doc->id));
} else {
printf('%03d', $doc->id);
}
?>
</td>
<td class='text-left' title="<?php
echo $doc->title;
?>
"><nobr><?php
echo $canView ? html::a($viewLink, $doc->title) : $doc->title;
示例13:
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Tingting Dai <daitingting@xirangit.com>
* @package order
* @version $Id$
* @link http://www.ranzhico.com
*/
include '../../common/view/header.html.php';
js::set('mode', $mode);
?>
<li id='bysearchTab'><?php
echo html::a('#', "<i class='icon-search icon'></i>" . $lang->search->common);
?>
</li>
<div id='menuActions'>
<?php
if (commonModel::hasPriv('order', 'export')) {
?>
<div class='btn-group'>
<button data-toggle='dropdown' class='btn btn-primary dropdown-toggle' type='button'><?php
echo $lang->exportIcon . $lang->export;
?>
<span class='caret'></span></button>
<ul id='exportActionMenu' class='dropdown-menu'>
<li><?php
commonModel::printLink('order', 'export', "mode=all&&orderBy={$orderBy}", $lang->exportAll, "class='iframe' data-width='700'");
?>
</li>
<li><?php
commonModel::printLink('order', 'export', "mode=thisPage&&orderBy={$orderBy}", $lang->exportThisPage, "class='iframe' data-width='700'");
?>
</li>
示例14:
<?php
}
?>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<td colspan='10'>
<div class='pull-left'><?php
echo html::selectButton() . html::submitButton($lang->close);
?>
</div>
<?php
$pager->show();
?>
</td>
</tr>
</tfoot>
</table>
<?php
if (commonModel::hasPriv('task', 'batchClose')) {
?>
</form>
<?php
}
?>
</div>
<?php
include '../../common/view/footer.html.php';
示例15:
<?php
echo html::hidden('module', $module);
echo html::hidden('actionURL', $actionURL);
echo html::hidden('groupItems', $groupItems);
echo "<div class='btn-group'>";
echo html::submitButton($lang->search->common, 'btn-primary btn', '');
echo html::commonButton($lang->search->reset, 'btn', 'onclick=resetForm();');
echo html::commonButton($lang->save, 'btn', 'onclick=saveQuery()');
echo '</div>';
?>
</td>
<td class='w-120px'>
<div class='input-group'>
<?php
echo html::select('queryID', $queries, $queryID, 'onchange=executeQuery(this.value) class=form-control');
if (commonModel::hasPriv('search', 'deleteQuery')) {
echo "<span class='input-group-btn'>" . html::a('javascript:deleteQuery()', '<i class="icon-remove"></i>', 'class=btn') . '</span>';
}
?>
</div>
</td>
</tr>
</table>
<div id='moreOrLite'>
<a id="searchmore" href="javascript:showmore()"><i class="icon-double-angle-down icon-2x"></i></a>
<a id="searchlite" href="javascript:showlite()"><i class="icon-double-angle-up icon-2x"></i></a>
<?php
echo html::hidden('formType', 'lite');
?>
</div>
</form>