Called before the listing renders
553268
def update(self):
        
        super(BatchFolderContentsView, self).update()

        if self.on_batch_folder() and self.can_add_batches():
            self.context_actions[_("Add")] = {
                "url": "createObject?type_name=Batch",
                "permission": "Add portal content",
                "icon": "++resource++bika.lims.images/add.png"}
1059235
private function listTotalStartHandler(): void
    {
        if ($this->list_private == 0) {
            $this->current_element->addText((string) $this->list_total);
        } else {
            $this->current_element->addText(($this->list_total - $this->list_private) . ' / ' . $this->list_total);
        }
    }
144193
function(view) {
        if (view._root._morph && !view._elementInserted) {
          throw new EmberError("Something you did caused a view to re-render after it rendered but before it was inserted into the DOM.");
        }
        // TODO: should be scheduled with renderer
        run.scheduleOnce('render', function () {
          if (view.isDestroying) return;
          view._renderer.renderTree(view, view._parentView);
        });
      }
848864
def before_render(self):
        
        super(BatchFolderContentsView, self).before_render()

        if self.context.portal_type == "BatchFolder":
            self.request.set("disable_border", 1)
672642
public function handleFrontendEditingInListRendering(RenderItemListEvent $event): void
    {
        $caller = $event->getCaller();
        if (!($caller instanceof HybridList)) {
            return;
        }

        $page    = null;
        $enabled = (bool) $caller->metamodel_fe_editing;
        if ($enabled) {
            $page    = $this->getPageDetails($caller->metamodel_fe_editing_page);
            $enabled = (null !== $page);

            $view = $event->getList()->getView();

            $view->set(self::FRONTEND_EDITING_PAGE, $page);
            $view->set(self::FRONTEND_EDITING_ENABLED_FLAG, $enabled);
        }

        if ($enabled) {
            $tableName  = $this->factory->translateIdToMetaModelName($caller->metamodel);
            $definition = $this->frontendEditor->createDcGeneral($tableName)->getDataDefinition();
            $enabled    = $definition->getBasicDefinition()->isCreatable();

            if ($enabled) {
                $url = $this->generateAddUrl($page);

                $caller->Template->addUrl      = $url;
                $caller->Template->addNewLabel = $this->translateLabel('metamodel_add_item', $tableName);
                $event->getTemplate()->addUrl  = $url;
            }
        }

        $event->getTemplate()->editEnable = $caller->Template->editEnable = $enabled;
    }
337926
public function beforeDisplay()
    {
        if ($this->_csrf) {
            $this->_csrf->initCsrfToken();
        }

        $links = $this->getMenuList();
        if (\MUtil_Bootstrap::enabled()) {
            if ($links) {
                $element = $this->_form->createElement('html', 'menuLinks');
                $element->setValue($links);
                $element->setOrder(999);
                $this->_form->addElement($element);
            }
        } else {
            $table = new \MUtil_Html_TableElement(array('class' => $this->class));
            $table->setAsFormLayout($this->_form, true, true);

            // There is only one row with formLayout, so all in output fields get class.
            $table['tbody'][0][0]->appendAttrib('class', $this->labelClass);

            if ($links) {
                $table->tf(); // Add empty cell, no label
                $table->tf($links);
            }
        }
    }
1126494
function (items, index, before) {
        var self = this, curItems, beforeItems, afterItems;

        items = self.create(items);
        curItems = self.items();

        if (!before && index < curItems.length - 1) {
          index += 1;
        }

        if (index >= 0 && index < curItems.length) {
          beforeItems = curItems.slice(0, index).toArray();
          afterItems = curItems.slice(index).toArray();
          curItems.set(beforeItems.concat(items, afterItems));
        }

        return self.renderNew();
      }
1366634
public function onBeforeWrite()
    {
        $this->owner->StyleID = $this->owner->cleanStyleID($this->owner->StyleID);
        $this->owner->StyleClasses = $this->owner->cleanStyleClasses($this->owner->StyleClasses);
    }
717032
public function Render()
    {
        if (strlen($this->_ankor) > 0) {
            WebApplication::$app->getResponse()->addJavaScript("window.location='#" . $this->_ankor . "'", true);
            $this->_ankor = '';
        }
        $this->beforeRender();
        $this->RenderImpl();
        $this->afterRender();
    }
1325752
public function before()
	{
		// setup the template if this isn't a RESTful call
		if ( ! $this->is_restful())
		{
			if ( ! empty($this->template) and is_string($this->template))
			{
				// Load the template
				$this->template = \View::forge($this->template);
			}
		}

		return parent::before();
	}
53223
protected function beforeRenderFormType()
    {
        $controller = $this->_controller();

        $controller->set('formEnableDirtyCheck', $this->_getFormEnableDirtyCheck());
        $controller->set('formSubmitButtonText', $this->_getFormSubmitButtonText());
        $controller->set('formSubmitExtraButtons', $this->_getFormSubmitExtraButtons());
        $controller->set('formSubmitExtraLeftButtons', $this->_getFormSubmitExtraLeftButtons());
        $controller->set('formUrl', $this->_getFormUrl());
    }
624103
function() {
		if (this.falseyRender && this.indexMap.length === 0) {
			// If there are no items ... we should render the falsey template
			var falseyNodeLists = [];
			var falseyFrag = renderAndAddToNodeLists(falseyNodeLists, this.masterNodeList, this.falseyRender, this.currentList, [this.currentList]);

			// put the frag after the reference element in the associated nodeList
			nodeLists.after([this.masterNodeList[0]], falseyFrag);
			// and push the first element onto the master list
			this.masterNodeList.push(falseyNodeLists[0]);
		}
	}
479761
public function renderItems()
	{
		if($this->dataProvider->getItemCount()>0 || $this->showTableOnEmpty)
		{
			echo "<table class=\"{$this->itemsCssClass}\">\n";
			$this->renderTableHeader();
			ob_start();
			$this->renderTableBody();
			$body=ob_get_clean();
			$this->renderTableFooter();
			echo $body; // TFOOT must appear before TBODY according to the standard.
			echo "</table>";
		}
		else
			$this->renderEmptyText();
	}
492454
public function renderItems()
	{
		if ($this->json)
		{
			$renderedTableBody = $this->getRenderedTableBody();
			echo function_exists('json_encode')
				? json_encode($renderedTableBody)
				: CJSON::encode($renderedTableBody);
		}
		elseif ($this->dataProvider->getItemCount() > 0 || $this->showTableOnEmpty)
		{
			echo "<table class=\"{$this->itemsCssClass}\">\n";
			$this->renderTableHeader();
			$this->renderTableFooter(); // TFOOT must appear before TBODY according to the standard.
			$this->renderTableBody();
			echo "</table>";
			$this->renderTemplates();
		}
		else
		{
			$this->renderEmptyText();
		}
	}
792872
public function triggerBeforeFind()
    {
        if (!$this->_beforeFindFired && $this->_type === 'select') {
            $this->_beforeFindFired = true;

            /** @var \Cake\Event\EventDispatcherInterface $repository */
            $repository = $this->getRepository();
            $repository->dispatchEvent('Model.beforeFind', [
                $this,
                new ArrayObject($this->_options),
                !$this->isEagerLoaded()
            ]);
        }
    }
694454
protected void beforeEndElement() {
        if (depth > 0 && stack[depth] == WROTE_MARKUP) { // but not data
            try {
                writeNewLine(depth - 1);
            } catch (Exception ignored) {
                ignored.printStackTrace();
            }
        }
    }
547537
def _render_before(self, element):
        ''''''
        start = ["%s<%s" % (self.spaces, element.tag)]
        if element.id:
            start.append(" id=%s" % self.element.attr_wrap(self.replace_inline_variables(element.id)))
        if element.classes:
            start.append(" class=%s" % self.element.attr_wrap(self.replace_inline_variables(element.classes)))
        if element.attributes:
            start.append(' ' + self.replace_inline_variables(element.attributes))

        content = self._render_inline_content(self.element.inline_content)

        if element.nuke_inner_whitespace and content:
            content = content.strip()

        if element.self_close and not content:
            start.append(" />")
        elif content:
            start.append(">%s" % (content))
        elif self.children:
            start.append(">%s" % (self.render_newlines()))
        else:
            start.append(">")
        return ''.join(start)