From 4569cae57f127afd093794310ccd290d2d9fdf36 Mon Sep 17 00:00:00 2001
From: Marius Burkard <m.burkard@pixcept.de>
Date: Wed, 20 Apr 2016 10:58:46 -0400
Subject: [PATCH] Merge branch 'stable-3.1'

---
 interface/lib/classes/plugin_directive_snippets.inc.php |  142 +++++++++++++++++++++++-----------------------
 1 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/interface/lib/classes/plugin_directive_snippets.inc.php b/interface/lib/classes/plugin_directive_snippets.inc.php
index dbc7d48..41138bc 100644
--- a/interface/lib/classes/plugin_directive_snippets.inc.php
+++ b/interface/lib/classes/plugin_directive_snippets.inc.php
@@ -1,72 +1,72 @@
-<?php
-
-
-class plugin_directive_snippets extends plugin_base
-{
-	var $module;
-	var $form;
-	var $tab;
-	var $record_id;
-	var $formdef;
-	var $options;
-
-	public function onShow()
-	{
-		global $app;
-
-		$listTpl = new tpl;
-		$listTpl->newTemplate('templates/web_directive_snippets.htm');
-
-		//* Loading language file
-		$lng_file = "lib/lang/".$_SESSION["s"]["language"]."_web_directive_snippets.lng";
-
-		include $lng_file;
-		$listTpl->setVar($wb);
-
-		$message = '';
-		$error   = '';
-
-		$server_type = $app->getconf->get_server_config($this->form->dataRecord['server_id'], 'web');
-		$server_type = $server_type['server_type'];
-		$records = $app->db->queryAllRecords("SELECT directive_snippets_id, name FROM directive_snippets WHERE customer_viewable = 'y' AND type = ? ORDER BY name ASC", $server_type);
-
-		for ($i = 0, $c = count($records); $i < $c; $i++)
-		{
-			$records[$i]['is_selected'] = false;
-
-			if ($this->form->dataRecord['directive_snippets_id'] === $records[$i]['directive_snippets_id'])
-				$records[$i]['is_selected'] = true;
-		}
-
-		$listTpl->setLoop('records', $records);
-
-		$list_name = 'directive_snippets_list';
-		$_SESSION["s"]["list"][$list_name]["parent_id"] = $this->form->id;
-		$_SESSION["s"]["list"][$list_name]["parent_name"] = $app->tform->formDef["name"];
-		$_SESSION["s"]["list"][$list_name]["parent_tab"] = $_SESSION["s"]["form"]["tab"];
-		$_SESSION["s"]["list"][$list_name]["parent_script"] = $app->tform->formDef["action"];
-		$_SESSION["s"]["form"]["return_to"] = $list_name;
-
-		return $listTpl->grab();
-	}
-	
-	public function onUpdate()
-	{
-		global $app, $conf;
-
-		if (isset($this->form->dataRecord['directive_snippets_id']) && $this->form->oldDataRecord['directive_snippets_id'] !== $this->form->dataRecord['directive_snippets_id']) {
-			$app->db->query('UPDATE web_domain SET directive_snippets_id = ? WHERE domain_id = ?', $this->form->dataRecord['directive_snippets_id'], $this->form->id);
-		}
-	}
-
-	public function onInsert()
-	{
-		global $app, $conf;
-
-		if (isset($this->form->dataRecord['directive_snippets_id'])) {
-			$app->db->query('UPDATE web_domain SET directive_snippets_id = ? WHERE domain_id = ?', $this->form->dataRecord['directive_snippets_id'], $this->form->id);
-		}
-	}
-
-}
+<?php
+
+
+class plugin_directive_snippets extends plugin_base
+{
+	var $module;
+	var $form;
+	var $tab;
+	var $record_id;
+	var $formdef;
+	var $options;
+
+	public function onShow()
+	{
+		global $app;
+
+		$listTpl = new tpl;
+		$listTpl->newTemplate('templates/web_directive_snippets.htm');
+
+		//* Loading language file
+		$lng_file = "lib/lang/".$_SESSION["s"]["language"]."_web_directive_snippets.lng";
+
+		include $lng_file;
+		$listTpl->setVar($wb);
+
+		$message = '';
+		$error   = '';
+
+		$server_type = $app->getconf->get_server_config($this->form->dataRecord['server_id'], 'web');
+		$server_type = $server_type['server_type'];
+		$records = $app->db->queryAllRecords("SELECT directive_snippets_id, name FROM directive_snippets WHERE customer_viewable = 'y' AND type = ? ORDER BY name ASC", $server_type);
+
+		for ($i = 0, $c = count($records); $i < $c; $i++)
+		{
+			$records[$i]['is_selected'] = false;
+
+			if ($this->form->dataRecord['directive_snippets_id'] === $records[$i]['directive_snippets_id'])
+				$records[$i]['is_selected'] = true;
+		}
+
+		$listTpl->setLoop('records', $records);
+
+		$list_name = 'directive_snippets_list';
+		$_SESSION["s"]["list"][$list_name]["parent_id"] = $this->form->id;
+		$_SESSION["s"]["list"][$list_name]["parent_name"] = $app->tform->formDef["name"];
+		$_SESSION["s"]["list"][$list_name]["parent_tab"] = $_SESSION["s"]["form"]["tab"];
+		$_SESSION["s"]["list"][$list_name]["parent_script"] = $app->tform->formDef["action"];
+		$_SESSION["s"]["form"]["return_to"] = $list_name;
+
+		return $listTpl->grab();
+	}
+	
+	public function onUpdate()
+	{
+		global $app, $conf;
+
+		if (isset($this->form->dataRecord['directive_snippets_id']) && $this->form->oldDataRecord['directive_snippets_id'] !== $this->form->dataRecord['directive_snippets_id']) {
+			$app->db->query('UPDATE web_domain SET directive_snippets_id = ? WHERE domain_id = ?', $this->form->dataRecord['directive_snippets_id'], $this->form->id);
+		}
+	}
+
+	public function onInsert()
+	{
+		global $app, $conf;
+
+		if (isset($this->form->dataRecord['directive_snippets_id'])) {
+			$app->db->query('UPDATE web_domain SET directive_snippets_id = ? WHERE domain_id = ?', $this->form->dataRecord['directive_snippets_id'], $this->form->id);
+		}
+	}
+
+}
 ?>
\ No newline at end of file

--
Gitblit v1.9.1