function RenderListOptions() { global $Security, $Language, $objForm; $this->ListOptions->LoadDefault(); // Set up row action and key if (is_numeric($this->RowIndex) && $this->CurrentMode != "view") { $objForm->Index = $this->RowIndex; $ActionName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormActionName); $OldKeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormOldKeyName); $KeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormKeyName); $BlankRowName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormBlankRowName); if ($this->RowAction != "") { $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $ActionName . "\" id=\"" . $ActionName . "\" value=\"" . $this->RowAction . "\">"; } if ($this->RowAction == "delete") { $rowkey = $objForm->GetValue($this->FormKeyName); $this->SetupKeyValues($rowkey); } if ($this->RowAction == "insert" && $this->CurrentAction == "F" && $this->EmptyRow()) { $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $BlankRowName . "\" id=\"" . $BlankRowName . "\" value=\"1\">"; } } // "delete" if ($this->AllowAddDeleteRow) { if ($this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit") { $option =& $this->ListOptions; $option->UseButtonGroup = TRUE; // Use button group for grid delete button $option->UseImageAndText = TRUE; // Use image and text for grid delete button $oListOpt =& $option->Items["griddelete"]; if (is_numeric($this->RowIndex) && ($this->RowAction == "" || $this->RowAction == "edit")) { // Do not allow delete existing record $oListOpt->Body = " "; } else { $oListOpt->Body = "<a class=\"ewGridLink ewGridDelete\" title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"javascript:void(0);\" onclick=\"ew_DeleteGridRow(this, " . $this->RowIndex . ");\">" . $Language->Phrase("DeleteLink") . "</a>"; } } } // "copy" $oListOpt =& $this->ListOptions->Items["copy"]; if (($this->CurrentAction == "add" || $this->CurrentAction == "copy") && $this->RowType == EW_ROWTYPE_ADD) { // Inline Add/Copy $this->ListOptions->CustomItem = "copy"; // Show copy column only $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineInsert\" title=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit();\">" . $Language->Phrase("InsertLink") . "</a> " . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $this->PageUrl() . "a=cancel\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"insert\"></div>"; return; } // "edit" $oListOpt =& $this->ListOptions->Items["edit"]; if ($this->CurrentAction == "edit" && $this->RowType == EW_ROWTYPE_EDIT) { // Inline-Edit $this->ListOptions->CustomItem = "edit"; // Show edit column only $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineUpdate\" title=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit('" . ew_GetHashUrl($this->PageName(), $this->PageObjName . "_row_" . $this->RowCnt) . "');\">" . $Language->Phrase("UpdateLink") . "</a> " . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $this->PageUrl() . "a=cancel\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"update\"></div>"; $oListOpt->Body .= "<input type=\"hidden\" name=\"k" . $this->RowIndex . "_key\" id=\"k" . $this->RowIndex . "_key\" value=\"" . ew_HtmlEncode($this->id_tramite->CurrentValue . $GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"] . $this->fecha->CurrentValue . $GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"] . $this->hora->CurrentValue) . "\">"; return; } // "view" $oListOpt =& $this->ListOptions->Items["view"]; if ($Security->CanView()) { $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>"; } else { $oListOpt->Body = ""; } // "edit" $oListOpt =& $this->ListOptions->Items["edit"]; if ($Security->CanEdit()) { $oListOpt->Body .= "<a class=\"ewRowLink ewInlineEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" href=\"" . ew_HtmlEncode(ew_GetHashUrl($this->InlineEditUrl, $this->PageObjName . "_row_" . $this->RowCnt)) . "\">" . $Language->Phrase("InlineEditLink") . "</a>"; } else { $oListOpt->Body = ""; } // "copy" $oListOpt =& $this->ListOptions->Items["copy"]; if ($Security->CanAdd()) { $oListOpt->Body .= "<a class=\"ewRowLink ewInlineCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("InlineCopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InlineCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->InlineCopyUrl) . "\">" . $Language->Phrase("InlineCopyLink") . "</a>"; } else { $oListOpt->Body = ""; } // "checkbox" $oListOpt =& $this->ListOptions->Items["checkbox"]; $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->id_tramite->CurrentValue . $GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"] . $this->fecha->CurrentValue . $GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"] . $this->hora->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event, this);'>"; if ($this->CurrentAction == "gridedit" && is_numeric($this->RowIndex)) { $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $KeyName . "\" id=\"" . $KeyName . "\" value=\"" . $this->id_tramite->CurrentValue . $GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"] . $this->fecha->CurrentValue . $GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"] . $this->hora->CurrentValue . "\">"; } $this->RenderListOptionsExt(); // Call ListOptions_Rendered event $this->ListOptions_Rendered(); }
function RenderListOptions() { global $Security, $Language, $objForm; $this->ListOptions->LoadDefault(); // Set up row action and key if (is_numeric($this->RowIndex) && $this->CurrentMode != "view") { $objForm->Index = $this->RowIndex; $ActionName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormActionName); $OldKeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormOldKeyName); $KeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormKeyName); $BlankRowName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormBlankRowName); if ($this->RowAction != "") { $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $ActionName . "\" id=\"" . $ActionName . "\" value=\"" . $this->RowAction . "\">"; } if ($this->RowAction == "delete") { $rowkey = $objForm->GetValue($this->FormKeyName); $this->SetupKeyValues($rowkey); } if ($this->RowAction == "insert" && $this->CurrentAction == "F" && $this->EmptyRow()) { $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $BlankRowName . "\" id=\"" . $BlankRowName . "\" value=\"1\">"; } } // "copy" $oListOpt =& $this->ListOptions->Items["copy"]; if (($this->CurrentAction == "add" || $this->CurrentAction == "copy") && $this->RowType == EW_ROWTYPE_ADD) { // Inline Add/Copy $this->ListOptions->CustomItem = "copy"; // Show copy column only $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineInsert\" title=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit();\">" . $Language->Phrase("InsertLink") . "</a> " . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $this->PageUrl() . "a=cancel\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"insert\"></div>"; return; } // "edit" $oListOpt =& $this->ListOptions->Items["edit"]; if ($this->CurrentAction == "edit" && $this->RowType == EW_ROWTYPE_EDIT) { // Inline-Edit $this->ListOptions->CustomItem = "edit"; // Show edit column only $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineUpdate\" title=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit('" . ew_GetHashUrl($this->PageName(), $this->PageObjName . "_row_" . $this->RowCnt) . "');\">" . $Language->Phrase("UpdateLink") . "</a> " . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $this->PageUrl() . "a=cancel\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"update\"></div>"; $oListOpt->Body .= "<input type=\"hidden\" name=\"k" . $this->RowIndex . "_key\" id=\"k" . $this->RowIndex . "_key\" value=\"" . ew_HtmlEncode($this->codigo->CurrentValue) . "\">"; return; } // "view" $oListOpt =& $this->ListOptions->Items["view"]; if ($Security->CanView() && $this->ShowOptionLink('view')) { $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>"; } else { $oListOpt->Body = ""; } // "edit" $oListOpt =& $this->ListOptions->Items["edit"]; if ($Security->CanEdit() && $this->ShowOptionLink('edit')) { $oListOpt->Body = "<a class=\"ewRowLink ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . "</a>"; $oListOpt->Body .= "<a class=\"ewRowLink ewInlineEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" href=\"" . ew_HtmlEncode(ew_GetHashUrl($this->InlineEditUrl, $this->PageObjName . "_row_" . $this->RowCnt)) . "\">" . $Language->Phrase("InlineEditLink") . "</a>"; } else { $oListOpt->Body = ""; } // "copy" $oListOpt =& $this->ListOptions->Items["copy"]; if ($Security->CanAdd() && $this->ShowOptionLink('add')) { $oListOpt->Body = "<a class=\"ewRowLink ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("CopyLink") . "</a>"; $oListOpt->Body .= "<a class=\"ewRowLink ewInlineCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("InlineCopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InlineCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->InlineCopyUrl) . "\">" . $Language->Phrase("InlineCopyLink") . "</a>"; } else { $oListOpt->Body = ""; } // "delete" $oListOpt =& $this->ListOptions->Items["delete"]; if ($Security->CanDelete() && $this->ShowOptionLink('delete')) { $oListOpt->Body = "<a class=\"ewRowLink ewDelete\"" . "" . " title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . "</a>"; } else { $oListOpt->Body = ""; } // "checkbox" $oListOpt =& $this->ListOptions->Items["checkbox"]; $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->codigo->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event, this);'>"; $this->RenderListOptionsExt(); // Call ListOptions_Rendered event $this->ListOptions_Rendered(); }
function RenderListOptions() { global $Security, $Language, $objForm; $this->ListOptions->LoadDefault(); // Set up row action and key if (is_numeric($this->RowIndex) && $this->CurrentMode != "view") { $objForm->Index = $this->RowIndex; $ActionName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormActionName); $OldKeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormOldKeyName); $KeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormKeyName); $BlankRowName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormBlankRowName); if ($this->RowAction != "") { $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $ActionName . "\" id=\"" . $ActionName . "\" value=\"" . $this->RowAction . "\">"; } if ($this->RowAction == "delete") { $rowkey = $objForm->GetValue($this->FormKeyName); $this->SetupKeyValues($rowkey); } if ($this->RowAction == "insert" && $this->CurrentAction == "F" && $this->EmptyRow()) { $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $BlankRowName . "\" id=\"" . $BlankRowName . "\" value=\"1\">"; } } // "delete" if ($this->AllowAddDeleteRow) { if ($this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit") { $option =& $this->ListOptions; $option->UseButtonGroup = TRUE; // Use button group for grid delete button $option->UseImageAndText = TRUE; // Use image and text for grid delete button $oListOpt =& $option->Items["griddelete"]; if (!$Security->CanDelete() && is_numeric($this->RowIndex) && ($this->RowAction == "" || $this->RowAction == "edit")) { // Do not allow delete existing record $oListOpt->Body = " "; } else { $oListOpt->Body = "<a class=\"ewGridLink ewGridDelete\" title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" onclick=\"return ew_DeleteGridRow(this, " . $this->RowIndex . ");\">" . $Language->Phrase("DeleteLink") . "</a>"; } } } // "copy" $oListOpt =& $this->ListOptions->Items["copy"]; if (($this->CurrentAction == "add" || $this->CurrentAction == "copy") && $this->RowType == EW_ROWTYPE_ADD) { // Inline Add/Copy $this->ListOptions->CustomItem = "copy"; // Show copy column only $cancelurl = $this->AddMasterUrl($this->PageUrl() . "a=cancel"); $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineInsert\" title=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit('" . $this->AddMasterUrl($this->PageName()) . "');\">" . $Language->Phrase("InsertLink") . "</a> " . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $cancelurl . "\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"insert\"></div>"; return; } // "edit" $oListOpt =& $this->ListOptions->Items["edit"]; if ($this->CurrentAction == "edit" && $this->RowType == EW_ROWTYPE_EDIT) { // Inline-Edit $this->ListOptions->CustomItem = "edit"; // Show edit column only $cancelurl = $this->AddMasterUrl($this->PageUrl() . "a=cancel"); $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineUpdate\" title=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit('" . ew_GetHashUrl($this->AddMasterUrl($this->PageName()), $this->PageObjName . "_row_" . $this->RowCnt) . "');\">" . $Language->Phrase("UpdateLink") . "</a> " . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $cancelurl . "\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"update\"></div>"; $oListOpt->Body .= "<input type=\"hidden\" name=\"k" . $this->RowIndex . "_key\" id=\"k" . $this->RowIndex . "_key\" value=\"" . ew_HtmlEncode($this->item_id->CurrentValue) . "\">"; return; } // "view" $oListOpt =& $this->ListOptions->Items["view"]; if ($Security->CanView()) { $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>"; } else { $oListOpt->Body = ""; } // "edit" $oListOpt =& $this->ListOptions->Items["edit"]; if ($Security->CanEdit()) { $oListOpt->Body = "<a class=\"ewRowLink ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . "</a>"; $oListOpt->Body .= "<a class=\"ewRowLink ewInlineEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" href=\"" . ew_HtmlEncode(ew_GetHashUrl($this->InlineEditUrl, $this->PageObjName . "_row_" . $this->RowCnt)) . "\">" . $Language->Phrase("InlineEditLink") . "</a>"; } else { $oListOpt->Body = ""; } // "copy" $oListOpt =& $this->ListOptions->Items["copy"]; if ($Security->CanAdd()) { $oListOpt->Body = "<a class=\"ewRowLink ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("CopyLink") . "</a>"; $oListOpt->Body .= "<a class=\"ewRowLink ewInlineCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("InlineCopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InlineCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->InlineCopyUrl) . "\">" . $Language->Phrase("InlineCopyLink") . "</a>"; } else { $oListOpt->Body = ""; } // "delete" $oListOpt =& $this->ListOptions->Items["delete"]; if ($Security->CanDelete()) { $oListOpt->Body = "<a class=\"ewRowLink ewDelete\"" . "" . " title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . "</a>"; } else { $oListOpt->Body = ""; } // Set up list action buttons $oListOpt =& $this->ListOptions->GetItem("listactions"); if ($oListOpt) { $body = ""; $links = array(); foreach ($this->ListActions->Items as $listaction) { if ($listaction->Select == EW_ACTION_SINGLE && $listaction->Allow) { $action = $listaction->Action; $caption = $listaction->Caption; $icon = $listaction->Icon != "" ? "<span class=\"" . ew_HtmlEncode(str_replace(" ewIcon", "", $listaction->Icon)) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\"></span> " : ""; $links[] = "<li><a class=\"ewAction ewListAction\" data-action=\"" . ew_HtmlEncode($action) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\" href=\"\" onclick=\"ew_SubmitAction(event,jQuery.extend({key:" . $this->KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $icon . $listaction->Caption . "</a></li>"; if (count($links) == 1) { // Single button $body = "<a class=\"ewAction ewListAction\" data-action=\"" . ew_HtmlEncode($action) . "\" title=\"" . ew_HtmlTitle($caption) . "\" data-caption=\"" . ew_HtmlTitle($caption) . "\" href=\"\" onclick=\"ew_SubmitAction(event,jQuery.extend({key:" . $this->KeyToJson() . "}," . $listaction->ToJson(TRUE) . "));return false;\">" . $Language->Phrase("ListActionButton") . "</a>"; } } } if (count($links) > 1) { // More than one buttons, use dropdown $body = "<button class=\"dropdown-toggle btn btn-default btn-sm ewActions\" title=\"" . ew_HtmlTitle($Language->Phrase("ListActionButton")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("ListActionButton") . "<b class=\"caret\"></b></button>"; $content = ""; foreach ($links as $link) { $content .= "<li>" . $link . "</li>"; } $body .= "<ul class=\"dropdown-menu" . ($oListOpt->OnLeft ? "" : " dropdown-menu-right") . "\">" . $content . "</ul>"; $body = "<div class=\"btn-group\">" . $body . "</div>"; } if (count($links) > 0) { $oListOpt->Body = $body; $oListOpt->Visible = TRUE; } } // "checkbox" $oListOpt =& $this->ListOptions->Items["checkbox"]; $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->item_id->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event);'>"; if ($this->CurrentAction == "gridedit" && is_numeric($this->RowIndex)) { $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $KeyName . "\" id=\"" . $KeyName . "\" value=\"" . $this->item_id->CurrentValue . "\">"; } $this->RenderListOptionsExt(); // Call ListOptions_Rendered event $this->ListOptions_Rendered(); }
function RenderListOptions() { global $Security, $Language, $objForm; $this->ListOptions->LoadDefault(); // Set up row action and key if (is_numeric($this->RowIndex) && $this->CurrentMode != "view") { $objForm->Index = $this->RowIndex; $ActionName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormActionName); $OldKeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormOldKeyName); $KeyName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormKeyName); $BlankRowName = str_replace("k_", "k" . $this->RowIndex . "_", $this->FormBlankRowName); if ($this->RowAction != "") { $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $ActionName . "\" id=\"" . $ActionName . "\" value=\"" . $this->RowAction . "\">"; } if ($this->RowAction == "delete") { $rowkey = $objForm->GetValue($this->FormKeyName); $this->SetupKeyValues($rowkey); } if ($this->RowAction == "insert" && $this->CurrentAction == "F" && $this->EmptyRow()) { $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $BlankRowName . "\" id=\"" . $BlankRowName . "\" value=\"1\">"; } } // "delete" if ($this->AllowAddDeleteRow) { if ($this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit") { $option =& $this->ListOptions; $option->UseButtonGroup = TRUE; // Use button group for grid delete button $option->UseImageAndText = TRUE; // Use image and text for grid delete button $oListOpt =& $option->Items["griddelete"]; if (!$Security->CanDelete() && is_numeric($this->RowIndex) && ($this->RowAction == "" || $this->RowAction == "edit")) { // Do not allow delete existing record $oListOpt->Body = " "; } else { $oListOpt->Body = "<a class=\"ewGridLink ewGridDelete\" title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"javascript:void(0);\" onclick=\"ew_DeleteGridRow(this, " . $this->RowIndex . ");\">" . $Language->Phrase("DeleteLink") . "</a>"; } } } // "sequence" $oListOpt =& $this->ListOptions->Items["sequence"]; $oListOpt->Body = ew_FormatSeqNo($this->RecCnt); // "copy" $oListOpt =& $this->ListOptions->Items["copy"]; if (($this->CurrentAction == "add" || $this->CurrentAction == "copy") && $this->RowType == EW_ROWTYPE_ADD) { // Inline Add/Copy $this->ListOptions->CustomItem = "copy"; // Show copy column only $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineInsert\" title=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InsertLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit();\">" . $Language->Phrase("InsertLink") . "</a> " . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $this->PageUrl() . "a=cancel\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"insert\"></div>"; return; } // "edit" $oListOpt =& $this->ListOptions->Items["edit"]; if ($this->CurrentAction == "edit" && $this->RowType == EW_ROWTYPE_EDIT) { // Inline-Edit $this->ListOptions->CustomItem = "edit"; // Show edit column only $oListOpt->Body = "<div" . ($oListOpt->OnLeft ? " style=\"text-align: right\"" : "") . ">" . "<a class=\"ewGridLink ewInlineUpdate\" title=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("UpdateLink")) . "\" href=\"\" onclick=\"return ewForms(this).Submit('" . ew_GetHashUrl($this->PageName(), $this->PageObjName . "_row_" . $this->RowCnt) . "');\">" . $Language->Phrase("UpdateLink") . "</a> " . "<a class=\"ewGridLink ewInlineCancel\" title=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CancelLink")) . "\" href=\"" . $this->PageUrl() . "a=cancel\">" . $Language->Phrase("CancelLink") . "</a>" . "<input type=\"hidden\" name=\"a_list\" id=\"a_list\" value=\"update\"></div>"; $oListOpt->Body .= "<input type=\"hidden\" name=\"k" . $this->RowIndex . "_key\" id=\"k" . $this->RowIndex . "_key\" value=\"" . ew_HtmlEncode($this->codigo->CurrentValue) . "\">"; return; } // "view" $oListOpt =& $this->ListOptions->Items["view"]; if ($Security->CanView()) { $oListOpt->Body = "<a class=\"ewRowLink ewView\" title=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("ViewLink")) . "\" href=\"" . ew_HtmlEncode($this->ViewUrl) . "\">" . $Language->Phrase("ViewLink") . "</a>"; } else { $oListOpt->Body = ""; } // "edit" $oListOpt =& $this->ListOptions->Items["edit"]; if ($Security->CanEdit()) { $oListOpt->Body = "<a class=\"ewRowLink ewEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("EditLink")) . "\" href=\"" . ew_HtmlEncode($this->EditUrl) . "\">" . $Language->Phrase("EditLink") . "</a>"; $oListOpt->Body .= "<a class=\"ewRowLink ewInlineEdit\" title=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InlineEditLink")) . "\" href=\"" . ew_HtmlEncode(ew_GetHashUrl($this->InlineEditUrl, $this->PageObjName . "_row_" . $this->RowCnt)) . "\">" . $Language->Phrase("InlineEditLink") . "</a>"; } else { $oListOpt->Body = ""; } // "copy" $oListOpt =& $this->ListOptions->Items["copy"]; if ($Security->CanAdd()) { $oListOpt->Body = "<a class=\"ewRowLink ewCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("CopyLink")) . "\" href=\"" . ew_HtmlEncode($this->CopyUrl) . "\">" . $Language->Phrase("CopyLink") . "</a>"; $oListOpt->Body .= "<a class=\"ewRowLink ewInlineCopy\" title=\"" . ew_HtmlTitle($Language->Phrase("InlineCopyLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("InlineCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->InlineCopyUrl) . "\">" . $Language->Phrase("InlineCopyLink") . "</a>"; } else { $oListOpt->Body = ""; } // "delete" $oListOpt =& $this->ListOptions->Items["delete"]; if ($Security->CanDelete()) { $oListOpt->Body = "<a class=\"ewRowLink ewDelete\"" . "" . " title=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("DeleteLink")) . "\" href=\"" . ew_HtmlEncode($this->DeleteUrl) . "\">" . $Language->Phrase("DeleteLink") . "</a>"; } else { $oListOpt->Body = ""; } $DetailViewTblVar = ""; $DetailCopyTblVar = ""; $DetailEditTblVar = ""; // "detail_seguimiento_tramites" $oListOpt =& $this->ListOptions->Items["detail_seguimiento_tramites"]; if ($Security->AllowList(CurrentProjectID() . 'seguimiento_tramites')) { $body = $Language->Phrase("DetailLink") . $Language->TablePhrase("seguimiento_tramites", "TblCaption"); $body .= str_replace("%c", $this->seguimiento_tramites_Count, $Language->Phrase("DetailCount")); $body = "<a class=\"btn btn-default btn-sm ewRowLink ewDetail\" data-action=\"list\" href=\"" . ew_HtmlEncode("cciag_seguimiento_tramiteslist.php?" . EW_TABLE_SHOW_MASTER . "=tramites&fk_codigo=" . strval($this->codigo->CurrentValue) . "") . "\">" . $body . "</a>"; $links = ""; if ($GLOBALS["seguimiento_tramites_grid"]->DetailView && $Security->CanView() && $Security->AllowView(CurrentProjectID() . 'seguimiento_tramites')) { $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=seguimiento_tramites")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>"; if ($DetailViewTblVar != "") { $DetailViewTblVar .= ","; } $DetailViewTblVar .= "seguimiento_tramites"; } if ($GLOBALS["seguimiento_tramites_grid"]->DetailEdit && $Security->CanEdit() && $Security->AllowEdit(CurrentProjectID() . 'seguimiento_tramites')) { $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=seguimiento_tramites")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>"; if ($DetailEditTblVar != "") { $DetailEditTblVar .= ","; } $DetailEditTblVar .= "seguimiento_tramites"; } if ($GLOBALS["seguimiento_tramites_grid"]->DetailAdd && $Security->CanAdd() && $Security->AllowAdd(CurrentProjectID() . 'seguimiento_tramites')) { $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=seguimiento_tramites")) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>"; if ($DetailCopyTblVar != "") { $DetailCopyTblVar .= ","; } $DetailCopyTblVar .= "seguimiento_tramites"; } if ($links != "") { $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewDetail\" data-toggle=\"dropdown\"><b class=\"caret\"></b></button>"; $body .= "<ul class=\"dropdown-menu\">" . $links . "</ul>"; } $body = "<div class=\"btn-group\">" . $body . "</div>"; $oListOpt->Body = $body; if ($this->ShowMultipleDetails) { $oListOpt->Visible = FALSE; } } if ($this->ShowMultipleDetails) { $body = $Language->Phrase("MultipleMasterDetails"); $body = "<div class=\"btn-group\">"; $links = ""; if ($DetailViewTblVar != "") { $links .= "<li><a class=\"ewRowLink ewDetailView\" data-action=\"view\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" href=\"" . ew_HtmlEncode($this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailViewTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailViewLink")) . "</a></li>"; } if ($DetailEditTblVar != "") { $links .= "<li><a class=\"ewRowLink ewDetailEdit\" data-action=\"edit\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailEditLink")) . "\" href=\"" . ew_HtmlEncode($this->GetEditUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailEditTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailEditLink")) . "</a></li>"; } if ($DetailCopyTblVar != "") { $links .= "<li><a class=\"ewRowLink ewDetailCopy\" data-action=\"add\" data-caption=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailCopyLink")) . "\" href=\"" . ew_HtmlEncode($this->GetCopyUrl(EW_TABLE_SHOW_DETAIL . "=" . $DetailCopyTblVar)) . "\">" . ew_HtmlImageAndText($Language->Phrase("MasterDetailCopyLink")) . "</a></li>"; } if ($links != "") { $body .= "<button class=\"dropdown-toggle btn btn-default btn-sm ewMasterDetail\" title=\"" . ew_HtmlTitle($Language->Phrase("MultipleMasterDetails")) . "\" data-toggle=\"dropdown\">" . $Language->Phrase("MultipleMasterDetails") . "<b class=\"caret\"></b></button>"; $body .= "<ul class=\"dropdown-menu ewMenu\">" . $links . "</ul>"; } $body .= "</div>"; // Multiple details $oListOpt =& $this->ListOptions->Items["details"]; $oListOpt->Body = $body; } // "checkbox" $oListOpt =& $this->ListOptions->Items["checkbox"]; $oListOpt->Body = "<input type=\"checkbox\" name=\"key_m[]\" value=\"" . ew_HtmlEncode($this->codigo->CurrentValue) . "\" onclick='ew_ClickMultiCheckbox(event, this);'>"; if ($this->CurrentAction == "gridedit" && is_numeric($this->RowIndex)) { $this->MultiSelectKey .= "<input type=\"hidden\" name=\"" . $KeyName . "\" id=\"" . $KeyName . "\" value=\"" . $this->codigo->CurrentValue . "\">"; } $this->RenderListOptionsExt(); // Call ListOptions_Rendered event $this->ListOptions_Rendered(); }