本文整理汇总了PHP中paloSantoGrid::setUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::setUrl方法的具体用法?PHP paloSantoGrid::setUrl怎么用?PHP paloSantoGrid::setUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paloSantoGrid
的用法示例。
在下文中一共展示了paloSantoGrid::setUrl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reportInbound
function reportInbound($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $credentials)
{
global $arrPermission;
$error = "";
$pORGZ = new paloSantoOrganization($pDB);
$domain = getParameter("organization");
$name = getParameter("name");
//
$domain = empty($domain) ? 'all' : $domain;
if ($credentials['userlevel'] != "superadmin") {
$domain = $credentials['domain'];
}
$url['menu'] = $module_name;
$url['organization'] = $domain;
$url['name'] = $name;
if ($credentials['userlevel'] == "superadmin") {
if (isset($domain) && $domain != "all") {
$pInbound = new paloSantoInbound($pDB, $domain);
} else {
$pInbound = new paloSantoInbound($pDB, "");
}
$total = $pInbound->getNumInbound($domain, $name);
$arrOrgz = array("all" => _tr("all"));
foreach ($pORGZ->getOrganization(array()) as $value) {
$arrOrgz[$value["domain"]] = $value["name"];
}
} else {
$arrOrgz = array();
$pInbound = new paloSantoInbound($pDB, $domain);
$total = $pInbound->getNumInbound($domain, $name);
}
if ($total === false) {
$error = $pInbound->errMsg;
$total = 0;
}
$limit = 20;
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $offset + $limit <= $total ? $offset + $limit : $total;
$oGrid->setTitle(_tr('Inbound Routes List'));
$oGrid->setUrl($url);
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
if ($credentials['userlevel'] == "superadmin") {
$arrColumns[] = _tr("Organization");
}
$arrColumns[] = _tr("Description");
$arrColumns[] = _tr("DID Number") . "/" . _tr("CID Number");
$arrColumns[] = _tr("CID Prefix");
$arrColumns[] = _tr("Language");
$arrColumns[] = _tr("Destination");
$oGrid->setColumns($arrColumns);
$arrInbound = array();
$arrData = array();
if ($total != 0) {
$arrInbound = $pInbound->getInbounds($domain, $name, $limit, $offset);
}
if ($arrInbound === false) {
$error = _tr("Error to obtain Inbounds") . $pInbound->errMsg;
$arrInbound = array();
}
foreach ($arrInbound as $inbound) {
$arrTmp = array();
if ($credentials['userlevel'] == 'superadmin') {
$arrTmp[] = $arrOrgz[$inbound['organization_domain']];
}
//organization
$arrTmp[] = " <a href='?menu=inbound_route&action=view&id_inbound=" . $inbound['id'] . "&organization={$inbound['organization_domain']}'>" . htmlentities($inbound['description'], ENT_QUOTES, "UTF-8") . "</a>";
$did = $cid = "";
if ($inbound["did_number"] != "") {
$did = $inbound["did_number"];
}
if ($inbound["cid_number"] != "") {
$cid = $inbound["cid_number"];
}
$arrTmp[] = $did . " / " . $cid;
$arrTmp[] = $inbound["cid_prefix"];
$arrTmp[] = $inbound["language"];
$arrTmp[] = $inbound["destination"];
$arrData[] = $arrTmp;
}
$smarty->assign("USERLEVEL", $credentials['userlevel']);
$smarty->assign("SEARCH", "<input type='submit' class='button' value='" . _tr('Search') . "' name='report'>");
if ($pORGZ->getNumOrganization(array()) >= 1) {
if (in_array('create', $arrPermission)) {
if ($credentials['userlevel'] == 'superadmin') {
$oGrid->addComboAction("organization_add", _tr("ADD Incoming Route"), array_slice($arrOrgz, 1), $selected = null, "create_inbound", $onchange_select = null);
} else {
$oGrid->addNew("create_inbound", _tr("ADD Incoming Route"));
}
}
if ($credentials['userlevel'] == 'superadmin') {
$_POST["organization"] = $domain;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Organization") . " = " . $arrOrgz[$domain], $_POST, array("organization" => "all"), true);
}
$_POST["name"] = $name;
// name inboundrout
//.........这里部分代码省略.........