[runtime function] adds a block to the block stack

@param string $blockName the block name (without Dwoo_Plugin_ prefix)
@param array $args the arguments to be passed to the block's init() function
@return Dwoo_Block_Plugin the newly created block
179096
public function addStack($blockName, array $args=array())
	{
		if (isset($this->plugins[$blockName])) {
			$class = $this->plugins[$blockName]['class'];
		} else {
			$class = 'Dwoo_Plugin_'.$blockName;
		}

		if ($this->curBlock !== null) {
			$this->curBlock->buffer(ob_get_contents());
			ob_clean();
		} else {
			$this->buffer .= ob_get_contents();
			ob_clean();
		}

		$block = new $class($this);

		$cnt = count($args);
		if ($cnt===0) {
			$block->init();
		} elseif ($cnt===1) {
			$block->init($args[0]);
		} elseif ($cnt===2) {
			$block->init($args[0], $args[1]);
		} elseif ($cnt===3) {
			$block->init($args[0], $args[1], $args[2]);
		} elseif ($cnt===4) {
			$block->init($args[0], $args[1], $args[2], $args[3]);
		} else {
			call_user_func_array(array($block,'init'), $args);
		}

		$this->stack[] = $this->curBlock = $block;
		return $block;
	}
656655
protected function endRenderBlock($blockName)
    {
        $contents = ob_get_contents();
        ob_end_clean();
        foreach ($this->plugins as $plugin) {
            $blockRenderList = $plugin->getBlockRenderList();
            if (in_array($blockName, $blockRenderList) === true) {
                echo $plugin->callBlockRenderEnd($blockName, $contents);
                return;
            }
        }
        echo $contents;
        throw new JigException("Block $blockName not known for ending block in plugins.");
    }
844674
private function setSubject($blockId): BaseBlock
    {
        /** @var BaseBlock $block */
        $block = $this->admin->getObject($blockId);
        if (!$block) {
            throw $this->createNotFoundException(sprintf('Unable to find block with id %d', $blockId));
        }
        $this->admin->setSubject($block);

        return $block;
    }
553545
function blockSet(BlockInterface $block, $templateFile) {
		$this->_blockStack[]= $block;
		$this->_templateFileStack[]= $templateFile;
	}
1170797
public function add(Block ...$blocks)
    {
        foreach ($blocks as $block) {
            $this->blocks[] = $block;
        }

        return $this;
    }
1017344
public function add($arg1, $arg2 = null) {

        if(isset($arg2)) {

			$this->set("var[$arg1]", $arg2);

            return $arg2;

        } else {

        	if(is_array($arg1)) {

	            foreach($arg1 as $name => $value) {

	                $this->set("var[$name]", $value);
	            }

                return $arg1;
        	}
		}
	}
481641
public function getBlockById(int $blockId, int $siteId = null)
    {
        /** @var SuperTableBlock|null $block */
        $block = Craft::$app->getElements()->getElementById($blockId, SuperTableBlockElement::class, $siteId);

        return $block;
    }
889798
public function groupCall(string $groupName, string $methodName, ...$args)
    {
        return $this->createGroup($groupName)->$methodName(...$args);
    }
1219059
protected function createBlocks(BlockInterface $block)
    {
        $content = [];
        $content['id'] = $block->getId();
        $content['name'] = $block->getName();
        $content['enabled'] = $block->getEnabled();
        $content['position'] = $block->getPosition();
        $content['settings'] = $block->getSettings();
        $content['type'] = $block->getType();
        $content['created_at'] = $block->getCreatedAt()->format('U');
        $content['updated_at'] = $block->getUpdatedAt()->format('U');
        $content['blocks'] = [];

        foreach ($block->getChildren() as $child) {
            $content['blocks'][] = $this->createBlocks($child);
        }

        return $content;
    }
889726
public function extendBlock($blockName, Closure $closure)
    {
        $blockName  = ucfirst(strtolower($blockName));
        $methodName = camel_case("block_{$blockName}");

        return $this->bindElementClosure($methodName, $closure);
    }
80465
public function addBlock(Block $block)
	{
		if ($this->lock('block')) {
			$this->matchDiscriminator($block);
			if ($this->addUnique($this->blocks, $block)) {
				$block->setPlaceHolder($this);
			}
			$this->unlock('block');
		}
	}
98111
public function canCreate(ContainerInterface $container, $requestedName)
    {
        /** @var BlockPluginManager $blockPluginManager */
        $blockPluginManager = $container->get(BlockPluginManager::class);
        $blocks = $blockPluginManager->getAvailableBlocks();

        return in_array($requestedName, $blocks);
    }
148210
public LocatedBlock addBlock(String src,
                               String clientName) throws IOException {
    return addBlock(src, clientName, null);
  }
113334
public function addBlock($type, array $params, $paramtype)
	{
		$class = 'Dwoo_Plugin_'.$type;
		if (class_exists($class, false) === false) {
			$this->dwoo->getLoader()->loadPlugin($type);
		}

		$params = $this->mapParams($params, array($class, 'init'), $paramtype);

		$this->stack[] = array('type' => $type, 'params' => $params, 'custom' => false, 'class' => $class, 'buffer' => null);
		$this->curBlock =& $this->stack[count($this->stack)-1];
		return call_user_func(array($class,'preProcessing'), $this, $params, '', '', $type);
	}
1083152
public static function updateblockorder( $args )
    {
        $http = eZHTTPTool::instance();

        $contentObjectAttributeID = (int)$http->postVariable( 'contentobject_attribute_id', 0 );
        $version =(int)$http->postVariable( 'version', 0 );
        $zoneID = $http->postVariable( 'zone', '' );
        $blockOrder = $http->postVariable( 'block_order', array() );

        $contentObjectAttribute = eZContentObjectAttribute::fetch( $contentObjectAttributeID, $version );
        if ( !$contentObjectAttribute instanceof eZContentObjectAttribute )
        {
            return array();
        }
        $contentObject = $contentObjectAttribute->attribute( 'object' );
        if ( !$contentObject->attribute( 'can_edit' ) )
        {
            return array();
        }

        // checking that the version is a draft and belongs to the current user
        $contentVersion = $contentObjectAttribute->attribute( 'object_version' );
        if ( $contentVersion->attribute( 'status' ) != eZContentObjectVersion::STATUS_DRAFT &&
                $contentVersion->attribute( 'status' ) != eZContentObjectVersion::STATUS_INTERNAL_DRAFT
           )
        {
            return array();
        }
        if ( $contentVersion->attribute( 'creator_id' ) != eZUser::currentUserID() )
        {
            return array();
        }

        $sortArray = array();
        foreach ( $blockOrder as $blockID )
        {
            $idArray = explode('_', $blockID);

            if ( isset( $idArray[1]) )
                $sortArray[] = $idArray[1];
        }

        if ( $contentObjectAttribute )
            $page = $contentObjectAttribute->content();
        if ( $page )
            $zone = $page->getZone( $zoneID );
        if ( $zone )
            $zone->sortBlocks( $sortArray );

        $contentObjectAttribute->setContent( $page );
        $contentObjectAttribute->store();

        return array();
    }
1210443
public void addBlock(String tierAlias, long blockId, long blockSize, long blockLastAccessTimeMs) {
    UIFileBlockInfo block =
        new UIFileBlockInfo(blockId, blockSize, blockLastAccessTimeMs, tierAlias,
            mAlluxioConfiguration);
    List<UIFileBlockInfo> blocksOnTier = mBlocksOnTier.get(tierAlias);
    if (blocksOnTier == null) {
      blocksOnTier = new ArrayList<>();
      mBlocksOnTier.put(tierAlias, blocksOnTier);
    }
    blocksOnTier.add(block);

    Long sizeOnTier = mSizeOnTier.get(tierAlias);
    mSizeOnTier.put(tierAlias, (sizeOnTier == null ? 0L : sizeOnTier) + blockSize);
  }
271066
def add_block(pBlock, pBehaviour = Languages::KEEP_LEVEL)
      return nil unless (pBlock.instance_of?Languages::BlockData)
      add_with_manager(pBlock, 'block', pBehaviour)
    end