You are here

function _nd_content_build_modes in Node displays 6

Return nd build modes.

1 call to _nd_content_build_modes()
nd_content_build_modes in ./nd.module
Implementation of hook_content_build_modes().

File

includes/nd.registry.inc, line 236
Registry functions.

Code

function _nd_content_build_modes() {
  $build_modes = array(
    'full' => array(
      'title' => t('Full node'),
      'weight' => -1,
      'build modes' => array(
        'full' => array(
          'title' => t('Full node'),
          'views style' => TRUE,
        ),
      ),
    ),
    'teaser' => array(
      'title' => t('Teaser'),
      'weight' => 1,
      'build modes' => array(
        'teaser' => array(
          'title' => t('Teaser'),
          'views style' => TRUE,
        ),
      ),
    ),
    'nd_sticky' => array(
      'title' => t('Sticky'),
      'weight' => 2,
      'build modes' => array(
        'nd_sticky' => array(
          'title' => t('Sticky'),
          'views style' => TRUE,
        ),
      ),
    ),
  );

  // Custom build modes through the UI.
  $weight = 10;
  $db_build_modes = variable_get('nd_build_modes', array());
  if (!empty($db_build_modes)) {
    foreach ($db_build_modes as $key => $name) {
      $build_modes[$key] = array(
        'title' => check_plain($name),
        'weight' => $weight++,
        'build modes' => array(
          $key => array(
            'title' => check_plain($name),
            'views style' => TRUE,
          ),
        ),
      );
    }
  }
  return $build_modes;
}