📁
SKYSHELL MANAGER
PHP v8.2.31
Create
Create
Path:
root
/
home
/
thevaxnx
/
nativize.com
/
staging
/
wp-includes
/
js
/
tinymce
/
themes
/
Name
Size
Perm
Actions
📁
inlite
-
0755
🗑️
🏷️
🔒
📁
modern
-
0755
🗑️
🏷️
🔒
📄
wp-links-opml.php
6.83 KB
0444
🗑️
🏷️
⬇️
✏️
🔒
Edit: pkgform.tmpl
[% # Copyright 2026 WebPros International, LLC # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited. USE Whostmgr; USE JSON; USE NVData; # We fill this below. SET fields_with_help = []; SET extensions_dry_dock = edit ? data.new_available_extensions : data.extensions; # Get initial visibility config for selected package type SET current_visibility = data.package_types_visibility.${data.selected_package_type}; WRAPPER 'master_templates/master.tmpl' theme="yui" app_key = 'add_a_package' scripts = [ '/templates/packages/pkgform.min.js', ], stylesheets = [ '/cjt/css/ajaxapp-min.css', '/templates/common/revised_notices.min.css', '/templates/packages/common.min.css', '/templates/packages/pkgform.min.css', ] -%] <div id="content"> <div id="extensionDryDock"> [% FOREACH package IN extensions_dry_dock.keys %] <div id="[% package %]" class="fatBorder hidden" data-extension="[% package %]"> <fieldset> <div class="propertyGroup"> [% file_to_process = data.extensions_path _ package _ '.tt2' %] [% PROCESS $file_to_process %] </div> </fieldset> </div> [% END %] </div> <!-- end extensionDryDock --> [% IF Whostmgr.hasroot() -%] <div id="resellerNotice" class="notice addEditPkgTopNotice"> <div class="notice-content"> [% locale.maketext("[output,strong,Note]: If a package name is [output,strong,preceded] by a reseller’s username and an underscore, [output,strong,only] that reseller can see the package.") %] </div> </div> [% END -%] <form name="mainform" action="javascript:void(0);" onsubmit="ajax_save(this);"> [%# Package Type Selector - show only when creating and more than one type available %] [% SET selected_pkg_type = data.selected_package_type || data.default_package_type || 'standard'; SET selected_pkg_type_name = ''; SET package_type_feature_labels = {}; # NOTE: This loop intentionally processes ALL package types (no LAST statement) to build # the complete package_type_feature_labels hash. This hash is passed to JavaScript for # dynamic feature list warning messages when users switch between package types. FOREACH package_type IN data.package_types; IF package_type.id == selected_pkg_type; SET selected_pkg_type_name = locale.makevar(package_type.name); END; IF package_type.feature_label; SET package_type_feature_labels.${package_type.id} = package_type.feature_label; END; END; -%] [% IF !edit && data.package_types.size > 1 -%] <div id="packageTypeSelector" class="pkgTypeSelector" data-testid="package-type-selector" data-visibility-config="[% data.package_types_visibility.json().html() %]"> <div id="pkgTypeHeader" class="pkgTypeSelectorHeader" data-testid="package-type-header">[% locale.maketext('Package Type') %]</div> <div class="pkgTypeCards" role="radiogroup" aria-labelledby="pkgTypeHeader" data-testid="package-type-cards"> [% FOREACH pkg_type IN data.package_types -%] <label class="pkgTypeCard[% IF pkg_type.id == selected_pkg_type %] pkgTypeCardSelected[% END %]" for="pkg_type_[% pkg_type.id.html() %]" data-testid="package-type-card-[% pkg_type.id.html() %]"> <input type="radio" id="pkg_type_[% pkg_type.id.html() %]" name="package_type" value="[% pkg_type.id.html() %]" [% IF pkg_type.id == selected_pkg_type %]checked="checked"[% END %] class="pkgTypeRadio" data-testid="package-type-radio-[% pkg_type.id.html() %]" /> <span class="pkgTypeName" data-testid="package-type-name-[% pkg_type.id.html() %]">[% locale.makevar(pkg_type.name).html() %]</span> [% IF pkg_type.description -%] <span class="pkgTypeDescription" data-testid="package-type-description-[% pkg_type.id.html() %]">[% locale.makevar(pkg_type.description).html() %]</span> [% END -%] </label> [% END -%] </div> </div> [% ELSE -%] <div id="packageTypeSelector" data-visibility-config="[% data.package_types_visibility.json().html() %]" style="display:none;"> <input type="hidden" name="package_type" value="[% selected_pkg_type.html() %]" data-testid="package-type-hidden" /> </div> [% END -%] [%# Feature List Warning - shown/hidden dynamically based on package type selection and condition %] <div id="featureListWarning" class="notice notice-warning" style="display:none;text-shadow:none;" role="alert" aria-live="assertive" data-testid="feature-list-warning" data-feature-labels="[% package_type_feature_labels.json().html() %]"> <div class="notice-content warning-notice-content"> [%# NOTE: featureListWarningMessage span is intentionally empty and populated by JavaScript. This is acceptable because: 1) The warning div starts hidden (display:none) and only becomes visible when JS populates the message, 2) The visibility change + content population happens in the same JS execution, ensuring screen readers announce the complete message when shown, 3) User-initiated package type changes trigger the update, which is expected behavior. %] <span id="featureListWarningMessage"></span> <div> <a id="featureListWarningAction" href="../scripts2/featuremanager" class="btn btn-primary btn-sm feature-list-warning-action" data-testid="create-feature-list-link"> [% locale.maketext('Create Feature List') %] </a> </div> </div> </div> [% IF edit && data.is_feature_list_deleted -%] [%# Feature List Mismatch - rendered during package edit when the package's feature list no longer exists %] <div id="featureListMismatchWarning" class="notice notice-warning" style="display:block;text-shadow:none;" data-testid="edit-package-feature-list-warning" aria-live="assertive"> <div class="notice-content warning-notice-content"> <span id="featureListMismatchWarningMessage">[% locale.maketext('The feature list for this package no longer exists. Select one from the available list or create one before you save this package.') %]</span> <div> <a id="featureListMismatchWarningAction" href="../scripts2/featuremanager" class="btn btn-primary btn-sm feature-list-mismatch-warning-action" data-testid="edit-package-create-feature-list-link"> [% locale.maketext('Create Feature List') %] </a> </div> </div> </div> [% END %] [%# Package Name %] <div class="fatBorder"> <fieldset class="groupEditor"> <div class="propertyGroup"> <div class="propertyEditor[% IF !(edit && data.package_types.size > 1 && selected_pkg_type_name) %] last[% END %]"> <div class="propertyLabel">[% locale.maketext('Package Name') %]</div> <div class="propertyValue"> [%~ IF edit -%] <input value="[% data.name.html() %]" disabled="disabled" size="40" /> <input type="hidden" name="name" value="[% data.name.html() %]" /> <input type="hidden" name="_PACKAGE_EXTENSIONS" value="[% data.PACKAGE_EXTENSIONS %]" /> <input type="hidden" name="package_type" value="[% data.selected_package_type.html() %]" /> [%~ ELSE %] <input name="name" size="40" /> [% END -%] </div> </div> [% IF edit && data.package_types.size > 1 && selected_pkg_type_name -%] <div class="propertyEditor last"> <div class="propertyLabel">[% locale.maketext('Package Type') %]</div> <div class="propertyValue">[% selected_pkg_type_name.html() %]</div> </div> [% END -%] </div> </fieldset> </div> <div id="resourcesSection" class="fatBorder" data-section="resources"[% IF !current_visibility.sections.resources %] style="display:none"[% END %]> <fieldset class="groupEditor"> <h3>[% locale.maketext('Resources') %]</h3> <div class="propertyGroup"> [% FOR resource IN data.package_resources_order -%] [% NEXT IF !data.package_resources.$resource; SET cur = data.package_resources.$resource; SET cur_value = cur.exists('value') ? cur.value : cur.default; SET is_unlimited = cur_value.match('[.\D]'); SET field_visible = current_visibility.fields.$resource; -%] [% IF !cur.hide %] <div class="propertyEditor" data-field="[% resource %]"[% IF !field_visible %] style="display:none"[% END %]> <div class="propertyLabel"> [% locale.makevar( cur.label ) %] [% IF cur.help_text -%] [% fields_with_help.push([ resource, cur ]) -%] <span id="[% resource %]__help" class="pkgform-help"><span class="far fa-question-circle help-text"></span></span> [% END -%] </div> <div class="propertyValue"> [% SET display_num = is_unlimited ? ( cur.default.match('[.\D]') ? cur.limited_default || ( resource == 'max_defer_fail_percentage' ? '100' :'0' ) : cur.default ) : cur_value -%] [% IF cur.allowed -%] <input type="radio" id="[% resource %]_custom_radio" name="[% resource %]_control" [% is_unlimited ? '' : 'checked="checked"' %] [% IF cur.can_unlimited; 'value="custom"'; ELSE; 'style="visibility:hidden"'; END; -%] /> [% END -%] <input class="resource-text" name="[% resource %]" value="[% display_num -%]" type="number" size="10" min=[% cur.min || 0 %] [% cur.max ? "max=${cur.max}" : '' %] [% ((is_unlimited || cur.can_unlimited || (!cur.allowed))) ? 'disabled="disabled"' : '' %] /> [% IF cur.allowed && (cur.can_unlimited || is_unlimited) -%] <label> <input type="radio" id="[% resource %]_unlimited_radio" name="[% resource %]_control" value="unlimited" [% is_unlimited ? 'checked="checked"' : '' %] [% cur.can_unlimited || is_unlimited ? '' : 'disabled="disabled"' -%] /> [% locale.maketext("Unlimited") -%] </label> <script>YAHOO.util.Event.onDOMReady(function () { new CPANEL.ajax.Grouped_Input_Set( document.forms.mainform, "[% resource %]_custom_radio", "[% resource %]_unlimited_radio")});</script> [% END -%] </div> </div> [% END -%] [% END -%] </div> </fieldset> </div> [% SET options_order = ['ip']; IF data.show_shell; options_order.push('hasshell'); END; IF data.show_cgi; options_order.push('cgi'); END; options_order.push('digestauth'); -%] <div id="settingsSection" class="fatBorder" data-section="settings"[% IF !current_visibility.sections.settings %] style="display:none"[% END %]> <fieldset class="groupEditor"> <div class="propertyGroup"> <h3>[% locale.maketext('Settings') %]</h3> <div class="propertyEditor" data-field="options"> <div class="propertyLabel multiOptionLabel">[% locale.maketext('Options') %]</div> <div class="propertyValue"> [%~ FOR option = options_order ~%] [%~ SET cur = data.package_items.$option ~%] [%~ SET cur_value = cur.exists('value') ? cur.value : cur.default ~%] [%~ SET checked = cur_value && cur_value != 'n' ~%] [%~ SET option_visible = current_visibility.fields.$option ~%] <span data-field="[% option %]"[% IF !option_visible %] style="display:none"[% END %]><input value="1" type="checkbox" name="[% option %]" [% cur.allowed ? '' : 'disabled="disabled"' -%] [% checked ? 'checked="checked"' : '' -%] />[%~ locale.makevar(cur.label) -%] [%~ IF checked && !cur.allowed ~%] <input type="hidden" name="[% option %]" value="1" /> [%~ END ~%]<br></span> [%~ END -%] </div> </div> [% SET cur = data.package_items.cpmod; -%] <div class="propertyEditor" data-field="cpmod"[% IF !current_visibility.fields.cpmod %] style="display:none"[% END %]> <div class="propertyLabel">[% locale.makevar(cur.label) %]</div> <div class="propertyValue"> <select name="cpmod"> [% SET selected_theme = ( cur.exists('value') && (data.themes.grep(cur.regexp) > 0 ) ) ? cur.value : cur.default -%] [% FOR cur_theme = data.themes -%] [% SET selected_text = cur_theme == selected_theme ? 'selected="selected"' : '' -%] <option value="[% cur_theme %]" [% selected_text %]> [% cur_theme %] </option> [% END -%] </select> </div> </div> [% SET cur = data.package_items.featurelist; -%] <div class="propertyEditor" data-field="featurelist"[% IF !current_visibility.fields.featurelist %] style="display:none"[% END %]> <div class="propertyLabel"> [% locale.makevar(cur.label) %] </div> <div class="propertyValue"> <select name="featurelist" id="featurelistSelect" data-all-options="[% data.feature_list_options.json().html() %]" data-feature-lists-with-app="[% data.feature_lists_with_app.json().html() %]" data-default="[% cur.default.html() %]"> [% SET selected_featurelist = ( cur.exists('value') && ( data.feature_list_options.grep(cur.regexp).size > 0 ) ) ? cur.value : cur.default -%] [% FOR fl = data.feature_list_options -%] <option value="[% fl %]" [% fl == selected_featurelist ? ' selected="selected"' : '' %]>[% fl %]</option> [% END -%] </select> [% IF Whostmgr.checkacl('add-pkg') %] <a id="editFeatureListLink" href="../scripts2/featuremanager/editFeatureList?name=[% selected_featurelist %]" title="[% locale.maketext('View the selected feature list.') %]" target="_blank">[% locale.maketext('View') %] <i class="fas fa-external-link-alt" aria-hidden="true"></i></a> [% END %] </div> </div> [% SET cur = data.package_items.language; -%] <div class="propertyEditor last" data-field="language"[% IF !current_visibility.fields.language %] style="display:none"[% END %]> <div class="propertyLabel">[% locale.makevar(cur.label) %]</div> <div class="propertyValue"> <select name="language">[%# TODO: change from 'language' to 'locale' %] [% PROCESS '_locale_option_tags.tmpl' %] </select> </div> </div> </div> </fieldset> </div> <div id="packageExtensions" data-section="extensions"[% IF !current_visibility.sections.extensions %] style="display:none"[% END %]> [% IF data.extensions.keys.size > 0 || data.missing_extensions.size > 0 %] <div id="packageExtensionHeader" class="pkgExtensionHeader">[% locale.maketext('Package Extensions') %]</div> [% END %] [% IF edit %] [% IF data.missing_extensions.size > 0 %] <div class="fatBorder" id="missingExtensionsGroup"> <fieldset class="groupEditor"> <div id="missingPackageError" class="notice notice-error"> <div class="notice-content error-notice-content">[% locale.maketext("You must install the following extensions before you can edit their values: [list_and,_1]", data.missing_extensions) %]</div> </div> <div id="missingExtensionsOption"><input type="checkbox" name="remove_missing_extensions" value="[% data.missing_extensions.join(' ') %]" id="missingExtensionsCheckbox"><label class="bolded" for="missingPackagesCheckbox">[% locale.maketext('Remove these extensions from the package.') %]</label></div> </fieldset> </div> [% END -%] [% FOREACH package IN data.extensions.keys %] <div id="[% package %]" class="fatBorder" data-extension="[% package %]"> <fieldset> <h3>[% locale.makevar(data.extensions.$package) %]</h3> <div class="propertyGroup"> [% file_to_process = data.extensions_path _ package _ '.tt2' %] [% PROCESS $file_to_process %] </div> </fieldset> </div> [% END %] [% FOREACH package IN data.new_available_extensions.keys %] <h3 class="pkgSelectorWrapper" id="[% package %]DataWrapper" data-extension="[% package %]"> <input type="checkbox" name="_PACKAGE_EXTENSIONS" value="[% package %]" id="[% package %]Control" class="packageOptionSelector" data-packageOptions="[% package %]">[% locale.makevar(data.new_available_extensions.$package) %] </h3> [% END %] [% ELSE %] [% FOREACH package IN data.extensions.keys %] <h3 class="pkgSelectorWrapper" id="[% package %]DataWrapper" data-extension="[% package %]"> <input type="checkbox" name="_PACKAGE_EXTENSIONS" value="[% package %]" id="[% package %]Control" class="packageOptionSelector" data-packageOptions="[% package %]">[% locale.makevar(data.extensions.$package) %] </h3> [% END %] [% END %] </div> <div class="formButtons"> [% IF edit -%] <input type="hidden" name="edit" value="yes" /> <input type="submit" id="submit" class="btn-primary" value="[% locale.maketext('Save Changes') %]" /> <input type="reset" class="btn-secondary" value="[% locale.maketext('Reset') %]" /> [% ELSE -%] <input type="submit" id="submit" class="btn-primary" value="[% locale.maketext('Add') %]" /> [% END -%] </div> </form> </div> <!-- end content --> [% PROCESS '_ajaxapp_footer.tmpl' -%] <!-- JSON data storage: type="application/json" is not executed --> <script type="application/json" id="packageFeatureListsData"> [% data.package_feature_lists.json() || '{}' %] </script> <script type="text/javascript"> // Package type to feature list mapping for dynamic filtering var PACKAGE_FEATURE_LISTS = JSON.parse(document.getElementById('packageFeatureListsData').textContent); import('[% MagicRevision('/js/modules/pkgform-help_optimized.js') %]').then( o => { [% FOR name_cur = fields_with_help -%] o.cPSetupResourceHelp( DOM.get('[% "${name_cur.0}__help" %]'), [% locale.makevar( name_cur.1.label ).json %], [% locale.makevar( name_cur.1.help_text ).json %] ); [% END -%] } ); function ajax_save(form) { var form_data = CPANEL.dom.get_data_from_form(form, { include_unchecked_checkboxes: 0 }); // massage the package extensions variable (if there) // to remove extraneous package name values (0) // This is necessary because get_data_from_form() sets unchecked checkboxes to 0. if (form_data._PACKAGE_EXTENSIONS && Object.prototype.toString.call(form_data._PACKAGE_EXTENSIONS) === "[object Array]") { var massagedExtensions = []; var candidateExtensionsLength = form_data._PACKAGE_EXTENSIONS.length; for (var x = 0; x < candidateExtensionsLength; x++) { if (isNaN(form_data._PACKAGE_EXTENSIONS[x]) || parseFloat(form_data._PACKAGE_EXTENSIONS[x]) !== 0) { massagedExtensions.push(form_data._PACKAGE_EXTENSIONS[x]); } } form_data._PACKAGE_EXTENSIONS = massagedExtensions; } // package extension controls could be named *_control, // so explicitly test for known manual controls to avoid // accidentally failing to update a value for a package // extension var customControlMatcher = /^(quota|maxftp|maxsql|maxpop|maxlst|maxsub|bwlimit|maxpark|maxaddon|max_email_per_hour|max_defer_fail_percentage|max_emailacct_quota|max_team_users)_control$/; for (var key in form_data) { var match = key.match(customControlMatcher); if (match) { if (form_data[key] === "unlimited") { form_data[match[1]] = "unlimited"; } delete form_data[key]; } } var status_template = [% edit ? locale.maketext('Saving package “[output,class,_1,code]” ….','{pkg}').json() : locale.maketext('Creating new package “[output,class,_1,code]” …','{pkg}').json() %]; var before_success = function () { var missingExtensionsCheckbox = YAHOO.util.Dom.get("missingExtensionsCheckbox"); if (missingExtensionsCheckbox) { var isChecked = YAHOO.util.Dom.getAttribute(missingExtensionsCheckbox, "checked"); if (isChecked) { var missingExtensionsDiv = YAHOO.util.Dom.get("missingExtensionsGroup"); if (missingExtensionsDiv) { // check to see if there are any other fatBorder divs left var extensionsContainer = YAHOO.util.Dom.get("packageExtensions"); var isFatBorder = function (el) { return YAHOO.util.Dom.hasClass(el, "fatBorder"); }; var remainingExtensions = YAHOO.util.Dom.getChildrenBy(extensionsContainer, isFatBorder); // hide the subhead if no more extensions if (remainingExtensions.length === 1) { YAHOO.util.Dom.addClass("packageExtensionHeader", "hidden"); } YAHOO.util.Dom.addClass(missingExtensionsDiv, "hidden"); missingExtensionsDiv.parentNode.removeChild(missingExtensionsDiv); } } } // The saved package now references a valid feature list, so dismiss the // "feature list no longer exists" warning on a successful save (this is // an AJAX save, so the page does not reload on its own). var featureListMismatchWarning = YAHOO.util.Dom.get("featureListMismatchWarning"); if (featureListMismatchWarning) { featureListMismatchWarning.style.display = "none"; } // Normalize the feature list dropdown to the repaired state so the // stale empty placeholder cannot be re-selected (or restored by Reset) // and disable Save again with no warning to explain why. if (typeof window.normalizeFeatureListAfterSave === "function") { window.normalizeFeatureListAfterSave(); } }; CPANEL.api( { progress_panel: { status_html: status_template.replace('{pkg}',form_data.name.html_encode()), source_el: "submit", before_success: before_success }, func: "[% edit ? 'editpkg' : 'addpkg' %]", data: form_data }); } </script> [% END -%]
Save