/[drupal]/contributions/modules/createcontentblock/createcontentblock.module
ViewVC logotype

Diff of /contributions/modules/createcontentblock/createcontentblock.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.8, Tue Mar 4 18:22:21 2008 UTC revision 1.1.2.9, Fri May 16 21:36:13 2008 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: createcontentblock.module,v 1.1.2.7 2008/02/21 20:29:09 douggreen Exp $  // $Id: createcontentblock.module,v 1.1.2.6 2007/12/19 00:14:56 douggreen Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 95  function createcontentblock_form_init() Line 95  function createcontentblock_form_init()
95        }        }
96        if (isset($name)) {        if (isset($name)) {
97          $init['options'][$type->type] = $name;          $init['options'][$type->type] = $name;
         asort($init['options']);  
98        }        }
99      }      }
100    }    }
# Line 121  function createcontentblock_form($init) Line 120  function createcontentblock_form($init)
120    }    }
121    if (isset($init['subscribe_nid'])) {    if (isset($init['subscribe_nid'])) {
122      $form['subscribe'] = array(      $form['subscribe'] = array(
123        '#value' => l(t('Subscribe to Add Content to this Group'), 'og/subscribe/'. $init['subscribe_nid'], array(), 'destination=node/'. $init['subscribe']),        '#value' => l(t('Subscribe to Add Content to this Group'), 'og/subscribe/'. $init['subscribe_nid'], array(), 'destination=node/'. $init['subscribe_nid']),
124      );      );
125    }    }
126    $options = array(t('-- Select One --'));    $options = array(t('-- Select One --'));
# Line 146  function createcontentblock_form_submit( Line 145  function createcontentblock_form_submit(
145      $fragment[] = 'destination='. $form['dest'];      $fragment[] = 'destination='. $form['dest'];
146    }    }
147    if (!empty($form['type'])) {    if (!empty($form['type'])) {
148        $type = str_replace('_', '-', $form['type']);
149      if (empty($form['gid'])) {      if (empty($form['gid'])) {
150        drupal_goto('node/add/'. $form['type'], implode('&', $fragment));        drupal_goto('node/add/'. $type, implode('&', $fragment));
151      }      }
152      else {      else {
153        $fragment[] = 'gids[]='. $form['gid'];        $fragment[] = 'gids[]='. $form['gid'];
154        drupal_goto('node/add/'. $form['type'], implode('&', $fragment));        drupal_goto('node/add/'. $type, implode('&', $fragment));
155      }      }
156    }    }
157    elseif (isset($form['gid'])) {    elseif (isset($form['gid'])) {
158      $fragment[] = 'gids[]='. $form['gid'];      $fragment[] = 'gids[]='. $form['gid'];
159      drupal_goto('node/add-og', implode('&', $fragment));      drupal_goto('node/add-og', implode('&', $fragment));
160    }    }
161    else {    else {
162      drupal_goto('node/add', implode('&', $fragment));      drupal_goto('node/add', implode('&', $fragment));
163    }    }

Legend:
Removed from v.1.1.2.8  
changed lines
  Added in v.1.1.2.9

  ViewVC Help
Powered by ViewVC 1.1.2