/[drupal]/contributions/modules/image_pub/image_pub.xp.inc
ViewVC logotype

Diff of /contributions/modules/image_pub/image_pub.xp.inc

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

revision 1.1.2.1, Sat Jan 31 02:00:25 2009 UTC revision 1.1.2.2, Sat Mar 28 23:32:31 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: image_pub.xp.inc,v 1.16 2008/12/02 22:46:58 egfrith Exp $  // $Id: image_pub.xp.inc,v 1.1.2.1 2009/01/31 02:00:25 egfrith Exp $
3    
4  /*  /*
5   * Windows Web publishing wizard support   * Windows Web publishing wizard support
# Line 131  function _image_pub_xp_album($edit) { Line 131  function _image_pub_xp_album($edit) {
131      $create_descr = $edit['create_descr'];      $create_descr = $edit['create_descr'];
132    
133      $album = _image_pub_album_get($albumid);      $album = _image_pub_album_get($albumid);
134      if (!_image_pub_album_access('update', $album)) {      if (!_image_pub_album_access('create', $album)) {
135        drupal_set_message('Created album permission denied.', 'error');        drupal_set_message('Created album permission denied.', 'error');
136        _image_pub_xp_album_form('Create Album Permission Denied', $album);        _image_pub_xp_album_form('Create Album Permission Denied', $album);
137      }      }
# Line 158  function _image_pub_xp_album($edit) { Line 158  function _image_pub_xp_album($edit) {
158      _image_pub_xp_album_form('Invalid album specified');      _image_pub_xp_album_form('Invalid album specified');
159      return;      return;
160    }    }
161    if (!_image_pub_album_access('create', $album)) {    if (!_image_pub_album_access('update', $album)) {
162      drupal_set_message('Create image permission denied.', 'error');      drupal_set_message('Create image permission denied.', 'error');
163      _image_pub_xp_album_form('Create Image Permission Denied', $album);      _image_pub_xp_album_form('Create Image Permission Denied', $album);
164      return;      return;
# Line 307  function _image_pub_xp_album_form($messa Line 307  function _image_pub_xp_album_form($messa
307      '#type' => 'fieldset',      '#type' => 'fieldset',
308      '#tree' => FALSE,      '#tree' => FALSE,
309    );    );
310    
311    // radio button for existing album    if (user_access('administer images')) {
312    $form['existing']['create_new'] = array(      // radio button for existing album
313      '#type' => 'radio',      $form['existing']['create_new'] = array(
314      '#return_value' => 0,        '#type' => 'radio',
315      '#title' => t('Use an existing album'),        '#return_value' => 0,
316      '#attributes' => array('checked' => 'checked'),        '#title' => t('Use an existing album'),
317      '#parents' => array('edit', 'create_new'),        '#attributes' => array('checked' => 'checked'),
318    );        '#parents' => array('edit', 'create_new'),
319          );
320      }
321    
322    // for some reason if a new album it doesn't always end up in the select list    // for some reason if a new album it doesn't always end up in the select list
323    // I tried using cache_clear_all but that doesn't help    // I tried using cache_clear_all but that doesn't help
# Line 329  function _image_pub_xp_album_form($messa Line 331  function _image_pub_xp_album_form($messa
331    unset($form['existing']['albumid']['#weight']);    unset($form['existing']['albumid']['#weight']);
332    unset($form['existing']['albumid']['#title']);    unset($form['existing']['albumid']['#title']);
333    unset($form['existing']['albumid']['#description']);    unset($form['existing']['albumid']['#description']);
334    
335    // create a container for new album fields    if (user_access('administer images')) {
336    // call it edit to avoid having to force #parents      // create a container for new album fields
337    $form['edit'] = array(      // call it edit to avoid having to force #parents
338      '#type' => 'fieldset',      $form['edit'] = array(
339      '#tree' => TRUE,        '#type' => 'fieldset',
340    );        '#tree' => TRUE,
341          );
342    // radio button for new album  
343    $form['edit']['create_new'] = array(      // radio button for new album
344      '#type' => 'radio',      $form['edit']['create_new'] = array(
345      '#return_value' => 1,        '#type' => 'radio',
346      '#title' => t('Create a new album'),        '#return_value' => 1,
347    );        '#title' => t('Create a new album'),
348          );
349    // get the parent selector by calling _image_gallery_parent_select  
350    $form['edit']['create_parentid'] = _image_gallery_parent_select(NULL, 'Within');      // get the parent selector by calling _image_gallery_parent_select
351        $form['edit']['create_parentid'] = _image_gallery_parent_select(NULL, 'Within');
352    // reset #required option in this instance  
353    unset($form['edit']['create_parentid']['#required']);      // reset #required option in this instance
354        unset($form['edit']['create_parentid']['#required']);
355    $form['edit']['create_name'] = array(  
356      '#type' => 'textfield',      $form['edit']['create_name'] = array(
357      '#title' => t('Album name'),        '#type' => 'textfield',
358    );        '#title' => t('Album name'),
359          );
360    $form['edit']['create_descr'] = array(  
361      '#type' => 'textfield',      $form['edit']['create_descr'] = array(
362      '#title' => t('Album description'),        '#type' => 'textfield',
363    );        '#title' => t('Album description'),
364          );
365      }
366    
367    // Common section - render to all forms    // Common section - render to all forms
368    $form['cmd'] = array(    $form['cmd'] = array(

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

  ViewVC Help
Powered by ViewVC 1.1.2