You are here

function total_control_create_content_type_render in Total Control Admin Dashboard 6.2

Same name and namespace in other branches
  1. 6 plugins/content_types/create.inc \total_control_create_content_type_render()
  2. 7.2 plugins/content_types/create.inc \total_control_create_content_type_render()

Run-time rendering of the body of the block.

Parameters

$subtype:

$conf: Configuration as done at admin time.

$args:

$context: Context - in this case we don't have any.

Return value

An object with at least title and content members.

1 string reference to 'total_control_create_content_type_render'
create.inc in plugins/content_types/create.inc
create.inc

File

plugins/content_types/create.inc, line 72
create.inc

Code

function total_control_create_content_type_render($subtype, $conf, $panel_args, &$context) {
  $types = node_get_types('types');
  $create = array();
  foreach ($types as $type => $object) {

    // compare against type option on pane config
    if (isset($conf['types']) && $conf['types'][$type] || $conf == array()) {

      // check access to create nodes of this type
      if (node_access('create', $type)) {
        $object_path = str_replace('_', '-', $object->type);
        $create[] = l(t('Add New ' . $object->name), 'node/add/' . $object_path);
      }
    }
  }
  $block = new stdClass();
  $block->module = t('total_control');
  $block->title = t('Create Content');
  $block->content = theme('total_control_create', $create);
  return $block;
}