public function getAdminEditFields($package, $vars = null)
 {
     $fields = new ModuleFields();
     $domain = $fields->label(Language::_("tastycpanel.service.domain", true), "domain_name");
     $domain->attach($fields->fieldText("domain_name", $this->Html->ifSet($vars->domain_name, $this->Html->ifSet($vars->domain_name)), array('id' => "domain_name")));
     $fields->setField($domain);
     $username = $fields->label(Language::_("tastycpanel.service.username", true), "username");
     $username->attach($fields->fieldText("username", $this->Html->ifSet($vars->username, $this->Html->ifSet($vars->username)), array('id' => "username")));
     $fields->setField($username);
     $password = $fields->label(Language::_("tastycpanel.service.password", true), "password");
     $password->attach($fields->fieldPassword("password", array('id' => "password", 'value' => "{$this->Html->ifSet($vars->password, $this->Html->ifSet($vars->password))}")));
     $fields->setField($password);
     $dedicated_ip = $fields->label(Language::_("tastycpanel.dedicated_ip", true), "password");
     $dedicated_ip->attach($fields->fieldText("dedicated_ip", $this->Html->ifSet($vars->dedicated_ip, $this->Html->ifSet($vars->dedicated_ip)), array('id' => "dedicated_ip")));
     $fields->setField($dedicated_ip);
     return $fields;
 }
 public function getAdminEditFields($package, $vars = null)
 {
     Loader::loadHelpers($this, array("Html"));
     $fields = new ModuleFields();
     $domain = $fields->label(Language::_("Digitaloceanmodule.hostname", true), "hostname");
     $domain->attach($fields->fieldText("hostname", $this->Html->ifSet($vars->hostname, $this->Html->ifSet($vars->hostname)), array('id' => "hostname")));
     $fields->setField($domain);
     return $fields;
 }
示例#3
0
 /**
  * Returns all fields to display to a client attempting to add a service with the module
  *
  * /DONE/
  */
 public function getClientAddFields($package, $vars = null)
 {
     Loader::loadHelpers($this, array("Html"));
     // Fetch the module row available for this package
     $module_row = $this->getModuleRowByServer(isset($package->module_row) ? $package->module_row : 0, isset($package->module_group) ? $package->module_group : "");
     $fields = new ModuleFields();
     // Create hostname label
     $hostname = $fields->label(Language::_("Proxmoxv2.service_field.Proxmoxv2_hostname", true), "hostname");
     $hostname->attach($fields->fieldText("hostname", $this->Html->ifSet($vars->hostname), array('id' => "hostname", 'placeholder' => "server.yourdomain.com")));
     $fields->setField($hostname);
     // Load templates
     $templatesres = $package->meta->templates;
     foreach ($templatesres as $template) {
         $search_name = array("-1_", "-2_", "-", "i386", "amd64", "turnkey");
         $replace_name = array(" ", " ", " ", "(32 Bits)", "(64 Bits)", "");
         $template_name = str_replace($search_name, $replace_name, $template);
         $templates[$template] = ucwords($template_name);
     }
     // Set the Templates as a selectable option
     $ostemplate = $fields->label(Language::_("Proxmoxv2.service_field.Proxmoxv2_template", true), "ostemplate");
     $ostemplate->attach($fields->fieldSelect("ostemplate", $templates, $this->Html->ifSet($vars->ostemplate), array('id' => "ostemplate")));
     $fields->setField($ostemplate);
     return $fields;
 }
示例#4
0
 /**
  * Returns all fields to display to a client attempting to add a service with the module
  *
  * @param stdClass $package A stdClass object representing the selected package
  * @param $vars stdClass A stdClass object representing a set of post fields
  * @return ModuleFields A ModuleFields object, containg the fields to render as well as any additional HTML markup to include
  */
 public function getClientAddFields($package, $vars = null)
 {
     //return $this->makeAddFields($package, $vars);
     Loader::loadHelpers($this, array("Form", "Html"));
     //We are just going to get domain name we want SSL for
     $fields = new ModuleFields();
     $fields->setHtml("\n\t\t\t<script type=\"text/javascript\">\n                \$(document).ready(function() {\n                    \$('#gogetssl_fqdn').change(function() {\n\t\t\t\t\t\tvar form = \$(this).closest('form');\n\t\t\t\t\t\t\$(form).append('<input type=\"hidden\" name=\"refresh_fields\" value=\"true\">');\n\t\t\t\t\t\t\$(form).submit();\n\t\t\t\t\t});\n                });\n\t\t\t</script>\n\t\t");
     $gogetssl_fqdn = $fields->label(Language::_("GoGetSSLv2.service_field.gogetssl_fqdn", true), "gogetssl_fqdn");
     $gogetssl_fqdn->attach($fields->fieldText("gogetssl_fqdn", $this->Html->ifSet($vars->gogetssl_fqdn), array('id' => "gogetssl_fqdn")));
     $fields->setField($gogetssl_fqdn);
     unset($gogetssl_fqdn);
     return $fields;
 }
 public function getAdminEditFields($package, $vars = null)
 {
     Loader::loadHelpers($this, array("Html"));
     $fields = new ModuleFields();
     // Set a domain field if this is not a reseller
     if ((!isset($vars->reseller_id) || $vars->reseller_id == 0) && $package->meta->type != "reseller") {
         // Create domain label
         $domain = $fields->label(Language::_("tastyinterworx.service_field.domain", true), "domain");
         // Create email field and attach to email label
         $domain->attach($fields->fieldText("domain", $this->Html->ifSet($vars->domain), array('id' => "domain")));
         // Add tooltip
         $tooltip = $fields->tooltip(Language::_("tastyinterworx.service_field.tooltip.domain", true));
         $domain->attach($tooltip);
         // Set the label as a field
         $fields->setField($domain);
     } else {
         // Set a field for reseller ID
         $reseller_id = $fields->label(Language::_("tastyinterworx.service_field.reseller_id", true), "reseller_id");
         // Create domain field and attach to domain label
         $reseller_id->attach($fields->fieldText("reseller_id", $this->Html->ifSet($vars->reseller_id), array('id' => "reseller_id")));
         $tooltip = $fields->tooltip(Language::_("tastyinterworx.service_field.tooltip.reseller_id", true));
         $reseller_id->attach($tooltip);
         // Set the label as a field
         $fields->setField($reseller_id);
     }
     // Create email label
     $email = $fields->label(Language::_("tastyinterworx.service_field.email", true), "email");
     // Create email field and attach to email label
     $email->attach($fields->fieldText("email", $this->Html->ifSet($vars->email), array('id' => "email")));
     // Set the label as a field
     $fields->setField($email);
     // Create username label
     $username = $fields->label(Language::_("tastyinterworx.service_field.username", true), "username");
     // Create username field and attach to username label
     $username->attach($fields->fieldText("username", $this->Html->ifSet($vars->username), array('id' => "username")));
     // Set the label as a field
     $fields->setField($username);
     // Create password label
     $password = $fields->label(Language::_("tastyinterworx.service_field.password", true), "password");
     // Create password field and attach to password label
     $password->attach($fields->fieldPassword("password", array('id' => "password", 'value' => $this->Html->ifSet($vars->password))));
     // Set the label as a field
     $fields->setField($password);
     return $fields;
 }
 /**
  * Returns all fields to display to an admin attempting to add a service with the module
  *
  * @param stdClass $package A stdClass object representing the selected package
  * @param $vars stdClass A stdClass object representing a set of post fields
  * @return ModuleFields A ModuleFields object, containg the fields to render as well as any additional HTML markup to include
  */
 public function getAdminAddFields($package, $vars = null)
 {
     Loader::loadHelpers($this, array("Html"));
     $fields = new ModuleFields();
     // Create domain label
     $domain = $fields->label(Language::_('Cpe.label.domain', true), "cpanel_domain");
     // Create domain field and attach to domain label
     $domain->attach($fields->fieldText("cpanel_domain", $this->Html->ifSet($vars->cpanel_domain), array('id' => "cpanel_domain")));
     // Set the label as a field
     $fields->setField($domain);
     if ($package->meta->usernamefield == 'true') {
         // Create username label
         $username = $fields->label(Language::_('Cpe.label.username', true), "cpanel_username");
         // Create username field and attach to username label
         $username->attach($fields->fieldText("cpanel_username", $this->Html->ifSet($vars->cpanel_username), array('id' => "cpanel_username")));
         // Set the label as a field
         $fields->setField($username);
     }
     if ($package->meta->passwordfield == 'true') {
         // Create password label
         $password = $fields->label(Language::_('Cpe.label.password', true), "cpanel_password");
         // Create password field and attach to password label
         $password->attach($fields->fieldPassword("cpanel_password", array('id' => "cpanel_password")));
         // Set the label as a field
         $fields->setField($password);
         // Confirm password label
         $confirm_password = $fields->label(Language::_('Cpe.label.passwordconfirm', true), "cpanel_confirm_password");
         // Create confirm password field and attach to password label
         $confirm_password->attach($fields->fieldPassword("cpanel_confirm_password", array('id' => "cpanel_confirm_password")));
         // Set the label as a field
         $fields->setField($confirm_password);
     }
     return $fields;
 }