t('MySite Content'), 'content_types' => 'panels_admin_content_types_mysite', 'render callback' => 'panels_content_mysite', 'add callback' => 'panels_admin_add_mysite', 'edit callback' => 'panels_admin_edit_mysite', 'title callback' => 'panels_admin_title_mysite', 'add submit callback' => 'panels_admin_submit_mysite', 'edit submit callback' => 'panels_admin_submit_mysite', //'validate callback' => 'panels_admin_validate_mysite', ); return $items; } /** * Output function for the 'mysite' content type. Outputs a block * based on the module and delta supplied in the configuration. */ function panels_content_mysite($conf) { return 'hello'; } /** * Return all content types available. */ function panels_admin_content_types_mysite() { $list = array(); // load the active MySite includes and get their options $types = mysite_load_includes('types'); # SIMPLE VERSION foreach ($types as $type) { $options = module_invoke('mysite_type', $type, TRUE); // if no options are available, it can't be used if (!empty($options['options'])) { $list[$type] = array( 'title' => $options['name'], 'icon' => 'icon_contrib_block.png', 'category' => t('MySite') ); } } # COMPLEX VERSION $items = array(); foreach ($types as $type) { $options = module_invoke('mysite_type', $type, TRUE); // if no options are available, it can't be used if (!empty($options['options'])) { foreach($options['options']['name'] as $key => $value) { $id = $options['options']['type'][$key] .'-'. $options['options']['type_id'][$key]; $items['mysite-'. $id] = array( 'title' => $value, 'icon' => 'icon_contrib_block.png', 'category' => $options['name'] ); } } } return $list; # return $items; } /** * Returns the form for a new block. */ function panels_admin_add_mysite($id) { $conf['type'] = $id; $conf['module'] = 'mysite'; return panels_admin_edit_mysite($conf); } /** * Returns an edit form for a mysite. */ function panels_admin_edit_mysite($conf) { $form['module'] = array( '#type' => 'value', '#value' => $conf['module'], ); $form['delta'] = array( '#type' => 'value', '#value' => $conf['delta'], ); $form['aligner_start'] = array( '#value' => '