本文整理汇总了PHP中CLink::canCreate方法的典型用法代码示例。如果您正苦于以下问题:PHP CLink::canCreate方法的具体用法?PHP CLink::canCreate怎么用?PHP CLink::canCreate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLink
的用法示例。
在下文中一共展示了CLink::canCreate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
<?php
if (!defined('W2P_BASE_DIR')) {
die('You should not access this file directly.');
}
$tab = $AppUI->processIntState('LinkIdxTab', $_GET, 'tab', 0);
if (isset($_REQUEST['project_id'])) {
$AppUI->setState('LinkIdxProject', w2PgetParam($_REQUEST, 'project_id', null));
}
$project_id = $AppUI->getState('LinkIdxProject') !== null ? $AppUI->getState('LinkIdxProject') : 0;
$link = new CLink();
if (!$link->canAccess()) {
$AppUI->redirect(ACCESS_DENIED);
}
$canCreate = $link->canCreate();
// get the list of visible companies
$extra = array('from' => 'links', 'where' => 'projects.project_id = link_project');
$project = new CProject();
$projects = $project->getAllowedRecords($AppUI->user_id, 'projects.project_id,project_name', 'project_name', null, $extra, 'projects');
$projects = arrayMerge(array('0' => $AppUI->_('All', UI_OUTPUT_JS)), $projects);
$search_string = w2PgetParam($_POST, 'search_string', '');
$AppUI->setState($m . '_search_string', $search_string);
$search_string = w2PformSafe($search_string, true);
// setup the title block
$titleBlock = new w2p_Theme_TitleBlock('Links', 'icon.png', $m);
$titleBlock->addSearchCell($search_string);
$titleBlock->addFilterCell('Filter', 'project_id', $projects, $project_id);
if ($canCreate) {
$titleBlock->addButton('New link', '?m=links&a=addedit');
}
$titleBlock->show();