Make sure the decorated view gets the essential pages
    variables.
184421
def pages_view(view):
    
    def pages_view_decorator(request, *args, **kwargs):
        # if the current page is already there
        if(kwargs.get('current_page', False) or
                kwargs.get('pages_navigation', False)):
            return view(request, *args, **kwargs)

        path = kwargs.pop('path', None)
        lang = kwargs.pop('lang', None)
        if path:
            from basic_cms.views import details
            response = details(request, path=path, lang=lang,
                only_context=True, delegation=False)
            context = response
            extra_context_var = kwargs.pop('extra_context_var', None)
            if extra_context_var:
                kwargs.update({extra_context_var: context})
            else:
                kwargs.update(context)
        return view(request, *args, **kwargs)
    return pages_view_decorator
952396
def apply_scopes(params = nil, pagination = true)
      raise ::AbstractController::ActionNotFound.new("List config is turn off") if without_index?
      params ||= @request_params
      
      scope = default_scope(params)

      if current_list == :tree
        scope = scope.roots
      elsif pagination
        scope = page_scope(scope, params[:page], params[:per])
      end

      scope
    end
724935
public function prepareVars()
    {
        $this->vars['search'] = $this->searchWidget ? $this->searchWidget->render() : '';
        $this->vars['cssClasses'] = implode(' ', $this->cssClasses);
        $this->vars['controlPanel'] = $this->makeControlPanel();
    }
400277
function decorate(pages, page) {
  Object.defineProperties(page, {
    first: {
      enumerable: true,
      set: function() {},
      get: function() {
        return pages.first && pages.first.current;
      }
    },

    current: {
      enumerable: true,
      set: function() {},
      get: function() {
        return this.idx + 1;
      }
    },

    last: {
      enumerable: true,
      set: function() {},
      get: function() {
        return pages.last && pages.last.current;
      }
    },

    total: {
      enumerable: true,
      set: function() {},
      get: function() {
        return pages.total;
      }
    }
  });

  var prev = pages.last;
  var idx = pages.total;
  page.idx = idx;
  if (prev) {
    page.prev = prev.current;
    prev.next = page.current;
  }
  return page;
}
1308158
protected function prepareVars()
    {
        if ($this->formField->disabled) {
            $this->previewMode = true;
        }

        if ($this->previewMode) {
            $this->useCaption = false;
        }

        $this->vars['fileList'] = $fileList = $this->getFileList();
        $this->vars['singleFile'] = $fileList->first();
        $this->vars['displayMode'] = $this->getDisplayMode();
        $this->vars['emptyIcon'] = $this->getConfig('emptyIcon', 'icon-upload');
        $this->vars['imageHeight'] = $this->imageHeight;
        $this->vars['imageWidth'] = $this->imageWidth;
        $this->vars['acceptedFileTypes'] = $this->getAcceptedFileTypes(true);
        $this->vars['cssDimensions'] = $this->getCssDimensions();
        $this->vars['cssBlockDimensions'] = $this->getCssDimensions('block');
        $this->vars['useCaption'] = $this->useCaption;
        $this->vars['prompt'] = $this->getPromptText();
    }
1217945
protected static function checkRequiredVariables()
    {
        foreach (self::$required as $key) {
            if (!isset(self::$variables[$key])) {
                throw new MissingVariableException(".env variable '{$key}' is missing");
            }
        }
    }
928562
private void initVariables() {
		if (this.currentWindow == null) {
			this.currentWindow = new int[this.windowSize];
		}

		if (this.classDistributions == null) {
			this.classDistributions = new long[this.getModelContext().classAttribute().numValues()];
		}
	}
407950
def update_views(self):
        """"""
        # Call the father's method
        super(Plugin, self).update_views()

        # Add specifics informations
        # Alert and log
        self.views['used']['decoration'] = self.get_alert_log(self.stats['used'], maximum=self.stats['total'])
        # Optional
        for key in ['active', 'inactive', 'buffers', 'cached']:
            if key in self.stats:
                self.views[key]['optional'] = True
478504
def view_variables
      instance_variables
        .select { |var| additional_var?(var) }
        .map { |var| fetch_ivar_value(var) }
    end
1009271
def get_style_var(var_name)
      style_details = style_variables_for_theme["vic"] || Pwb::PresetStyle.default_values
      style_vars = style_details["variables"] || []
      style_vars[var_name] || ""
    end
1232137
protected function pages_prepare_prev(){
		if($this->page_prev>=0){
			$url=$this->generateurl($this->page_prev);
			$this->pages[]=(object)array(
				'name'=>'&lt;',
				'url'=>$url,
				'active'=>($this->page_prev==$this->page_active),
				'disabled'=>false
				);
			}else{
			$this->pages[]=(object)array(
				'name'=>'&lt;',
				'url'=>'',
				'active'=>false,
				'disabled'=>true
				);
			}
		}
869779
function() {
      // Remember the current page state
      var t = this;
      t.pageSettingsView.originalModel = t.model.toJSON({trim:false});

      // Load & show the dialog
      t.showDialog('#nm-pv-settings');
    }
1317989
def _resolve_view_params(self, request, defaults, *args, **kwargs):
        
        params = copy.copy(defaults)
        params.update(self.params)
        params.update(kwargs)
        resolved_params = {}
        
        extra_context = {}
        for key in params:
            # grab from provided params. 
            value = params[key]
            
            # otherwise grab from existing params
            if value == None:
                value = self.params[key] if self.params.has_key(key) else None
            
            # otherwise grab from class method
            if value == None:
                value = getattr(self, 'get_%s' % key)(request, *args, **kwargs) if getattr(self, 'get_%s' % key, None) else None

            if key in defaults:
                resolved_params[key] = value
            else:
                extra_context[key] = value
        
        if extra_context:
            try:
                resolved_params['extra_context'].update(extra_context)
            except AttributeError:
                resolved_params['extra_context'] = extra_context

        return resolved_params
122617
public function prepareVars()
    {
        $this->vars['placeholder'] = $this->placeholder;
        $this->vars['useKey'] = $this->useKey;
        $this->vars['field'] = $this->formField;
        $this->vars['fieldOptions'] = $this->getFieldOptions();
        $this->vars['selectedValues'] = $this->getLoadValue();
        $this->vars['customSeparators'] = $this->getCustomSeparators();
    }
608983
protected function prepareVars()
    {
        clearstatcache();

        $folder = $this->getCurrentFolder();
        $viewMode = $this->getViewMode();
        $filter = $this->getFilter();
        $sortBy = $this->getSortBy();
        $sortDirection = $this->getSortDirection();
        $searchTerm = $this->getSearchTerm();
        $searchMode = strlen($searchTerm) > 0;

        if (!$searchMode) {
            $this->vars['items'] = $this->listFolderItems($folder, $filter, ['by' => $sortBy, 'direction' => $sortDirection]);
        }
        else {
            $this->vars['items'] = $this->findFiles($searchTerm, $filter, ['by' => $sortBy, 'direction' => $sortDirection]);
        }

        $this->vars['currentFolder'] = $folder;
        $this->vars['isRootFolder'] = $folder == self::FOLDER_ROOT;
        $this->vars['pathSegments'] = $this->splitPathToSegments($folder);
        $this->vars['viewMode'] = $viewMode;
        $this->vars['thumbnailParams'] = $this->getThumbnailParams($viewMode);
        $this->vars['currentFilter'] = $filter;
        $this->vars['sortBy'] = $sortBy;
        $this->vars['sortDirection'] = $sortDirection;
        $this->vars['searchMode'] = $searchMode;
        $this->vars['searchTerm'] = $searchTerm;
        $this->vars['sidebarVisible'] = $this->getSidebarVisible();
    }
670890
function(starting_view, config) {

		var widget = starting_view.getWidget(),
			template_arguments = ('arguments' in config) ? this._evalTargetArguments(starting_view, config) : null;

		if ('locator_type' in config) {

			widget = this['_locateWidgetBy' + config.locator_type](widget, config.locator);

			if (!widget || !widget.isWidget) Lava.t();

		}

		return widget.getInclude(config.name, template_arguments);

	}
747801
protected function _dasherizeIncludesViewVar()
    {
        foreach ($this->viewVars['_include'] as $key => $value) {
            $this->viewVars['_include'][$key] = Inflector::dasherize($value);
        }
    }