Explorar el Código

Merge pull request #1843 from stiivo/indulge_csvHomepageUrlToken_introduce_new_formtype

modify csvhomepageurltoken and  introduce new formtype
causefx hace 3 años
padre
commit
7d2a3b229b

+ 8 - 8
api/functions/homepage-connect-functions.php

@@ -8,14 +8,14 @@ trait HomepageConnectFunctions
 		$list = array();
 		$urlList = explode(',', $url);
 		$tokenList = explode(',', $token);
-		if (count($urlList) == count($tokenList)) {
-			foreach ($urlList as $key => $value) {
-				$list[$key] = array(
-					'url' => $this->qualifyURL($value),
-					'token' => $tokenList[$key]
-				);
-			}
-		}
+        foreach ($urlList as $key => $value) {
+            if (isset($tokenList[$key])) {
+                $list[$key] = array(
+                    'url' => $this->qualifyURL($value),
+                    'token' => $tokenList[$key]
+                );
+            }
+        }
 		return $list;
 	}
 

+ 1 - 1
api/functions/option-functions.php

@@ -458,7 +458,7 @@ trait OptionsFunction
 				break;
 			case 'calendarlinkurl':
 				$settingMerge = [
-					'type' => 'select',
+					'type' => 'select-input',
 					'label' => 'Target URL',
 					'help' => 'Set the primary URL used when clicking on calendar icon.',
 					'options' => $this->makeOptionsFromValues($this->config[str_replace('CalendarLink', '', $name) . 'URL'], true, 'Use Default'),

+ 3 - 0
js/functions.js

@@ -1217,6 +1217,9 @@ function buildFormItem(item){
 	`;
 	//+tof(item.value,'c')+`
 	switch (item.type) {
+        case 'select-input':
+            return smallLabel + '<input list="'+item.name+'Options" data-changed="false" lang="en" type="text" class="form-control' + extraClass + '"' + placeholder + value + id + name + disabled + type + label + attr + ' autocomplete="new-password" /><datalist id="'+item.name+'Options">' + selectOptions(item.options, item.value) + '</datalist>';
+            break;
 		case 'input':
 		case 'text':
 			return smallLabel+'<input data-changed="false" lang="en" type="text" class="form-control'+extraClass+'"'+placeholder+value+id+name+disabled+type+label+attr+' autocomplete="new-password" />';