Example #1
0
 public function deactivation($page_id = null)
 {
     $result = false;
     // доступно дл¤ пользователей первой роли (например, Ђ–еактивуї)
     $role_id = Users::model()->findByPk(Yii::app()->user->id)->role_id;
     if ($role_id < 2 && !is_null($page_id) && Pages::model()->existsPage($page_id)) {
         $link_id = ModulesInPages::model()->getLink($page_id, $this->id);
         if ($link_id) {
             $result = ModuleFields::model()->deactivation($link_id, $this->id);
         }
     }
     return $result;
 }
Example #2
0
 public function actionDeactivation($page_id = null)
 {
     $result = false;
     // доступно для пользователей первой роли (например, «Реактиву»)
     $role_id = Users::model()->findByPk(Yii::app()->user->id)->role_id;
     if ($role_id < 2 && !is_null($page_id) && Pages::model()->existsPage($page_id)) {
         $link_id = ModulesInPages::model()->getLink($page_id, $this->module->id);
         if ($link_id) {
             $result = ModuleFields::model()->deactivation($link_id, $this->module->id);
         }
     }
     if ($result) {
         $this->redirect(Yii::app()->baseUrl . '?r=pages/update&id=' . $page_id . '&/#!/tab_fourth');
     } else {
         $this->redirect(Yii::app()->request->baseUrl . '/admin.php');
     }
 }
 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;
 }
Example #5
0
 public function actionError()
 {
     header("HTTP/1.1 404 Not Found");
     $pages = new Pages();
     $data = [];
     // $pages->getTreePages(NULL,&$data['tree']);
     $data['tree'] = $pages->getTreePages2(true);
     $data['title'] = 'Страница не найдена';
     $data['pages'] = $pages;
     $data['additional_main_data'] = ModuleFields::model()->getValueListByPageId(1);
     // $this->redirect('/');
     $this->render('404', $data);
 }
Example #6
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;
 }
Example #7
0
    if (Yii::app()->user->hasFlash($this->module->id . '_add_message')) {
        echo Yii::app()->user->getFlash($this->module->id . '_add_message');
    }
    ?>
		<?php 
    $this->endWidget();
    ?>
		</div>
	</div>
	<?php 
}
?>
	<div class="catalog">
		<?php 
$mpage_id = ModulesInPages::model()->getLink($page_id, $this->module->id);
$data = ModuleFields::model()->getList($mpage_id);
if (count($data) > 0) {
    ?>
			<form method="POST" action="/admin.php?r=pages/update&id=<?php 
    echo $page_id;
    ?>
&/#!/tab_<?php 
    echo $this->module->id;
    ?>
">
				<ul class="<?php 
    echo count($data) > 1 && $role_id < 2 ? 'sortable' : '';
    ?>
 type_2">
				<?php 
    foreach ($data as $item_id => $item) {
Example #8
0
			<?php 
$aside_fixed_class = 'aside-fixed';
include 'inc/aside.php';
?>
			<?php 
$cards_code = array(40 => 'debit', 41 => 'credit', 110 => 'storage', 111 => 'pension', 112 => 'salary');
$debit_doc_id = 40;
$credit_doc_id = 41;
$storage_doc_id = 110;
$pension_doc_id = 111;
$salary_doc_id = 112;
$fields_data_1 = ModuleFields::model()->getValueListByPageId($debit_doc_id);
$fields_data_2 = ModuleFields::model()->getValueListByPageId($credit_doc_id);
$fields_data_3 = ModuleFields::model()->getValueListByPageId($storage_doc_id);
$fields_data_4 = ModuleFields::model()->getValueListByPageId($pension_doc_id);
$fields_data_5 = ModuleFields::model()->getValueListByPageId($salary_doc_id);
$criteria = new CDbCriteria();
$criteria->order = 'sort ASC';
$criteria->condition = 'active > 0 AND id IN (40,41,110,111,112)';
$cards_list = Pages::model()->findAll($criteria);
foreach ($cards_list as $v) {
    $cards_data[$v->id] = array('page' => $v->getAttributes(), 'nav' => '<li><a href="#' . $cards_code[$v->id] . 'cards" class="onPage" data-cardtype="doc_' . $v->id . '">' . $v->name . '</a></li>');
}
?>
			<div class="page-content fixed-aside">
				<div class="pad-content">
					<?php 
echo $pages->set_url($content);
?>
					<nav class="section-navigator js-navigator">
						<ul>
Example #9
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;
 }