Generic info about the tool.

@return string
972222
protected function generic_info() {

        $title = get_string('pluginname', 'tool_behat');

        // Header.
        $html = $this->output->header();
        $html .= $this->output->heading($title);

        // Info.
        $installurl = behat_command::DOCS_URL;
        $installlink = html_writer::tag('a', $installurl, array('href' => $installurl, 'target' => '_blank'));
        $writetestsurl = 'https://docs.moodle.org/dev/Writing acceptance tests';
        $writetestslink = html_writer::tag('a', $writetestsurl, array('href' => $writetestsurl, 'target' => '_blank'));
        $writestepsurl = 'https://docs.moodle.org/dev/Writing_new_acceptance_test_step_definitions';
        $writestepslink = html_writer::tag('a', $writestepsurl, array('href' => $writestepsurl, 'target' => '_blank'));
        $infos = array(
            get_string('installinfo', 'tool_behat', $installlink),
            get_string('newtestsinfo', 'tool_behat', $writetestslink),
            get_string('newstepsinfo', 'tool_behat', $writestepslink)
        );

        // List of steps.
        $html .= $this->output->box_start();
        $html .= html_writer::tag('h3', get_string('infoheading', 'tool_behat'));
        $html .= html_writer::tag('div', get_string('aim', 'tool_behat'));
        $html .= html_writer::start_tag('div');
        $html .= html_writer::start_tag('ul');
        $html .= html_writer::start_tag('li');
        $html .= implode(html_writer::end_tag('li') . html_writer::start_tag('li'), $infos);
        $html .= html_writer::end_tag('li');
        $html .= html_writer::end_tag('ul');
        $html .= html_writer::end_tag('div');
        $html .= $this->output->box_end();

        return $html;
    }
679910
public function getToolTemplateDataAction()
    {
        // get the service for Templates Model & Table
        $templatesModel = $this->getServiceLocator()->get('MelisEngineTableTemplate');

        // declare the Tool service that we will be using to completely create our tool.
        $melisTool = $this->getServiceLocator()->get('MelisCoreTool');

        // tell the Tool what configuration in the app.tool.php that will be used.
        $melisTool->setMelisToolKey('meliscms', 'meliscms_tool_templates');

        // Site Table
        $tableSite = $this->getServiceLocator()->get('MelisEngineTableSite');


        $colId = array();
        $dataCount = 0;
        $draw = 0;
        $tableData = array();

        // make sure that the request is an AJAX call
        if($this->getRequest()->isPost()) {

            $siteId = $this->getRequest()->getPost('tpl_site_id');
            $siteId = !empty($siteId)? $siteId : null;

            $colId = array_keys($melisTool->getColumns());

            $sortOrder = $this->getRequest()->getPost('order');
            $sortOrder = $sortOrder[0]['dir'];

            $selCol = $this->getRequest()->getPost('order');
            $selCol = $colId[$selCol[0]['column']];

            $draw = $this->getRequest()->getPost('draw');

            $start = $this->getRequest()->getPost('start');
            $length =  $this->getRequest()->getPost('length');

            $search = $this->getRequest()->getPost('search');
            $search = $search['value'];

            $dataCount = $templatesModel->getTotalData();

            $getData = $templatesModel->getData($search, $siteId, $melisTool->getSearchableColumns(), $selCol, $sortOrder, $start, $length);
            $tableData = $getData->toArray();

            for($ctr = 0; $ctr < count($tableData); $ctr++)
            {
                // apply text limits
                foreach($tableData[$ctr] as $vKey => $vValue)
                {
                    $tableData[$ctr][$vKey] = $melisTool->limitedText($vValue);
                }

                $tableData[$ctr]['DT_RowId'] = $tableData[$ctr]['tpl_id'];

                // Append Template status: Green Circle = Active || Red Circle = Inctive
                try {
                    $tpl = [
                        'module'        => $tableData[$ctr]['tpl_zf2_website_folder'],
                        'controller'    => $tableData[$ctr]['tpl_zf2_controller'],
                        'action'        => $tableData[$ctr]['tpl_zf2_action']
                    ];
                    $tpl_status                     = $this->getTemplateStatus($tpl);
                    $tableData[$ctr]['tpl_status']  = '<span class="text-'.($tpl_status? 'success' : 'danger').'"><i class="fa fa-fw fa-circle"></i></span>';
                } catch (\Exception $e) {
                    // Place handling here
                }

                // display controller and action in Controller Column
                $tableData[$ctr]['tpl_zf2_controller'] = !empty($tableData[$ctr]['tpl_zf2_action']) ? $tableData[$ctr]['tpl_zf2_controller'] . '/' . $tableData[$ctr]['tpl_zf2_action'] : $tableData[$ctr]['tpl_zf2_controller'];
            }
        }

        return new JsonModel(array(
            'draw' => (int) $draw,
            'recordsTotal' => $dataCount,
            'recordsFiltered' => $templatesModel->getTotalFiltered(),
            'data' => $tableData,
        ));
    }
433986
protected function generateTool()
    {

        $this->data = $this->getMappedArguments();
        $generatorPath = str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__)) . '/studentToolGenerator';
        $targetPath    = $generatorPath . '/generated-code/' . $this->data['client'] . '/' . $this->data['tool-id'];
        $templatePath  = $generatorPath . '/template';

        $objects = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($templatePath), \RecursiveIteratorIterator::SELF_FIRST);

        $patterns = $this -> getPatterns();
        $replacements = $this -> getReplacements();

        foreach($objects as $tplFile => $cursor){
            if(in_array(basename($tplFile), array('.', '..'))) {
                continue;
            }

            $toolFile = str_replace($templatePath, $targetPath, $tplFile);

            if($cursor->isDir() && !is_dir($toolFile)) {
                mkdir($toolFile, 0755, true);
            }
            else if($cursor->isFile()){
                $toolFile = dirname($toolFile) . '/' . str_replace('template', $this->data['tool-base'], basename($toolFile));
                $toolContent = str_replace($patterns, $replacements, file_get_contents($tplFile));
                file_put_contents($toolFile, $toolContent);
            }
        }
        return $targetPath;
    }
708725
public function info()
    {
        $data = [];
        foreach ($this->attributes as $key => $value) {
            switch (gettype($value)) {
                case 'boolean':
                    $data[$key] = [
                        'boolValue' => $value
                    ];
                    break;
                case 'integer':
                    $data[$key] = [
                        'intValue' => $value
                    ];
                    break;
                default:
                    $data[$key] = [
                        'stringValue' => ['value' => (string) $value]
                    ];
            }
        }
        return [
            'attributeMap' => $data
        ];
    }
467788
public function get_plugin_name() {
        if ($this->plugin === 'core') {
            $string = get_string('core', 'tool_monitor');
        } else if (get_string_manager()->string_exists('pluginname', $this->plugin)) {
            $string = get_string('pluginname', $this->plugin);
        } else {
            $string = $this->plugin;
        }
        return $string;
    }
999795
public function details() {
		return array_intersect_key(count($this->_details)?$this->_details:array(), array_flip($this->_public_details));
	}
334382
public function toString()
    {
        return trim($this->getName() . ' ' . (!empty($this->version) && !$this->version->hidden ? $this->getVersion() : ''));
    }
196478
public function getDebugInfo()
    {
        if (Director::isLive()) {
            return false;
        }
        $Debug = array(
            'ID' => $this->ID,
            'Preset' => $this->Preset()->Title,
            'ClassName' => $this->ClassName,
            'Style' => ($this->Style) ? $this->Style : 'Default'
        );
        $this->extend('updateDebugInfo', $Debug);
        $Debug = implode(";\n", array_map(
            function ($value, $key) { return "$key: $value"; },
            $Debug,
            array_keys($Debug)
        ));
        return "\n<!--\n{$Debug}\n-->\n";
    }
371043
public function info()
    {
        $info = [
            'id' => $this->id,
            'action' => $this->action,
            'condition' => $this->condition,
            'expressions' => $this->expressions,
            'logMessageFormat' => $this->logMessageFormat,
            'logLevel' => $this->logLevel,
            'isFinalState' => $this->isFinalState,
            'createTime' => $this->createTime,
            'finalTime' => $this->finalTime,
            'stackFrames' => array_map(function ($sf) {
                return $sf->info();
            }, $this->stackFrames),
            'evaluatedExpressions' => $this->evaluatedExpressions
        ];
        if ($this->labels) {
            $info['labels'] = $this->labels;
        }
        if ($this->userEmail) {
            $info['userEmail'] = $this->userEmail;
        }
        if ($this->location) {
            $info['location'] = $this->location->info();
        }
        if ($this->status) {
            $info['status'] = $this->status->info();
        }
        if ($this->variableTable) {
            $info['variableTable'] = $this->variableTable->info();
        }
        return $info;
    }
1357649
public function get_endpoint() {

        $this->parse_template();
        $url = $this->get_service()->get_service_path() . $this->get_template();
        foreach ($this->params as $key => $value) {
            $url = str_replace('{' . $key . '}', $value, $url);
        }
        $toolproxy = $this->get_service()->get_tool_proxy();
        if (!empty($toolproxy)) {
            $url = str_replace('{tool_proxy_id}', $toolproxy->guid, $url);
        }

        return $url;

    }
385685
public function getFileInfo()
    {
        $prefix = str_replace(yii::getAlias(yii::getAlias('@frontend/web')), '', yii::getAlias('@ueditor'));
        return array(
            "state" => $this->stateInfo,
            "url" => $prefix . $this->fullName,
            "title" => $this->fileName,
            "original" => $this->oriName,
            "type" => $this->fileType,
            "size" => $this->fileSize
        );
    }
606465
public function toolContainerAction()
    {

        $form = $this->getForm();
        $melisKey = $this->params()->fromRoute('melisKey', '');
        $view = new ViewModel();

        $view->melisKey = $this->getMelisKey();
        $view->hasAccess = $this->hasAccess($melisKey);

        $schemeData = $this->getPlatformSchemeSvc()->getCurrentScheme();

        if ($schemeData) {
            $colors = json_decode($schemeData->getColors(), true);
            if ($colors) {
                $form->setData($colors);
            }
        }

        $view->setVariable('form', $form);
        $view->schemes = $schemeData;

        return $view;
    }
237171
private function getMethod()
    {
        if (is_array($this->handler) && 2 === sizeof($this->handler)) {
            return $this->handler[1];
        }

        if ($this->isStaticMethod()) {
            list (, $method) = explode('::', $this->handler);

            return $method;
        }

        return '';
    }
998067
private function _info()
    {
        if (empty($this->_output)) {
            return;
        }
        $model = array();
        $percCharge = array();
        $lines = explode(PHP_EOL, implode($this->_output));
        if (count($lines)>1) {
            $model = explode('FW:', $lines[1]);
            if (strpos($model[0], 'InternalBattery') === false) {
                $dev = new UPSDevice();
                $percCharge = explode(';', $lines[1]);
                $dev->setName('UPS');
                if ($model !== false) {
                    $dev->setModel(substr(trim($model[0]), 1));
                }
                if ($percCharge !== false) {
                    $dev->setBatterCharge(trim(substr($percCharge[0], -4, 3)));
                    $dev->setStatus(trim($percCharge[1]));
                    if (isset($percCharge[2])) {
                        $time = explode(':', $percCharge[2]);
                        $hours = $time[0];
                        $minutes = $hours*60+substr($time[1], 0, 2);
                        $dev->setTimeLeft($minutes);
                    }
                }
                $dev->setMode("pmset");
                $this->upsinfo->setUpsDevices($dev);
            }
        }
    }
802795
public function getToolProvider()
    {
        if (empty($this->toolProvider)) {
            $this->setToolProvider(
                new ToolProvider(
                    $this->mysql,
                    $this->metadata['TOOL_HANDLER_URLS']
                )
            );
        }
        return $this->toolProvider;
    }
656653
private function _get_systeminfo()
    {
        if ($this->_systeminfo === null) CommonFunctions::executeProgram('systeminfo', '', $this->_systeminfo, false);
        return $this->_systeminfo;
    }
806543
public function getInfo() {
		$info = $this->createInfoset();
		
		$this->handleIcon($info);
		$this->createTitle($info);
		$this->createContent($info);
		
		return $info;
	}