/** * Constructor of the class * * return void */ public function __construct() { try { foreach ($this->arrayFieldDefinition as $key => $value) { $this->arrayFieldNameForException[$value["fieldNameAux"]] = $key; } //Library \G::LoadClass("triggerLibrary"); $this->library = \triggerLibrary::getSingleton(); } catch (\Exception $e) { throw $e; } }
* 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 License * 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. * */ try { G::LoadClass("tree"); G::LoadClass("triggerLibrary"); $triggerLibrary = triggerLibrary::getSingleton(); $triggerLibraryO = $triggerLibrary->getRegisteredClasses(); $oTree = new Tree(); $oTree->nodeType = "blank"; $oTree->name = "Triggers"; $oTree->showSign = false; $div1Style = strpos($_SERVER["HTTP_USER_AGENT"], "MSIE") !== false ? " style=\"margin-top: 0.65em;\"" : null; $oNode =& $oTree->addChild("TRI_CUSTOM", "<div" . $div1Style . "><span onclick=\"currentPopupWindow.remove(); triggerNewCustom();\" style=\"cursor: pointer;\"><img src=\"/images/50px-Edit.png\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" /> <strong>" . G::LoadTranslation("ID_CUSTOM_TRIGGER") . "</strong></span><br /><span onclick=\"currentPopupWindow.remove(); triggerNewCustom();\" style=\"cursor: pointer;\"><small><em>" . G::LoadTranslation("ID_CUSTOM_TRIGGER_DESCRIPTION") . "</em></small></span></div>", array("nodeType" => "parent")); $oNode =& $oTree->addChild("TRI_COPY", "<div style=\"margin-top: 1.25em;\"><span onclick=\"currentPopupWindow.remove(); triggerCopy();\" style=\"cursor: pointer;\"><img src=\"/images/documents/_editcopy.png\" width=\"15px\" heigth=\"15px\" valing=\"middle\" alt=\"\" /> <strong>" . G::LoadTranslation("ID_TRIGGER_COPY_OPTION") . "</strong></span><br /><span onclick=\"currentPopupWindow.remove(); triggerCopy();\" style=\"cursor: pointer;\"><small><em>" . G::LoadTranslation("ID_TRIGGER_COPY_OPTION_DESCRIPTION") . "</em></small></span></div>", array("nodeType" => "parent")); $triggerLibraryOCount = count($triggerLibraryO); foreach ($triggerLibraryO as $keyLibrary => $libraryObj) { $libraryName = $libraryObj->info["name"]; $libraryIcon = isset($libraryObj->info["icon"]) && $libraryObj->info["icon"] != "" ? $libraryObj->info["icon"] : "/images/browse.gif"; $libraryDescription = trim(str_replace("*", "", implode(" ", $libraryObj->info["description"]))); $triggerCount = count($libraryObj->methods); if ($triggerCount > 0) {
/** * Get all Libraries * * @param string $processUid Unique id of Process * * return array Return an array with all Libraries */ public function getLibraries($processUid) { try { $arrayLibrary = array(); //Verify data $this->throwExceptionIfNotExistsProcess($processUid, $this->arrayFieldNameForException["processUid"]); //Get data \G::LoadClass("triggerLibrary"); $triggerWizard = new \ProcessMaker\BusinessModel\TriggerWizard(); $triggerWizard->setFormatFieldNameInUppercase($this->formatFieldNameInUppercase); $triggerWizard->setArrayFieldNameForException($this->arrayFieldNameForException); $triggerLibrary = \triggerLibrary::getSingleton(); $library = $triggerLibrary->getRegisteredClasses(); ksort($library); foreach ($library as $key => $value) { $libraryName = (preg_match("/^class\.?(.*)\.pmFunctions\.php$/", $key, $arrayMatch))? ((isset($arrayMatch[1]) && $arrayMatch[1] != "")? $arrayMatch[1] : "pmFunctions") : $key; $arrayLibrary[] = $triggerWizard->getLibrary($libraryName); } //Return return $arrayLibrary; } catch (\Exception $e) { throw $e; } }