MentDB  Mentalese Database Engine
Strong AI, Weak AI, Interoperability and Software Development
Download MentDB Weak
    Home  >  App 'Knowledge'
I present you the application 'Knowledge'. This application allows you to put online your knowledge on internet/intranet

Download 'Knowledge v_1.0.1' MQL source code (GPL v3) >>> MentDB v_2.1.9 compatible

Download 'Knowledge v_1.0.0' MQL source code (GPL v3) >>> MentDB v_2.1.9 compatible

Install:
  • Install MentDB Weak vX.X.X
  • Start a MQL Editor
  • Unzip the file 'knowledge_X.X.X.mql.zip'
  • Copy the MQL source code from the file 'knowledge_X.X.X.mql'
  • Paste the MQL source code into the MQL Editor
  • Execute the MQL source code
  • Your application is ready!
  • Go to https://localhost:9999
  • Click on 'knowledge'
  • Login 'system', password 'pwd'
  • Enjoy!

Demo: W101 - The knowledge manager

Screenshot:
MQL Source code
script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Get data from a database into a list ..." 
{
	
	#Load the current object id and his configuration;
	-> "[OBJECT_ID]" "MENTDB_kl_tags_list";
	include "app.100.scrud.overwrite_config.exe"
		"[OBJ_PARAM_LIST]" "container_id,page,nb_by_page,nb_lr_pagination,order_by,filter_sql"
	;
	
	if (equal [nb_by_page] "*") {-> "[nb_by_page]" 999999999};
	if (is empty [order_by]) {
		-> "[asc_desc]" "ASC|";
		-> "[cur_asc_desc]" "";
		-> "[cur_order_by]" "";
	} {
		-> "[cur_asc_desc]" (atom get [order_by] 1 "|");
		-> "[cur_order_by]" (atom get [order_by] 2 "|");
		if (string starts_with [order_by] "ASC|") {
			-> "[asc_desc]" "DESC|";
		} {
			-> "[asc_desc]" "";
		};
	};

	#Initialization;
	-> "[object]" "<div style='border: 1px solid rgba(0,0,0,.12);-webkit-border-radius: 3px;
		-moz-border-radius: 3px;border-radius: 3px;
		margin-top: 2px;margin-bottom: 2px;padding:5px;background-color:#fff;color:#313131'>";

	if (app is_granted_a "MENTDB.kl_tags.list.delete") {concat_var "[object]" "<span style='float:right'><button type='button' class='btn btn-danger btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.delete_confirm.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "get_all_checked('kl_tags_keys_checkbox')") "><span class='fa fa-remove fa-sm' aria-hidden='true'></span></button></span>";};
	if (app is_granted_a "MENTDB.kl_tags.list.insert") {concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-success btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.insert_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-plus fa-sm' aria-hidden='true'></span></button></span>";};
	if (app is_granted_a "MENTDB.kl_tags.list.search") {concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.search_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-search fa-sm' aria-hidden='true'></span></button></span>";};

	concat_var "[object]" "
	<span style='font-size:16px'><b>  " (string first_letter_upper (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "list_title")) "</b></span>
	
	<div style='height:10px;'></div>
	
	<table class='table table-striped table-hover table-bordered' style='margin-bottom: 0px;'>
  <thead>
    <tr>";
	
	#Connect to the database;
	sql connect "session1" {cm get "MENTDB";};

	try {

		#concat the row title counter;
		concat_var "[object]" "
      <th style='width:44px;padding: 0px 0px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' id='kl_tags_main_checkbox' onchange='check_all(\"kl_tags_keys_checkbox\", this);'></div></th>
      <th scope='col' style='padding: 0px;'><a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "tag") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "tag")}} {(concat "ASC|" "tag")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "list_field_tag") (if (equal [cur_order_by] "tag") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th scope='col' style='padding: 0px;'><a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "color_bg") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "color_bg")}} {(concat "ASC|" "color_bg")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "list_field_color_bg") (if (equal [cur_order_by] "color_bg") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th scope='col' style='padding: 0px;'><a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "color_ft") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "color_ft")}} {(concat "ASC|" "color_ft")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "list_field_color_ft") (if (equal [cur_order_by] "color_ft") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th scope='col' style='width:20px;padding: 0px;'></th>
	</tr>
  </thead>
  <tbody>";
		
		-> "[sql_filter]" "";
		-> "[sql_filter_keys]" "";
		if (not (is null or empty [filter_sql])) {
			json load "filter_sql" [filter_sql];
			json parse_obj "filter_sql" "/" "[key]" "[val]" {

				if (not (string starts_with [key] "type:")) {
					switch (json select "filter_sql" (concat "/type:" [key]))
						("EQUAL") {concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
						("LIKE_L") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "'";}
						("LIKE_R") {concat_var "[sql_filter]" " and `" [key] "` like '" (string sublrchar (sql encode [val]) 1) "%'";}
						("LIKE_LR") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "%'";}
						{concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
					;
					concat_var "[sql_filter_keys]" "<span class='badge badge-light'>" [key] "</span> ";
				};
			
			};
	
			if (> (json count "filter_sql" "/") 0) {
				-> "[sql_filter]" (concat " WHERE " (string substring [sql_filter] 5));
				-> "[sql_filter_keys]" (concat "<h5 style='margin-top: 1px;margin-bottom:0px'><button type='button' style='margin-left: 10px;' class='btn btn-outline-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"filter_sql\":{}}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-remove fa-xs' aria-hidden='true'></span> " (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "list_filter") "(s)</button></h5>");
			};
		};

		-> "[iline]" (+ 1 (- (* [page] [nb_by_page]) [nb_by_page]));
		-> "[nb_elements]" (sql value "session1" (concat "select count(*) from `kl_tags` " [sql_filter] ";"));
		-> "[nb_page]" (math ceil (/ [nb_elements] [nb_by_page]));
		if (is empty [cur_order_by]) {
			-> "[sql_order_by]" "";
		} {
			-> "[sql_order_by]" (concat "order by `" [cur_order_by] "` " [cur_asc_desc]);
		};

		-> "[app_is_granted_update]" (app is_granted_a "MENTDB.kl_tags.list.update");
		
		sql parse "session1" "T" (concat "select 
			`id`, 
			`tag`, 
			`color_bg`, 
			`color_ft` from `kl_tags` " [sql_filter] " " [sql_order_by] " limit " (- (* [page] [nb_by_page]) [nb_by_page]) ", " [nb_by_page] ";") {
			
			json load "primary_key" "{}";
			json iobject "primary_key" / "client_data" "{}" OBJ;
			json iobject "primary_key" "/client_data" "id" [T_id] STR;
			
      		
			concat_var "[object]" "
      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='kl_tags_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_tag] "<" "<") "</td>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_color_bg] "<" "<") "</td>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_color_ft] "<" "<") "</td>";

			if ([app_is_granted_update]) {
				concat_var "[object]" "<td style='padding: 0px 2px 0px 2px;'><button type='button' class='btn btn-warning btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") "><span class='fa fa-pencil fa-sm' aria-hidden='true'></span></button></td>";
			} {
				concat_var "[object]" "<td style='padding: 0px 2px 0px 2px;'></td>";
			};
			concat_var "[object]" "</tr>";

      		++ "[iline]";
		
		};
    
		concat_var "[object]" "
	</tbody>
</table>

";

	concat_var "[object]" "<nav aria-label='Page navigation' style='display:inline-block'>
  <ul class='pagination' style='margin-bottom:0px'>
    <li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" 1 "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Previous'>
        <span aria-hidden='true'>«</span>
        <span class='sr-only'>Previous</span>
      </a>
    </li>";

	for (-> "[i_page]" (- [page] [nb_lr_pagination])) (< [i_page] [page]) (++ "[i_page]") {

		if (> [i_page] 0) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};

	for (-> "[i_page]" [page]) (<= [i_page] (+ [page] [nb_lr_pagination])) (++ "[i_page]") {

		if (<= [i_page] [nb_page]) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};
    
    concat_var "[object]" "<li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [nb_page] "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>
        <span aria-hidden='true'>»</span>
        <span class='sr-only'>Next</span>
      </a>
    </li>
  </ul>
</nav>   " (+ 1 (- (* [page] [nb_by_page]) [nb_by_page])) " - " (if (> (* [page] [nb_by_page]) [nb_elements]) {[nb_elements]} {* [page] [nb_by_page]}) " / " [nb_elements] "
  <div style='float: right;display: inline-block;'><select id='app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.key.nb_by_page' style='height: 33px;color: #007bff;' class='form-control' onChange=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"order_by\":\"\", \"page\":\"1\"}") "[getElementById]" "nb_by_page=app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.key.nb_by_page" "[data]" "") ">
      <option " (if (== [nb_by_page] 1) {"selected"}) ">1</option>
      <option " (if (== [nb_by_page] 2) {"selected"}) ">2</option>
      <option " (if (== [nb_by_page] 3) {"selected"}) ">3</option>
      <option " (if (== [nb_by_page] 4) {"selected"}) ">4</option>
      <option " (if (== [nb_by_page] 5) {"selected"}) ">5</option>
      <option " (if (== [nb_by_page] 10) {"selected"}) ">10</option>
      <option " (if (== [nb_by_page] 12) {"selected"}) ">12</option>
      <option " (if (== [nb_by_page] 14) {"selected"}) ">14</option>
      <option " (if (== [nb_by_page] 16) {"selected"}) ">16</option>
      <option " (if (== [nb_by_page] 18) {"selected"}) ">18</option>
      <option " (if (== [nb_by_page] 20) {"selected"}) ">20</option>
      <option " (if (== [nb_by_page] 25) {"selected"}) ">25</option>
      <option " (if (== [nb_by_page] 50) {"selected"}) ">50</option>
      <option " (if (== [nb_by_page] 100) {"selected"}) ">100</option>
      <option " (if (== [nb_by_page] 250) {"selected"}) ">250</option>
      <option " (if (== [nb_by_page] 500) {"selected"}) ">500</option>
      <option " (if (== [nb_by_page] 1000) {"selected"}) ">1000</option>
      <option " (if (== [nb_by_page] 2500) {"selected"}) ">2500</option>
      <option " (if (== [nb_by_page] 5000) {"selected"}) ">5000</option>
      <option " (if (== [nb_by_page] 999999999) {"selected"}) ">*</option>
    </select></div><div style='float: right;display: inline-block;line-height: 32px;margin-right: 20px;'>" [sql_filter_keys] "</div>

</div>";

		sql disconnect "session1";

		include "app.100.obj.sajax.refresh.exe"
			"[target]" [container_id]
			"[innerHtml]" [object]
		;

	} {

		#Save the error;
		log trace [err]; 
		
		#Close all objects;
		try {sql disconnect "session1";} {} "[e]";

		exception (1) (concat "ERR/APP/LIST: " [err]);

	} "[err]";
	
} "Return the list";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.insert" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);
		
		-> "[result]" (sql dml "session1" (concat 
			"INSERT INTO `kl_articles` (
			`id`, 
			`id_tag`, 
			`title`, 
			`article`, 
			`order`, 
			`is_draft`
			) VALUES (
			" (sql encode (json select "data" "/client_data/id")) ", 
			" (sql encode (json select "data" "/client_data/id_tag")) ", 
			" (sql encode (json select "data" "/client_data/title")) ", 
			" (sql encode (json select "data" "/client_data/article")) ", 
			" (sql encode (json select "data" "/client_data/order")) ", 
			" (sql encode (json select "data" "/client_data/is_draft")) "
			);"
		));
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (concat "
			" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "insert_ok"))
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.insert_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.update_reopen_form" false 1 
  (param
  	(var "[container_id]" {true} "" is_null:false is_empty:false "container1")
  ;) 
  "Reopen an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_tags_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_title_re")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]" (json select "data" "/client_data/id")
			;
		
		# tag -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "tag" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_field_tag") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/tag")
			;
		
		# color_bg -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.color.exe" "[control_id]" "color_bg" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_field_color_bg") "[description]" "" "[maxlength]" "7" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/color_bg")
			;
		
		# color_ft -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.color.exe" "[control_id]" "color_ft" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_field_color_ft") "[description]" "" "[maxlength]" "7" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/color_ft")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "kl_tags_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.update.exe"
		"[data_eval]" "$('#kl_tags_update_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_close_button")
		"[submitTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_update_button")
		"[submitType]" "warning";
	
} "Return the form";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.insert_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an insert form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_tags_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_title")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# tag -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "tag" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_field_tag") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		# color_bg -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.color.exe" "[control_id]" "color_bg" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_field_color_bg") "[description]" "" "[maxlength]" "7" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" "#FFFFFF"
			;
		
		# color_ft -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.color.exe" "[control_id]" "color_ft" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_field_color_ft") "[description]" "" "[maxlength]" "7" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" "#000000"
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "kl_tags_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.insert.exe"
		"[data_eval]" "$('#kl_tags_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_close_button")
		"[submitTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_insert_button")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.delete_confirm" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a confirm dialog box for delete ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_articles_delete_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (concat 
					(include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_delete_title_1") (json count "data" "/client_data") 
					(include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_delete_title_2"))
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-md"
				"[html]" "style='font-size:14px'";
			
		include "app.100.obj.form.end.exe" "[form_id]" "kl_articles_delete_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.delete.exe"
		"[data_eval]" ""
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_delete_cancel_button")
		"[submitTitle]" (if (> (json count "data" "/client_data") 0) {include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_delete_delete_button"} {""})
		"[submitType]" "danger";
	
} "Return the form";

script create app "app.100.template.knowledge" false 1 
  (param
  ;) 
  "Start point for the template" 
{

	#Main actions;
	if (not (is null or empty [app_action])) {

		#Disconnect the user;
		if (equal [app_action] "logout";) {

			json iobject "app" / connected "0" STR;
			json iobject "app" / disconnected "1" STR;
		
		};

		#Menu toggle;
		if (equal [app_action] "menu_toggle") {

			if (json select "app" /menu_default_show) {
				json iobject "app" / menu_default_show false STR;
			
			} {
				json iobject "app" / menu_default_show true STR;
			
			};
		
		};
	
	};

	#Change the page;
	if (not (is null or empty [app_page])) {

		json iobject "app" / "current_page" [app_page] STR;
	
	};
	
	-> "[app_page]" (json select "app" /current_page);
	-> "[app_user]" (json select "app" /user);

	#Check if the user is connected;
	if (json select "app" /connected) {

		include (concat "app." [app_version] ".template." [app_template] ".page." [app_page] ".exe");
	
	} {
		
		#try to connect if the user is send;
		if (is not null (json select "app" "/param/x-user")) {

			try {
				
				sql connect "session1" {cm get (json select "app" "/database")};
				
				if (equal (sql value "session1" (concat "select `password` from `users` where `login`=" (sql encode (json select "app" "/param/x-user")))) 
					(string md5 (json select "app" "/param/x-password"))) {

					json iobject "app" / groups (sql col_distinct "session1" (concat "select distinct tag 
						from user_group inner join group_tag on user_group.group_id=group_tag.group_id
						where login=" (sql encode (json select "app" "/param/x-user")));) OBJ;
					
					json iobject "app" / connected "1" STR;
					json iobject "app" / "user" (json select "app" "/param/x-user") STR;
					json iobject "app" / "current_page" (json select "app" "/default_page") STR;
					-> "[app_page]" (json select "app" /current_page);
					
					include (concat "app." [app_version] ".template." [app_template] ".page." [app_page] ".exe");
					
				} {
					
					if (or (is null or empty [app_page]) (equal [app_page] "knowledge")) {
						include (concat "app." [app_version] ".template." [app_template] ".page.knowledge.exe") "[err]" (json select "app" "/login_error_msg");
					} {
						include (concat "app." [app_version] ".template." [app_template] ".page.login.exe") "[err]" (json select "app" "/login_error_msg");
					};
					
				};
				
				sql disconnect "session1";
		
			} {
				
				if (or (is null or empty [app_page]) (equal [app_page] "knowledge")) {
					include (concat "app." [app_version] ".template." [app_template] ".page.knowledge.exe") "[err]" [err];
				} {
					include (concat "app." [app_version] ".template." [app_template] ".page.login.exe") "[err]" [err];
				};
				try {sql disconnect "session1";} {} "[sub_err]";
				
			} "[err]";

			[page];
		
		} {

			if (or (is null or empty [app_page]) (equal [app_page] "knowledge")) {
				include (concat "app." [app_version] ".template." [app_template] ".page.knowledge.exe") "[err]" "";
			} {
				include (concat "app." [app_version] ".template." [app_template] ".page.login.exe") "[err]" "";
			};
		
		};
	
	};

} "html";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang" false 1 
  (param
  	(var "[key_lang]" {true} "" is_null:false is_empty:true "")
  ;) 
  "Get a label from the language" 
{

	if (not (json exist "MENTDB_kl_tags_lang")) {

		json load "MENTDB_kl_tags_lang" "{
			\"insert_ok\": {
				\"en\": \"Element added with successfull.\",
				\"fr\": \"Elément(s) ajouté(s) avec succès.\"
			},
			\"update_ok\": {
				\"en\": \"Element updated with successfull.\",
				\"fr\": \"Elément(s) modifié(s) avec succès.\"
			},
			\"delete_ok\": {
				\"en\": \"Element deleted with successfull.\",
				\"fr\": \"Elément(s) suprimé(s) avec succès.\"
			},
			\"list_title\": {
				\"en\": \"Tag list\",
				\"fr\": \"Liste des tags\"
			},
			\"list_filter\": {
				\"en\": \"Filter\",
				\"fr\": \"Filtre\"
			},
			\"list_field_id\": {
				\"en\": \"id\",
				\"fr\": \"id\"
			},
			\"list_field_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"list_field_color_bg\": {
				\"en\": \"background color\",
				\"fr\": \"couleur arrière plan\"
			},
			\"list_field_color_ft\": {
				\"en\": \"font color\",
				\"fr\": \"couleur du texte\"
			},
			\"form_search_title\": {
				\"en\": \"Search an element\",
				\"fr\": \"Recherche d'un élément\"
			},
			\"form_search_close_button\": {
				\"en\": \"Close\",
				\"fr\": \"Fermer\"
			},
			\"form_search_search_button\": {
				\"en\": \"Search\",
				\"fr\": \"Rechercher\"
			},
			\"form_search_field_id\": {
				\"en\": \"id\",
				\"fr\": \"id\"
			},
			\"form_search_field_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"form_search_field_color_bg\": {
				\"en\": \"background color\",
				\"fr\": \"couleur arrière plan\"
			},
			\"form_search_field_color_ft\": {
				\"en\": \"font color\",
				\"fr\": \"couleur du texte\"
			},
			\"form_insert_title\": {
				\"en\": \"Insert an element\",
				\"fr\": \"Ajout d'un élément\"
			},
			\"form_insert_title_re\": {
				\"en\": \"Insert an element (Correction)\",
				\"fr\": \"Ajout d'un élément (Correction)\"
			},
			\"form_insert_close_button\": {
				\"en\": \"Close\",
				\"fr\": \"Fermer\"
			},
			\"form_insert_insert_button\": {
				\"en\": \"Add\",
				\"fr\": \"Ajouter\"
			},
			\"form_insert_field_id\": {
				\"en\": \"id\",
				\"fr\": \"id\"
			},
			\"form_insert_field_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"form_insert_field_color_bg\": {
				\"en\": \"background color\",
				\"fr\": \"couleur arrière plan\"
			},
			\"form_insert_field_color_ft\": {
				\"en\": \"font color\",
				\"fr\": \"couleur du texte\"
			},
			\"form_update_title\": {
				\"en\": \"Update an element\",
				\"fr\": \"Modification d'un élément\"
			},
			\"form_update_title_re\": {
				\"en\": \"Update an element (Correction)\",
				\"fr\": \"Modification d'un élément (Correction)\"
			},
			\"form_update_close_button\": {
				\"en\": \"Close\",
				\"fr\": \"Fermer\"
			},
			\"form_update_update_button\": {
				\"en\": \"Update\",
				\"fr\": \"Modifier\"
			},
			\"form_update_field_id\": {
				\"en\": \"id\",
				\"fr\": \"id\"
			},
			\"form_update_field_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"form_update_field_color_bg\": {
				\"en\": \"background color\",
				\"fr\": \"couleur arrière plan\"
			},
			\"form_update_field_color_ft\": {
				\"en\": \"font color\",
				\"fr\": \"couleur du texte\"
			},
			\"form_delete_title_1\": {
				\"en\": \"Delete of \",
				\"fr\": \"Suppression de \"
			},
			\"form_delete_title_2\": {
				\"en\": \" element(s)\",
				\"fr\": \" élément(s)\"
			},
			\"form_delete_cancel_button\": {
				\"en\": \"Cancel\",
				\"fr\": \"Annuler\"
			},
			\"form_delete_delete_button\": {
				\"en\": \"Delete\",
				\"fr\": \"Supprimer\"
			},
		}";

	};

	json select "MENTDB_kl_tags_lang" (concat "/" [key_lang] "/" (parameter get value "KNOWLEDGE_LANG"));
	
} "Return the translation";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.search_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a search form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_articles_search_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_search_title") 
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";

	-> "[filter_sql]" (json select "app" (concat "/objects/MENTDB_kl_articles_list/filter_sql"));
	if (not (is null or empty [filter_sql])) {
		json load "filter_sql" [filter_sql];
	} {
		json load "filter_sql" "{}";
	};
			
		# id_tag -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/id_tag")) {
				json iobject "filter_sql" / "id_tag" "" STR;
			};
			
			sql connect "session_data" {cm get "MENTDB";};
			json load "tmp_inValues" "[]";
			json load "tmp_optionValues" "[]";
			json iarray "tmp_inValues" / "" STR;
			json iarray "tmp_optionValues" / "" STR;
			
			sql parse "session_data" "T" (concat "select id, tag from kl_tags order by tag") {
			
				json iarray "tmp_inValues" / [T_id] STR;
				json iarray "tmp_optionValues" / [T_tag] STR;
			
			};
			
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "id_tag" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_search_field_id_tag") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "tmp_inValues")
				"[optionValues]" (json doc "tmp_optionValues")
				"[value]" (json select "filter_sql" "/id_tag")
			;

			sql disconnect "session_data";
		
		# title -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/title")) {
				json iobject "filter_sql" / "title" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_search_field_title") "[description]" "" "[maxlength]" "512" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/title")
			;
		
		# article -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/article")) {
				json iobject "filter_sql" / "article" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "article" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_search_field_article") "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/article")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "kl_articles_search_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.search.exe"
		"[data_eval]" "$('#kl_articles_search_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_search_close_button")
		"[submitTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_search_search_button")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.knowledge.html.menu_left" false 1 
  (param
  ;) 
  "Menu left" 
{
	
	concat_var "[page]" "<div style='width: 100%;width:100%;height:100%;
		background-color: " (json select "app" "/menu_background_color") ";'>

		" (app menu show) "
	
	</div>";

;} "html";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.delete" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Delete elements ..." 
{

	json load "client_data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {

		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};
	
		json parse_array "client_data" "/client_data" "[o]" {
		
			json load "data" [o];
	
			-> "[result]" (sql dml "session1" (concat 
				"DELETE FROM `kl_articles` 
				WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
				;"
			));
		
		};
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (concat "
			" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "delete_ok"))
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"page\":\"1\"}")
		;

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;

	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.knowledge.page.admin" false 1 
  (param
  ;) 
  "Show the admin page" 
{

	include (concat "app." [app_version] ".template." [app_template] ".html.body_top.exe");

	#____________________________________________________________;
	
	#Your code here;
	include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.skeleton.exe";
	
	include "app.100.obj.sajax.skeleton.onload.exe"
		"[scriptname]" (concat "app." [app_version] ".template." [app_template] ".page.admin.onload.exe")
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
	;
	
	#____________________________________________________________;
	
	include (concat "app." [app_version] ".template." [app_template] ".html.body_bottom.exe");

;} "The 'admin' page";

script create exe "app.100.template.knowledge.html.bar_top" false 1 
  (param
  ;) 
  "Bar top" 
{

	concat_var "[page]" "<div style='box-shadow: 0px 0px 8px " (json select "app" "/top_background_color") ";z-index: 999;position: fixed;width:100%;height:65px;line-height:63px;
		background-color: " (json select "app" "/top_background_color") ";
		color: " (json select "app" "/top_color") ";
		font-size: 22px;'>
		<img src='images/refresh.gif' style='display:none'>
	     <a href='index.jsp'><img id='top_refresh_icon' src='images/" (json select "app" "/top_logo") "' 
			style='vertical-align:middle;
		     width:" (json select "app" "/top_logo_width") ";
			margin-top:" (json select "app" "/top_logo_top") ";
			margin-left:" (json select "app" "/top_logo_left") ";'></a>   " (json select "app" "/top_title") "

		<div style='float:right'>
			<span class='hidden-xs' style='font-size:18px'>" (json select "app" "/user") "</span>  
			<a style='margin-right: 20px;color:#fff' href='index.jsp?app_action=menu_toggle'><i class='fa fa-bars' style='vertical-align: middle;'></i></a>
			<a style='margin-right: 20px;color:#fff' href='index.jsp?app_action=logout'><i class='fa fa-power-off' style='vertical-align: middle;'></i></a>
		</div>
	
	</div>";

;} "html";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Get data from a database into a list ..." 
{
	
	#Load the current object id and his configuration;
	-> "[OBJECT_ID]" "MENTDB_kl_articles_list";
	include "app.100.scrud.overwrite_config.exe"
		"[OBJ_PARAM_LIST]" "container_id,page,nb_by_page,nb_lr_pagination,order_by,filter_sql"
	;
	
	if (equal [nb_by_page] "*") {-> "[nb_by_page]" 999999999};
	if (is empty [order_by]) {
		-> "[asc_desc]" "ASC|";
		-> "[cur_asc_desc]" "";
		-> "[cur_order_by]" "";
	} {
		-> "[cur_asc_desc]" (atom get [order_by] 1 "|");
		-> "[cur_order_by]" (atom get [order_by] 2 "|");
		if (string starts_with [order_by] "ASC|") {
			-> "[asc_desc]" "DESC|";
		} {
			-> "[asc_desc]" "";
		};
	};

	#Initialization;
	-> "[object]" "<div style='border: 1px solid rgba(0,0,0,.12);-webkit-border-radius: 3px;
		-moz-border-radius: 3px;border-radius: 3px;
		margin-top: 2px;margin-bottom: 2px;padding:5px;background-color:#fff;color:#313131'>";

	if (app is_granted_a "MENTDB.kl_articles.list.delete") {concat_var "[object]" "<span style='float:right'><button type='button' class='btn btn-danger btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.delete_confirm.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "get_all_checked('kl_articles_keys_checkbox')") "><span class='fa fa-remove fa-sm' aria-hidden='true'></span></button></span>";};
	if (app is_granted_a "MENTDB.kl_articles.list.insert") {concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-success btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.insert_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-plus fa-sm' aria-hidden='true'></span></button></span>";};
	if (app is_granted_a "MENTDB.kl_articles.list.search") {concat_var "[object]" "<span style='float:right'><button type='button' style='margin-right:6px' class='btn btn-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.search_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-search fa-sm' aria-hidden='true'></span></button></span>";};

	concat_var "[object]" "
	<span style='font-size:16px'><b>  " (string first_letter_upper (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "list_title")) "</b></span>
	
	<div style='height:10px;'></div>
	
	<table class='table table-striped table-hover table-bordered' style='margin-bottom: 0px;'>
  <thead>
    <tr>";
	
	#Connect to the database;
	sql connect "session1" {cm get "MENTDB";};

	try {

		#concat the row title counter;
		concat_var "[object]" "
      <th style='width:44px;padding: 0px 0px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' id='kl_articles_main_checkbox' onchange='check_all(\"kl_articles_keys_checkbox\", this);'></div></th>
      <th scope='col' style='padding: 0px;width:200px'><a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "id_tag") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "id_tag")}} {(concat "ASC|" "id_tag")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "list_field_id_tag") (if (equal [cur_order_by] "id_tag") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th scope='col' style='padding: 0px;width:20px'><a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "order") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "order")}} {(concat "ASC|" "order")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "list_field_order") (if (equal [cur_order_by] "order") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th scope='col' style='padding: 0px;width:20px'><a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "is_draft") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "is_draft")}} {(concat "ASC|" "is_draft")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "list_field_is_draft") (if (equal [cur_order_by] "is_draft") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      <th scope='col' style='padding: 0px;'><a style='border:0px' class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"order_by\":\"" (if (equal [cur_order_by] "title") {if (is empty [asc_desc]) {""} {(concat [asc_desc] "title")}} {(concat "ASC|" "title")}) "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "list_field_title") (if (equal [cur_order_by] "title") {(if (is empty [asc_desc]) {"<i class='fa fa-sort-down  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"} {if (not equal "ASC|" [asc_desc]) {"<i class='fa fa-sort-up  float-right' aria-hidden='true' style='margin-top: 3px;'></i>"}})}) "</a></th>
      </tr>
  </thead>
  <tbody>";
		
		-> "[sql_filter]" "";
		-> "[sql_filter_keys]" "";
		if (not (is null or empty [filter_sql])) {
			json load "filter_sql" [filter_sql];
			json parse_obj "filter_sql" "/" "[key]" "[val]" {

				if (not (string starts_with [key] "type:")) {
					switch (json select "filter_sql" (concat "/type:" [key]))
						("EQUAL") {concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
						("LIKE_L") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "'";}
						("LIKE_R") {concat_var "[sql_filter]" " and `" [key] "` like '" (string sublrchar (sql encode [val]) 1) "%'";}
						("LIKE_LR") {concat_var "[sql_filter]" " and `" [key] "` like '%" (string sublrchar (sql encode [val]) 1) "%'";}
						{concat_var "[sql_filter]" " and `" [key] "`=" (sql encode [val]);}
					;
					concat_var "[sql_filter_keys]" "<span class='badge badge-light'>" [key] "</span> ";
				};
			
			};
	
			if (> (json count "filter_sql" "/") 0) {
				-> "[sql_filter]" (concat " WHERE " (string substring [sql_filter] 5));
				-> "[sql_filter_keys]" (concat "<h5 style='margin-top: 1px;margin-bottom:0px'><button type='button' style='margin-left: 10px;' class='btn btn-outline-dark btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"filter_sql\":{}}")) "[getElementById]" "" "[data]" "") "><span class='fa fa-remove fa-xs' aria-hidden='true'></span> " (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "list_filter") "(s)</button></h5>");
			};
		};

		-> "[iline]" (+ 1 (- (* [page] [nb_by_page]) [nb_by_page]));
		-> "[nb_elements]" (sql value "session1" (concat "select count(*) from `kl_articles` " [sql_filter] ";"));
		-> "[nb_page]" (math ceil (/ [nb_elements] [nb_by_page]));
		if (is empty [cur_order_by]) {
			-> "[sql_order_by]" "order by `kl_tags`.`tag`, kl_articles.`order`";
		} {
			if (equal "order" [cur_order_by]) {
				-> "[sql_order_by]" (concat "order by `" [cur_order_by] "` " [cur_asc_desc]);
			} {
				if (equal "id_tag" [cur_order_by]) {
					-> "[sql_order_by]" (concat "order by `kl_tags`.`tag` " [cur_asc_desc]);
				} {
					-> "[sql_order_by]" (concat "order by " [cur_order_by] " " [cur_asc_desc]);
				};
			};
		};

		-> "[app_is_granted_update]" (app is_granted_a "MENTDB.kl_articles.list.update");
		
		sql parse "session1" "T" (concat "select 
			`kl_articles`.`id`, 
			`kl_articles`.`id_tag`, 
			`kl_articles`.`title`, 
			`kl_articles`.`article`, 
			`kl_articles`.`order`, 
			`kl_articles`.`dtcreate`,
			`kl_articles`.`is_draft`,
			`kl_tags`.`tag` from `kl_articles` inner join `kl_tags` on `kl_articles`.`id_tag`=`kl_tags`.`id` " [sql_filter] " " [sql_order_by] " limit " (- (* [page] [nb_by_page]) [nb_by_page]) ", " [nb_by_page] ";") {
			
			json load "primary_key" "{}";
			json iobject "primary_key" / "client_data" "{}" OBJ;
			json iobject "primary_key" "/client_data" "id" [T_id] STR;
			
      		
			concat_var "[object]" "
      <tr><th style='width:44px;padding: 0px 2px 0px 12px;'><div class='form-check form-check-inline form-control-lg' style='margin-right: 0px;padding-right: 0px;margin-left: 3px;'><input style='margin-right: 0px;' class='form-check-input' type='checkbox' name='kl_articles_keys_checkbox' value='" (string encode_b64 (json doc "primary_key")) "'></div></th>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_tag] "<" "<") "</td>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_order] "<" "<") "</td>
      <td style='padding: 6px 2px 0px 2px;'>" (string replace [T_is_draft] "<" "<") "</td>
      <td style='padding: 0px 2px 0px 2px;'><button type='button' class='btn btn-link btn-sm' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.update_open_form.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "primary_key")) "[getElementById]" "" "[data]" "") ">" (string replace [T_title] "<" "<") "</button></td>";

			concat_var "[object]" "</tr>";

      		++ "[iline]";
		
		};
    
		concat_var "[object]" "
	</tbody>
</table>

";

	concat_var "[object]" "<nav aria-label='Page navigation' style='display:inline-block'>
  <ul class='pagination' style='margin-bottom:0px'>
    <li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" 1 "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Previous'>
        <span aria-hidden='true'>«</span>
        <span class='sr-only'>Previous</span>
      </a>
    </li>";

	for (-> "[i_page]" (- [page] [nb_lr_pagination])) (< [i_page] [page]) (++ "[i_page]") {

		if (> [i_page] 0) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};

	for (-> "[i_page]" [page]) (<= [i_page] (+ [page] [nb_lr_pagination])) (++ "[i_page]") {

		if (<= [i_page] [nb_page]) {
			if (== [page] [i_page]) {
				concat_var "[object]" "<li class='page-item active'>
		      <span class='page-link'>
		        " [i_page] "
		        <span class='sr-only'>(current)</span>
		      </span>
		    </li>";
			} {
				concat_var "[object]" "<li class='page-item'><a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [i_page] "\"}")) "[getElementById]" "" "[data]" "") ">" [i_page] "</a></li>";
			};
		};

	};
    
    concat_var "[object]" "<li class='page-item'>
      <a class='page-link' href='javascript:;' onClick=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 (concat "{\"page\":\"" [nb_page] "\"}")) "[getElementById]" "" "[data]" "") " aria-label='Next'>
        <span aria-hidden='true'>»</span>
        <span class='sr-only'>Next</span>
      </a>
    </li>
  </ul>
</nav>   " (+ 1 (- (* [page] [nb_by_page]) [nb_by_page])) " - " (if (> (* [page] [nb_by_page]) [nb_elements]) {[nb_elements]} {* [page] [nb_by_page]}) " / " [nb_elements] "
  <div style='float: right;display: inline-block;'><select id='app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.key.nb_by_page' style='height: 33px;color: #007bff;' class='form-control' onChange=" (include "app.100.obj.sajax.client.exe" "[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe" "[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"order_by\":\"\", \"page\":\"1\"}") "[getElementById]" "nb_by_page=app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.key.nb_by_page" "[data]" "") ">
      <option " (if (== [nb_by_page] 1) {"selected"}) ">1</option>
      <option " (if (== [nb_by_page] 2) {"selected"}) ">2</option>
      <option " (if (== [nb_by_page] 3) {"selected"}) ">3</option>
      <option " (if (== [nb_by_page] 4) {"selected"}) ">4</option>
      <option " (if (== [nb_by_page] 5) {"selected"}) ">5</option>
      <option " (if (== [nb_by_page] 10) {"selected"}) ">10</option>
      <option " (if (== [nb_by_page] 12) {"selected"}) ">12</option>
      <option " (if (== [nb_by_page] 14) {"selected"}) ">14</option>
      <option " (if (== [nb_by_page] 16) {"selected"}) ">16</option>
      <option " (if (== [nb_by_page] 18) {"selected"}) ">18</option>
      <option " (if (== [nb_by_page] 20) {"selected"}) ">20</option>
      <option " (if (== [nb_by_page] 25) {"selected"}) ">25</option>
      <option " (if (== [nb_by_page] 50) {"selected"}) ">50</option>
      <option " (if (== [nb_by_page] 100) {"selected"}) ">100</option>
      <option " (if (== [nb_by_page] 250) {"selected"}) ">250</option>
      <option " (if (== [nb_by_page] 500) {"selected"}) ">500</option>
      <option " (if (== [nb_by_page] 1000) {"selected"}) ">1000</option>
      <option " (if (== [nb_by_page] 2500) {"selected"}) ">2500</option>
      <option " (if (== [nb_by_page] 5000) {"selected"}) ">5000</option>
      <option " (if (== [nb_by_page] 999999999) {"selected"}) ">*</option>
    </select></div><div style='float: right;display: inline-block;line-height: 32px;margin-right: 20px;'>" [sql_filter_keys] "</div>

</div>";

		sql disconnect "session1";

		include "app.100.obj.sajax.refresh.exe"
			"[target]" [container_id]
			"[innerHtml]" [object]
		;

	} {

		#Save the error;
		log trace [err]; 
		
		#Close all objects;
		try {sql disconnect "session1";} {} "[e]";

		exception (1) (concat "ERR/APP/LIST: " [err]);

	} "[err]";
	
} "Return the list";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.skeleton" false 1 
  (param
  ;) 
  "SCRUD skeleton ..." 
{

	if (app is_granted_a "MENTDB.kl_tags.list.show") {

		include "app.100.obj.sajax.skeleton.container.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
			include "app.100.obj.sajax.skeleton.row.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
				include "app.100.obj.sajax.skeleton.col.exe" "[id]" "MENTDB_kl_tags" "[name]" "" "[class]" "col-12 col-xs-12 col-sm-12 col-md-12 col-lg-12" "[style]" "padding-left:0px;padding-right:0px";
				
				include "app.100.obj.sajax.skeleton.div.end.exe";
			include "app.100.obj.sajax.skeleton.div.end.exe";
		include "app.100.obj.sajax.skeleton.div.end.exe";
	
		include "app.100.obj.sajax.skeleton.onload.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.onload.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;

	};
	
} "Return the page";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.delete" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Delete elements ..." 
{

	json load "client_data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {

		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};
	
		json parse_array "client_data" "/client_data" "[o]" {
		
			json load "data" [o];
	
			-> "[result]" (sql dml "session1" (concat 
				"DELETE FROM `kl_tags` 
				WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
				;"
			));
		
		};
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (concat "
			" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "delete_ok"))
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"page\":\"1\"}")
		;

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;

	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.update_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {
		
		#Connect to the database;
		sql connect "session1" {cm get "MENTDB";};
		json load "row" (sql row "session1" (concat "select 
			`id`, 
			`id_tag`, 
			`title`, 
			`article`, 
			`order`, 
			is_draft,
			`dtcreate` from `kl_articles` where `id`= " (sql encode (json select "data" "/client_data/id")) " "));
	
		#Disconnection ...;
		sql disconnect "session1";

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		exception (1) ([err]);
		
	} "[err]";

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_articles_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_title")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "90%;max-width:90%"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]"(json select "row" "/id")
			;
		
		# id_tag -------- TO DELETE ...;

		sql connect "session_data" {cm get "MENTDB";};
		json load "tmp_inValues" "[]";
		json load "tmp_optionValues" "[]";
		sql parse "session_data" "T" (concat "select id, tag from kl_tags order by tag") {
		
			json iarray "tmp_inValues" / [T_id] STR;
			json iarray "tmp_optionValues" / [T_tag] STR;
		
		};
			
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "id_tag" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_field_id_tag") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "tmp_inValues")
				"[optionValues]" (json doc "tmp_optionValues")
				"[value]" (json select "row" "/id_tag")
			;

		sql disconnect "session_data";
		
		# title -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_field_title") "[description]" "" "[maxlength]" "512" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/title")
			;
		
		# article -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textarea_cke.exe" "[control_id]" "article" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_field_article") "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/article")
			;
		
		# order -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.number.exe" "[control_id]" "order" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_field_order") "[description]" "" "[maxlength]" ""
				"[min]" "0" "[max]" "10000" "[step]" "1" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/order")
			;

			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "is_draft" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "list_field_is_draft") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "row" "/is_draft")
			;

			include "app.100.obj.form.control.textbox.file.exe" "[control_id]" "img_to_upload" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "Image" "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "kl_articles_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.update.exe"
		"[data_eval]" "@@@$('#kl_articles_update_form_id').serializeObject_file_upload(scriptname, OBJ_OVERWRITE_B64)"
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_close_button")
		"[submitTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_update_button")
		"[submitType]" "warning";
	
} "Return the form";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.insert_reopen_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Reopen an insert form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_tags_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_title_re")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# tag -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "tag" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_field_tag") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/tag")
			;
		
		# color_bg -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.color.exe" "[control_id]" "color_bg" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_field_color_bg") "[description]" "" "[maxlength]" "7" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/color_bg")
			;
		
		# color_ft -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.color.exe" "[control_id]" "color_ft" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_field_color_ft") "[description]" "" "[maxlength]" "7" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/color_ft")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "kl_tags_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.insert.exe"
		"[data_eval]" "$('#kl_tags_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_close_button")
		"[submitTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_insert_insert_button")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.update" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Update an element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);
		
		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `kl_tags` SET 
			`tag`=" (sql encode (json select "data" "/client_data/tag")) ", 
			`color_bg`=" (sql encode (json select "data" "/client_data/color_bg")) ", 
			`color_ft`=" (sql encode (json select "data" "/client_data/color_ft")) "
			WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
			;"
		));
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (concat "
			" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "update_ok"))
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.update_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.delete_confirm" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a confirm dialog box for delete ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_tags_delete_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (concat 
					(include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_delete_title_1") (json count "data" "/client_data") 
					(include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_delete_title_2"))
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-md"
				"[html]" "style='font-size:14px'";
			
		include "app.100.obj.form.end.exe" "[form_id]" "kl_tags_delete_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.delete.exe"
		"[data_eval]" ""
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_delete_cancel_button")
		"[submitTitle]" (if (> (json count "data" "/client_data") 0) {include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_delete_delete_button"} {""})
		"[submitType]" "danger";
	
} "Return the form";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.update" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Update an element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		-> "[result]" (sql dml "session1" (concat 
			"UPDATE `kl_articles` SET 
			`id_tag`=" (sql encode (json select "data" "/client_data/id_tag")) ", 
			`title`=" (sql encode (json select "data" "/client_data/title")) ", 
			`article`=" (sql encode (json select "data" "/client_data/article")) ", 
			`order`=" (sql encode (json select "data" "/client_data/order")) ", 
			`is_draft`=" (sql encode (json select "data" "/client_data/is_draft")) "
			WHERE `id`= " (sql encode (json select "data" "/client_data/id")) " 
			;"
		));
		
		#Disconnection ...;
		sql disconnect "session1";

		if (not (is null or empty (json select "data" "/client_data/img_to_upload_filename"))) {

			-> "[filename_tmp]" (string replace (json select "data" "/client_data/img_to_upload_filename") (string int_to_char 92) "/");

			file b64_write (json select "data" "/client_data/img_to_upload_datafile") 
				(concat "web/https/knowledge/images/" (atom get [filename_tmp] (atom size [filename_tmp] "/") "/"));
			
		};
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (concat "
			" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "update_ok"))
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.update_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.knowledge.page.login" false 1 
  (param
  	(var "[err]" {true} "The error message" is_null:true is_empty:true "Bad password.")
  ;) 
  "Show the login page" 
{

	-> "[page]" "";

	concat_var "[page]" "<!doctype html>
		<html lang=\"fr\">
		<head>
		  <meta charset=\"utf-8\">
		  <title>" (json select "app" "/title") "</title>
		  <link  href=\"css/style.css\" rel=\"stylesheet\">
		  <link href=\"dist/css/bootstrap.css\" rel=\"stylesheet\">
		  <link rel=\"icon\" type=\"image/png\" href=\"images/" (json select "app" "/bar_icon") "\" />
		</head>
		<body id=\"body\" style='background-repeat: no-repeat;
		    background-attachment: fixed;
		    background-position: center;
		    background-size: 100% 100%;
		    background-image: url(images/bg.jpg);margin:0px;color:#333;font-family: " (json select "app" "/font_family") ";font-size: 12px;'>
		<div id=\"login\">
		  <div id='divSignInCenter'>
		      <div id='divSignIn' style='border: 5px #4e4e4e solid;background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #7d7d7d), color-stop(100%, #1b1b1b)), #1b1b1b;
			      background: -webkit-linear-gradient(#7d7d7d, #1b1b1b), #3F3F3F;
			      background: -moz-linear-gradient(#7d7d7d, #1b1b1b), #3F3F3F;
			      background: -o-linear-gradient(#7d7d7d, #1b1b1b), #3F3F3F;
			      background: linear-gradient(#7d7d7d, #1b1b1b), #3F3F3F;box-shadow: 2px 0px 15px 1px #888888;'>
		          <div id='divSignInImg' style='padding-top: 35px;'><a href='index.jsp'><img src='images/" (json select "app" "/login_logo") "' height='70px' alt=''></a></div>
		          <div style='padding:5px;font-size: 16px;color:#fff;border-bottom: 1px #696969 solid;'><b>" (json select "app" "/title") "<br><a style='color:#FF9900' href='index.jsp?app_page=knowledge'>" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "back") "</a></b></div>
		          <div id='connectError' style=\"color:#F00;min-height:25px\">" [err] "</div>
		          <form action='index.jsp' method='post'>
		              <input class='style-1' type='text' placeholder='" (json select "app" "/login_placeholder_user") "' name='x-user' id='x-user' autofocus><br>
		              <input class='style-1' type='password' placeholder='" (json select "app" "/login_placeholder_password") "' name='x-password' id='x-password'>
		              <input type=\"submit\" class='btn btn-light' style='padding: 5px 30px 5px 30px;margin-top: 10px;width: 200px;height: 35px;' value=\"" (json select "app" "/login_submit_title") "\">
		              <div style='height:25px'></div>
		          </form>
		      </div>
		      <div style='margin-top: 10px;color:#FFF'>© " (json select "app" "/copyright_years") " - " (json select "app" "/copyright_link") "</div>
		  </div>
		</div>
		</body>
		</html>";

	[page];

;} "The 'login' page";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.search_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open a search form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_tags_search_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_search_title") 
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";

	-> "[filter_sql]" (json select "app" (concat "/objects/MENTDB_kl_tags_list/filter_sql"));
	if (not (is null or empty [filter_sql])) {
		json load "filter_sql" [filter_sql];
	} {
		json load "filter_sql" "{}";
	};
			
		# tag -------- TO DELETE ...;

			if (is null (json select "filter_sql" "/tag")) {
				json iobject "filter_sql" / "tag" "" STR;
			};
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "tag" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_search_field_tag") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "filter_sql" "/tag")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "kl_tags_search_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.search.exe"
		"[data_eval]" "$('#kl_tags_search_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_search_close_button")
		"[submitTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_search_search_button")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.insert_reopen_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Reopen an insert form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_articles_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_title_re")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "90%;max-width:90%"
				"[html]" "style='font-size:14px'";
			
		# id_tag -------- TO DELETE ...;
		
		sql connect "session_data" {cm get "MENTDB";};
		json load "tmp_inValues" "[]";
		json load "tmp_optionValues" "[]";
		sql parse "session_data" "T" (concat "select id, tag from kl_tags order by tag") {
		
			json iarray "tmp_inValues" / [T_id] STR;
			json iarray "tmp_optionValues" / [T_tag] STR;
		
		};
			
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "id_tag" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_field_id_tag") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "tmp_inValues")
				"[optionValues]" (json doc "tmp_optionValues")
				"[value]" (json select "data" "/client_data/id_tag")
			;

		sql disconnect "session_data";
		
		# title -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_field_title") "[description]" "" "[maxlength]" "512" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/title")
			;
		
		# article -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textarea_cke.exe" "[control_id]" "article" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_field_article") "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/article")
			;
		
		# order -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.number.exe" "[control_id]" "order" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_field_order") "[description]" "" "[maxlength]" ""
				"[min]" "0" "[max]" "10000" "[step]" "1" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/order")
			;

			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "is_draft" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "list_field_is_draft") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "data" "/client_data/is_draft")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "kl_articles_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.insert.exe"
		"[data_eval]" "$('#kl_articles_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_close_button")
		"[submitTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_insert_button")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.knowledge.html.body_top" false 1 
  (param
  ;) 
  "Body top" 
{

	-> "[page]" "";

	concat_var "[page]" "<!doctype html>
		<html lang=\"fr\" style='height:100%'>
		<head>
		  <meta charset=\"utf-8\">
		  <title>" (json select "app" "/title") "</title>
		  <link href=\"font_awesome/css/font-awesome.min.css\" rel=\"stylesheet\">
		  <link href=\"css/menu-vertical.css\" rel=\"stylesheet\">
		  <script src=\"js/menu-vertical.js\"></script>
		  <link href=\"dist/css/bootstrap.css\" rel=\"stylesheet\">
		  <link href=\"css/tempusdominus-bootstrap-4.min.css\" rel=\"stylesheet\">
		  <script src=\"js/jquery.min.js\"></script>
		  <script src=\"js/moment-with-locales.js\"></script>
		  <script src=\"js/tempusdominus-bootstrap-4.min.js\"></script>
		  <script src=\"js/utils.js\"></script>
		  <script src=\"js/Chart.bundle.js\"></script>
		  <script src=\"dist/js/bootstrap.min.js\"></script>
		  <script src=\"js/jquery.sparkline.min.js\"></script>
		  <script src=\"js/raphael-2.1.4.min.js\"></script>
		  <script src=\"js/justgage.js\"></script>
		  <script src=\"js/progressbar.min.js\"></script>
		  <script src=\"js/ckeditor.js\"></script>
		  <script src=\"js/mentdb.js\"></script>
		  <link rel=\"icon\" type=\"image/png\" href=\"images/" (json select "app" "/bar_icon") "\" />
		  <style>
.jqstooltip{
    box-sizing: content-box;
}

.GaugeMeter{
	Position:        Relative;
	Text-Align:      Center;
	Overflow:        Hidden;
	Cursor:          Default;
}

.GaugeMeter SPAN,
    .GaugeMeter B{
    	Margin:          0 23%;
    	Width:           50%;
    	Position:        Absolute;
    	Text-align:      Center;
    	Display:         Inline-Block;
    	Color:           RGBa(0,0,0,.8);
    	Font-Weight:     100;
    	Font-Family:     \"Open Sans\", Arial;
    	Overflow:        Hidden;
    	White-Space:     NoWrap;
    	Text-Overflow:   Ellipsis;
}
.GaugeMeter[data-style=\"Semi\"] B{
	Margin:          0 10%;
	Width:           80%;
}

.GaugeMeter S,
    .GaugeMeter U{
    	Text-Decoration: None;
    	Font-Size:       .49em;
    	Opacity:         .5;
}

.GaugeMeter B{
	Color:           Black;
	Font-Weight:     300;
	Opacity:         .8;
}

.progress > svg {
	width: 100%;
	height: 100%;
	display: block;
}
			
		  </style>
		</head>
		<body id=\"body\" style='height:100%;margin:0px;color:#333;font-family: " (json select "app" "/font_family") ";font-size: 12px;'>
			<div id='mentdb_alert_container'></div><div id='mentdb_modal_container'></div>";

	include (concat "app." [app_version] ".template." [app_template] ".html.bar_top.exe");
	concat_var "[page]" "<div style='display:table;width:100%;height:100%;padding-top: 65px;'>";
	concat_var "[page]" "  <div style='display:table-row'>";
	if (json select "app" /menu_default_show) {
	
		concat_var "[page]" "    <div style='display:table-cell;width:70px;border-right: 1px solid rgba(0,0,0,.11);vertical-align: top;'>";
		include (concat "app." [app_version] ".template." [app_template] ".html.menu_left.exe");
		concat_var "[page]" "    </div>";
	
	};
	
	concat_var "[page]" "    <div style='display:table-cell;background-color:#f1f2f3;padding: 8px;'>";

;} "html";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.update_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	try {
		
		#Connect to the database;
		sql connect "session1" {cm get "MENTDB";};
		json load "row" (sql row "session1" (concat "select 
			`id`, 
			`tag`, 
			`color_bg`, 
			`color_ft` from `kl_tags` where `id`= " (sql encode (json select "data" "/client_data/id")) " "));
	
		#Disconnection ...;
		sql disconnect "session1";

	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		exception (1) ([err]);
		
	} "[err]";

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_tags_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_title")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "modal-lg"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]"(json select "row" "/id")
			;
		
		# tag -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "tag" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_field_tag") "[description]" "" "[maxlength]" "255" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/tag")
			;
		
		# color_bg -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.color.exe" "[control_id]" "color_bg" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_field_color_bg") "[description]" "" "[maxlength]" "7" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/color_bg")
			;
		
		# color_ft -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.color.exe" "[control_id]" "color_ft" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_field_color_ft") "[description]" "" "[maxlength]" "7" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "row" "/color_ft")
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "kl_tags_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.update.exe"
		"[data_eval]" "$('#kl_tags_update_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_close_button")
		"[submitTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "form_update_update_button")
		"[submitType]" "warning";
	
} "Return the form";

script create conf "app.100.template.knowledge" false 1 
  (param
  ;) 
  "Configuration" 
{

	json load "configuration" "{}";

	#All;
	json iobject "configuration" / title (if (equal (parameter get value "KNOWLEDGE_LANG") "fr") {"Base de connaissance"} {"Knowledge"}) STR;
	json iobject "configuration" / bar_icon "knowledge32.png" STR;
	json iobject "configuration" / font_family "Roboto,Helvetica Neue,Helvetica,Arial,sans-serif;" STR;
	json iobject "configuration" / copyright_years (concat "2012 - " (date year (date sysdate))) STR;
	json iobject "configuration" / copyright_link "<a href='https://www.mentdb.org' style='color:#fff' target='_blank'><b>MentDB</b></a>" STR;
	
	#login;
	json iobject "configuration" / login_logo "knowledge.png" STR;
	json iobject "configuration" / login_placeholder_user (if (equal (parameter get value "KNOWLEDGE_LANG") "fr") {"Utilisateur"} {"User"}) STR;
	json iobject "configuration" / login_placeholder_password (if (equal (parameter get value "KNOWLEDGE_LANG") "fr") {"Mot de passe"} {"Password"}) STR;
	json iobject "configuration" / login_submit_title (if (equal (parameter get value "KNOWLEDGE_LANG") "fr") {"Connexion"} {"Login"}) STR;
	json iobject "configuration" / login_error_msg "Bad user or password." STR;

	#default page;
	json iobject "configuration" / default_page "home" STR;

	#top;
	json iobject "configuration" / top_background_color "#313131" STR;
	json iobject "configuration" / top_color "#fff" STR;
	json iobject "configuration" / top_logo "knowledge.png" STR;
	json iobject "configuration" / top_logo_width "50px" STR;
	json iobject "configuration" / top_logo_top "-2px" STR;
	json iobject "configuration" / top_logo_left "10px" STR;
	json iobject "configuration" / top_title (if (equal (parameter get value "KNOWLEDGE_LANG") "fr") {"Base de connaissance"} {"Knowledge"}) STR;

	#menu;
	json iobject "configuration" / menu_background_color "#fff" STR;
	json iobject "configuration" / menu_default_show true STR;
	json iobject "configuration" / menu "[]" ARRAY;
	
	app menu "/menu" "home" "Home" "fa-home" "index.jsp?app_page=home" post "home" "menu_home" "*-";
	app menu "/menu" "admin" "Config" "fa-gear" "index.jsp?app_page=admin" post "admin" "menu_admin" "*+";

	json doc "configuration";

} "";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.onload" false 1 
  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Execute this script on load ..." 
{

	include "app.100.obj.sajax.server.exe"
		"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"container_id\":\"MENTDB_kl_articles\", \"page\":\"1\", \"nb_by_page\":\"16\", \"nb_lr_pagination\":\"4\", \"order_by\":\"\"}")
	;
	
} "Reload all blocs";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.search" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json load "filter_sql" "{\"filter_sql\":{}}";

		

		if (not (is null or empty (json select "data" "/client_data/id_tag"))) {
			json iobject "filter_sql" "/filter_sql" "id_tag" (json select "data" "/client_data/id_tag") STR;
			json iobject "filter_sql" "/filter_sql" "type:id_tag" "EQUAL" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		if (not (is null or empty (json select "data" "/client_data/title"))) {
			json iobject "filter_sql" "/filter_sql" "title" (json select "data" "/client_data/title") STR;
			json iobject "filter_sql" "/filter_sql" "type:title" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		if (not (is null or empty (json select "data" "/client_data/article"))) {
			json iobject "filter_sql" "/filter_sql" "article" (json select "data" "/client_data/article") STR;
			json iobject "filter_sql" "/filter_sql" "type:article" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "filter_sql"))
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.search" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

		json load "filter_sql" "{\"filter_sql\":{}}";

		

		if (not (is null or empty (json select "data" "/client_data/tag"))) {
			json iobject "filter_sql" "/filter_sql" "tag" (json select "data" "/client_data/tag") STR;
			json iobject "filter_sql" "/filter_sql" "type:tag" "LIKE_LR" STR; #EQUAL|LIKE_L|LIKE_LR|LIKE_R;
		};

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 (json doc "filter_sql"))
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.update_reopen_form" false 1 
  (param
  	(var "[container_id]" {true} "" is_null:false is_empty:false "container1")
  ;) 
  "Reopen an update form ..." 
{

	json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_articles_update_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_title_re")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "90%;max-width:90%"
				"[html]" "style='font-size:14px'";
			
		# id -------- TO DELETE ...;
			
			include "app.100.obj.form.control.hidden.exe"
				"[control_id]" "id"
				"[value]" (json select "data" "/client_data/id")
			;
		
		# id_tag -------- TO DELETE ...;

		sql connect "session_data" {cm get "MENTDB";};
		json load "tmp_inValues" "[]";
		json load "tmp_optionValues" "[]";
		sql parse "session_data" "T" (concat "select id, tag from kl_tags order by tag") {
		
			json iarray "tmp_inValues" / [T_id] STR;
			json iarray "tmp_optionValues" / [T_tag] STR;
		
		};
			
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "id_tag" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_field_id_tag") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "tmp_inValues")
				"[optionValues]" (json doc "tmp_optionValues")
				"[value]" (json select "data" "/client_data/id_tag")
			;

		sql disconnect "session_data";
		
		# title -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_field_title") "[description]" "" "[maxlength]" "512" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/title")
			;
		
		# article -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textarea_cke.exe" "[control_id]" "article" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_field_article") "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/article")
			;
		
		# order -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.number.exe" "[control_id]" "order" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_field_order") "[description]" "" "[maxlength]" ""
				"[min]" "" "[max]" "" "[step]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" (json select "data" "/client_data/order")
			;

			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "is_draft" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "list_field_is_draft") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" (json select "data" "/client_data/is_draft")
			;

			include "app.100.obj.form.control.textbox.file.exe" "[control_id]" "img_to_upload" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" "Image" "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "kl_articles_update_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.update.exe"
		"[data_eval]" "@@@$('#kl_articles_update_form_id').serializeObject_file_upload(scriptname, OBJ_OVERWRITE_B64)"
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_close_button")
		"[submitTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_update_update_button")
		"[submitType]" "warning";
	
} "Return the form";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang" false 1 
  (param
  	(var "[key_lang]" {true} "" is_null:false is_empty:true "")
  ;) 
  "Get a label from the language" 
{

	if (not (json exist "MENTDB_kl_articles_lang")) {

		json load "MENTDB_kl_articles_lang" "{
			\"insert_ok\": {
				\"en\": \"Element added with successfull.\",
				\"fr\": \"Elément(s) ajouté(s) avec succès.\"
			},
			\"update_ok\": {
				\"en\": \"Element updated with successfull.\",
				\"fr\": \"Elément(s) modifié(s) avec succès.\"
			},
			\"delete_ok\": {
				\"en\": \"Element deleted with successfull.\",
				\"fr\": \"Elément(s) suprimé(s) avec succès.\"
			},
			\"list_title\": {
				\"en\": \"Article list\",
				\"fr\": \"Liste des articles\"
			},
			\"list_filter\": {
				\"en\": \"Filter\",
				\"fr\": \"Filtre\"
			},
			\"list_field_id\": {
				\"en\": \"id\",
				\"fr\": \"id\"
			},
			\"list_field_id_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"list_field_title\": {
				\"en\": \"title\",
				\"fr\": \"titre\"
			},
			\"list_field_article\": {
				\"en\": \"article\",
				\"fr\": \"article\"
			},
			\"list_field_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"list_field_order\": {
				\"en\": \"order\",
				\"fr\": \"ordre\"
			},
			\"list_field_is_draft\": {
				\"en\": \"draft\",
				\"fr\": \"brouillon\"
			},
			\"list_field_dtcreate\": {
				\"en\": \"creation date\",
				\"fr\": \"date de création\"
			},
			\"form_search_title\": {
				\"en\": \"Search an element\",
				\"fr\": \"Recherche d'un élément\"
			},
			\"form_search_close_button\": {
				\"en\": \"Close\",
				\"fr\": \"Fermer\"
			},
			\"form_search_search_button\": {
				\"en\": \"Search\",
				\"fr\": \"Rechercher\"
			},
			\"form_search_field_id\": {
				\"en\": \"id\",
				\"fr\": \"id\"
			},
			\"form_search_field_id_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"form_search_field_title\": {
				\"en\": \"title\",
				\"fr\": \"titre\"
			},
			\"form_search_field_article\": {
				\"en\": \"article\",
				\"fr\": \"article\"
			},
			\"form_search_field_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"form_search_field_order\": {
				\"en\": \"order\",
				\"fr\": \"ordre\"
			},
			\"form_search_field_dtcreate\": {
				\"en\": \"creation date\",
				\"fr\": \"date de création\"
			},
			\"form_insert_title\": {
				\"en\": \"Insert an element\",
				\"fr\": \"Ajout d'un élément\"
			},
			\"form_insert_title_re\": {
				\"en\": \"Insert an element (Correction)\",
				\"fr\": \"Ajout d'un élément (Correction)\"
			},
			\"form_insert_close_button\": {
				\"en\": \"Close\",
				\"fr\": \"Fermer\"
			},
			\"form_insert_insert_button\": {
				\"en\": \"Add\",
				\"fr\": \"Ajouter\"
			},
			\"form_insert_field_id\": {
				\"en\": \"id\",
				\"fr\": \"id\"
			},
			\"form_insert_field_id_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"form_insert_field_title\": {
				\"en\": \"title\",
				\"fr\": \"titre\"
			},
			\"form_insert_field_article\": {
				\"en\": \"article\",
				\"fr\": \"article\"
			},
			\"form_insert_field_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"form_insert_field_order\": {
				\"en\": \"order\",
				\"fr\": \"ordre\"
			},
			\"form_insert_field_dtcreate\": {
				\"en\": \"creation date\",
				\"fr\": \"date de création\"
			},
			\"form_update_title\": {
				\"en\": \"Update an element\",
				\"fr\": \"Modification d'un élément\"
			},
			\"form_update_title_re\": {
				\"en\": \"Update an element (Correction)\",
				\"fr\": \"Modification d'un élément (Correction)\"
			},
			\"form_update_close_button\": {
				\"en\": \"Close\",
				\"fr\": \"Fermer\"
			},
			\"form_update_update_button\": {
				\"en\": \"Update\",
				\"fr\": \"Modifier\"
			},
			\"form_update_field_id\": {
				\"en\": \"id\",
				\"fr\": \"id\"
			},
			\"form_update_field_id_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"form_update_field_title\": {
				\"en\": \"title\",
				\"fr\": \"titre\"
			},
			\"form_update_field_article\": {
				\"en\": \"article\",
				\"fr\": \"article\"
			},
			\"form_update_field_tag\": {
				\"en\": \"tag\",
				\"fr\": \"tag\"
			},
			\"form_update_field_order\": {
				\"en\": \"order\",
				\"fr\": \"ordre\"
			},
			\"form_update_field_dtcreate\": {
				\"en\": \"creation date\",
				\"fr\": \"date de création\"
			},
			\"form_delete_title_1\": {
				\"en\": \"Delete of \",
				\"fr\": \"Suppression de \"
			},
			\"form_delete_title_2\": {
				\"en\": \" element(s)\",
				\"fr\": \" élément(s)\"
			},
			\"form_delete_cancel_button\": {
				\"en\": \"Cancel\",
				\"fr\": \"Annuler\"
			},
			\"form_delete_delete_button\": {
				\"en\": \"Delete\",
				\"fr\": \"Supprimer\"
			},
			\"back\": {
				\"en\": \"Back\",
				\"fr\": \"Retour\"
			},
		}";

	};

	json select "MENTDB_kl_articles_lang" (concat "/" [key_lang] "/" (parameter get value "KNOWLEDGE_LANG"));
	
} "Return the translation";

script create exe "app.100.template.knowledge.page.admin.onload" false 1 
  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Show the admin page" 
{

	

;} "The 'admin' page";

script create exe "app.100.template.knowledge.page.home.onload" false 1 
  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Show the home page" 
{

	

;} "The 'home' page";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.insert_open_form" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Open an insert form ..." 
{

	-> "[object]" "";
	include "app.100.obj.form.begin.exe" "[form_id]" "kl_articles_insert_form_id" "[modal]" true
				"[action]" "index.jsp"
				"[enctype]" false
				"[title]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_title")
				"[subTitle]" ""
				"[method]" "post"
				"[widthIfModal]" "90%;max-width:90%"
				"[html]" "style='font-size:14px'";
			
		# id_tag -------- TO DELETE ...;

		sql connect "session_data" {cm get "MENTDB";};
		json load "tmp_inValues" "[]";
		json load "tmp_optionValues" "[]";
		sql parse "session_data" "T" (concat "select id, tag from kl_tags order by tag") {
		
			json iarray "tmp_inValues" / [T_id] STR;
			json iarray "tmp_optionValues" / [T_tag] STR;
		
		};
			
			include "app.100.obj.form.control.select_mono.exe" "[control_id]" "id_tag" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_field_id_tag") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" (json doc "tmp_inValues")
				"[optionValues]" (json doc "tmp_optionValues")
				"[value]" ""
			;

		sql disconnect "session_data";
		
		# title -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.text.exe" "[control_id]" "title" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_field_title") "[description]" "" "[maxlength]" "512" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		# article -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textarea_cke.exe" "[control_id]" "article" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_field_article") "[description]" "" "[maxlength]" "" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" ""
			;
		
		# order -------- TO DELETE ...;
			
			include "app.100.obj.form.control.textbox.number.exe" "[control_id]" "order" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_field_order") "[description]" "" "[maxlength]" ""
				"[min]" "0" "[max]" "10000" "[step]" "1" "[placeholder]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[value]" 0
			;

			include "app.100.obj.form.control.radio_inline.exe" "[control_id]" "is_draft" "[class]" "col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12"
				"[label]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "list_field_is_draft") "[description]" ""
				"[readonly]" false "[required]" false "[disabled]" false "[html]" ""
				"[inValues]" "[\"Y\", \"N\"]"
				"[optionValues]" "[\"Y\", \"N\"]"
				"[value]" "Y"
			;
		
		include "app.100.obj.form.end.exe" "[form_id]" "kl_articles_insert_form_id" "[modal]" true
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		"[container_id]" ""
		"[mql_script]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.insert.exe"
		"[data_eval]" "$('#kl_articles_insert_form_id').serializeObject()"
		"[closeTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_close_button")
		"[submitTitle]" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.lang.exe" "[key_lang]" "form_insert_insert_button")
		"[submitType]" "primary";
	
} "Return the form";

script create exe "app.100.template.knowledge.page.home" false 1 
  (param
  ;) 
  "Show the home page" 
{

	include (concat "app." [app_version] ".template." [app_template] ".html.body_top.exe");

	#____________________________________________________________;

	#Your container code here;
	include "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.skeleton.exe";
	
	include "app.100.obj.sajax.skeleton.onload.exe"
		"[scriptname]" (concat "app." [app_version] ".template." [app_template] ".page.home.onload.exe")
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
	;
	
	#____________________________________________________________;
	
	include (concat "app." [app_version] ".template." [app_template] ".html.body_bottom.exe");

;} "The 'home' page";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.onload" false 1 
  (param
  	(var "[OBJ_OVERWRITE]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Execute this script on load ..." 
{

	include "app.100.obj.sajax.server.exe"
		"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe"
		"[OBJ_OVERWRITE_B64]" (string encode_b64 "{\"container_id\":\"MENTDB_kl_tags\", \"page\":\"1\", \"nb_by_page\":\"16\", \"nb_lr_pagination\":\"4\", \"order_by\":\"\"}")
	;
	
} "Reload all blocs";

script create exe "app.100.template.knowledge.html.body_bottom" false 1 
  (param
  ;) 
  "Body bottom" 
{

	concat_var "[page]" "    </div>";
	concat_var "[page]" "  </div>";
	concat_var "[page]" "</div>";
	
	include (concat "app." [app_version] ".obj.onload.exe");

	concat_var "[page]" "</body></html>";

	[page]

;} "html";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.skeleton" false 1 
  (param
  ;) 
  "SCRUD skeleton ..." 
{

	if (app is_granted_a "MENTDB.kl_articles.list.show") {

		include "app.100.obj.sajax.skeleton.container.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
			include "app.100.obj.sajax.skeleton.row.exe" "[id]" "" "[name]" "" "[class]" "" "[style]" "";
				include "app.100.obj.sajax.skeleton.col.exe" "[id]" "MENTDB_kl_articles" "[name]" "" "[class]" "col-12 col-xs-12 col-sm-12 col-md-12 col-lg-12" "[style]" "padding-left:0px;padding-right:0px";
				
				include "app.100.obj.sajax.skeleton.div.end.exe";
			include "app.100.obj.sajax.skeleton.div.end.exe";
		include "app.100.obj.sajax.skeleton.div.end.exe";
	
		include "app.100.obj.sajax.skeleton.onload.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_articles.onload.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;

	};
	
} "Return the page";

script create exe "app.100.template.knowledge.page.knowledge" false 1 
  (param
  	(var "[err]" {true} "The error message" is_null:true is_empty:true "Bad password.")
  ;) 
  "Show the login page" 
{

	-> "[page]" "";

	if (not (env exist var "[app_current_article]")) {
		-> "[app_current_article]" "";
	};

	if (not (is null or empty (json select "app" /param/app_current_article))) {

		-> "[app_current_article]" (json select "app" /param/app_current_article);

	};

	if (not (env exist var "[search_text]")) {
		-> "[search_text]" "";
	};
	
	if (not (is null (json select "app" /param/search_text))) {

		-> "[search_text]" (json select "app" /param/search_text);
		-> "[app_current_article]" "";

	};

	concat_var "[page]" "<!doctype html>
		<html lang=\"fr\">
		<head>
		  <meta charset=\"utf-8\">
		  <title>" (json select "app" "/title") "</title>
		  <link  href=\"css/style.css\" rel=\"stylesheet\">
		  <link href=\"dist/css/bootstrap.css\" rel=\"stylesheet\">
		  <link rel=\"icon\" type=\"image/png\" href=\"images/" (json select "app" "/bar_icon") "\" />
		</head>
		<body id=\"body\" style='margin:0px;color:#333;font-family: " (json select "app" "/font_family") ";font-size: 12px;'>

		<div style='box-shadow: 0px 0px 8px " (json select "app" "/top_background_color") ";z-index: 999;width:100%;height:65px;line-height:63px;
			background-color: " (json select "app" "/top_background_color") ";
			color: " (json select "app" "/top_color") ";
			font-size: 22px;'>
			<img src='images/refresh.gif' style='display:none'>
		     <a href='index.jsp'><img id='top_refresh_icon' src='images/" (json select "app" "/top_logo") "' 
				style='vertical-align:middle;
			     width:" (json select "app" "/top_logo_width") ";
				margin-top:" (json select "app" "/top_logo_top") ";
				margin-left:" (json select "app" "/top_logo_left") ";'></a>   " (json select "app" "/top_title") "    

			<form name='search_bar' action='' method='POST' style='display: inline-block;line-height:18px;font-size:18px'>
				<input type='text' name='search_text' value='" (string replace [search_text] "'" "'") "' style='width:400px'>
			</form>
	
			<div style='float:right'>
				<span class='hidden-xs' style='font-size:18px'>" (json select "app" "/user") "</span>  
				<a style='margin-right: 20px;color:#fff;font-size:15px' href='index.jsp?app_page=login'>" (json select "app" "/login_submit_title") "</a>
			</div>
		
		</div>

			<div class='container-fluid' style='margin-top:10px'>
				<div class='row'>
					<div class='col-3 col-xs-3 col-sm-3 col-md-3 col-lg-3' style='padding-right: 10px;padding-left: 10px;vertical-align:top;height:1000px;overflow-y: auto;'>

						";

			sql connect "session_data" {cm get "MENTDB";};
			-> "[old_tag]" "";
			sql parse "session_data" "T" (concat "select kl_articles.id, title, tag, color_bg, color_ft from kl_articles inner join kl_tags on kl_articles.id_tag=kl_tags.id 
			WHERE is_draft='N' " (if (is not empty [search_text]) {concat " and ( title like '%" (string replace [search_text] "'" "''") "%' or article like '%" (string replace [search_text] "'" "''") "%' ) "}) " 
			order by kl_tags.tag, kl_articles.`order`") {

				if (not equal [T_tag] [old_tag]) {
					concat_var "[page]" "
						<div style='font-size: 0.875rem;background-color:" [T_color_bg] ";color:" [T_color_ft] ";padding-left:5px'>" [T_tag] "</div>";
					-> "[old_tag]" [T_tag];
				};
			
				concat_var "[page]" "
						<div style='font-size: 0.875rem;'>   <img style='width:16px' src='images/knowledge32.png'> <a href='index.jsp?app_current_article=" [T_id] "'>" [T_title] "</a></div>";
			
			};

			concat_var "[page]" "
					
					</div>

					<div class='col-9 col-xs-9 col-sm-9 col-md-9 col-lg-9' style='padding-right: 10px;padding-left: 10px;font-size: 0.875rem;border-left:1px #aaa solid;vertical-align:top;height:1000px;overflow-y: auto;'>
					
					" (if (is not empty [app_current_article]) {

						concat "<div style='background-color:#555;color:#FFF;padding-left:5px'>" (sql value "session_data" (concat "select title from kl_articles where id=" [app_current_article])) "</div><br>" 
							(sql value "session_data" (concat "select article from kl_articles where id=" [app_current_article]));
					
					}) "
					
					</div>
				</div>
			</div>
		</div>
		</body>
		</html>";
		
		sql disconnect "session_data";

	[page];

;} "The 'login' page";

script create exe "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.insert" false 1 
  (param
  	(var "[OBJ_OVERWRITE_B64]" {true} "" is_null:false is_empty:true "{}")
  ;) 
  "Insert a new element ..." 
{

	try {
		
		#Connection ...;
		sql connect "session1" {cm get "MENTDB"};

		json load "data" (string decode_b64 [OBJ_OVERWRITE_B64]);
		
		-> "[result]" (sql dml "session1" (concat 
			"INSERT INTO `kl_tags` (
			`tag`, 
			`color_bg`, 
			`color_ft`
			) VALUES (
			" (sql encode (json select "data" "/client_data/tag")) ", 
			" (sql encode (json select "data" "/client_data/color_bg")) ", 
			" (sql encode (json select "data" "/client_data/color_ft")) "
			);"
		));
		
		#Disconnection ...;
		sql disconnect "session1";
		
		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_SUCCESS"
			"[strong]" "OK !"
			"[msg]" (concat "
			" (include "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.lang.exe" "[key_lang]" "insert_ok"))
		;

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.list.exe"
			"[OBJ_OVERWRITE_B64]" (string encode_b64 "{}")
		;
		
	} {

		#Close the connection;
		try {sql disconnect "session1"} {} "[sub_err]";

		include "app.100.obj.sajax.server.exe"
			"[scriptname]" "app.100.template.knowledge.actions.demo.MENTDB.kl_tags.insert_reopen_form.exe"
			"[OBJ_OVERWRITE_B64]" [OBJ_OVERWRITE_B64]
		;

		include "app.100.obj.sajax.alert.exe"
			"[type]" "ALERT_DANGER"
			"[strong]" "ERR :"
			"[msg]" [err]
		;
		
	} "[err]";
	
} "Return OK or KO";

script create exe "app.100.template.knowledge.init" false 1 
  (param
  	(var "[lang]" {type is_enum [lang] "en,fr"} "The app language" is_null:false is_empty:false "en")
  ;) 
  "Initialise the knowledge" 
{

	#The default language;
	parameter add "KNOWLEDGE_LANG" [lang] 0;

	#Create the SQL database;
	sql connect "session1" {cm get "MENTDB";};
	sql dml "session1" (concat "CREATE TABLE IF NOT EXISTS `kl_tags` (
		  `id` bigint(20) NOT NULL AUTO_INCREMENT,
		  `tag` varchar(255) NOT NULL,
		  `color_bg` varchar(7) NOT NULL DEFAULT '#ffffff',
		  `color_ft` varchar(7) NOT NULL DEFAULT '#000000',
		  PRIMARY KEY (`id`)
		) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
	");
	sql dml "session1" (concat "CREATE TABLE IF NOT EXISTS `kl_articles` (
		  `id` bigint(20) NOT NULL AUTO_INCREMENT,
		  `id_tag` bigint(20) NOT NULL,
		  `title` varchar(512) NOT NULL,
		  `article` longtext NOT NULL,
		  `order` int(11) NOT NULL DEFAULT '1',
		  `dtcreate` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
          `is_draft` CHAR(1) NOT NULL DEFAULT 'N',
		  PRIMARY KEY (`id`),
		  KEY `fk_kl_articles_tags_idx` (`id_tag`),
		  CONSTRAINT `fk_kl_articles_tags` FOREIGN KEY (`id_tag`) REFERENCES `kl_tags` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
		) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

	");
	sql disconnect "session1";

	file b64_write "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
QCAQCEL4fypLA3RHjvygAAAAAElFTkSuQmCC" 
	"web/https/knowledge/images/knowledge.png";

	file b64_write "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
WXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4woJDRkzR7TP+gAABAhJREFUWMPtl1tMHFUYx39nZhfc
ZWG7wAItl7SltK7cQqBpSYnGNI1SfMRUCdH60MuTJtYXE036YkysaWJik1pibIxGjZeKtdW0pLUm
1EikxUVuRbJ05RJYFtiyBZbZmeMD0FK7u2yR1pj0/zRzcr5zfnPm+/7fDDzUfyyx9MZqMtmmw+Ev
8lNSCmSMgMFgcGLWMPYB7oXhkgSLrcGRmeOQMnKkEIKR/u7eRIttT2gmGIwIAJwZOHBgd3ZODggR
hUCAplFy7JjW7vMlAGRtcM29c6rTnGyBcDhymDkBbvhneWG75SxQszhuWjppk91ekJ2XR/6RIxQ6
nUR6ms6xMS7V17MjN9fc7vOpgMwv3m6eGvZy4eK3PP38y3fFqCY4+upeXn//JHkFxQXe3nYiAoiF
py50Ovmurg50nR6fj9bhYerKykDXeffyZaY1Debh5OIxanMhQrMzAAz19+DpasWabKf8iRqEgOCk
HyEWw4gMsCgpJeg6CMGLp0/T7fdT6HRSmpGBbhixk0pA01fH+evPP1BNZpq+PsEbxxujzldiLaZr
GldHRnhv1y4+cruj58U/F1VUEi1JqKqJoq1PEos5JsCnHR2YFYW3mps56XZDQkLc5SUNg0SrDfcv
51HVlQCoKkdbWviwpoZrhw4RCIVovX49boD0tXlsfKwcT9eVmACm6Oev03bwIITDyJs3kYcPg6bR
5PEsu/mWsip+Pf8lQlF5+7MrhGbvESCk6/MXc3O3zSIUAkAzDAwp78iH+eqRtDX/cOt+/aNlGIbB
z99/jKqqDHg6QdydRncADExNTRAO01hbC4YRMele27aNR6xWvIEAgAEwMTrIBtdm9r/5QQRvm1fl
U8+hhWB0sH8iqhUDJcVO5287cnPNRLFUhMAbCHC2r28/0LAwuq+saveJ9LV5scLoaWvWvL3tFUss
nGh1pS6aTBQZK6gqAegxm1GcigUXcZO4u+EyqrY70s+mrEmNGiSFIBiYYMI/Wg38uKoAVluK/5na
l1KngzeQ0axNCNKcWTR+3jAemPSnxbOuKV4AizXJoaoql86dYmNBEXLhLQihgDSQCz1kjSMNqy3Z
EZj0s6oAC12K9Ix1uEoqUBSF/r5uBr19pKZnsqWoHGkYGIa8pyVNrEiCjt9b6O1qo6JyJyazmaj1
dz8AVJPKtc6rVD5ejTMr+3YLX4GUlX5MKopKKDSDEOLWh8wDOwE9HKa0oormi2cocJViTUrGVbwV
KY0HACAEiqKyfpMLZ2Y2Y6NDpNhTURSBlMsZ6L8AEICiKAwPePjp3DcR95FIdlY/e38AApP+Xgmb
9+x9JeY8bW6O8bGR3lW3YiFEDkJ8YrenrovVCAKB8SGkrJdSDjz87/tf6G+Zt38A9BrERQAAAABJ
RU5ErkJggg==" 
	"web/https/knowledge/images/knowledge32.png";
	
} "Return nothing";

app create "https" "knowledge" "knowledge" "100";

execute "app.100.template.knowledge.init.exe" 
	"[lang]" "en"
;
                
    Home  >  App 'Knowledge'
MentDB © 2019 - Legal Notice