Init header (like asc, desc, column name )
349702
protected function initRendering()
    {
        $paramColumn = $this->getTable()->getParamAdapter()->getColumn();
        $paramOrder = $this->getTable()->getParamAdapter()->getOrder();
        $order = ($paramColumn == $this->getName()) ? self::$orderReverse[$paramOrder] : 'asc';

        if ($this->getSortable()) {
            $classSorting = ($paramColumn == $this->getName())
                ? 'sorting_' . self::$orderReverse[$paramOrder] : 'sorting';
            $this->addClass($classSorting);
            $this->addClass('sortable');
            $this->addAttr('data-order', $order);
            $this->addAttr('data-column', $this->getName());
        }


        if ($this->width) {
            $this->addAttr('width', $this->width);
        }
    }
198197
function inits() {
  log( "init", "step="+step+" ajaxOngoing="+ajaxOngoing );
  if ( getParam( 'nc' ) == 'true' ) {
    noCache = "?nc="+ Math.random();
  }

  if ( ajaxOngoing == 0 ) { 
    if ( step == "load-lang" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load module list...');
      loadLang();
      step = "loadmodulemap";
    } else if ( step == "loadmodulemap" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load module list...');
      loadModuleList();
      step = "loaddecor";
    } else if ( step == "loaddecor" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load decor config...');
      loadDecorList();
      step = "loadstructure";
    } else  if ( step == "loadstructure" ) {
      ajaxOngoing++;
      log( 'init', 'Load Structure File ...');
      loadStructure();
      step = "loadincludes";
    } else if ( step == "loadincludes" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load include JS modules ...');
      checkModules( );
      loadIncludes();
      step = "loadmodules";
    } else if ( step == "loadmodules" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load JS modules ...');
      loadModules();
      if ( layout.theme != null ) {
        loadCSSrelPath( 'css-custom/'+layout.theme+'.css' );
        //jQuery('head').append('<link rel="stylesheet" rel="nofollow" href="css-custom/'+layout.theme+'.css" type="text/css" />');        
      }
      loadCSSrelPath( "css-custom/custom.css" );
      if ( pageInfo["layoutMode"] == 'tablet' ) {
        loadCSSrelPath( "css-custom/custom-t.css" );
        //jQuery('head').append('<link rel="stylesheet" rel="nofollow" href="css-custom/custom-t.css" type="text/css" />');        
      } else if ( pageInfo["layoutMode"] == 'mobile' ) {
        loadCSSrelPath( "css-custom/custom-m.css" );
        //jQuery('head').append('<link rel="st<ylesheet" rel="nofollow" href="css-custom/custom-m.css" type="text/css" />');
      } 
      step = "initmodules";
    } else  if ( step == "initmodules" ) {
      ajaxOngoing++;
      log( 'init', 'Load Structure File ...');
      initModules( layout );
      step = "buildstructure";
    } else  if ( step == "buildstructure" ) {
      ajaxOngoing++;
      log( 'init', 'Start to build HTML ...');
      buildStructure( layout );
      step = "loadres-ht";
    } else  if ( step == "loadres-ht" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load resources HTML ...');
      loadResourcesHT();
      step = "call-hooks";
    } else  if ( step == "call-hooks" ) {
      log( 'init', 'Call module hooks ...');
      callHooks();
      step = "loadres-js";
    } else  if ( step == "loadres-js" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load resources JS ...');
      loadResourcesJS();
      step = "callbacks";
    } else  if ( step == "callbacks" ) {
      log( 'init', 'Start callback methods for resources...');
      resourceCallbacks();
      step = "dialogs";
    } else  if ( step == "dialogs" ) {
      log( 'init', 'Start load dialogs for resources...');
      resourceDialogs();
      step = "afterInit";
    } else  if ( step == "afterInit" ) {
      log( 'init', 'Start load dialogs for resources...');
      startModulesAfterPageLoad( layout );
      clearInterval( initTimerId );
      step = "done";
    }
  }  
}
116545
protected function iniciaHeaderLote()
    {
        $this->iRegistrosLote = 0;
        $this->aRegistros[self::HEADER_LOTE] = array_fill(0, $this->tamanho_linha, ' ');
        $this->atual = &$this->aRegistros[self::HEADER_LOTE];
    }
536287
def column(*names)
      # Clear the header row if this is being customized by the user
      unless @customized
        @customized = true
        clear
      end
      
      # Extract configuration
      options = names.last.is_a?(Hash) ? names.pop : {}
      content = names.last.is_a?(String) ? names.pop : nil
      args = [content, options].compact
      
      names.collect! do |name|
        column = row.cell(name, *args)
        column.content_type = :header
        column[:scope] ||= 'col'
        column
      end
      
      names.length == 1 ? names.first : names
    end
572454
protected function initColumns()
    {
        if (empty($this->columns)) {
            $this->guessColumns();
        }
        foreach ($this->columns as $i => $column) {
            if (is_string($column)) {
                $column = $this->createDataColumn($column);
            } else {
                $column = Yii::createObject(array_merge([
                    'class' => $this->dataColumnClass ? : TreeColumn::className(),
                    'grid' => $this,
                ], $column));
            }
            if (!$column->visible) {
                unset($this->columns[$i]);
                continue;
            }
            $this->columns[$i] = $column;
        }
    }
649600
void init() {

        if (m_container == null) {
            m_container = new IndexedContainer();
            setContainerDataSource(m_container);
        } else {
            m_container.removeAllContainerFilters();
            m_container.removeAllItems();
        }
        for (TableProperty prop : TableProperty.values()) {
            m_container.addContainerProperty(prop, prop.getType(), prop.getDefaultValue());
            setColumnHeader(prop, prop.getLocalizedMessage());
        }

        setItemIconPropertyId(TableProperty.Icon);
        setRowHeaderMode(RowHeaderMode.ICON_ONLY);
        setColumnWidth(null, 40);
        setSelectable(true);
        setMultiSelect(true);

        for (I_CmsResourceType type : CmsVaadinUtils.getResourceTypes()) {
            CmsExplorerTypeSettings typeSetting = OpenCms.getWorkplaceManager().getExplorerTypeSetting(
                type.getTypeName());
            Item item = m_container.addItem(type.getTypeName());
            item.getItemProperty(TableProperty.ID).setValue(String.valueOf(type.getTypeId()));
            item.getItemProperty(TableProperty.Icon).setValue(CmsResourceUtil.getBigIconResource(typeSetting, null));
            item.getItemProperty(TableProperty.Name).setValue(CmsVaadinUtils.getMessageText(typeSetting.getKey()));
            item.getItemProperty(TableProperty.ShortName).setValue(type.getTypeName());
            item.getItemProperty(TableProperty.Module).setValue(type.getModuleName());
        }

        setVisibleColumns(TableProperty.Name, TableProperty.ShortName, TableProperty.ID, TableProperty.Module);
    }
241556
function header(columns, opt, repeat, nodisplay){
  var headers = Object.keys(columns);
  var widths = headers.map(head => columns[head]);
  var topl = opt.title ? p[1][0] : p[0][0];
  var topr = opt.title ? p[1][2] : p[0][2];
  var topc = repeat ? p[1][1] : p[0][1];
  log(topl + widths.map(col => p.h + strN(col, p.h) + p.h).join(topc) + topr);
  if (!nodisplay) {
    log(p.v + ' ' + headers.map((txt, i) => fixed(txt, widths[i])).join(' ' + p.v + ' ') + ' ' + p.v);
    log(p[1][0] + widths.map(col => p.h + strN(col, p.h) + p.h).join(p[1][1]) + p[1][2]);
  }
}
1246644
def build_header(self, plugin, attribute, stat):
        """"""
        line = ''

        if attribute is not None:
            line += '{}.{}{}'.format(plugin, attribute, self.separator)
        else:
            if isinstance(stat, dict):
                for k in stat.keys():
                    line += '{}.{}{}'.format(plugin,
                                             str(k),
                                             self.separator)
            elif isinstance(stat, list):
                for i in stat:
                    if isinstance(i, dict) and 'key' in i:
                        for k in i.keys():
                            line += '{}.{}.{}{}'.format(plugin,
                                                        str(i[i['key']]),
                                                        str(k),
                                                        self.separator)
            else:
                line += '{}{}'.format(plugin, self.separator)

        return line
1154940
def _in_header(self, col):
        """"""
        # pylint: disable=R1704
        if not self._has_header:
            # Conditionally register exceptions so that they do not appear
            # in situations where has_header is always True. In this way
            # they are not auto-documented by default
            icol_ex = pexdoc.exh.addex(RuntimeError, "Invalid column specification")
        hnf_ex = pexdoc.exh.addex(ValueError, "Column *[column_identifier]* not found")
        col_list = [col] if isinstance(col, (str, int)) else col
        for col in col_list:
            edata = {"field": "column_identifier", "value": col}
            if not self._has_header:
                # Condition not subsumed in raise_exception_if
                # so that calls that always have has_header=True
                # do not pick up this exception
                icol_ex(not isinstance(col, int))
                hnf_ex((col < 0) or (col > len(self._header) - 1), edata)
            else:
                hnf_ex(
                    (isinstance(col, int) and ((col < 0) or (col > self._data_cols)))
                    or (
                        isinstance(col, str) and (col.upper() not in self._header_upper)
                    ),
                    edata,
                )
        return col_list
538400
function initSubHeaders () {
    var each = [].forEach
    var main = document.getElementById('main')
    var header = document.getElementById('header')
    var sidebar = document.querySelector('.sidebar')
    var content = document.querySelector('.content')

    // build sidebar
    var currentPageAnchor = sidebar.querySelector('.sidebar-link.current')
    var isAPI = document.querySelector('.content').classList.contains('api')
    if (currentPageAnchor || isAPI) {
      var allHeaders = []
      var sectionContainer
      if (isAPI) {
        sectionContainer = document.querySelector('.menu-root')
      } else {
        sectionContainer = document.createElement('ul')
        sectionContainer.className = 'menu-sub'
        currentPageAnchor.parentNode.appendChild(sectionContainer)
      }
      var headers = content.querySelectorAll('h2')
      if (headers.length) {
        each.call(headers, function (h) {
          sectionContainer.appendChild(makeLink(h))
          var h3s = collectH3s(h)
          allHeaders.push(h)
          allHeaders.push.apply(allHeaders, h3s)
          if (h3s.length) {
            sectionContainer.appendChild(makeSubLinks(h3s, isAPI))
          }
        })
      } else {
        headers = content.querySelectorAll('h3')
        each.call(headers, function (h) {
          sectionContainer.appendChild(makeLink(h))
          allHeaders.push(h)
        })
      }

      var animating = false
      sectionContainer.addEventListener('click', function (e) {
        e.preventDefault()
        if (e.target.classList.contains('section-link')) {
          sidebar.classList.remove('open')
          setActive(e.target)
          animating = true
          setTimeout(function () {
            animating = false
          }, 400)
        }
      }, true)

      // make links clickable
      allHeaders.forEach(makeHeaderClickable)

      smoothScroll.init({
        speed: 400,
        offset: 0
      })
    }

    var hoveredOverSidebar = false
    sidebar.addEventListener('mouseover', function () {
      hoveredOverSidebar = true
    })
    sidebar.addEventListener('mouseleave', function () {
      hoveredOverSidebar = false
    })

    // listen for scroll event to do positioning & highlights
    window.addEventListener('scroll', updateSidebar)
    window.addEventListener('resize', updateSidebar)

    function updateSidebar () {
      var doc = document.documentElement
      var top = doc && doc.scrollTop || document.body.scrollTop
      if (animating || !allHeaders) return
      var last
      for (var i = 0; i < allHeaders.length; i++) {
        var link = allHeaders[i]
        if (link.offsetTop > top) {
          if (!last) last = link
          break
        } else {
          last = link
        }
      }
      if (last)
      setActive(last.id, !hoveredOverSidebar)
    }

    function makeLink (h) {
      var link = document.createElement('li')
      var text = h.textContent.replace(/\(.*\)$/, '')
      link.innerHTML =
        '<a class="section-link" data-scroll href="#' + h.id + '">' +
          htmlEscape(text) +
        '</a>'
      return link
    }

    function htmlEscape (text) {
      return text
        .replace(/&/g, '&amp;')
        .replace(/"/g, '&quot;')
        .replace(/'/g, '&#39;')
        .replace(/</g, '&lt;')
        .replace(/>/g, '&gt;')
    }

    function collectH3s (h) {
      var h3s = []
      var next = h.nextSibling
      while (next && next.tagName !== 'H2') {
        if (next.tagName === 'H3') {
          h3s.push(next)
        }
        next = next.nextSibling
      }
      return h3s
    }

    function makeSubLinks (h3s, small) {
      var container = document.createElement('ul')
      if (small) {
        container.className = 'menu-sub'
      }
      h3s.forEach(function (h) {
        container.appendChild(makeLink(h))
      })
      return container
    }

    function setActive (id, shouldScrollIntoView) {
      var previousActive = sidebar.querySelector('.section-link.active')
      var currentActive = typeof id === 'string'
        ? sidebar.querySelector('.section-link[href="#' + id + '"]')
        : id
      if (currentActive !== previousActive) {
        if (previousActive) previousActive.classList.remove('active')
        currentActive.classList.add('active')
        if (shouldScrollIntoView) {
          var currentPageOffset = currentPageAnchor
            ? currentPageAnchor.offsetTop - 8
            : 0
          var currentActiveOffset = currentActive.offsetTop + currentActive.parentNode.clientHeight
          var sidebarHeight = sidebar.clientHeight
          var currentActiveIsInView = (
            currentActive.offsetTop >= sidebar.scrollTop &&
            currentActiveOffset <= sidebar.scrollTop + sidebarHeight
          )
          var linkNotFurtherThanSidebarHeight = currentActiveOffset - currentPageOffset < sidebarHeight
          var newScrollTop = currentActiveIsInView
            ? sidebar.scrollTop
            : linkNotFurtherThanSidebarHeight
              ? currentPageOffset
              : currentActiveOffset - sidebarHeight
          sidebar.scrollTop = newScrollTop
        }
      }
    }

    function makeHeaderClickable (link) {
      var wrapper = document.createElement('a')
      wrapper.href = '#' + link.id
      wrapper.setAttribute('data-scroll', '')
      link.parentNode.insertBefore(wrapper, link)
      wrapper.appendChild(link)
    }
  }
1283700
function init()
    {
        $this->_a['table'] = 'cms_contents';
        $this->_a['cols'] = array(
            // Identifier
            'id' => array(
                'type' => 'Pluf_DB_Field_Sequence',
                'is_null' => false,
                'editable' => false
            ),
            // Fields
            'name' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => false,
                'size' => 64,
                'unique' => true,
                'editable' => true
            ),
            'title' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 250,
                'default' => '',
                'editable' => true
            ),
            'description' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 2048,
                'default' => 'auto created content',
                'editable' => true
            ),
            'mime_type' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 64,
                'default' => 'application/octet-stream',
                'editable' => true
            ),
            'media_type' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 64,
                'default' => 'application/octet-stream',
                'verbose' => 'Media type',
                'help_text' => 'This types allow you to category contents',
                'editable' => true
            ),
            'file_path' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => false,
                'size' => 250,
                'verbose' => 'File path',
                'help_text' => 'Content file path',
                'editable' => false,
                'readable' => false
            ),
            'file_name' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => false,
                'size' => 250,
                'default' => 'unknown',
                'verbose' => 'file name',
                'help_text' => 'Content file name',
                'editable' => false
            ),
            'file_size' => array(
                'type' => 'Pluf_DB_Field_Integer',
                'is_null' => false,
                'default' => 'no title',
                'verbose' => 'file size',
                'help_text' => 'content file size',
                'editable' => false
            ),
            'downloads' => array(
                'type' => 'Pluf_DB_Field_Integer',
                'is_null' => false,
                'default' => 0,
                'help_text' => 'content downloads number',
                'editable' => false
            ),
            'status' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 64,
                'default' => 'published',
                'editable' => false
            ),
            'password' => array(
                'type' => 'Pluf_DB_Field_Password',
                'is_null' => true,
                'size' => 150,
                'help_text' => __('Format: [algo]:[salt]:[hash]'),
                'editable' => false,
                'readable' => false
            ),
            'comment_status' => array(
                'type' => 'Pluf_DB_Field_Varchar',
                'is_null' => true,
                'size' => 64,
                'default' => NULL,
                'editable' => false
            ),
            'comment_count' => array(
                'type' => 'Pluf_DB_Field_Integer',
                'is_null' => false,
                'default' => 0,
                'help_text' => 'number of comments on the content',
                'editable' => false
            ),
            'creation_dtime' => array(
                'type' => 'Pluf_DB_Field_Datetime',
                'blank' => true,
                'verbose' => 'creation',
                'help_text' => 'content creation time',
                'editable' => false
            ),
            'modif_dtime' => array(
                'type' => 'Pluf_DB_Field_Datetime',
                'blank' => true,
                'verbose' => 'modification',
                'help_text' => 'content modification time',
                'editable' => false
            ),
            /*
             * Foreign keys
             */
            'author_id' => array(
                'type' => 'Pluf_DB_Field_Foreignkey',
                'model' => 'User_Account',
                'is_null' => false,
                'name' => 'author',
                'relate_name' => 'cms_contents',
                'graphql_name' => 'author',
                'editable' => false
            ),
            'parent_id' => array(
                'type' => 'Pluf_DB_Field_Foreignkey',
                'model' => 'CMS_Content',
                'is_null' => true,
                'name' => 'parent',
                'graphql_name' => 'parent',
                'relate_name' => 'children',
                'editable' => true,
                'readable' => true
            ),
        );

        $this->_a['idx'] = array(
            // @Note: hadi - 1396-10: when define an attribute as 'unique => true', pluf automatically
            // create an unique index for it (for example 'name' field here).
            'content_mime_filter_idx' => array(
                'col' => 'mime_type',
                'type' => 'normal', // normal, unique, fulltext, spatial
                'index_type' => '', // hash, btree
                'index_option' => '',
                'algorithm_option' => '',
                'lock_option' => ''
            )
        );
    }
720099
public static function init() {
		header("Transfer-Encoding: chunked");
		@apache_setenv('no-gzip', 1);
		@ini_set('zlib.output_compression', 0);
		@ini_set('implicit_flush', 1);
		for ($i = 0; $i < ob_get_level(); $i++)  ob_end_flush();
		ob_implicit_flush(1); flush();
		
		$pad = str_pad('',4096);
		echo dechex(strlen($pad))."\r\n";
		echo $pad;
		echo "\r\n";
	}
1058696
protected function init_script()
    {
        if (!$this->sieve->script) {
            return;
        }

        $this->script = $this->sieve->script->as_array();

        $headers    = array();
        $exceptions = array('date', 'currentdate', 'size', 'body');

        // find common headers used in script, will be added to the list
        // of available (predefined) headers (#1489271)
        foreach ($this->script as $rule) {
            foreach ((array) $rule['tests'] as $test) {
                if ($test['test'] == 'header') {
                    foreach ((array) $test['arg1'] as $header) {
                        $lc_header = strtolower($header);

                        // skip special names to not confuse UI
                        if (in_array($lc_header, $exceptions)) {
                            continue;
                        }

                        if (!isset($this->headers[$lc_header]) && !isset($headers[$lc_header])) {
                            $headers[$lc_header] = $header;
                        }
                    }
                }
            }
        }

        ksort($headers);

        $this->headers += $headers;
    }
673980
function createFormattedTable (headers) {
    var chars = {
        'top': '═', 'top-mid': '╤', 'top-left': '╔', 'top-right': '╗',
        'bottom': '═', 'bottom-mid': '╧', 'bottom-left': '╚',
        'bottom-right': '╝', 'left': '║', 'left-mid': '╟', 'mid': '─',
        'mid-mid': '┼', 'right': '║', 'right-mid': '╢', 'middle': '│'
    };
    
    return new Table({
        head: headers,
        chars: chars
    });
}
398771
def mk_set_headers(self, data, columns):
        
        columns = tuple(columns)
        lens = []

        for key in columns:
            value_len = max(len(str(each.get(key, ''))) for each in data)
            # account for header lengths
            lens.append(max(value_len, len(self._get_name(key))))

        fmt = self.mk_fmt(*lens)
        return fmt
1003607
def compiled_init_func(self):
        """"""

        def get_column_assignment(column_name):
            return ALCHEMY_TEMPLATES.col_assignment.safe_substitute(col_name=column_name)

        def get_compiled_args(arg_name):
            return ALCHEMY_TEMPLATES.func_arg.safe_substitute(arg_name=arg_name)

        join_string = "\n" + self.tab + self.tab
        column_assignments = join_string.join([get_column_assignment(n) for n in self.columns])
        init_args = ", ".join(get_compiled_args(n) for n in self.columns)
        return ALCHEMY_TEMPLATES.init_function.safe_substitute(col_assignments=column_assignments,
                                                               init_args=init_args)
333823
def _init():
    """"""
    import importlib
    import os
    import re

    filenames = os.listdir(os.path.dirname(__file__))

    module_names = set()
    for filename in filenames:
        match = re.match(r'^(?P<name>[A-Z_a-z]\w*)\.py[co]?$', filename)
        if match:
            module_names.add(match.group('name'))

    for module_name in module_names:
        try:
            module = importlib.import_module('.' + module_name, __name__)
        except ImportError:
            continue

        for name, member in module.__dict__.items():
            if not isinstance(member, type):
                # skip non-new-style classes
                continue
            if not issubclass(member, Engine):
                # skip non-subclasses of Engine
                continue
            if member is Engine:
                # skip "abstract" class Engine
                continue

            try:
                handle = member.handle
            except AttributeError:
                continue

            engines[handle] = member