本文整理汇总了PHP中Device::GetTags方法的典型用法代码示例。如果您正苦于以下问题:PHP Device::GetTags方法的具体用法?PHP Device::GetTags怎么用?PHP Device::GetTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Device
的用法示例。
在下文中一共展示了Device::GetTags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
// insert date formating later for regionalization settings
$date = date("d M Y", strtotime($row["InstallDate"]));
$Model = "";
$Department = "";
if ($row["TemplateID"] > 0) {
$templ->TemplateID = $row["TemplateID"];
$templ->GetTemplateByID();
$Model = "<a href=\"device_templates.php?TemplateID={$templ->TemplateID}\" target=\"template\">{$templ->Model}</a>";
}
if ($row["Owner"] > 0) {
$dept->DeptID = $row["Owner"];
$dept->GetDeptByID();
$Department = $dept->Name;
}
$dev->DeviceID = $row["DeviceID"];
$tags = implode(",", $dev->GetTags());
$body .= "\t\t<tr>\n\t\t\t\t<td><a href=\"dc_stats.php?dc={$row["DataCenterID"]}\" target=\"datacenter\">{$row["DataCenter"]}</a></td>\n\t\t\t\t<td><a href=\"cabnavigator.php?cabinetid={$row["CabinetID"]}\" target=\"cabinet\">{$row["Location"]}</a></td>\n\t\t\t\t<td>{$row["Position"]}</td>\n\t\t\t\t<td>{$row["Height"]}</td>\n\t\t\t\t<td><a href=\"devices.php?DeviceID={$dev->DeviceID}\" target=\"device\">{$row["Label"]}</a></td>\n\t\t\t\t<td>{$row["SerialNo"]}</td>\n\t\t\t\t<td>{$row["AssetTag"]}</td>\n\t\t\t\t<td><a href=\"search.php?key=dev&DeviceType={$row["DeviceType"]}&search\" target=\"search\">{$row["DeviceType"]}</a></td>\n\t\t\t\t<td>{$Model}</td>\n\t\t\t\t<td>{$tags}</td>\n\t\t\t\t<td>{$Department}</td>\n\t\t\t\t<td>{$date}</td>\n\t\t</tr>\n";
if ($row["DeviceType"] == "Chassis") {
// Find all of the children!
$childList = $dev->GetDeviceChildren();
foreach ($childList as $child) {
$cdate = date("d M Y", strtotime($child->InstallDate));
$cModel = "";
$cDepartment = "";
$ctags = implode(",", $child->GetTags());
if ($child->TemplateID > 0) {
$templ->TemplateID = $child->TemplateID;
$templ->GetTemplateByID();
$cModel = "<a href=\"device_templates.php?TemplateID={$templ->TemplateID}\" target=\"template\">{$templ->Model}</a>";
}
if ($child->Owner > 0) {
示例2: getTagsString
/**
* Merge the tags of a Device or Cabinet into one string separated by ', '
*
* @param Device|Cabinet $obj
* @return string
*/
function getTagsString($obj, $emptyVal = null)
{
$tagNames = $emptyVal;
$tag_list = $obj->GetTags();
if (count($tag_list) > 0) {
$tagNames = implode(', ', $tag_list);
}
return $tagNames;
}