_stateMachine = new CRM_Core_StateMachine($this); $params = array($path => NULL); $savedAction = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, NULL); if (!empty($savedAction) && $savedAction != $mode ) { $mode = $savedAction; } $this->_stateMachine->addSequentialPages($params, $mode); $this->addPages($this->_stateMachine, $mode); //changes for custom data type File $uploadNames = $this->get('uploadNames'); $config = CRM_Core_Config::singleton(); if (is_array($uploadNames) && !empty($uploadNames)) { $uploadArray = $uploadNames; $this->addActions($config->customFileUploadDir, $uploadArray); $this->set('uploadNames', NULL); } else { // always allow a single upload file with same name if ($attachUpload) { $this->addActions($config->uploadDir, CRM_Core_BAO_File::uploadNames() ); } elseif ($imageUpload) { $this->addActions($config->imageUploadDir, array('uploadFile')); } else { $this->addActions(); } } } /** * @param $parent */ public function setParent($parent) { $this->_parent = $parent; } /** * @return mixed */ public function getTemplateFileName() { // there is only one form here, so should be quite easy $actionName = $this->getActionName(); list($pageName, $action) = $actionName; return $this->_pages[$pageName]->getTemplateFileName(); } /** * A wrapper for getTemplateFileName that includes calling the hook to * prevent us from having to copy & paste the logic of calling the hook */ public function getHookedTemplateFileName() { $pageTemplateFile = $this->getTemplateFileName(); CRM_Utils_Hook::alterTemplateFile(get_class($this), $this, 'page', $pageTemplateFile); return $pageTemplateFile; } }