PMCORE-3846

This commit is contained in:
Julio Cesar Laura Avendaño
2022-06-02 20:27:42 +00:00
committed by Mauricio Veliz
parent 5835a96800
commit b3f57c2fd8
5 changed files with 52 additions and 100 deletions

View File

@@ -1,29 +1,4 @@
<?php
/**
* class.headPublisher.php
*
* @package gulliver.system
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2011 Colosa Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public LicensegetExtJsLibraries
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
use ProcessMaker\Plugins\PluginRegistry;
use ProcessMaker\Core\System;
@@ -31,8 +6,6 @@ use ProcessMaker\Core\System;
/**
* Class headPublisher
*
* @author David S. Callizaya S. <davidsantos@colosa.com>
* @package gulliver.system
* @access public
*/
class headPublisher
@@ -417,7 +390,13 @@ class headPublisher
return $script;
}
public function getExtJsVariablesScript()
/**
* Build javascript section with declaration of variables
*
* @param string $declarationKeyword
* @return string
*/
public function getExtJsVariablesScript($declarationKeyword = 'var')
{
$script = '';
if (count($this->extVariable) > 0) {
@@ -427,15 +406,7 @@ class headPublisher
$value = $val['value'];
$variablesValues = G::json_encode($value);
$variablesValues = $this->stripCodeQuotes($variablesValues);
// var_dump($variablesValues);
// echo "<br>";
$script .= " var $name = " . $variablesValues . ";\n";
/*
if ($val ['type'] == 'number')
$script .= " var $name = $value;\n";
else
$script .= " var $name = '$value';\n";
*/
$script .= " $declarationKeyword $name = " . $variablesValues . ";\n";
}
$script .= "</script>\n";
}