todo: falta completar el pasaje de opciones de configuracion para especificar los partials a renderizar
505306
def ajax_forms options={}
      default_options = {
          quick_new_partial: nil,
          quick_create_partial: nil,
          model: config.resource_class,
          search_fields: ['name'],
          display_column: 'name',
          search_condition: 'cont_all'
      }
      options = default_options.deep_merge(options)

      @ajax_form_enabled = true

      # XXX: usar reflect on association para definir los collection_actions en los modelos
      # relacionados donde se quieren buscar los datos
      # Por ejemplo, si product belongs_to invoice_line, y quiero crear dinámicamente un producto
      # solo hace falta definir en invoice_line que se quiere usar ajax_forms. Automáticamente
      # se crean los collection_actions en products para realizar las búsquedas.

      #todo: Posibilidad de especificar los atributos a devolver en el método find. Si no se especifica nada devolver todas las columnas
      collection_action :find, :method => :get do
        model = resource_class
        search_term = params[:q]
        groupping_condition = params[:q][:g] rescue nil
        ransack_search = options[:search_fields].join('_or_').concat('_').concat(options[:search_condition]).to_sym

        if params[:q_id].present?
          params[:q]={:id_equals => params[:q_id]} #selected element
        elsif groupping_condition.nil?
          params[:q]={
            :g=>{
              "0"=>{ransack_search=>search_term.split(" ")}
            }
          }

          # if this search depends on the result of another select box
          # we need to add the filter to the existing ransack options
          if params[:dependentSelect] and !params[:dependentSelect][:selectorValue].empty?
            params[:q][:g]["1"]={params[:dependentSelect][:ransackFilter].to_sym=>params[:dependentSelect][:selectorValue]}
          end
        end

        q = model.search(params[:q])
        @items = q.result.order('id asc', 'name asc').limit(100).map { |item| {:id => item.id, :text => item.to_s} }
        respond_to do |format|
          format.json { render :json => @items }
        end
      end

      collection_action :quick_new, :method => :get do
        @model = resource_class.new(:name => Base64.decode64(params[:name]))
        options[:selector]=params[:selectorid]
        #crea una variable de instancia con el nombre del recurso para compatibilidad con partials normales
        instance_variable_set("@#{resource_instance_name.to_s}", @model)
        @remote = true
        @form_url = eval "quick_create_admin_#{resource_collection_name.to_s}_path"

        @id="#{Time.now.to_i.to_s}_#{resource_instance_name.to_s}"
        options[:id]=@id

        #todo: tiene que renderizar un formulario por defecto
        if options.fetch(:quick_new_partial).nil?
          render :nothing => true
        else
          render partial: options.fetch(:quick_new_partial), layout: 'application'
        end
      end

      collection_action :quick_create, :method => :post do
        @model = resource_class.new(params[resource_instance_name])
        @selector=options[:selector]
        @model.save
        @id=options[:id]
        render file: 'quick_response', layout: false
      end
    end
1237368
function render()
    {
        if (!isset($this->result)) {
            $this->usageError('Nothing to render!');
        }

        $baseViewFilePath = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'views';

        if (!empty($_SERVER['argv'])) {
            $viewFilename = $baseViewFilePath.DIRECTORY_SEPARATOR.'console'.DIRECTORY_SEPARATOR.'index.php';
        } else {
            $viewFilename = $baseViewFilePath.DIRECTORY_SEPARATOR.'web'.DIRECTORY_SEPARATOR.'index.php';
        }

        $this->renderViewFile($viewFilename, $this->result);
    }
1323630
public function render()
    {
        $addOnsLeft = [];
        $addOnsRight = [];

        if ($this->addOns->count()) {
            foreach ($this->addOns as $addOn) {
                if ($addOn->position === Group\AddOn::ADDON_LEFT) {
                    $addOnsLeft[] = $addOn;
                } else {
                    $addOnsRight[] = $addOn;
                }
            }
        }

        $output[] = $this->open();

        // AddOn Left
        if (count($addOnsLeft)) {
            $prependContainer = new Element('div');
            $prependContainer->attributes->addAttributeClass('input-group-prepend');

            foreach ($addOnsLeft as $addOn) {
                $prependContainer->childNodes->push($addOn);
            }

            $output[] = $prependContainer;
        }

        // Input
        $output[] = $this->input;

        // AddOn Right
        if (count($addOnsRight)) {
            $appendContainer = new Element('div');
            $appendContainer->attributes->addAttributeClass('input-group-prepend');

            foreach ($addOnsRight as $addOn) {
                $appendContainer->childNodes->push($addOn);
            }

            $output[] = $appendContainer;
        }

        if ($this->hasChildNodes()) {
            foreach ($this->childNodes as $childNode) {
                if ($childNode instanceof Components\Dropdown) {
                    $childNode->attributes->removeAttributeClass('dropdown');
                    $childNode->attributes->addAttributeClass('input-group-btn');

                    $childNode->toggle->tagName = 'a';
                    $childNode->toggle->attributes->removeAttribute('type');
                }

                $output[] = $childNode;
            }
        }

        if ($this->hasTextContent()) {
            $output[] = implode(PHP_EOL, $this->textContent->getArrayCopy());
        }

        $output[] = $this->close();

        return implode(PHP_EOL, $output);
    }
810083
public function render() {

		// check authentication

		if(!$this->authenticateMenu($this->menu)) {
			return '';
		}

		$request = Request::createFromGlobals();
		
		// if menu has not been prepared yet, do it now (caching avoids re-parsing for submenus)

		if(!in_array($this->menu, self::$primedMenus, true)) {

			// clear selected menu entries (which remain in the session)

			$this->clearSelectedMenuEntries($this->menu);

			// walk entire menu and add dynamic entries where necessary
			
			$this->completeMenu($this->menu);
			
			// prepare path segments to identify active menu entries

			$this->pathSegments = explode('/', trim($request->getPathInfo(), '/'));

			// skip script name

			if($this->rewriteActive && basename($request->getScriptName()) != 'index.php') {
				array_shift($this->pathSegments);
			}

			// skip locale if one found

			if(count($this->pathSegments) && Application::getInstance()->hasLocale($this->pathSegments[0])) {
				array_shift($this->pathSegments);
			}

			// walk tree until an active entry is reached

			$this->walkMenuTree($this->menu, (!count($this->pathSegments) || $this->pathSegments[0] === '') ? explode('/', $this->route->getPath()) : $this->pathSegments);

			// cache menu for multiple renderings

			self::$primedMenus[] = $this->menu;
		}

		$htmlId = $this->id . 'menu';

		// drill down to required submenu (if only submenu needs to be rendered)

		$m = $this->menu;

		if($this->level !== false) {

			$htmlId .= '_level_' . $this->level;

			if($this->level > 0) {

				while($this->level-- > 0) {
					$e = $this->menu->getSelectedEntry();
					if(!$e || !$e->getSubMenu()) {
						break;
					}
					$m = $e->getSubMenu();
				}

				if($this->level >= 0) {
					return '';
				}

			}
		}

		// output

		// instantiate renderer class, defaults to SimpleListRenderer

		if(!empty($this->decorator)) {
			$rendererName = $this->decorator;
		}
		else {
			$rendererName = 'SimpleList';
		}

		$className = __NAMESPACE__ . '\\Menu\\Renderer\\' . $rendererName . 'Renderer';

		$renderer = new $className($m);
		$renderer->setParameters($this->renderArgs);

		// enable or disable display of submenus

		$m->setShowSubmenus($this->level === false);

		// enable or disable always active menu

		$m->setForceActive(self::$forceActiveMenu);

		// if no container tag was specified, use a DIV element

		if(!isset($this->renderArgs['containerTag'])) {
			$this->renderArgs['containerTag'] = 'div';
		}

		// omit wrapper, if a falsy container tag was specified

		if($this->renderArgs['containerTag']) {
			return sprintf(
				'<%1$s%2$s>%3$s</%1$s>',
				$this->renderArgs['containerTag'],
				(isset($this->renderArgs['omitId']) && $this->renderArgs['omitId']) ? '' : (' id="' . $htmlId . '"'),
				$renderer->render()
			);
		}

		return $renderer->render();

	}
558600
private function generateConfiguration()
    {
        if (!in_array($this->format, array('yml', 'xml', 'php'))) {
            return;
        }

        $target = sprintf(
            '%s/Resources/config/routing/%s.%s',
            $this->bundle->getPath(),
            strtolower(str_replace('\\', '_', $this->document)),
            $this->format
        );

        $this->renderFile('config/routing.'.$this->format.'.twig', $target, array(
            'actions' => $this->actions,
            'route_prefix' => $this->routePrefix,
            'route_name_prefix' => $this->routeNamePrefix,
            'bundle' => $this->bundle->getName(),
            'document' => $this->document,
        ));
    }
477935
public function render()
    {
        return self::renderStatic(['value' => $this->arguments['value'], 'mode' => $this->arguments['mode']], $this->buildRenderChildrenClosure(), $this->renderingContext);
    }
140444
public function render()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
        parent::render();

        $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
        $oCur = $myConfig->getActShopCurrencyObject();
        $oLang = \OxidEsales\Eshop\Core\Registry::getLang();

        $soxId = $this->getEditObjectId();
        if (isset($soxId) && $soxId != "-1") {
            $oOrder->load($soxId);

            $this->_aViewData["edit"] = $oOrder;
            $this->_aViewData["aProductVats"] = $oOrder->getProductVats();
            $this->_aViewData["orderArticles"] = $oOrder->getOrderArticles();
            $this->_aViewData["giftCard"] = $oOrder->getGiftCard();
            $this->_aViewData["paymentType"] = $this->_getPaymentType($oOrder);
            $this->_aViewData["deliveryType"] = $oOrder->getDelSet();
            $sTsProtectsField = 'oxorder__oxtsprotectcosts';
            if ($oOrder->$sTsProtectsField->value) {
                $this->_aViewData["tsprotectcosts"] = $oLang->formatCurrency($oOrder->$sTsProtectsField->value, $oCur);
            }
        }

        // orders today
        $dSum = $oOrder->getOrderSum(true);
        $this->_aViewData["ordersum"] = $oLang->formatCurrency($dSum, $oCur);
        $this->_aViewData["ordercnt"] = $oOrder->getOrderCnt(true);

        // ALL orders
        $dSum = $oOrder->getOrderSum();
        $this->_aViewData["ordertotalsum"] = $oLang->formatCurrency($dSum, $oCur);
        $this->_aViewData["ordertotalcnt"] = $oOrder->getOrderCnt();
        $this->_aViewData["afolder"] = $myConfig->getConfigParam('aOrderfolder');
        $this->_aViewData["alangs"] = $oLang->getLanguageNames();

        $this->_aViewData["currency"] = $oCur;

        return "order_overview.tpl";
    }
442900
private function renderControlMenu()
    {
        $menu = '';
        for ($section = 0; $section < count($this->extmenu); $section++)
        {
            if (UserRights($this->extmenu[$section]['access']))
            {
                $menu .= '<div class="header">' . $this->extmenu[$section]['caption'] .
                    '</div><div class="content">';
                foreach ($this->extmenu[$section]['items'] as $item)
                {
                    if (
                        UserRights(
                            isset($item['access']) ? $item['access'] : $this->extmenu[$section]['access']
                        ) &&
                        (!(isset($item['disabled']) && $item['disabled']))
                    )
                    {
                        if ($item['link'] == arg('mod'))
                        {
                            $this->title = $item['caption'];
                        }
                        $menu .= '<div ' . ($item['link'] == arg('mod') ? 'class="selected"' : '') .
                            "><a href=\"" . Eresus_CMS::getLegacyKernel()->root . "admin.php?mod=" . $item['link'] .
                            "\" title=\"" .	$item['hint'] . "\">" . $item['caption'] . "</a></div>\n";
                    }
                }
                $menu .= "</div>\n";
            }
        }

        for ($section = 0; $section < count($this->menu); $section++)
        {
            if (UserRights($this->menu[$section]['access']))
            {
                $menu .= '<div class="header">' . $this->menu[$section]['caption'] .
                    '</div><div class="content">';
                foreach ($this->menu[$section]['items'] as $item)
                {
                    if (
                        UserRights(
                            isset($item['access']) ? $item['access'] : $this->menu[$section]['access']
                        ) &&
                        (!(isset($item['disabled']) && $item['disabled']))
                    )
                    {
                        if ($item['link'] == arg('mod'))
                        {
                            $this->title = $item['caption'];
                        }
                        $menu .= '<div '.($item['link'] == arg('mod') ?'class="selected"':'') .
                            "><a href=\"" . Eresus_CMS::getLegacyKernel()->root . "admin.php?mod=" . $item['link'] .
                            "\" title=\"" .	$item['hint'] . "\">" . $item['caption'] . "</a></div>\n";
                    }
                }
                $menu .= "</div>\n";
            }
        }

        return $menu;
    }
568408
public function render()
    {
        /** @var Gallery $plugin */
        // TODO Добавить в этот класс ссылку на плагин
        $plugin = Eresus_Plugin_Registry::getInstance()->load('gallery');

        /** @var TClientUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $page->linkJsLib('jquery');
        $page->linkScripts($plugin->getCodeUrl() . '/client/gallery.js');
        $page->linkStyles($plugin->getCodeUrl() . '/client/gallery.css');

        $tmpl = $plugin->templates()->client('popup.html');
        $popup = $tmpl->compile();
        $html = '<div id="gallery-popup">' . $popup . '</div>';

        $html .= $this->renderImageList();

        return $html;
    }
331932
public function RenderControl () {
		$result = '';
		foreach ($this->options as $key => $value) {
			$result .= $this->RenderControlItem($key, $value);
		}
		return $result;
	}
342588
public function render()
    {
        // Prepare details
        $path       = $this->config['settings']['path'];
        $name       = $this->config['settings']['name'] . '/';
        $template   = 'index.tpl.php';
        $functions  = 'functions.php';

        // Include theme specific functions file
        $file = $path . $name . $functions;
        if (is_readable($file)) {
            include $file;
        }

        // Create views for regions, from config-file
        if (isset($this->config['views'])) {
            foreach ($this->config['views'] as $view) {
                $this->di->views->add($view['template'], $view['data'], $view['region'], $view['sort']);
            }
        }

        // Sen response headers, if any.
        $this->di->response->sendHeaders();

        // Create a view to execute the default template file
        $tpl  = $path . $name . $template;
        $data = array_merge($this->config['data'], $this->data);
        $view = $this->di->get('view');
        $view->set($tpl, $data);
        $view->setDI($this->di);
        $view->render();
    }
1082025
public function render()
    {
        if ($this->options['enableListButton']) {
            $this->add($this->listButton());
        }

        if ($this->options['enableBackButton']) {
            $this->add($this->backButton());
        }

        return $this->tools->map(function ($tool) {
            if ($tool instanceof Renderable) {
                return $tool->render();
            }

            if ($tool instanceof Htmlable) {
                return $tool->toHtml();
            }

            return (string) $tool;
        })->implode(' ');
    }
624734
public function render() {
		$tabsList = new ListUnordered();
		$tabsList->setSeparator('');
		$tabsList->addClass('debug-bar');
		$tabsList->id = 'debug-elements';
		
		$panels = '';
		
		foreach ($this->info as $info) {
			$tabElement = $this->createTab($info);
			
			if (! $info->isEmpty()) {
				$id = 'debug-panel-' . substr(md5(rand(0, 1000) . $info->getName()), 24);
			
				$tabElement->addClass('withpanel clickable');
				$tabElement->setAttr('data-panel-id', $id);
				
				$panelTag = $this->createPanel($info);
				$panelTag->id = $id;
				
				$panels .= $panelTag->render();
			}
			
			$tabsList->addElement($tabElement);
		}
		
		$styleTag  = new Tag('style', $this->getAsset('bar.css'));
		$scriptTag = new Script($this->getAsset('bar.js'));
		
		$wrapperTag = new Tag('div', $tabsList->render(), 'debug-bar-wrapper');
		$debugTag   = new Tag('div', $panels . $wrapperTag->render(), 'debug-main');
		
		return $styleTag->render() . $scriptTag->render() . $debugTag->render();
	}
1154543
public function render()
    {
        $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

        // automatically redirect to SSL login
        if (!$myConfig->isSsl() && strpos($myConfig->getConfigParam('sAdminSSLURL'), 'https://') === 0) {
            \OxidEsales\Eshop\Core\Registry::getUtils()->redirect($myConfig->getConfigParam('sAdminSSLURL'), false, 302);
        }

        //resets user once on this screen.
        $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
        $oUser->logout();

        \OxidEsales\Eshop\Core\Controller\BaseController::render();

        $this->setShopConfigParameters();

        if ($myConfig->isDemoShop()) {
            // demo
            $this->addTplParam("user", "admin");
            $this->addTplParam("pwd", "admin");
        }
        //#533 user profile
        $this->addTplParam("profiles", \OxidEsales\Eshop\Core\Registry::getUtils()->loadAdminProfile($myConfig->getConfigParam('aInterfaceProfiles')));

        $aLanguages = $this->_getAvailableLanguages();
        $this->addTplParam("aLanguages", $aLanguages);

        // setting templates language to selected language id
        foreach ($aLanguages as $iKey => $oLang) {
            if ($aLanguages[$iKey]->selected) {
                \OxidEsales\Eshop\Core\Registry::getLang()->setTplLanguage($iKey);
                break;
            }
        }

        return "login.tpl";
    }
1282166
public function renderFilter()
    {
        FrontController::getInstance()->getView()->_column = $this;
        //pusta opcja
        $this->setMultioptions([null => '---'] + $this->getMultioptions());
        //tworzy selecta z template'u
        return FrontController::getInstance()->getView()->renderTemplate(self::TEMPLATE_FILTER);
    }
975987
protected function compile()
	{
		// get included elements
		if($this->objWrapper->getType() == ContentWrapper\Model::TYPE_START) {
			$this->Template->count = ContentWrapper\Repository::countRelatedElements($this->objWrapper);

			$cssID = $this->cssID;

			if($cssID[0] == '') {
				$cssID[0] = sprintf($this->strIdentifier, $this->id);
				$this->cssID = $cssID;
			}
		}
		// generate css identifier
		else {
			$start = \ContentModel::findByPk($this->bootstrap_parentId);

			if($start !== null) {
				$start = new Attributes($start);
				$start->registerNamespaceAttributes($this->arrBootstrapAttributes);
				$start->cssID = deserialize($start->cssID, true);

				$this->Template->start = $start;

				if($start->cssID[0] == '') {
					$cssID = $start->cssID;
					$cssID[0] = sprintf($this->strIdentifier, $start->id);
					$this->cssID = $cssID;
				}
				else {
					$this->cssID = $start->cssID;
				}
			}
		}

		$this->Template->identifier = $this->cssID[0];
	}
1129372
public function dispatchAction()
    {
        //pobranie kategorii
        $category = $this->_getPublishedCategoryByUri($this->uri);
        //wpięcie kategorii do głównego widoku aplikacji
        FrontController::getInstance()->getView()->category = $category;
        //klucz bufora
        $cacheKey = 'category-html-' . $category->id;
        //buforowanie dozwolone
        $bufferingAllowed = $this->_bufferingAllowed();
        //wczytanie zbuforowanej strony (dla niezalogowanych i z pustym requestem)
        if ($bufferingAllowed && (null !== $html = \App\Registry::$cache->load($cacheKey))) {
            //wysyłanie nagłówka o buforowaniu strony
            $this->getResponse()->setHeader('X-Cache', 'HIT');
            //zwrot html
            return $this->_decorateHtmlWithEditButton($html, $category);
        }
        //wysyłanie nagłówka o braku buforowaniu strony
        $this->getResponse()->setHeader('X-Cache', 'MISS');
        //przekazanie rekordu kategorii do widoku
        $this->view->category = $category;
        //renderowanie docelowej akcji
        $html = \Mmi\Mvc\ActionHelper::getInstance()->forward($this->_prepareForwardRequest($category));
        //buforowanie niedozwolone
        if (!$bufferingAllowed || 0 == $cacheLifetime = $this->_getCategoryCacheLifetime($category)) {
            //zwrot html
            return $this->_decorateHtmlWithEditButton($html, $category);
        }
        //zapis html kategorii do cache
        \App\Registry::$cache->save($html, $cacheKey, $cacheLifetime);
        //zwrot html
        return $this->_decorateHtmlWithEditButton($html, $category);
    }