当前位置: 首页>>代码示例>>PHP>>正文


PHP paloSantoGrid::addLinkAction方法代码示例

本文整理汇总了PHP中paloSantoGrid::addLinkAction方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::addLinkAction方法的具体用法?PHP paloSantoGrid::addLinkAction怎么用?PHP paloSantoGrid::addLinkAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在paloSantoGrid的用法示例。


在下文中一共展示了paloSantoGrid::addLinkAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: viewFormAccount

function viewFormAccount($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $arrLang)
{
    $pEmail = new paloEmail($pDB);
    $oGrid = new paloSantoGrid($smarty);
    $id_domain = 0;
    /*if (isset($_POST['domain'])) $id_domain=$_POST['domain'];
      if (isset($_GET['id_domain'])) $id_domain=$_GET['id_domain'];*/
    if (isset($_POST['domain']) || isset($_GET['domain'])) {
        $id_domain = getParameter('domain');
        if ($id_domain == null) {
            $id_domain = 0;
        }
    }
    $_POST['domain'] = $id_domain;
    $arrDominios = array("0" => '-- ' . $arrLang["Select a domain"] . ' --');
    $arrDomains = $pEmail->getDomains();
    foreach ($arrDomains as $domain) {
        $arrDominios[$domain[0]] = $domain[1];
    }
    $arrFormElements = createFieldFormAccount($arrLang, $arrDominios);
    $oFilterForm = new paloForm($smarty, $arrFormElements);
    $smarty->assign("SHOW", $arrLang["Show"]);
    $smarty->assign("CREATE_ACCOUNT", $arrLang["Create Account"]);
    // $oGrid->pagingShow(true);
    $url = array("menu" => $module_name);
    if ($id_domain == 0) {
        $url = array("menu" => $module_name);
    } else {
        $url = array("menu" => $module_name, "domain" => $id_domain);
    }
    $oGrid->setURL($url);
    $oGrid->setTitle(_tr("Email Account List"));
    ////////////////////////////////////////////////////////////////////////////////////////////////////////
    $arrData = array();
    $pACL = new paloACL(new paloDB($arrConf['elastix_dsn']['acl']));
    $userAccount = isset($_SESSION['elastix_user']) ? $_SESSION['elastix_user'] : "";
    $isAdministrator = $pACL->isUserAdministratorGroup($userAccount);
    $reconstruir = _tr("Reconstruct");
    if ($id_domain > 0) {
        $arrAccounts = $pEmail->getAccountsByDomain($id_domain);
    } else {
        $arrAccounts = $pEmail->getAccountsByDomain();
    }
    if (is_array($arrAccounts)) {
        //username, password, id_domain, quota
        $end = count($arrAccounts);
        //$configPostfix2 = isPostfixToElastix2();// in misc.lib.php
        foreach ($arrAccounts as $account) {
            $arrTmp = array();
            $username = $account[0];
            $arrTmp[0] = "&nbsp;<a href='?menu={$module_name}&action=view&username={$username}'>{$username}</a>";
            $arrTmp[1] = obtener_quota_usuario($pEmail, $username, $module_name, $arrLang, $id_domain);
            if ($isAdministrator) {
                $arrTmp[2] = "&nbsp;<a href='?menu={$module_name}&action=reconstruir&username={$username}&domain={$id_domain}'>{$reconstruir}</a>";
            }
            $link_agregar_direccion = "<a href='?action=add_address&id_domain={$id_domain}&username={$username}'>Add Address</a>";
            $link_modificar_direccion = "<a href='?action=edit_addresses&id_domain={$id_domain}&username={$username}'>Addresses</a>";
            //$arrTmp[3]=$link_agregar_direccion."&nbsp;&nbsp; ".$link_modificar_direccion;
            $arrData[] = $arrTmp;
        }
    } else {
        $smarty->assign("mb_title", _tr("Error"));
        $smarty->assign("mb_message", $pEmail->errMsg);
    }
    $total = count($arrData);
    $limit = 20;
    $oGrid->setLimit($limit);
    $oGrid->setTotal($total);
    $offset = $oGrid->calculateOffset();
    $inicio = $total == 0 ? 0 : $offset + 1;
    $fin = $offset + $limit <= $total ? $offset + $limit : $total;
    $leng = $fin - $inicio;
    $arrDatosGrid = array_slice($arrData, $inicio - 1, $leng + 1);
    if ($isAdministrator) {
        $oGrid->setColumns(array(_tr("Account Name"), _tr("Used Space"), _tr("Reconstruct MailBox")));
    } else {
        $oGrid->setColumns(array(_tr("Account Name"), _tr("Used Space")));
    }
    $arrGrid = array("width" => "99%", "start" => $inicio, "end" => $fin, "total" => $total);
    $oGrid->addComboAction("domain", _tr("Create Account"), $arrDominios, $id_domain, "submit_create_account", "this.form.submit();");
    if ($id_domain != 0) {
        $oGrid->addLinkAction("?menu={$module_name}&action=export&domain={$id_domain}&rawmode=yes", _tr("Export Accounts"));
        $smarty->assign("id_domain", $id_domain);
    }
    $content = $oGrid->fetchGrid($arrGrid, $arrDatosGrid, $arrLang);
    return $content;
}
开发者ID:hardikk,项目名称:HNH,代码行数:87,代码来源:index.php


注:本文中的paloSantoGrid::addLinkAction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。