Write History row.

@param string $action
@param string $title
@param string $locale

@return null
165350
public function writeHistory($action, $title = null, array $old = [], array $new = [])
    {
        $data['historable_id'] = $this->getKey();
        $data['historable_type'] = get_class($this);
        $data['user_id'] = auth()->id();
        $data['title'] = $title;
        $data['icon_class'] = $this->iconClass($action);
        $data['historable_table'] = $this->getTable();
        $data['action'] = $action;
        $data['old'] = $old;
        $data['new'] = $new;
        (new EloquentHistory())->create($data);
    }
680726
public function writeTitle($title, $color = null)
    {
        $this->writeLine("---------------------------\n", $color);
        $this->writeLine($title . "\n", $color);
        $this->writeLine("---------------------------\n", $color);
    }
854037
protected function process(Action $action, EnvironmentInterface $environment)
    {
        if ($environment->getDataDefinition()->getBasicDefinition()->isEditOnlyMode()) {
            return $environment->getView()->edit($action);
        }

        $modelId      = ModelId::fromSerialized($environment->getInputProvider()->getParameter('id'));
        $dataProvider = $environment->getDataProvider($modelId->getDataProviderName());
        $translator   = $environment->getTranslator();
        $model        = $this->getModel($environment);
        $data         = $this->convertModel($model, $environment);

        $template = (new ContaoBackendViewTemplate('dcbe_general_show'))
            ->set('headline', $this->getHeadline($translator, $model))
            ->set('arrFields', $data['values'])
            ->set('arrLabels', $data['labels']);

        if ($dataProvider instanceof MultiLanguageDataProviderInterface) {
            $template
                ->set('languages', $environment->getController()->getSupportedLanguages($model->getId()))
                ->set('currentLanguage', $dataProvider->getCurrentLanguage())
                ->set('languageSubmit', $translator->translate('MSC.showSelected'))
                ->set('backBT', StringUtil::specialchars($translator->translate('MSC.backBT')));
        } else {
            $template->set('languages', null);
        }

        return $template->parse();
    }
1200121
private function getOrCreateRoot($namespace, $title, $locale, $userId, $parent = null)
    {
        if (null !== ($collection = $this->collectionManager->getByKey($namespace, $locale))) {
            $collection->setTitle($title);

            return $collection;
        }

        return $this->createCollection($title, $namespace, $locale, $userId, $parent);
    }
483632
public function beforeAction($action)
    {   
        // Are we trying to load the index page? Check we have defaults setup
        if ($action->actionMethod === 'actionIndex') {
            $layoutId = $this->_getCurrentLayoutId();

            $navItems = CpNav::$plugin->navigationService->getByLayoutId($layoutId);

            if (!$navItems) {
                CpNav::$plugin->cpNavService->setupDefaults();
            }
        }

        return parent::beforeAction($action);
    }
1305271
private function handleActionParameter($actionParameter, $document, $locale)
    {
        switch ($actionParameter) {
            case 'publish':
                $this->getDocumentManager()->publish($document, $locale);
                break;
        }
    }
935995
private function _writeTitle(PHPExcel_Chart_Title $title = null, $objWriter)
	{
		if (is_null($title)) {
			return;
		}

		$objWriter->startElement('c:title');
			$objWriter->startElement('c:tx');
				$objWriter->startElement('c:rich');

					$objWriter->startElement('a:bodyPr');
					$objWriter->endElement();

					$objWriter->startElement('a:lstStyle');
					$objWriter->endElement();

					$objWriter->startElement('a:p');

						$caption = $title->getCaption();
						if ((is_array($caption)) && (count($caption) > 0))
							$caption = $caption[0];
						$this->getParentWriter()->getWriterPart('stringtable')->writeRichTextForCharts($objWriter, $caption, 'a');

					$objWriter->endElement();
				$objWriter->endElement();
			$objWriter->endElement();

			$layout = $title->getLayout();
			$this->_writeLayout($layout, $objWriter);

			$objWriter->startElement('c:overlay');
				$objWriter->writeAttribute('val', 0);
			$objWriter->endElement();

		$objWriter->endElement();
	}
1183851
public function getTitle($page = NULL, $action = NULL) {
    $plugin = $this->customerPagesManager->createInstance($this->customerPagesPlugin);
    $page_id = $plugin->getPageId();
    $pages = $plugin->getPages();
    $page_config = $pages[$page_id];
    $title = isset($page_config['title']) ? $page_config['title'] : $page_id;

    if ($action == 'edit' && isset($page_config['edit_title'])) {
      $title = $page_config['edit_title'];
    }

    if (!$page) {
      $title = $this->t('Account');
    }

    return $title;
  }
748841
protected function processAction(DOMNode $action)
    {
        $actionName = substr($action->nodeName, strlen($action->lookupPrefix(self::NS)) + 1);
        $methodName = 'action' . $actionName;
        if (method_exists($this, $methodName))
        {
            $this->$methodName($action);
        }
    }
972150
private function logSection($title = "")
    {
        $this->logger->info("---------------------------");
        if (!empty($title)) {
            $this->logger->info($title);
        }
    }
184772
public function getLastVisited($locale = null, $query = null)
    {
        $query = $this->determineLocaleAndQuery($locale, $query);

        $lastVisited = $query->orderBy('created_at', 'desc')->first();

        return $lastVisited ? $lastVisited->created_at : null;
    }
742458
public function log(string $action, string $entity, array $dados, array $old)
    {
        $store = new Json("store/{$entity}");
        $dados['userlogin'] = (!empty($_SESSION['userlogin']) ? $_SESSION['userlogin']['id'] : 0);

        if ($action === "create") {
            $store->save($dados['id'], $dados);
        } else {
            foreach ($old as $item) {
                if ($action === "delete") {
                    if (!empty($item['id']))
                        $store->delete($item['id']);
                } else {
                    $store->save($item['id'], array_merge($item, $dados));
                }
            }
        }
    }
788122
public function duplicatePage(Node $node, $locale, $title = 'New page')
    {
        $user = $this->getAdminUser();

        $sourceNodeTranslations = $node->getNodeTranslation($locale, true);
        $sourcePage = $sourceNodeTranslations->getPublicNodeVersion()->getRef($this->em);
        $targetPage = $this->cloneHelper->deepCloneAndSave($sourcePage);
        $targetPage->setTitle($title);

        if ($node->getParent()) {
            $parentNodeTranslation = $node->getParent()->getNodeTranslation($locale, true);
            $parent = $parentNodeTranslation->getPublicNodeVersion()->getRef($this->em);
            $targetPage->setParent($parent);
        }
        $this->em->persist($targetPage);
        $this->em->flush();

        /* @var Node $nodeNewPage */
        $nodeNewPage = $this->em->getRepository(Node::class)->createNodeFor($targetPage, $locale, $user);

        $nodeTranslation = $nodeNewPage->getNodeTranslation($locale, true);
        if ($targetPage->isStructureNode()) {
            $nodeTranslation->setSlug('');
            $this->em->persist($nodeTranslation);
        }
        $this->em->flush();

        return $nodeTranslation;
    }
1307550
public function route(string $action, $callback, string $method = 'get', string $title = ''): PageInterface
    {
        $method = strtolower($method);
        $action = $this->parseAction($action, $method);

        $this->routes[$method][$action] = $callback;

        $this->titles[$action] = ! empty($title) ? $title : $this->getTitle();

        $this->registerRouteActions();

        return $this;
    }
779842
public function processPreAdd($entity, $name, &$value, $locale=null, $hook=true, $silentException=false) {
		if($hook)
			$this->trigger('set', [$entity, $name, &$value, $locale]);

		if(!$this->hasProperty($name))
			return;

		if($this->property($name)->get('hooks.set')) {
			$hook  = $this->property($name)->get('hooks.set');
			$value = call_user_func_array($hook, [$value, $entity]);
		}

		$value = $this->property($name)->_doSet($value, $entity, $name, $silentException);
	}
588085
private void writeActions(List<Action> actions)
            throws JsonGenerationException, IOException {
        List<String> actionStrings = new ArrayList<String>();

        for (Action action : actions) {
            actionStrings.add(action.getActionName());
        }
        writeJsonArray(JsonDocumentFields.ACTION, actionStrings);
    }
247912
public static function linkAction($action, $title = null, $parameters = array(), $attributes = array())
    {
        $html = self::getInstance()->html;
        $args = func_get_args();
        return call_user_func_array(array($html, __FUNCTION__), $args);
    }