本文整理汇总了PHP中paloSantoGrid::addButtonAction方法的典型用法代码示例。如果您正苦于以下问题:PHP paloSantoGrid::addButtonAction方法的具体用法?PHP paloSantoGrid::addButtonAction怎么用?PHP paloSantoGrid::addButtonAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类paloSantoGrid
的用法示例。
在下文中一共展示了paloSantoGrid::addButtonAction方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listPackages
function listPackages($smarty, $module_name, $local_templates_dir, $arrConf)
{
$oPackages = new PaloSantoPackages($arrConf['ruta_yum']);
$submitInstalado = getParameter('submitInstalado');
$nombre_paquete = getParameter('nombre_paquete');
$smarty->assign(array('module_name' => $module_name, 'RepositoriesUpdate' => _tr('Repositories Update'), 'Search' => _tr('Search'), 'UpdatingRepositories' => _tr('Updating Repositories'), 'InstallPackage' => _tr('Installing Package'), 'UpdatePackage' => _tr('Updating Package'), 'accionEnProceso' => _tr('There is an action in process'), 'msgConfirmDelete' => _tr('You will uninstall package along with everything what it depends on it. System can lose important functionalities or become unstable! Are you sure want to Uninstall?'), 'msgConfirmInstall' => _tr('Are you sure want to Install this package?'), 'UninstallPackage' => _tr('Uninstalling Package'), 'msgConfirmUpdate' => _tr('Are you sure want to Update this package?')));
$arrPaquetes = $oPackages->listarPaquetes($submitInstalado == 'all' ? 'all' : 'installed', $nombre_paquete);
if ($oPackages->bActualizar) {
$smarty->assign("mb_title", _tr("Message"));
$smarty->assign("mb_message", _tr("The repositories are not up to date. Click on the") . " <b>\"" . _tr('Repositories Update') . "\"</b> " . _tr("button to list all available packages."));
}
// Pagination
$limit = 20;
$total = count($arrPaquetes);
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $oGrid->getEnd();
$arrPaquetes = array_slice($arrPaquetes, $offset, $limit);
$arrData = array();
foreach ($arrPaquetes as $paquete) {
$packageActions = array();
$tmpPaquete = $paquete['name'] . '.' . $paquete['arch'];
if ($paquete['canupdate']) {
$packageActions[] = "<a href='#' onclick=" . "confirmUpdate('{$tmpPaquete}')" . ">[" . _tr('Update') . "]</a>";
}
if (is_null($paquete['version'])) {
$packageActions[] = "<a href='#' onclick=" . "installaPackage('{$tmpPaquete}',0)" . ">[" . _tr('Install') . "]</a>";
} else {
$packageActions[] = "<a href='#' onclick=" . "confirmDelete('{$tmpPaquete}')" . ">[" . _tr('Uninstall') . "]</a>";
}
$rowData = array($paquete['name'], $paquete['arch'], $paquete['summary'], is_null($paquete['version']) ? _tr('(not installed)') : $paquete['version'] . '-' . $paquete['release'], is_null($paquete['latestversion']) ? _tr('(not available)') : $paquete['latestversion'] . '-' . $paquete['latestrelease'], $paquete['repo'], implode(' ', $packageActions));
if ($paquete['canupdate']) {
$rowData[0] = '<b>' . $rowData[0] . '</b>';
$rowData[4] = '<b>' . $rowData[4] . '</b>';
}
$arrData[] = $rowData;
}
$url = array('menu' => $module_name, 'submitInstalado' => $submitInstalado, 'nombre_paquete' => $nombre_paquete);
$arrGrid = array("title" => _tr('Packages'), "icon" => "web/apps/{$module_name}/images/system_updates_packages.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "url" => $url, "columns" => array(array("name" => _tr("Package Name")), array("name" => _tr("Architecture")), array("name" => _tr("Package Info")), array('name' => _tr('Current Version')), array('name' => _tr('Available Version')), array("name" => _tr("Repositor Place")), array("name" => _tr("Status"))));
/*Inicio Parte del Filtro*/
$arrFilter = filterField();
$oFilterForm = new paloForm($smarty, $arrFilter);
if (getParameter('submitInstalado') == 'all') {
$arrFilter["submitInstalado"] = 'all';
$tipoPaquete = _tr('All Package');
} else {
$arrFilter["submitInstalado"] = 'installed';
$tipoPaquete = _tr('Package Installed');
}
$arrFilter["nombre_paquete"] = $nombre_paquete;
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Status") . " = {$tipoPaquete}", $arrFilter, array("submitInstalado" => "installed"), true);
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Name") . " = {$nombre_paquete}", $arrFilter, array("nombre_paquete" => ""));
$oGrid->addButtonAction('update_repositorios', _tr('Repositories Update'), null, 'mostrarReloj()');
$oGrid->showFilter($oFilterForm->fetchForm("{$local_templates_dir}/new.tpl", '', $arrFilter));
return $oGrid->fetchGrid($arrGrid, $arrData);
}
示例2: listRepositories
function listRepositories($smarty, $module_name, $local_templates_dir, $arrConf)
{
global $arrLang;
$oRepositories = new PaloSantoRepositories();
$arrReposActivos = array();
$typeRepository = getParameter("typeRepository");
if (isset($_POST['submit_aceptar'])) {
foreach ($_POST as $key => $value) {
if (substr($key, 0, 5) == 'repo-') {
$arrReposActivos[] = substr($key, 5);
}
}
$oRepositories->setRepositorios($arrConf['ruta_repos'], $arrReposActivos, $typeRepository, $arrConf["main_repos"]);
}
$option["main"] = "";
$option["others"] = "";
$option["all"] = "";
$arrRepositorios = $oRepositories->getRepositorios($arrConf['ruta_repos'], $typeRepository, $arrConf["main_repos"]);
$limit = 40;
$total = count($arrRepositorios);
$oGrid = new paloSantoGrid($smarty);
$oGrid->setLimit($limit);
$oGrid->setTotal($total);
$offset = $oGrid->calculateOffset();
$end = $oGrid->getEnd();
$arrData = array();
$version = $oRepositories->obtenerVersionDistro();
$arch = $oRepositories->obtenerArquitectura();
// print($arch);
if (is_array($arrRepositorios)) {
for ($i = $offset; $i < $end; $i++) {
$activo = "";
if ($arrRepositorios[$i]['activo']) {
$activo = "checked='checked'";
}
$arrData[] = array("<input {$activo} name='repo-" . $arrRepositorios[$i]['id'] . "' type='checkbox' id='repo-{$i}' />", $valor = str_replace(array("\$releasever", "\$basearch"), array($version, $arch), $arrRepositorios[$i]['name']));
}
}
if (isset($typeRepository)) {
$oGrid->setURL("?menu={$module_name}&typeRepository={$typeRepository}");
$_POST["typeRepository"] = $typeRepository;
} else {
$oGrid->setURL("?menu={$module_name}");
$_POST["typeRepository"] = "main";
}
$arrGrid = array("title" => $arrLang["Repositories"], "icon" => "modules/repositories/images/system_updates_repositories.png", "width" => "99%", "start" => $total == 0 ? 0 : $offset + 1, "end" => $end, "total" => $total, "columns" => array(0 => array("name" => $arrLang["Active"], "property1" => ""), 1 => array("name" => $arrLang["Name"], "property1" => "")));
$oGrid->customAction('submit_aceptar', _tr('Save/Update'));
$oGrid->addButtonAction("default", _tr('Default'), null, "defaultValues({$total},'{$version}','{$arch}')");
$FilterForm = new paloForm($smarty, createFilter());
$arrOpt = array("main" => _tr('Main'), "others" => _tr('Others'), "all" => _tr('All'));
if (isset($arrOpt[$typeRepository])) {
$valorfiltro = $arrOpt[$typeRepository];
} else {
$valorfiltro = _tr('Main');
}
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("Repo") . " = " . $valorfiltro, $_POST, array("typeRepository" => "main"), true);
$htmlFilter = $FilterForm->fetchForm("{$local_templates_dir}/new.tpl", "", $_POST);
$oGrid->showFilter($htmlFilter);
$contenidoModulo = $oGrid->fetchGrid($arrGrid, $arrData, $arrLang);
return $contenidoModulo;
}
示例3: reportOrganization
//.........这里部分代码省略.........
$url['fname'] = $arrProp["name"];
$url['fstate'] = $arrProp["state"];
$url['fdomain'] = $arrProp["domain"];
$oGrid->setTitle(_tr('Organization List'));
$oGrid->setURL($url);
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
$arrColumns = array();
if ($credentials["userlevel"] == "superadmin") {
$arrColumns[] = "";
//delete
}
if (in_array('access_DID', $arrPermission)) {
$arrColumns[] = "";
//did
}
$arrColumns[] = _tr("Domain");
$arrColumns[] = _tr("Name");
$arrColumns[] = _tr("State");
$arrColumns[] = _tr("Number of Users");
$arrColumns[] = _tr("Country Code") . " / " . _tr("Area Code");
$arrColumns[] = _tr("Email Qouta") . " (MB)";
$oGrid->setColumns($arrColumns);
$arrDatosGrid = array();
if ($total != 0) {
if ($credentials["userlevel"] == "superadmin") {
$arrProp["limit"] = $limit;
$arrProp["offset"] = $offset;
$arrOrgs = $pOrganization->getOrganization($arrProp);
} else {
$arrOrgs = $pOrganization->getOrganization($arrProp);
}
}
if ($arrOrgs === FALSE) {
$smarty->assign("mb_title", _tr("Error"));
$smarty->assign("mb_message", _tr($pOrganization->errMsg));
} else {
foreach ($arrOrgs as $value) {
$arrTmp = array();
if ($credentials["userlevel"] == "superadmin") {
$arrTmp[] = "<input type='checkbox' class='chk_id' value='{$value['id']}' />";
//checkbox selet
}
if (in_array('access_DID', $arrPermission)) {
$arrTmp[] = " <a href='?menu={$module_name}&action=reportDIDs&domain=" . $value['domain'] . "'>" . _tr("Assign DIDs") . "</a>";
//did
}
$arrTmp[] = " <a href='?menu={$module_name}&action=view&id=" . $value['id'] . "'>" . htmlentities($value['domain'], ENT_COMPAT, 'UTF-8') . "</a>";
$arrTmp[] = htmlentities($value['name'], ENT_COMPAT, 'UTF-8');
if ($value['state'] == 'active') {
$arrTmp[] = "<span class='font-green'>" . _tr($value['state']) . "</span>";
} elseif ($value['state'] == 'suspend') {
$arrTmp[] = "<span class='font-orange'>" . _tr($value['state']) . "</span>";
} else {
$arrTmp[] = "<span class='font-red'>" . _tr($value['state']) . "</span>";
}
$arrTmp[] = $pOrganization->getNumUserByOrganization($value['id']);
$cCode = $pOrganization->getOrganizationProp($value['id'], "country_code");
$aCode = $pOrganization->getOrganizationProp($value['id'], "area_code");
$eQuota = $pOrganization->getOrganizationProp($value['id'], "email_quota");
$tmpcode = $cCode === false ? _tr("NONE") : $cCode;
$tmpcode .= $aCode === false ? _tr("NONE") : " / " . $aCode;
$arrTmp[] = $tmpcode;
$arrTmp[] = $eQuota === false ? _tr("NONE") : $eQuota;
$arrDatosGrid[] = $arrTmp;
}
}
if ($credentials['userlevel'] == "superadmin") {
$oGrid->addNew("new_organization", _tr("Create Organization"));
$stateButton = '<select name="state_orgs" id="state_orgs">';
$stateButton .= '<option label="' . _tr("Suspend") . '" value="suspend">' . _tr("Suspend") . '</option>';
$stateButton .= '<option label="' . _tr("Unsuspend") . '" value="unsuspend">' . _tr("Unsuspend") . '</option>';
$stateButton .= '<option label="' . _tr("Terminate") . '" value="terminate">' . _tr("Terminate") . '</option>';
$stateButton .= "</select>";
$stateButton .= '<input type="button" name="button_state" value="' . _tr("Change State") . '" onclick="change_state();" class="neo-table-action">';
$stateButton .= '<input type="hidden" name="msg_ch_alert" id="msg_ch_alert" value="' . _tr("Are you sure you wish change the states of checked organizations to: ") . "STATE_NAME\n" . _tr("This process can take several minutes") . '">';
$oGrid->addHTMLAction($stateButton);
$oGrid->addButtonAction("del_orgs", _tr("Delete"), "{$arrConf['webCommon']}/images/delete5.png", "delete_orgs();");
//filter
$smarty->assign('USERLEVEL', $credentials['userlevel']);
$smarty->assign('SEARCH', "<input name='search_org' type='submit' class='button' value='" . _tr('Search') . "'>");
$arrState = array("all" => _tr("All"), "active" => _tr("Active"), "suspend" => _tr("Suspend"), "terminate" => _tr("terminate"));
$_POST['fname'] = $arrProp['name'];
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("fname") . " = {$arrProp['name']}", $_POST, array("fname" => ''));
$_POST['fdomain'] = $arrProp['domain'];
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("fdomain") . " = {$arrProp['domain']}", $_POST, array("fdomain" => ''));
$_POST['fstate'] = isset($arrState[$arrProp['state']]) ? $arrProp['state'] : 'all';
$oGrid->addFilterControl(_tr("Filter applied ") . _tr("State") . " = " . $arrState[$_POST['fstate']], $_POST, array("fstate" => 'all'), true);
$arrFormFilter = createFilterForm($arrState);
$oFilterForm = new paloForm($smarty, $arrFormFilter);
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", "", $_POST);
$oGrid->showFilter(trim($htmlFilter));
}
$content = $oGrid->fetchGrid(array(), $arrDatosGrid);
$mensaje = showMessageReload($module_name, $pDB, $credentials);
$content = $mensaje . $content;
return $content;
}
示例4: reportContact
//.........这里部分代码省略.........
$tmp[] = $value['username'];
} else {
$tmp[] = "N/A";
}
if ($validatedfilters['table'] != "internal") {
if ($value['status'] == "isPrivate") {
$tmp[] = _tr('Private');
} else {
$tmp[] = _tr('Public');
}
} else {
$tmp[] = _tr('Public');
}
$arrDatosGrid[] = $tmp;
}
} else {
//data para mostrar en las grillas
foreach ($contacts as $value) {
$tmp = array();
if ($validatedfilters['table'] == "internal") {
$tmp[] = "<input type='checkbox' name='checkContacts' id='{$value['id']}' disabled >";
} else {
if ($arrCredentials['idUser'] == $value['iduser']) {
$tmp[] = "<input type='checkbox' name='checkContacts' id='{$value['id']}'>";
} else {
$tmp[] = "<input type='checkbox' name='checkContacts' id='{$value['id']}' disabled >";
}
}
if ($validatedfilters['table'] == "internal") {
$tmp[] = "<img id='img-users' width='16' height='16' alt='image' src='index.php?menu=_elastixutils&action=getImage&ID={$value['id']}&rawmode=yes'/>";
} else {
$tmp[] = "<img id='img-users' width='16' height='16' alt='image' src='index.php?menu={$module_name}&action=getImageExtContact&image={$value['picture']}&rawmode=yes'/>";
}
if ($validatedfilters['table'] == "internal") {
$tmp[] = htmlentities($value['name'], ENT_QUOTES, "UTF-8");
} else {
if ($arrCredentials['idUser'] == $value['iduser']) {
$tmp[] = "<a href='#' onclick='editContact({$value['id']})'>" . htmlentities($value['name'], ENT_QUOTES, "UTF-8") . "</a>";
} else {
$tmp[] = htmlentities($value['name'], ENT_QUOTES, "UTF-8");
}
}
if ($validatedfilters['table'] == "internal") {
$tmp[] = htmlentities($value['extension'], ENT_QUOTES, "UTF-8");
} else {
if (empty($value['work_phone'])) {
$tmp[] = "N/A";
} else {
$tmp[] = htmlentities($value['work_phone'], ENT_QUOTES, "UTF-8");
}
}
if (!empty($value['username'])) {
$tmp[] = htmlentities($value['username'], ENT_QUOTES, "UTF-8");
} else {
$tmp[] = "N/A";
}
//$tmp[]="<span class='glyphicon glyphicon-earphone'></span>";
$tmp[] = "<a href='#' onclick='callContact({$value['id']})'><span class='glyphicon glyphicon-earphone'></span></a>";
if ($validatedfilters['table'] == "internal") {
//$tmp[]=_tr('Transfer');
$tmp[] = "<a href='#' onclick='transferCall({$value['id']})'>" . _tr('Transfer') . "</a>";
} else {
$tmp[] = "N/A";
}
if ($validatedfilters['table'] != "internal") {
if ($value['status'] == "isPrivate") {
$tmp[] = _tr('Private');
} else {
$tmp[] = _tr('Public');
}
} else {
$tmp[] = _tr('Public');
}
$arrDatosGrid[] = $tmp;
}
}
}
$action = getParameter('action');
if ($action == 'search') {
$arrData['url'] = $oGrid->getURL();
$arrData['url'] = str_replace('&', '&', $arrData['url']);
$arrData['numPage'] = $numPage;
$arrData['currentPage'] = $currentPage;
$arrData['content'] = $arrDatosGrid;
$jsonObject->set_message($arrData);
return $jsonObject->createJSON();
}
$oGrid->addButtonAction("new_contact", "<span class='glyphicon glyphicon-user'></span> New Contact", "", "newContact()");
$oGrid->addButtonAction("remove_contact", "<span class='glyphicon glyphicon-remove'></span> Delete Contacts", "", "deleteContacts('" . _tr("Are you sure you wish to delete the contact.") . "')");
$oGrid->addButtonAction("elx_upload_file", "<span class='glyphicon glyphicon-upload'></span> Upload from CSV", "", "");
$oGrid->addButtonAction("elx_export_data", "<span class='glyphicon glyphicon-download'></span>", "", "");
$oGrid->addButtonAction("elx_show_filter", "<span class='glyphicon glyphicon-filter'></span> Show filter", "", "");
$arrayData = array();
$arrFormFilter = createFilterForm();
$oFilterForm = new paloForm($smarty, $arrFormFilter);
$htmlFilter = $oFilterForm->fetchForm("{$local_templates_dir}/filter.tpl", _tr('extension'), $arrayData);
$oGrid->showFilter(trim($htmlFilter));
$contenidoModulo = actionsReport($arrDatosGrid, $oGrid);
return $contenidoModulo;
}
示例5: showCallers
//.........这里部分代码省略.........
$date = time();
if ($date >= strtotime($conference["startTime"]) && $date <= strtotime($conference["endtime"]) || $conference["startTime"] == "1900-01-01 12:00:00") {
$room = $conference["confno"];
$total = $conference["members"];
} else {
$smarty->assign("mb_title", _tr("ERROR"));
$smarty->assign("mb_message", _tr("Conference out of Time"));
return reportConference($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $credentials);
}
}
$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('Conference') . ": {$conference['name']} ({$conference['ext_conf']})");
//$oGrid->setIcon('url de la imagen');
$oGrid->setWidth("99%");
$oGrid->setStart($total == 0 ? 0 : $offset + 1);
$oGrid->setEnd($end);
$oGrid->setTotal($total);
$oGrid->setURL($url = "?menu={$module_name}&action=current_conf&id_conf={$id_conf}");
//permission
$invite_part = in_array("admin_conference_participant", $arrPermission);
$arrColum = array();
$arrColum[] = _tr("Orden Join");
$arrColum[] = _tr("CallerId");
$arrColum[] = _tr("Time in Conference");
$arrColum[] = _tr("Mode");
if ($invite_part) {
$arrColum[] = "<input type='button' name='mute_caller' value=" . _tr("Mute") . " class='button' onclick='javascript:muteCaller()'/>";
$msgKill = _tr("Are you sure you wish to Kick all caller (s)?");
$arrColum[] = "<input type='button' name='kick_caller' value=" . _tr("Kick") . " class='button' onclick=\"javascript:kickCaller('{$msgKill}');\"/>";
}
$oGrid->setColumns($arrColum);
$arrData = array();
$arrMemb = array();
if ($total != 0) {
$arrMemb = $pConf->ObtainCallers($room);
}
$session = getSession();
if ($arrMemb === false) {
$error = _tr("Error getting conference data.") . $pConf->errMsg;
} else {
$membPagg = array_slice($arrMemb, $offset, $limit);
foreach ($membPagg as $memb) {
$arrTmp = array();
$arrTmp[0] = $memb['userId'];
$arrTmp[1] = trim($memb['callerId']);
$arrTmp[2] = $memb['duration'];
$arrTmp[3] = empty($memb['mode']) ? "user" : "admin";
if ($invite_part) {
$status = strstr($memb['status'], "Muted");
//falso si no encuentra la palabra en el arreglo
$checked = empty($status) ? "" : "checked";
$arrTmp[4] = "<input type='checkbox' name=mute_{$memb['userId']} class='conf_mute' {$checked}>";
$arrTmp[5] = "<input type='checkbox' name=kick_{$memb['userId']} class='conf_kick'>";
}
$arrData[] = $arrTmp;
//se usa para comprobar si ha habido cambios en el estado de las conferencias
$session['conference']["current_conf"][$memb['userId']] = $memb['callerId'];
}
}
//se escribe en session el estado actual de las conferencias
if (!isset($session['conference']["current_conf"])) {
$session['conference']["current_conf"] = array();
}
putSession($session);
//filters
$extens = $pConf->getAllDevice($domain);
$arrExten = array("" => "--unselected--");
if ($extens != false) {
$astMang = AsteriskManagerConnect($errorM);
$result = $pConf->getCodeByDomain($domain);
foreach ($extens as $value) {
$cidname = "";
if ($astMang != false && $result != false) {
$cidname = $astMang->database_get("EXTUSER/" . $result["code"] . "/" . $value["exten"], "cidname");
}
$arrExten[$value["dial"]] = isset($cidname) ? $cidname . " <{$value["exten"]}>" : $value["exten"] . " ({$value["dial"]})";
}
}
if ($invite_part) {
$oGrid->addComboAction("invite_caller", _tr("Invite Caller"), $arrExten, "Invite Caller to Conference", "invite_caller", "javascript:inviteCaller()");
$oGrid->addButtonAction("kick_all", $alt = "Kick All Callers", "../web/_common/images/delete5.png", "javascript:kickAll('{$msgKill}')");
$oGrid->addButtonAction("mute_all", $alt = "Mute All Callers", null, "javascript:muteAll()");
}
if ($error != "") {
$smarty->assign("mb_title", _tr("MESSAGE"));
$smarty->assign("mb_message", $error);
}
$contenidoModulo = $oGrid->fetchGrid(array(), $arrData);
$contenidoModulo .= "<input type='hidden' name='id_conf' id='id_conf' value='{$id_conf}'>";
$contenidoModulo .= "<input type='hidden' name='organization' id='organization' value='{$domain}'>";
$contenidoModulo .= "<input type='hidden' name='grid_limit' id='grid_limit' value='{$limit}'>";
$contenidoModulo .= "<input type='hidden' name='grid_offset' id='grid_offset' value='{$offset}'>";
$contenidoModulo .= "<input type='hidden' name='conf_action' id='conf_action' value='showCallers'>";
return $contenidoModulo;
}