本文整理匯總了PHP中CommonGLPI::canUseDirectConnections方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonGLPI::canUseDirectConnections方法的具體用法?PHP CommonGLPI::canUseDirectConnections怎麽用?PHP CommonGLPI::canUseDirectConnections使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CommonGLPI
的用法示例。
在下文中一共展示了CommonGLPI::canUseDirectConnections方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
if (!$withtemplate) {
switch ($item->getType()) {
case __CLASS__:
$tabs = array(1 => __("Main"), 3 => _n("Field", "Fields", 2), 5 => __("Preview"), 6 => _n("Profile", "Profiles", 2));
if ($item->canUseDirectConnections()) {
$tabs[7] = __("Associated element");
}
return $tabs;
}
}
return '';
}
示例2: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
if (!$withtemplate) {
switch ($item->getType()) {
case __CLASS__:
// Number of fields in database
$itemtype = $item->fields['itemtype'];
$obj = new $itemtype();
$obj->getEmpty();
$nb_fields = count($obj->fields);
$tabs = array(1 => __("Main"), 3 => _n("Field", "Fields", 2), 3 => self::createTabEntry(_n("Field", "Fields", Session::getPluralNumber()), $nb_fields), 5 => __("Preview"));
if ($item->canUseDirectConnections()) {
$tabs[7] = __("Associated element");
}
return $tabs;
}
}
return '';
}