* @package ai * @link https://www.zentao.net */ ?> loadModel('ai'); if($this->ai->hasModelsAvailable() && commonModel::hasPriv('ai', 'promptExecute')):?> app->loadConfig('ai'); $module = $this->app->getModuleName(); $method = $this->app->getMethodName(); if(isset($config->ai->menuPrint->locations[$module][$method])): ?> ai->menuPrint->locations[$module][$method]; $prompts = $this->ai->getPromptsForUser($menuOptions->module); $prompts = $this->ai->filterPromptsForExecution($prompts, true); if(!empty($prompts)): ?> objectVarName) ? $menuOptions->module : $menuOptions->objectVarName; $currentObjectId = !empty($this->view->$objectVarName) ? $this->view->$objectVarName->id : 0; if(count($prompts) > 1) { $btnName = sprintf($this->lang->ai->promptMenu->dropdownTitle, isset($this->lang->ai->dataSource[$module]['common']) ? $this->lang->ai->dataSource[$module]['common'] : ''); $html .= ''; } else { $prompt = current($prompts); $html .= html::linkButton($prompt->name . ($prompt->status != 'active' ? '' . $lang->ai->prompts->statuses[$prompt->status] . '' : ''), helper::createLink('ai', 'promptExecute', "promptId=$prompt->id&objectId=$currentObjectId"), 'self', (empty($prompt->unauthorized) ? '' : 'disabled') . (empty($prompt->desc) ? '' : " data-toggle='popover' data-container='body' data-trigger='hover' data-content='$prompt->desc' data-title='$prompt->name' data-placement='bottom'"), 'prompt btn btn-link' . ((isset($menuOptions->class) ? ' ' . $menuOptions->class : '') . (isset($menuOptions->buttonClass) ? ' ' . $menuOptions->buttonClass : ''))); } ?> stylesheet)):?>